-
Notifications
You must be signed in to change notification settings - Fork 1
/
condition.h
59 lines (51 loc) · 1.29 KB
/
condition.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
/*!
* \file condition.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for model condition
*/
#ifndef CONDITION_H_
#define CONDITION_H_
#include <QString>
#include <QMetaType>
#include <QPainter>
#include <QXmlStreamWriter>
class Condition {
public:
enum EditMode { Editable, ReadOnly };
Condition();
~Condition();
void paint(QPainter *painter, const QRect &rect,
const QPalette &palette, EditMode mode) const;
void processSymbols();
QString toString();
void writeConditionXML(const Condition * c, QXmlStreamWriter * stream);
void toXML(QXmlStreamWriter * stream);
bool enabled;
bool isNot;
bool isTime;
bool isValues;
bool isConditions;
bool lhsIsAgentVariable;
bool rhsIsAgentVariable;
bool lhsIsValue;
bool rhsIsValue;
bool lhsIsMessageVariable;
bool rhsIsMessageVariable;
double lhsDouble;
double rhsDouble;
QString lhs;
QString op;
QString rhs;
QString timePeriod;
QString timePhaseVariable;
int timePhaseValue;
bool timePhaseIsVariable;
int timeDuration;
Condition * lhsCondition;
Condition * rhsCondition;
Condition * parentCondition;
};
Q_DECLARE_METATYPE(Condition)
#endif // CONDITION_H_