71 lines
1.4 KiB
C++
71 lines
1.4 KiB
C++
#ifndef TRAINING_H
|
|
#define TRAINING_H
|
|
#include "counter.h"
|
|
#include "database.h"
|
|
#include "hardwaresetup.h"
|
|
#include "timemodel.h"
|
|
#include <QMainWindow>
|
|
#include <QShortcut>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Ui {
|
|
class Training;
|
|
}
|
|
|
|
class Training : public QMainWindow {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Training(QWidget * parent, std::shared_ptr<DataBase> db);
|
|
~Training();
|
|
|
|
private:
|
|
void prepareNextRace();
|
|
|
|
Ui::Training * ui;
|
|
|
|
void closeEvent(QCloseEvent * event);
|
|
bool started;
|
|
std::shared_ptr<HardwareSetup> Hardware;
|
|
bool firstTimeShell;
|
|
bool firstTimeDea;
|
|
QVector<QVector<int>> VecShell;
|
|
QVector<QVector<int>> VecDea;
|
|
long getMinimum(std::vector<long> a);
|
|
|
|
bool paused;
|
|
bool finished;
|
|
Counter counterShell;
|
|
Counter counterDea;
|
|
std::shared_ptr<DataBase> db;
|
|
long minTimeOneRound;
|
|
int minimumTime;
|
|
|
|
int theoreticalMinShell;
|
|
int deltaShell;
|
|
|
|
int theoreticalMinDea;
|
|
int deltaDea;
|
|
|
|
// timeModel
|
|
std::shared_ptr<TimeModel> timeModelDea;
|
|
std::shared_ptr<TimeModel> timeModelShell;
|
|
QVector<int> minSecTime;
|
|
|
|
// shortcuts
|
|
std::shared_ptr<QShortcut> shellReset;
|
|
std::shared_ptr<QShortcut> shortcut;
|
|
std::shared_ptr<QShortcut> deaReset;
|
|
|
|
public slots:
|
|
void ResetShell();
|
|
void ResetDea();
|
|
void Reset();
|
|
void deaSlot(int time, int sector);
|
|
void shellSlot(int time, int sector);
|
|
};
|
|
|
|
#endif // TRAINING_H
|