Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room')
-rw-r--r--examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room298
1 files changed, 149 insertions, 149 deletions
diff --git a/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room b/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room
index dec2906db..da3384e84 100644
--- a/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room
+++ b/examples/org.eclipse.etrice.tutorials/model/Blinky/Blinky.room
@@ -1,150 +1,150 @@
-RoomModel Blinky {
-
- import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib/models/TimingService.room"
-
- LogicalSystem System_Blinky {
- SubSystemRef subsystem: SubSystem_Blinky
- }
-
- SubSystemClass SubSystem_Blinky {
- ActorRef application: BlinkyTop
- ActorRef timingService: ATimingService
- LayerConnection ref application satisfied_by timingService.timer
- LayerConnection ref application satisfied_by timingService.timeout
- }
-
- ActorClass BlinkyTop {
- Structure {
- ActorRef blinky: Blinky
- ActorRef controller: BlinkyController
- Binding blinky.ControlPort and controller.ControlPort
- }
- Behavior { }
- }
-
- ActorClass Blinky {
- Interface {
- Port ControlPort: BlinkyControlProtocoll
- }
- Structure {
- usercode1 {
- "import org.eclipse.etrice.tutorials.PedLightGUI.*;"
- }
- usercode2 {
- "private PedestrianLightWndNoTcp light = new PedestrianLightWndNoTcp();"
- "private TrafficLight3 carLights;"
- "private TrafficLight2 pedLights;"
- }
- external Port ControlPort
- SAP timer: PTimeout
- }
- Behavior {
- Operation destroyUser() {
- "light.closeWindow();"
- }
- StateMachine {
- Transition init: initial -> off {
- action {
- "carLights = light.getCarLights();"
- "pedLights = light.getPedLights();"
- "carLights.setState(TrafficLight3.OFF);"
- "pedLights.setState(TrafficLight2.OFF);"
- }
- }
- Transition tr0: off -> tp0 of blinking {
- triggers {
- <start: ControlPort>
- }
- }
- Transition tr1: blinking -> off {
- triggers {
- <stop: ControlPort>
- }
- action {
- "timer.Kill();"
- "carLights.setState(TrafficLight3.OFF);"
- }
- }
- State off
- State blinking {
- subgraph {
- Transition tr0: my tp0 -> on
- Transition tr1: on -> off {
- triggers {
- <timeoutTick: timer>
- }
- }
- Transition tr2: off -> on {
- triggers {
- <timeoutTick: timer>
- }
- }
- Transition init: initial -> on { }
- EntryPoint tp0
- State on {
- entry {
- "timer.Start(1000);"
- "carLights.setState(TrafficLight3.YELLOW);"
- }
- }
- State off {
- entry {
- "timer.Start(1000);"
- "carLights.setState(TrafficLight3.OFF);"
- }
- }
- }
- }
- }
- }
- }
-
- ActorClass BlinkyController {
- Interface {
- conjugated Port ControlPort: BlinkyControlProtocoll
- }
- Structure {
- external Port ControlPort
- SAP timer: PTimeout
- }
- Behavior {
- StateMachine {
- Transition init: initial -> on {
- action {
- "timer.Start(5000);"
- "ControlPort.start();"
- }
- }
- Transition goOff: on -> off {
- triggers {
- <timeoutTick: timer>
- }
- action {
- "ControlPort.stop();"
- "timer.Start(5000);"
- }
- }
- Transition goOn: off -> on {
- triggers {
- <timeoutTick: timer>
- }
- action {
- "ControlPort.start();"
- "timer.Start(5000);"
- }
- }
- State on
- State off { }
- }
- }
- }
-
- ProtocolClass BlinkyControlProtocoll {
- incoming {
- Message start()
- Message stop()
- }
- outgoing { }
- }
-
+RoomModel Blinky {
+
+ import room.basic.service.timing.* from "../../../org.eclipse.etrice.modellib/models/TimingService.room"
+
+ LogicalSystem System_Blinky {
+ SubSystemRef subsystem: SubSystem_Blinky
+ }
+
+ SubSystemClass SubSystem_Blinky {
+ ActorRef application: BlinkyTop
+ ActorRef timingService: ATimingService
+ LayerConnection ref application satisfied_by timingService.timer
+ LayerConnection ref application satisfied_by timingService.timeout
+ }
+
+ ActorClass BlinkyTop {
+ Structure {
+ ActorRef blinky: Blinky
+ ActorRef controller: BlinkyController
+ Binding blinky.ControlPort and controller.ControlPort
+ }
+ Behavior { }
+ }
+
+ ActorClass Blinky {
+ Interface {
+ Port ControlPort: BlinkyControlProtocoll
+ }
+ Structure {
+ usercode1 {
+ "import org.eclipse.etrice.tutorials.PedLightGUI.*;"
+ }
+ usercode2 {
+ "private PedestrianLightWndNoTcp light = new PedestrianLightWndNoTcp();"
+ "private TrafficLight3 carLights;"
+ "private TrafficLight2 pedLights;"
+ }
+ external Port ControlPort
+ SAP timer: PTimeout
+ }
+ Behavior {
+ Operation destroyUser() {
+ "light.closeWindow();"
+ }
+ StateMachine {
+ Transition init: initial -> off {
+ action {
+ "carLights = light.getCarLights();"
+ "pedLights = light.getPedLights();"
+ "carLights.setState(TrafficLight3.OFF);"
+ "pedLights.setState(TrafficLight2.OFF);"
+ }
+ }
+ Transition tr0: off -> tp0 of blinking {
+ triggers {
+ <start: ControlPort>
+ }
+ }
+ Transition tr1: blinking -> off {
+ triggers {
+ <stop: ControlPort>
+ }
+ action {
+ "timer.Kill();"
+ "carLights.setState(TrafficLight3.OFF);"
+ }
+ }
+ State off
+ State blinking {
+ subgraph {
+ Transition tr0: my tp0 -> on
+ Transition tr1: on -> off {
+ triggers {
+ <timeoutTick: timer>
+ }
+ }
+ Transition tr2: off -> on {
+ triggers {
+ <timeoutTick: timer>
+ }
+ }
+ Transition init: initial -> on { }
+ EntryPoint tp0
+ State on {
+ entry {
+ "timer.Start(1000);"
+ "carLights.setState(TrafficLight3.YELLOW);"
+ }
+ }
+ State off {
+ entry {
+ "timer.Start(1000);"
+ "carLights.setState(TrafficLight3.OFF);"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ActorClass BlinkyController {
+ Interface {
+ conjugated Port ControlPort: BlinkyControlProtocoll
+ }
+ Structure {
+ external Port ControlPort
+ SAP timer: PTimeout
+ }
+ Behavior {
+ StateMachine {
+ Transition init: initial -> on {
+ action {
+ "timer.Start(5000);"
+ "ControlPort.start();"
+ }
+ }
+ Transition goOff: on -> off {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "ControlPort.stop();"
+ "timer.Start(5000);"
+ }
+ }
+ Transition goOn: off -> on {
+ triggers {
+ <timeoutTick: timer>
+ }
+ action {
+ "ControlPort.start();"
+ "timer.Start(5000);"
+ }
+ }
+ State on
+ State off { }
+ }
+ }
+ }
+
+ ProtocolClass BlinkyControlProtocoll {
+ incoming {
+ Message start()
+ Message stop()
+ }
+ outgoing { }
+ }
+
} \ No newline at end of file

Back to the top