-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHelperStructures.h
213 lines (191 loc) · 2.96 KB
/
HelperStructures.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#ifndef HELPERSTRUCTURES_H
#define HELPERSTRUCTURES_H
#include <QString>
namespace helpers
{
static const QString SUPERSCRIPTS = "⁰¹²³⁴⁵⁶⁷⁸⁹";
} // namespace
struct SwVersion
{
SwVersion(uint8_t pMajor, uint8_t pMinor, uint8_t pPatch)
{
major = pMajor;
minor = pMinor;
patch = pPatch;
};
uint8_t major;
uint8_t minor;
uint8_t patch;
};
namespace file
{
enum class SaveFormat
{
JSON = 0,
BINARY
};
enum ComponentId
{
WIRE = 0,
CONPOINT,
AND_GATE,
OR_GATE,
XOR_GATE,
NOT_GATE,
BUFFER_GATE,
INPUT,
BUTTON,
CLOCK,
OUTPUT,
TEXT_LABEL,
HALF_ADDER,
FULL_ADDER,
RS_FLIPFLOP,
D_FLIPFLOP,
MULTIPLEXER,
DEMULTIPLEXER,
T_FLIPFLOP,
JK_FLIPFLOP,
DECODER,
ENCODER,
SHIFTREGISTER,
CONSTANT,
COUNTER,
RS_MS_FLIPFLOP,
RS_CLOCKED_FLIPFLOP,
D_MS_FLIPFLOP,
JK_MS_FLIPFLOP // only append!
};
} // namespace file
enum class ComponentType
{
NONE = 0,
AND_GATE,
OR_GATE,
XOR_GATE,
NOT_GATE,
BUFFER_GATE,
INPUT,
CONSTANT,
BUTTON,
CLOCK,
OUTPUT,
TEXT_LABEL,
HALF_ADDER,
FULL_ADDER,
RS_FLIPFLOP,
D_FLIPFLOP,
D_MS_FLIPFLOP,
MULTIPLEXER,
DEMULTIPLEXER,
T_FLIPFLOP,
JK_FLIPFLOP,
JK_MS_FLIPFLOP,
RS_MS_FLIPFLOP,
RS_CLOCKED_FLIPFLOP,
DECODER,
ENCODER,
SHIFTREGISTER,
COUNTER
};
enum class Direction
{
RIGHT = 0,
DOWN,
LEFT,
UP
};
enum class WireDirection
{
HORIZONTAL = 0,
VERTICAL,
UNSET
};
enum class DiodeDirection
{
HORIZONTAL = 0,
VERTICAL
};
enum class LogicState
{
LOW = 0,
HIGH = 1
};
enum class ConnectionType
{
FULL = 0,
DIODE_X,
DIODE_Y
};
enum class ConnectorType
{
IN = 0,
OUT
};
enum class ControlMode
{
EDIT = 0,
ADD,
WIRE,
SIMULATION,
COPY // Active mode after pasting, left after accepting or aborting the pasting process
};
enum class SimulationMode
{
STOPPED = 0,
RUNNING
};
enum class ClockMode
{
TOGGLE = 0,
PULSE
};
enum class FlipFlopStyle
{
LATCH = 0,
CLOCKED,
MASTER_SLAVE
};
enum class ConfiguratorMode
{
NO_CONFIGURATION = 0,
DIRECTION_AND_INPUT_COUNT,
DIRECTION_ONLY,
MULTIPLEXER_BITS,
ENCODER_DECODER,
SHIFTREGISTER_BITS,
CONSTANT_STATE,
COUNTER_BITS,
RS_FLIPFLOP_TYPE,
MASTER_SLAVE
};
enum TutorialStep
{
NONE = 0,
INTRODUCTION = 1,
NAVIGATION = 2,
OR_GATE = 3,
INPUTS = 4,
OUTPUT = 5,
WIRES = 6,
START_SIMULATION = 7,
END_SIMULATION = 8
};
namespace undo
{
enum class Type
{
MOVE = 0,
ADD,
DEL,
CONFIGURE,
COPY
};
enum class ConfigType
{
CONNECTION_TYPE = 0,
TEXTLABEL_CONTENT,
CONNECTOR_INVERSION
};
} // namespace
#endif // HELPERSTRUCTURES_H