Repository navigation
Expand file tree
/
Copy pathDEFS.h
More file actions
114 lines (89 loc) · 3.33 KB
/
Copy pathDEFS.h
File metadata and controls
114 lines (89 loc) · 3.33 KB
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
#ifndef DEFS_H
#define DEFS_H
//This file contains some global constants and definitions to be used in the project.
enum MODE //Modes of operation
{
DESIGN,
SIMULATION
};
// TODO: Add any action type here
enum ActionType // The actions supported
{
// --- User Actions ---
ADD_START, //Add start statement
ADD_END, //Add end statement
ADD_DECLARE_VARIABLE, // Add declare variable statement
ADD_VALUE_ASSIGN, //Add value assignment statement
ADD_VAR_ASSIGN, //Add variable assignment statement
ADD_OPER_ASSIGN, //Add operator assignment statement
ADD_CONDITION, //Add a conditional statement (for if and while-loop statements)
ADD_READ, //Add read statement
ADD_WRITE, //Add write statemetn
ADD_CONNECTOR, //Add a connector between two statements
SELECT, //Select a statement, a connector
EDIT_STAT, //Edit a statement
// --- Editing ---
DEL, //Delete a figure
COPY, //Copy a figure
CUT, //Cut a figure
PASTE, //Paste a figure
// --- System / UI Events ---
SAVE, //Save the whole graph to a file
LOAD, //Load a graph from a file
SWITCH_DSN_MODE, //Switch to Design mode
SWITCH_SIM_MODE, //Switch to simulation mode
EXIT, //Exit the application
//TODO: ADD THE ACTIONS OF SIMULATION MODE
VALIDATE, //Validate
RUN, //Run
DEBUG, //Debug
DRAWING_AREA, //A click on the drawing area
OUTPUT_AREA, //A click on the output area
DSN_TOOL, //A click on an empty place in the design tool bar
SIM_TOOL, //A click on an empty place in the simulation tool bar
STATUS //A click on the status bar
};
// TODO: you should add more items
enum DesignMenuItem //The items of the design menu --> THE ORDER MATTERS
{
//Note: Items are ordered here as they appear in menu
//If you change the menu items order, change the order here too
ITM_START, //Start statement
ITM_END, //End statement
ITM_DECLARE_VARIABLE, //declare variable statement
ITM_VALUE_ASSIGN, //simple assignment statement
ITM_VAR_ASSIGN, //variable assignment statement
ITM_OPER_ASSIGN, //operator assignment statement
ITM_COND, //conditional statement
ITM_READ, //read statement
ITM_WRITE, //write statemetn
ITM_CONNECTOR, //connector between two statements
ITM_SELECT, //Select a statement, a connector
ITM_EDIT_STAT, //Edit a statement
ITM_DEL, //Delete a figure
ITM_COPY, //Copy a figure
ITM_CUT, //Cut a figure
ITM_PASTE, //Paste a figure
ITM_SAVE, //Save the whole graph to a file
ITM_LOAD, //Load a graph from a file
ITM_SWITCH_SIM_MODE, //Switch to simulation mode
ITM_EXIT, //Exit
//TODO: Add more items names here
DSN_ITM_CNT //no. of design menu items ==> This should be the last line in this enum
};
// TODO: you should add more items if needed
enum SimMenuItem //The items of the simulation menu
{
//Note: Items are ordered here as they appear in menu
ITM_VALIDATE, //Validate
ITM_RUN, //Run
ITM_DEBUG,
//TODO:Add more items names here
ITM_SWITCH_DSN_MODE, //Switch to Design mode
ITM_EXIT_SIM, //Exit
SIM_ITM_CNT //no. of simulation menu items ==> This should be the last line in this enum
};
#ifndef NULL
#define NULL 0
#endif
#endif