-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDDisplay.mod
executable file
·205 lines (184 loc) · 10.5 KB
/
DDisplay.mod
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
{++++++++++++++++++++++++++++++++++++++RAPTOR++++++++++++++++++++++++++++++++++++++}
{+ +}
{+ Definition Module : Display +}
{+ Author : Steve Brown +}
{+ Last Modified : 22 August 08 wds/TES +}
{+ +}
{++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
DEFINITION MODULE Display;
FROM GMedia IMPORT SoundObj;
FROM GrpMod IMPORT QueueObj;
FROM Image IMPORT ImageObj;
FROM Window IMPORT WindowObj;
FROM GTypes IMPORT ScrollDirectionType(HorizontalScroll, VerticalScroll), ColorType;
FROM GrpMod IMPORT RankedObj;
FROM Cursor IMPORT LineCursorObj;
FROM Menu IMPORT PopupMenuObj;
FROM Objects IMPORT RBDBlockObj,RBDEventObj,LinkObj,RBDNodeObj,RBDHierObj,intArray,realArray,SparePoolObj,PhaseObj;
FROM GPalet IMPORT PaletteButtonObj;
FROM Graphic IMPORT GraphicLibObj;
FROM Chart IMPORT ChartObj;
FROM Menubar IMPORT simMenuObj, mainMenuObj, graphMenuObj, simToolObj,
fevToolObj,fevMenuObj,mainToolObj, weakMenuObj, weakToolObj;
FROM IOMod IMPORT StreamObj;
TYPE
cursorType = (blockC, nodeC, eventC, connectC, nilC, dialogC, simC, fevC, weakC, autoC, hierC);
CArrayType = ARRAY INTEGER OF CHAR; { wds/TES 8/14/08}
GridObj = OBJECT(ImageObj);
ASK METHOD Colorize(IN case : STRING);
OVERRIDE
ASK METHOD ObjInit;
END OBJECT;
safeSoundObj = OBJECT(SoundObj);
pID : INTEGER;
ASK METHOD PlayMe(IN fileName : STRING);
END OBJECT;
mainWindowObj = OBJECT(WindowObj);
{draggingblock,draggingnode,dragginghier,}
justCtrled,cancelAddMode : BOOLEAN;
ASK METHOD KillPopup;
ASK METHOD ShowRightClick(IN whatToShow : INTEGER);
ASK METHOD SetScroll;
ASK METHOD SetPanes;
ASK METHOD InitSimDisplay();
ASK METHOD InitFEVDisplay();
ASK METHOD DisplayFace(IN faceColor : INTEGER);
OVERRIDE
ASK METHOD BeResized;
ASK METHOD BeClosed;
ASK METHOD MouseClick(IN x, y : REAL;
IN buttondown : BOOLEAN);
ASK METHOD MouseMove (IN x, y : REAL);
ASK METHOD BeScrolled(IN horizThumbPos, vertThumbPos : REAL;
IN direction : ScrollDirectionType);
END OBJECT; {mainWindowObj}
selectGroupObj = OBJECT(RankedObj);
OVERRIDE
ASK METHOD Rank(IN a,b : ANYOBJ) : INTEGER;
END OBJECT; {selectGroupObj}
graphWindowObj = OBJECT(WindowObj);
ASK METHOD Startup;
OVERRIDE
ASK METHOD BeClosed;
ASK METHOD MouseClick(IN x, y : REAL;
IN buttondown : BOOLEAN);
END OBJECT; {outputWindowObj}
PROCEDURE SetTextSize;
PROCEDURE InitDisplay (OUT exploded : BOOLEAN);
PROCEDURE AddStartEndNodes;
PROCEDURE AddBlock;
PROCEDURE AddEvent;
PROCEDURE AddHier;
PROCEDURE AddConnector;
PROCEDURE AddNode;
PROCEDURE ClearAllBlocks;
PROCEDURE ClearObject;
PROCEDURE EditDetails;
PROCEDURE CopyObject;
PROCEDURE SelectAll;
PROCEDURE PasteObject;
PROCEDURE ValidateRBD (OUT valid :BOOLEAN);
PROCEDURE SendToEngine;
PROCEDURE StartFailureEffects;
PROCEDURE EndFailureEffects;
PROCEDURE ChangeWindow(IN newId, newLevel : INTEGER);
PROCEDURE AddWindow(IN newId : INTEGER);
PROCEDURE SelectBlock;
PROCEDURE SelectEvent;
PROCEDURE SelectHier;
PROCEDURE SelectNode;
PROCEDURE CheckOpenFileStatus;
PROCEDURE InitAoGraph;
PROCEDURE HandleLinks (IN addingItem : BOOLEAN);
PROCEDURE ResetPasted;
PROCEDURE CheckTimeBomb (OUT exploded : BOOLEAN);
PROCEDURE SetView (IN cusZoom,xIn,yIn : REAL);
PROCEDURE CheckTimeBomb (OUT exploded : BOOLEAN);
PROCEDURE ShowAnalView (IN display : BOOLEAN);
PROCEDURE GetPassword(IN today : STRING; OUT pword :STRING);
PROCEDURE ConvertNumber(INOUT a : STRING);
PROCEDURE ZoomPercent(IN ClickX, ClickY : REAL; IN center : BOOLEAN);
PROCEDURE ZoomFit;
PROCEDURE CollapseIntoHier;
PROCEDURE ClearPasteBuffer;
PROCEDURE getXres() : INTEGER ; NONMODSIM "CPP";
PROCEDURE getYres() : INTEGER ; NONMODSIM "CPP";
{wds/TES - mods for finding user's "Application Data" directory, 8/14/08}
PROCEDURE getUserFolderPath(); NONMODSIM "CPP";
PROCEDURE getUserMyDocsPath(); NONMODSIM "CPP";
CONST
aspectRatio = 2.9/3.; {y to x}
CompileType = "release"; {*** coordinate levelLimit with compileType ***}
training = FALSE; {Set to TRUE to build training version}
expireDate = 1491; {Julian date starting from Jan 31, 2001} {1491 ~ 31 Jan 2005} {not used}
elimiDays = 120;
demoCrippleLimit = 10; {Number of demo version blocks allowed}
studentCrippleLimit = 20; {Number of student version blocks allowed}
levelLimit = 5; {*** compileType = "release" or "student" or "demo" ***}
{levelLimit = 2;} {*** compileType = "gmd" ***};
VAR
numberOfRuns,totalObjects,totalBlocks,totalEvents,totalHiers,totalLinks,totalNodes,endId,
totalPools,startId,fontSize,activePhases,currentGraph,blueObjId,
flowGenerated, saveInc, lastSave, weakLinkAnalType, linksIn,
totalTriggers, hierLevel, activeWindow, deepestLevel, termType,
nodesIn, blocksIn, eventsIn, hiersIn, copyWindow, nextId, nextLinkId : INTEGER;
cusZoomVal, oldCusVal, fevZoomVal, xOrigin,yOrigin,simLength,dTimeTrunc,
dNumberOfRuns,dTimeSlice,yMin,yMax,dTimeStartTime,dFailStartTime,
dFailTrunc,dCycleStartTime, dCycleTrunc, graphYOff,symbolOffset,simZoomX,simZoomY,
timeSlice, systemRedCost, sysLostCost, GYthreshold, YRthreshold,
symbolScale : REAL;
simulated,somethingChanged,simOptionChanged,fileIsOpen,
nowSimulating,nodesAnalysed,gridIsOn,
openMenuFile,lambdaMode,muSigmaMode,soundIsOn,copied,
dSimWithGraph,negShutUp,result,linkCancelled,AoVisible,
DisplayAoGraph,addingEvent,nowInitialing,faceBoxOpen,editor,
doneSimming, nowPasting, capacityAnalysis,costAnalysis,weakAnalysis,
startStep, saveIsOn, statusBarOn, dZeroFail, analUp,
analViewAvail, configFrozen, hitXinSim, changedZoom, openFromIcon,
pastingMultiple, diagnostics, simDetails, devmode, password, writeBlkEvs,writeNdEvs,writeSysEvs,
writePhsEvs,writeOnlyItemEvs,DomainTree,CoreFile, importing, collapsing,
copiedFromPrevFile, dontChangeXY, ignoreMouse {eag error 51 fix}, C130File {cmc} : BOOLEAN;
pathName, graphicsPath, nameOfFile, filter, blueObjRef, {imageString,} systemImage, globalImage,
systemUnits, globalUnits, soundsPath, exampPath, soundPath, flowUnits, devVersion, compileType,
devDate,installPath,rbdPath,reportPath,libraryPath,diagFile,sysComment, currentView, detComp : STRING;
linkCursor : LineCursorObj;
typeOfCursor : cursorType;
grid : GridObj;
window : mainWindowObj;
hier : RBDHierObj;
{hier,}block,defaultBlock : RBDBlockObj;
event : RBDEventObj;
node : RBDNodeObj;
link : LinkObj;
popupMenu : PopupMenuObj;
sound : safeSoundObj;
selectGroup : selectGroupObj;
greenButton,yellowButton,redButton : PaletteButtonObj;
baseroot,root,scaleroot,faceVisible,greenFace,redFace,yellowFace,
internal,border : ImageObj;
dialogs,images : GraphicLibObj;
AoGraph,IntAoGraph,MultiRunGraph : ChartObj;
AoGraphWindow : graphWindowObj;
PoolArray : ARRAY INTEGER OF SparePoolObj;
phaseTimes : realArray;
phaseObjArray : ARRAY INTEGER OF PhaseObj;
sysStreams : intArray;
simMenuBar : simMenuObj;
weakMenuBar : weakMenuObj;
fevMenuBar : fevMenuObj;
menubar : mainMenuObj;
graphMenuBar : graphMenuObj;
simToolBar : simToolObj;
weakToolBar : weakToolObj;
fevToolBar : fevToolObj;
menuTool : mainToolObj;
selectedLinksGroup,blockGroup, nodeGroup, eventGroup,
hierGroup, linkGroup, capLinkGroup, capNodeGroup : QueueObj;
diagnosticsStream, simDetailsStream : StreamObj;
simColor,workColor,goggleColor,fevColor,gridColor,
linkWorkColor, textWorkColor, blockGUIColor : ColorType;
{wds/TES - mods for finding user's "Application Data" directory}
userPath : STRING;
{wds/TES - mods for finding user's "MyDocuments" directory}
docsPath : STRING;
END MODULE. {Display}