Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
e0e990af
Commit
e0e990af
authored
Nov 08, 2019
by
Maxime Perrotin
Browse files
Simplify Trafficlight model
parent
72d63e1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
tests/regression/TrafficLight_Basic/controller.gpr
View file @
e0e990af
...
...
@@ -11,6 +11,6 @@ project controller is
package
Compiler
is
for
Driver
(
"SDL"
)
use
"opengeode"
;
for
Object_File_Suffix
(
"SDL"
)
use
".adb"
;
for
Leading_Required_Switches
(
"SDL"
)
use
(
"--toAda"
,
"../system_structure.pr"
);
for
Leading_Required_Switches
(
"SDL"
)
use
(
"--toAda"
);
end
Compiler
;
end
controller
;
\ No newline at end of file
tests/regression/TrafficLight_Basic/controller.pr
View file @
e0e990af
/* CIF PROCESS (250, 150), (150, 75) */
process Controller;
state Green;
substructure
in (short);
out (Go_Orange);
/* CIF START (343, 131), (70, 35) */
START;
/* CIF NEXTSTATE (331, 186), (93, 35) */
NEXTSTATE First_Delay;
/* CIF START (604, 136), (70, 35) */
START short ;
/* CIF NEXTSTATE (584, 191), (110, 35) */
NEXTSTATE Second_Delay;
/* CIF state (331, 186), (93, 35) */
state First_Delay;
/* CIF input (251, 241), (70, 35) */
input Clock;
/* CIF PROCEDURECALL (200, 296), (171, 35) */
call Set_Timer (5000, Clock);
/* CIF NEXTSTATE (230, 351), (111, 35) */
NEXTSTATE Second_Delay;
/* CIF input (435, 241), (64, 35) */
input Button;
/* CIF PROCEDURECALL (382, 296), (171, 35) */
call Set_Timer (5000, Clock);
/* CIF NEXTSTATE (409, 346), (117, 35) */
NEXTSTATE Second_Delay;
endstate;
/* CIF state (584, 191), (110, 35) */
state Second_Delay;
/* CIF input (604, 246), (70, 35) */
input Clock;
/* CIF return (621, 301), (35, 35) */
return Go_Orange;
endstate;
endsubstructure;
state Red;
substructure
out (Go_Green);
...
...
@@ -13,8 +48,8 @@ process Controller;
input Clock;
/* CIF return (391, 226), (35, 35) */
return Go_Green;
/* CIF input (
477
, 171), (
123
, 35) */
input Button
(cmd)
;
/* CIF input (
506
, 171), (
64
, 35) */
input Button;
/* CIF task (453, 226), (172, 35) */
task Walk_Requested := True;
/* CIF NEXTSTATE (504, 281), (70, 35) */
...
...
@@ -45,41 +80,6 @@ process Controller;
NEXTSTATE Walking;
endstate;
endsubstructure;
state Green;
substructure
in (short);
out (Go_Orange);
/* CIF START (604, 136), (70, 35) */
START short ;
/* CIF NEXTSTATE (583, 191), (110, 35) */
NEXTSTATE Second_Delay;
/* CIF START (343, 131), (70, 35) */
START;
/* CIF NEXTSTATE (331, 186), (93, 35) */
NEXTSTATE First_Delay;
/* CIF state (583, 191), (110, 35) */
state Second_Delay;
/* CIF input (604, 246), (70, 35) */
input Clock;
/* CIF return (621, 301), (35, 35) */
return Go_Orange;
endstate;
/* CIF state (331, 186), (93, 35) */
state First_Delay;
/* CIF input (206, 241), (70, 35) */
input Clock;
/* CIF PROCEDURECALL (155, 296), (171, 35) */
call Set_Timer (5000, Clock);
/* CIF NEXTSTATE (185, 351), (111, 35) */
NEXTSTATE Second_Delay;
/* CIF input (361, 241), (123, 35) */
input Button (cmd);
/* CIF PROCEDURECALL (336, 296), (171, 35) */
call Set_Timer (5000, Clock);
/* CIF NEXTSTATE (364, 346), (117, 35) */
NEXTSTATE Second_Delay;
endstate;
endsubstructure;
/* CIF TEXT (939, 61), (282, 152) */
timer clock;
...
...
@@ -87,41 +87,23 @@ process Controller;
dcl Walk_Requested T_Boolean := False;
dcl Cmd Command;
dcl Cmd Command
:= request_passage
;
/* CIF ENDTEXT */
/* CIF START (155, 40), (70, 33) */
START;
/* CIF NEXTSTATE (152, 90), (75, 35) */
NEXTSTATE Off;
/* CIF state (443, 49), (70, 35) */
state Red;
/* CIF connect (478, 104), (0, 35) */
connect Go_Green;
/* CIF PROCEDURECALL (389, 159), (178, 35) */
call Set_Timer (5000, Clock);
/* CIF output (424, 214), (106, 35) */
output Color (Green);
/* CIF decision (415, 264), (124, 50) */
decision Walk_requested;
/* CIF ANSWER (364, 334), (70, 24) */
(True):
/* CIF NEXTSTATE (339, 378), (119, 35) */
NEXTSTATE Green via Short;
/* CIF ANSWER (533, 334), (68, 24) */
(False):
/* CIF NEXTSTATE (530, 378), (74, 35) */
NEXTSTATE Green;
enddecision;
endstate;
/* CIF state (686, 61), (70, 35) */
state Orange;
/* CIF input (686, 116), (70, 35) */
input Clock;
/* CIF PROCEDURECALL (632, 171), (178, 35) */
/* CIF state (152, 90), (75, 35) */
state Off;
/* CIF input (121, 145), (134, 35) */
input Initialize;
/* CIF PROCEDURECALL (99, 200), (178, 35) */
call Set_Timer (1000, Clock);
/* CIF output (
674
, 2
26
), (92, 35) */
/* CIF output (
142
, 2
55
), (92, 35) */
output Color (Red);
/* CIF NEXTSTATE (686, 276), (70, 35) */
/* CIF output (126, 310), (124, 35) */
output Info_User (Wait);
/* CIF NEXTSTATE (157, 360), (61, 35) */
NEXTSTATE Red;
endstate;
/* CIF state (828, 314), (70, 35) */
...
...
@@ -130,22 +112,40 @@ process Controller;
connect Go_Orange;
/* CIF PROCEDURECALL (762, 419), (201, 35) */
call Set_Timer (2000, Clock);
/* CIF output (80
5
, 474), (114, 35) */
/* CIF output (80
6
, 474), (114, 35) */
output Color (Orange);
/* CIF NEXTSTATE (828, 524), (70, 35) */
NEXTSTATE Orange;
endstate;
/* CIF state (
152, 90
), (7
5
, 35) */
state O
ff
;
/* CIF input (
121
, 1
45
), (
134
, 35) */
input
Initialize (dummy)
;
/* CIF PROCEDURECALL (
100, 200
), (178, 35) */
/* CIF state (
686, 61
), (7
0
, 35) */
state O
range
;
/* CIF input (
686
, 1
16
), (
70
, 35) */
input
Clock
;
/* CIF PROCEDURECALL (
632, 171
), (178, 35) */
call Set_Timer (1000, Clock);
/* CIF output (
142
, 2
55
), (92, 35) */
/* CIF output (
675
, 2
26
), (92, 35) */
output Color (Red);
/* CIF output (126, 310), (124, 35) */
output Info_User (Wait);
/* CIF NEXTSTATE (158, 360), (61, 35) */
/* CIF NEXTSTATE (686, 276), (70, 35) */
NEXTSTATE Red;
endstate;
/* CIF state (443, 49), (70, 35) */
state Red;
/* CIF connect (478, 104), (0, 35) */
connect Go_Green;
/* CIF PROCEDURECALL (389, 159), (178, 35) */
call Set_Timer (5000, Clock);
/* CIF output (425, 214), (106, 35) */
output Color (Green);
/* CIF decision (416, 264), (124, 50) */
decision Walk_requested;
/* CIF ANSWER (364, 334), (70, 24) */
(True):
/* CIF NEXTSTATE (339, 378), (119, 35) */
NEXTSTATE Green via Short;
/* CIF ANSWER (533, 334), (68, 24) */
(False):
/* CIF NEXTSTATE (530, 378), (74, 35) */
NEXTSTATE Green;
enddecision;
endstate;
endprocess Controller;
\ No newline at end of file
tests/regression/TrafficLight_Basic/system_structure.pr
View file @
e0e990af
...
...
@@ -16,9 +16,9 @@ use Datamodel;
system Controller;
/* CIF Keep Specific Geode PARAMNAMES req */
signal Button
(Command)
;
signal Button;
/* CIF Keep Specific Geode PARAMNAMES a */
signal Initialize
(T_Boolean)
;
signal Initialize;
;
/* CIF Keep Specific Geode PARAMNAMES current_color */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment