-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathOptions.h
453 lines (417 loc) · 19.8 KB
/
Options.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
/*
Copyright (C) 2000,2001 Stefan Duffner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef OPTIONS_H
#define OPTIONS_H
#include <qcolor.h>
#include <qobject.h>
class MainWindow;
/**
* @class Options
* @brief Stores the application options.
*/
class Options : public QObject {
Q_OBJECT
public:
Options(QObject *parent = NULL, const char *name = 0);
/// Returns true if states encoding should be displayed otherwise false
bool getViewStateEncoding() { return viewStateEncoding; }
/// If @a v is true moore outputs will be displayed otherwise not
void setViewStateEncoding(bool s) { viewStateEncoding = s; }
/// Returns true if moore outputs should be displayed otherwise false
bool getViewMoore() { return viewMoore; }
/// If @a v is true moore outputs will be displayed otherwise not
void setViewMoore(bool v) { viewMoore = v; }
/// Returns true if mealy inputs should be displayed otherwise false
bool getViewMealyIn() { return viewMealyIn; }
/// If @a v is true mealy inputs will be displayed otherwise not
void setViewMealyIn(bool v) { viewMealyIn = v; }
/// Returns true if mealy outputs should be displayed otherwise false
bool getViewMealyOut() { return viewMealyOut; }
/// If @a v is true mealy outputs will be displayed otherwise not
void setViewMealyOut(bool v) { viewMealyOut = v; }
/// Returns true if the IO view dialog is displayed otherwise false
bool getViewIOView() { return viewIOView; }
/// If @a v is true the IO view dialog will be displayed otherwise not
void setViewIOView(bool v) { viewIOView = v; }
/// Returns true if the grid is displayed otherwise false
bool getViewGrid() { return viewGrid; }
/// If @a v is true the grid will be displayed otherwise not
void setViewGrid(bool v) { viewGrid = v; }
/// Gets the color of the grid
QColor getGridColor() { return gridColor; }
/// Sets the color of the grid
void setGridColor(QColor c) { gridColor = c; }
/// Gets the grid size
int getGridSize() { return gridSize; }
/// Sets the grid size
void setGridSize(int s) { gridSize = s; }
/// Returns true if states are locked to the grid
bool getLockStates() { return lockstates; }
/// If @a ls is true states are locked to the grid
void setLockStates(bool ls) { lockstates = ls; }
/// Returns true if transitions are locked to the grid
bool getLockTransitions() { return locktransitions; }
/// If @a lt is true transitions are locked to the grid
void setLockTransitions(bool lt) { locktransitions = lt; }
/// Returns true if state shadows should be displayed
bool getStateShadows() { return stateShadows; }
/// If @a sh is true states are displayed with shadows
void setStateShadows(bool sh) { stateShadows = sh; }
/// Returns the color of the state shadows
QColor getStateShadowColor() { return stateShadowColor; }
/// Sets the state shadow color to @a col
void setStateShadowColor(QColor col) { stateShadowColor = col; }
/// Returns the 'show tooltips' flag
bool getToolTips() { return tooltips; }
/// Sets the 'show tooltips' flag
void setToolTips(bool t) { tooltips = t; }
/// Returns true if ?/! shall be shown, otherwise false
bool getIOMark() { return iomark; }
/// Sets/clears the 'show ?/!' flag
void setIOMark(bool m) { iomark = m; }
/// Returns true if I/O names (e.g. in1=...) shall be shown over the
/// transitions
bool getDisplayIONames() { return ionames; }
/// Sets/clears the 'Display I/O names' flag
void setDisplayIONames(bool dio) { ionames = dio; }
/// Returns true if a box shall be drawn around the I/O over transitions
bool getDrawBox() { return bdrawbox; }
/// Sets/clears the 'Draw Box' flag
void setDrawBox(bool db) { bdrawbox = db; }
/// Returns the initial transition descriptor
QString getInitialDescriptor() { return initial_descriptor; }
/// Sets the initial transition descriptor to @a sd
void setInitialDescriptor(QString sd) { initial_descriptor = sd; }
/// Returns the inversion descriptor
QString getInversionDescriptor() { return inversion_descriptor; }
/// Sets the inversion descriptor to @a id
void setInversionDescriptor(QString id) { inversion_descriptor = id; }
/// Returns the "any input" descriptor
QString getAnyInputDescriptor() { return any_input_descriptor; }
/// Sets the "any input" descriptor to @a ad
void setAnyInputDescriptor(QString ad) { any_input_descriptor = ad; }
/// Returns the default transition descriptor
QString getDefaultTransitionDescriptor() { return default_descriptor; }
/// Sets the default transition descriptor to @a dd
void setDefaultTransitionDescriptor(QString dd) { default_descriptor = dd; }
/// Returns the 'synchronous reset' flag (AHDL export)
bool getAHDLSyncReset() { return ahdl_sync_reset; }
/// Sets the 'synchronous reset' flag (AHDL export)
void setAHDLSyncReset(bool sr) { ahdl_sync_reset = sr; }
/// Returns the 'use moore outputs' flag (AHDL export)
bool getAHDLUseMoore() { return ahdl_use_moore; }
/// Sets the 'use moore outputs' flag (AHDL export)
void setAHDLUseMoore(bool um) { ahdl_use_moore = um; }
/// Returns the 'symbolic states' flag (VHDL export)
bool getVHDLSymbolicStates() { return vhdl_symbolic_states; }
/// Sets the 'symbolic states' flag (VHDL export)
void setVHDLSymbolicStates(bool ss) { vhdl_symbolic_states = ss; }
/// Returns the 'synchronous reset' flag (VHDL export)
bool getVHDLSyncReset() { return vhdl_sync_reset; }
/// Sets the 'synchronous reset' flag (VHDL export)
void setVHDLSyncReset(bool sr) { vhdl_sync_reset = sr; }
/// Returns the 'synchronous enable' flag (VHDL export)
bool getVHDLSyncEnable() { return vhdl_sync_enable; }
/// Sets the 'synchronous enable' flag (VHDL export)
void setVHDLSyncEnable(bool se) { vhdl_sync_enable = se; }
/// Returns the 'negated reset' flag (VHDL export)
bool getVHDLNegReset() { return vhdl_neg_reset; }
/// Sets the 'negated reset' flag (VHDL export)
void setVHDLNegReset(bool nr) { vhdl_neg_reset = nr; }
/// Returns the 'input/output names' flag (VHDL export)
bool getVHDLInOutNames() { return vhdl_inout_names; }
/// Sets the 'inpu/output names' flag (VHDL export)
void setVHDLInOutNames(bool ion) { vhdl_inout_names = ion; }
/// Returns the 'std_logic package' flag (VHDL export)
bool getVHDLStdLogic() { return vhdl_stdlogic; }
/// Sets the 'std_logic package' flag (VHDL export)
void setVHDLStdLogic(bool sl) { vhdl_stdlogic = sl; }
/// Returns the 'io header' flag (VHDL export)
bool getVHDLIOheader() { return vhdl_io_header; }
/// Sets the 'io header' flag (VHDL export)
void setVHDLIOheader(bool ioh) { vhdl_io_header = ioh; }
/// Returns the 'alliance' flag (VHDL export)
bool getVHDLAlliance() { return vhdl_alliance; }
/// Sets the 'alliance' flag (VHDL export)
void setVHDLAlliance(bool al) { vhdl_alliance = al; }
/// Returns the condition notation (0: if-then 1: case-when)
int getVHDLCondNotation() { return vhdl_cond_notation; }
/// Sets the condition notation (0: if-then 1: case-when)
void setVHDLCondNotation(int cn) { vhdl_cond_notation = cn; }
/// Returns true when state codes were exported
bool getVHDLStateCode() { return vhdl_state_code; }
/// Sets the state code export flag
void setVHDLStateCode(bool sc) { vhdl_state_code = sc; }
/// Returns the flag for exporting two VHDL files for architecture and entity
bool getVHDLSepFiles() { return vhdl_sep_files; }
/// Sets the flag for exporting two VHDL files
void setVHDLSepFiles(bool sc) { vhdl_sep_files = sc; }
/// Returns the flag for the export of a state machine with synchronous
/// look-ahead buffers
bool getVHDLSyncLookAhead() { return vhdl_sync_look_ahead; }
/// Sets the flag for the export of a state machine with synchronous
/// look-ahead buffers
void setVHDLSyncLookAhead(bool sc) { vhdl_sync_look_ahead = sc; }
/// Returns the VHDL architecture name
QString getVHDLArchitectureName() { return vhdl_architecture_name; }
/// Sets the VHDL architecture name
void setVHDLArchitectureName(QString n) { vhdl_architecture_name = n; }
/// Returns the VHDL architecture name
QString getVHDLArchitecturePath() { return vhdl_architecture_path; }
/// Sets the VHDL architecture name
void setVHDLArchitecturePath(QString n) { vhdl_architecture_path = n; }
/// Returns the VHDL architecture name
QString getVHDLEntityPath() { return vhdl_entity_path; }
/// Sets the VHDL architecture name
void setVHDLEntityPath(QString n) { vhdl_entity_path = n; }
/// Returns true when user wants state debug outputs
bool getVHDLDebugState() { return vhdl_state_debug; }
/// sets state_debug flag
void setVHDLDebugState(bool sd) { vhdl_state_debug = sd; }
/// Returns the 'synchronous reset' flag (Verilog export)
bool getVerilogSyncReset() { return ver_sync_reset; }
/// Sets the 'synchronous reset' flag (Verilog export)
void setVerilogSyncReset(bool sr) { ver_sync_reset = sr; }
/// Returns the 'stdlogic' flag (Testbench export)
bool getTestbenchStdLogic() { return testbench_stdlogic; }
/// Sets the 'stdlogic' flag (Testbench export)
void setTestbenchStdLogic(bool sl) { testbench_stdlogic = sl; }
/// Returns the 'synchronous reset' flag (Testbench export)
bool getTestbenchSynchronousReset() { return testbench_synchronousreset; }
/// Sets the 'synchronous reset' flag (Testbench export)
void setTestbenchSynchronousReset(bool sr) {
testbench_synchronousreset = sr;
}
/// Returns the 'synchronous enable' flag (Testbench export)
bool getTestbenchSynchronousEnable() { return testbench_synchronousenable; }
/// Sets the 'synchronous enable' flag (Testbench export)
void setTestbenchSynchronousEnable(bool se) {
testbench_synchronousenable = se;
}
/// Returns the 'negated reset' flag (Testbench export)
bool getTestbenchNegatedReset() { return testbench_negatedreset; }
/// Sets the 'negated reset' flag (Testbench export)
void setTestbenchNegatedReset(bool nr) { testbench_negatedreset = nr; }
/// Returns the 'io names' flag (Testbench export)
bool getTestbenchIONames() { return testbench_ionames; }
/// Sets the 'io names' flag (Testbench export)
void setTestbenchIONames(bool io) { testbench_ionames = io; }
/// Returns the 'io header' flag (Testbench export)
bool getTestbenchIOHeader() { return testbench_io_header; }
/// Sets the 'io header' flag (Testbench export)
void setTestbenchIOHeader(bool io) { testbench_io_header = io; }
/// Returns the testbench algorithm (0: Algorithm 1 1: Algorithm 1)
int getTestbenchAlgorithm() { return testbench_algorithm; }
/// Sets the testbench algorithm
void setTestbenchAlgorithm(int a) { testbench_algorithm = a; }
/// Returns the path of the VHDL testbench file relative to the testbench base
/// directory
QString getTestbenchVHDLPath() { return testbench_vhdl_path; }
/// Sets the path of the VHDL testbench file relative to the testbench base
/// directory
void setTestbenchVHDLPath(QString vp) { testbench_vhdl_path = vp; }
/// Returns the path of the ASCII testvector file relative to the testbench
/// base directory
QString getTestpackageVHDLPath() { return testpackage_vhdl_path; }
/// Sets the path of the ASCII testvector file relative to the testbench base
/// directory
void setTestpackageVHDLPath(QString ap) { testpackage_vhdl_path = ap; }
/// Returns the path of the ASCII testvector file relative to the testbench
/// base directory
QString getTestvectorASCIIPath() { return testvector_ascii_path; }
/// Sets the path of the ASCII testvector file relative to the testbench base
/// directory
void setTestvectorASCIIPath(QString ap) { testvector_ascii_path = ap; }
/// Returns the path of the logfile relative to the testbench base directory
QString getTestbenchLogfilePath() { return testbench_logfile_path; }
/// Sets the path of the logfile relative to the testbench base directory
void setTestbenchLogfilePath(QString lf) { testbench_logfile_path = lf; }
/// Returns the testbench base directory
QString getTestbenchBaseDirectory() { return testbench_base_directory; }
/// Sets the testbench base directory
void setTestbenchBaseDirectory(QString bd) { testbench_base_directory = bd; }
/// Returns the 'include asynchronous outputs' option (State table export)
bool getStateTableIncludeOut() { return statetable_includeout; }
/// Sets the 'include asynchronous outputs' option (State table export)
void setStateTableIncludeOut(bool io) { statetable_includeout = io; }
/// Returns the 'resolve inverted conditions' option (State table export)
bool getStateTableResolveInverted() { return statetable_resolve_inverted; }
/// Sets the 'resolve inverted conditions outputs' option (State table export)
void setStateTableResolveInverted(bool ri) {
statetable_resolve_inverted = ri;
}
/// Returns the orientation of the state table
int getStateTableOrientation() { return statetable_orientation; }
/// Sets the orientation of the state table
void setStateTableOrientation(int orient) { statetable_orientation = orient; }
/// Returns the 'create action file' flag (Ragel export)
bool getRagelCreateAction() { return ragel_create_action; }
/// Sets the 'create action file' flag (Ragel export)
void setRagelCreateAction(bool ca) { ragel_create_action = ca; }
/// Returns the language of the ragel file to export
int getRagelLangAction() { return ragel_lang_action; }
/// Sets the language of the ragel file to export
void setRagelLangAction(int la) { ragel_lang_action = la; }
/// Returns the 'create default transitions' flag (Ragel export)
bool getRagelDefaultTransitions() { return ragel_default_transitions; }
/// Sets the 'create default transitions' flag (Ragel export)
void setRagelDefaultTransitions(bool rd) { ragel_default_transitions = rd; }
/// Returns the 'vvvv reset' option
bool getVVVVReset() { return vvvv_reset; }
/// Sets the 'vvvv reset' option
void setVVVVReset(bool vr) { vvvv_reset = vr; }
/// Returns the vvvv reset event name
QString getVVVVResetEvent() { return vvvv_reset_event; }
/// Sets the vvvv reset event name
void setVVVVResetEvent(QString re) { vvvv_reset_event = re; }
/// Returns the vvvv reset action name
QString getVVVVResetAction() { return vvvv_reset_action; }
/// Sets the vvvv reset action name
void setVVVVResetAction(QString ra) { vvvv_reset_action = ra; }
/// Returns the 'print header' option
bool getPrintHeader() { return print_header; }
/// Sets the 'print header' option
void setPrintHeader(bool ph) { print_header = ph; }
void applyOptions(MainWindow *);
private:
/// If true, state encodings are shown
bool viewStateEncoding;
/// If true, moore outputs are shown
bool viewMoore;
/// If true, mealy inputs are shown
bool viewMealyIn;
/// If true, mealy outputs are shown
bool viewMealyOut;
/// If true, the grid is shown
bool viewGrid;
/// If true; the IO view dialog is shown
bool viewIOView;
/// Grid color
QColor gridColor;
/// Grid size
int gridSize;
/// If true, states are locked to the grid
bool lockstates;
/// If true, transitions are locked to the grid
bool locktransitions;
/// If true, state are displayed with shadows
bool stateShadows;
/// State shadow color
QColor stateShadowColor;
/// If true tooltips are shown
bool tooltips;
/// If true ?/! are shown
bool iomark;
/// If true I/O names are displayed over the transitions
bool ionames;
/// If true a box is drawn around the I/O over transitions
bool bdrawbox;
/// Initial transition descriptor
QString initial_descriptor;
/// Inversion descriptor (e.g. NOT or !)
QString inversion_descriptor;
/// "Any input" descriptor (e.g. "any")
QString any_input_descriptor;
/// Default transition descriptor
QString default_descriptor;
/// ExportAHDL: If true use synchronous reset, otherwise asynchronous reset
bool ahdl_sync_reset;
/// ExportAHDL: If true use moore outputs, otherwise use state codes
bool ahdl_use_moore;
/// ExportVHDL: If true use symbolic names for states
bool vhdl_symbolic_states;
/// ExportVHDL: If true use synchronous reset, otherwise asynchronous reset
bool vhdl_sync_reset;
/// ExportVHDL: If true add synchronous enable port
bool vhdl_sync_enable;
/// ExportVHDL: If true use negated reset
bool vhdl_neg_reset;
/// ExportVHDL: if true use std_logic_1164 package
bool vhdl_stdlogic;
/// ExportVHDL: if true use I/O names instead of vectors a,o,q
bool vhdl_inout_names;
/// ExportVHDL: if true write I/O description into header
bool vhdl_io_header;
/// ExportVHDL: if true write Alliance compliant code
bool vhdl_alliance;
/// ExportVHDL: 0: IF-THEN condition notation 1: CASE-WHEN notation
int vhdl_cond_notation;
/// ExportVHDL: if this is true, state codes will be exported
bool vhdl_state_code;
/// ExportVHDL: architecture name
QString vhdl_architecture_name;
/// ExportVHDL: if true, export architecture and entity in separate files
bool vhdl_sep_files;
/// ExportVHDL: export state machine with synchronous look-ahead-buffer
bool vhdl_sync_look_ahead;
/// ExportVHDL: architecture path
QString vhdl_architecture_path;
/// ExportVHDL: VHDL export path or entity export path if one file is exported
QString vhdl_entity_path;
/// EXPORTVHDL: if this is true, the state will be exported for debugging the
/// state.
bool vhdl_state_debug;
/// ExportVerilog: If true use synchronous reset, otherwise asynchronous reset
bool ver_sync_reset;
/// ExportTestbench: If true use std_logic_1164 package
bool testbench_stdlogic;
/// ExportTestbench: if true use synchronous reset
bool testbench_synchronousreset;
/// ExportTestbench: if true write I/O description into header
bool testbench_io_header;
/// ExportTestbench: 0: Use algorithm 0 1: Use algorithm 1
int testbench_algorithm;
/// ExportTestbench: if true write testbench with input and output names
bool testbench_ionames;
/// ExportTestbench: if true export testbench with synchronous enable
bool testbench_synchronousenable;
/// ExportTestbench: if true export testbench with negated reset
bool testbench_negatedreset;
/// ExportTestbench: Testbench export file path
QString testbench_vhdl_path;
/// ExportTestbench: Testvector export file path
QString testvector_ascii_path;
/// ExportTestbench: VHDL testbench package file path
QString testpackage_vhdl_path;
/// ExportTestbench: logfile path
QString testbench_logfile_path;
/// ExportTestbench: VHDL testbench base directory
QString testbench_base_directory;
/// Export State table: If true include asynchronous outputs
bool statetable_includeout;
/// Export State table: If true resolve inverted conditions
bool statetable_resolve_inverted;
/// Export State table: If 0 events are columns and states are rows, otherwise
/// the inverse
int statetable_orientation;
/// Export Ragel: If true create action file
bool ragel_create_action;
/// Export Ragel: Language of action file: 0: C/C++ 1: Java 2: Ruby
int ragel_lang_action;
/// Export Ragel: If true adds a default transition to every state for
/// exporting
bool ragel_default_transitions;
//// Export VVVV: If true outputs an reset transition for each state
bool vvvv_reset;
/// Export VVVV: reset event name
QString vvvv_reset_event;
;
/// Export VVVV: reset action name
QString vvvv_reset_action;
;
/// If true a header is printed at the top of the page when printing a diagram
bool print_header;
};
#endif