forked from collin80/SavvyCAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscretestatewindow.h
63 lines (54 loc) · 1.31 KB
/
discretestatewindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef DISCRETESTATEWINDOW_H
#define DISCRETESTATEWINDOW_H
#include <QDialog>
#include <QTimer>
#include "can_structs.h"
namespace Ui {
class DiscreteStateWindow;
}
namespace DWStates {
enum DiscreteWindowState
{
IDLE,
COUNTDOWN_SIGNAL,
COUNTDOWN_WAITING,
GETTING_SIGNAL,
DONE
};
}
using namespace DWStates;
class DiscreteStateWindow : public QDialog
{
Q_OBJECT
public:
explicit DiscreteStateWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
~DiscreteStateWindow();
void showEvent(QShowEvent*);
private slots:
void updatedFrames(int);
void handleStartButton();
void handleTick();
void typeChanged();
private:
Ui::DiscreteStateWindow *ui;
const QVector<CANFrame> *modelFrames;
QList< QVector<CANFrame> *> stateFrames;
QTimer *timer;
DiscreteWindowState operatingState;
int ticksUntilStateChange;
int ticksPerStateChange;
int numToggleStates;
int currToggleState;
int numIterations;
int currIteration;
bool isRealtime;
QHash<int, bool> idFilters;
void refreshFilterList();
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings();
void writeSettings();
void updateStateLabel();
void calculateResults();
};
#endif // DISCRETESTATEWINDOW_H