-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandState.hpp
66 lines (56 loc) · 2.45 KB
/
CommandState.hpp
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
64
65
66
#ifndef COMMANDSTATE_HPP
#define COMMANDSTATE_HPP
#include <QObject>
#include <QString>
#include <qqml.h>
#include "FrameHandler.hpp" // <----- This always stays here
// Only used to construct frames to send to the Alaras
struct CommandState : public QObject
{
Q_OBJECT
Q_PROPERTY(QString stateName READ stateName CONSTANT)
//Q_PROPERTY(FrameHandler::VehicleState vehicleState READ vehicleState CONSTANT)
Q_PROPERTY(QString commandID READ commandID CONSTANT)
Q_PROPERTY(QString commandOff READ commandOff CONSTANT)
Q_PROPERTY(QString commandOn READ commandOn CONSTANT)
Q_PROPERTY(bool isArmState READ isArmState CONSTANT)
QML_UNCREATABLE("C++ instantiation only")
public:
//FrameHandler::VehicleState _vehicleState; // should only be TEST, ABORT, VENT, OFF_NOMINAL
// HI_PRESS_ARM, HI_PRESS_PRESSURIZED,
// TANK_PRESS_ARM, TANK_PRESS_PRESSURIZED, FIRE_ARMED, FIRE.
// Also there are 2 instances of OFF_NOMINAL
//QString _stateID;
QString _stateName;
QString _commandID;
QString _commandOff;
QString _commandOn;
bool _isArmState;
//explicit CommandState(FrameHandler::VehicleState vehicleState,const QString& stateName,const quint16& commandID,const quint16& commandOff,const quint16& commandOn, bool isArmState, QObject *parent = nullptr)
// : QObject{parent},
// _stateName{stateName},
// _vehicleState{vehicleState},
// _commandID{QString::number(commandID, 16)},
// _commandOff{QString::number(commandOff, 16)},
// _commandOn{QString::number(commandOn, 16)},
// _isArmState{isArmState}
//{
//
//}
explicit CommandState(const QString& stateName,const quint16& commandID,const quint16& commandOff,const quint16& commandOn, bool isArmState, QObject *parent = nullptr)
:QObject{parent},
_stateName{stateName},
_commandID{QString::number(commandID, 16)},
_commandOff{QString::number(commandOff, 16)},
_commandOn{QString::number(commandOn, 16)},
_isArmState{isArmState}
{
}
QString stateName() {return _stateName;}
//FrameHandler::VehicleState vehicleState() {return _vehicleState;}
QString commandID() {return _commandID;}
QString commandOff() {return _commandOff;}
QString commandOn() {return _commandOn;}
bool isArmState() {return _isArmState;}
};
#endif // COMMANDSTATE_HPP