summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Jung2011-08-11 13:05:10 (EDT)
committerThomas Jung2011-08-11 13:05:10 (EDT)
commit821a6fae8b02feae4b3b984495c6391455529b94 (patch)
tree01428dec203f1fc2e2a6ab669e8894f1cacd22ab
parent0a7500f1ee06dd1eed1eed49b464e9e7cbf1ce62 (diff)
downloadorg.eclipse.etrice-821a6fae8b02feae4b3b984495c6391455529b94.zip
org.eclipse.etrice-821a6fae8b02feae4b3b984495c6391455529b94.tar.gz
org.eclipse.etrice-821a6fae8b02feae4b3b984495c6391455529b94.tar.bz2
[doc.doc] references to models instead of copy
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile156
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile142
-rw-r--r--plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile173
3 files changed, 5 insertions, 466 deletions
diff --git a/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile b/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
index 5265e87..d41186c 100644
--- a/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/020-tutorial-blinky.textile
@@ -191,162 +191,10 @@ timer.Kill();
carLights.setState(TrafficLight3.OFF);
bq.
-The complete resulting model looks like this:
-
-bc..
-RoomModel Blinky {
-
- LogicalSystem System_Blinky {
- SubSystemRef subsystem: SubSystem_Blinky
- }
-
- SubSystemClass SubSystem_Blinky {
- ActorRef application: BlinkyTop
- ActorRef timingService: room.basic.service.timing.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 de.protos.PedLightGUI.*;"
- }
- usercode2 {
- "private PedestrianLightWndNoTcp light = new PedestrianLightWndNoTcp();"
- "private TrafficLight3 carLights;"
- "private TrafficLight2 pedLights;"
-
- }
- external Port ControlPort
- SAP timer: room.basic.service.timing.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: room.basic.service.timing.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|timeoutTick: timer>
- }
- action {
- "ControlPort.start();"
- "timer.Start(5000);"
- }
- }
- State on
- State off
- }
- }
- }
-
- ProtocolClass BlinkyControlProtocoll {
- incoming {
- Message start()
- Message stop()
- }
- outgoing { }
- }
-
-}
-bq.
-
The model is complete now. You can run and debug the model as described in getting started. Have fun.
+The complete model can be found in /org.eclipse.etrice.tutorials/model/Blinky.
+
h2. Summary
Run the model and take a look at the generated MSCs. Inspect the generated code to understand the runtime model of eTrice. Within this tutorial you have learned how to create a hierarchical FSM with group transitions and history transitions and you have used entry code. You are now familiar with the basic features of eTrice. The further tutorials will take this knowledge as a precondition.
diff --git a/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile b/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile
index 09e2765..4886ead 100644
--- a/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/025-tutorial-sending-data.textile
@@ -199,147 +199,7 @@ Open the Structure from SendingDataTop and add MrPing and MrPong as a reference.
!images/025-SendingData13.png!
-The model is finished now and the model file should look like this:
-
-bc..
-RoomModel SendingData {
-
- LogicalSystem SendingData_LogSystem {
- SubSystemRef SendingDataAppl: SendingData_SubSystem
- }
-
- SubSystemClass SendingData_SubSystem {
- ActorRef SendigDataTopRef: SendingDataTop
- }
-
- ActorClass SendingDataTop {
- Structure {
- ActorRef ref0: MrPing
- ActorRef ref1: MrPong
- Binding ref0.PingPongPort and ref1.PingPongPort
- }
- Behavior { }
- }
-
- ActorClass MrPing {
- Interface {
- conjugated Port PingPongPort: PingPongProtocol
- }
- Structure {
- external Port PingPongPort
- }
- Behavior {
-
- Operation printData(d: DemoData) : void {
- "System.out.printf(\"d.int32Val: %d\\n\",d.int32Val);"
- "System.out.printf(\"d.float64Val: %f\\n\",d.float64Val);"
- "System.out.printf(\"d.int8Array: \");"
- "for(int i = 0; i<d.int8Array.length; i++) {"
- "System.out.printf(\"%d \",d.int8Array[i]);}"
- "System.out.printf(\"\\nd.stringVal: %s\\n\",d.stringVal);"
- }
-
- StateMachine {
- Transition wait2: waitForPong -> waitForPong {
- triggers {
- <pong: PingPongPort>
- }
- action {
- "printData(data);"
- }
- }
- Transition wait1: waitForPongSimple -> waitForPongSimple {
- triggers {
- <pongSimple: PingPongPort guard {
- "data < 10"
- }>
- }
- action {
- "// keep in mind that MrPong increments"
- "PingPongPort.pingSimple(data);"
- "System.out.printf(\"data: %d\\n\",data);"
- }
- }
- Transition next: waitForPongSimple -> waitForPong {
- triggers {
- <pongSimple: PingPongPort>
- }
- action {
- "System.out.printf(\"data: %d\\n\",data);"
- ""
- "DemoData d = new DemoData();"
- "// send the default values"
- "PingPongPort.ping(d);"
- "d.int32Val=815;"
- "for (int i = 0; i<d.int8Array.length;i++){"
- "\td.int8Array[i]=(byte)(i+100);"
- "\t}"
- "d.stringVal=\"some contents\";"
- "d.float64Val=3.141234;"
- "PingPongPort.ping(d);"
- }
- }
- Transition init0: initial -> waitForPongSimple {
- action {
- "PingPongPort.pingSimple(0);"
- }
- }
- State waitForPong
- State waitForPongSimple
- }
- }
- }
-
- ActorClass MrPong {
- Interface {
- Port PingPongPort: PingPongProtocol
- }
- Structure {
- external Port PingPongPort
- }
- Behavior {
- StateMachine {
- Transition init: initial -> looping { }
- Transition tr0: looping -> looping {
- triggers {
- <ping: PingPongPort>
- }
- action {
- "PingPongPort.pong(data);"
- }
- }
- Transition tr1: looping -> looping {
- triggers {
- <pingSimple: PingPongPort>
- }
- action {
- "PingPongPort.pongSimple(data+1);"
- }
- }
- State looping
- }
- }
- }
-
- ProtocolClass PingPongProtocol {
- incoming {
- Message ping(data: DemoData)
- Message pingSimple(data: int32)
- }
- outgoing {
- Message pong(data: DemoData)
- Message pongSimple(data: int32)
- }
- }
-
- DataClass DemoData {
- Attribute int32Val: int32 = "4711"
- Attribute int8Array [ 10 ]: int8 = "{1,2,3,4,5,6,7,8,9,10}"
- Attribute float64Val: float64 = "0.0"
- Attribute stringVal: string = "\"empty\""
- }
-}
-bq.
+The model is finished now and can be found in /org.eclipse.etrice.tutorials/model/SendingData.
h2. Generate and run the model
diff --git a/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile b/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile
index 3083dd0..a9f361d 100644
--- a/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile
+++ b/plugins/org.eclipse.etrice.doc/doc/030-tutorial-ped-lights.textile
@@ -24,177 +24,8 @@ h2. Setup the model
* Use the ??New Model Wizzard?? to create a new eTrice project and name it ??PedLightsController??.
* Copy the package ??de.protos.PedLightGUI?? to your ??src?? directory (see blinky tutorial).
* In PedestrianLightWndNoTcp.jav uncomment line 15 (import), 36, 122 (usage) and 132-134 (registration).
-* Copy the following model to your model file:
-
-bc..
-RoomModel PedLightsController {
-
- LogicalSystem LogSys_PedLights {
- SubSystemRef application: SubSys_PedLights
- }
-
- SubSystemClass SubSys_PedLights {
- ActorRef PedLightsTopRef: PedLightsTop
- ActorRef timingService: room.basic.service.timing.ATimingService
- LayerConnection ref PedLightsTopRef satisfied_by timingService.timer
- LayerConnection ref PedLightsTopRef satisfied_by timingService.timeout
- }
-
- ActorClass PedLightsTop {
- Structure {
- ActorRef adapter: GuiAdapter
- ActorRef controller: Controller
- Binding adapter.ControlPort and controller.ControlPort
- }
- Behavior { }
- }
-
- ActorClass GuiAdapter {
- Interface {
- conjugated Port ControlPort: PedControlProtocol
- }
- Structure {
- usercode1 {
- "import PedLightGUI.*;"
- }
- usercode2 {
- "private PedestrianLightWndNoTcp lights = new PedestrianLightWndNoTcp(\"Pedestrian Lights\",\" external port connection \");"
- "private TrafficLight3 carLights;"
- "private TrafficLight2 pedLights;"
- }
- external Port ControlPort
- }
- Behavior {
- Operation destroyUser() {
- "lights.closeWindow();"
- }
- StateMachine {
- Transition init: initial -> running {
- action {
- "carLights=lights.getCarLights();"
- "pedLights=lights.getPedLights();"
- "carLights.setState(TrafficLight3.OFF);"
- "pedLights.setState(TrafficLight2.OFF);"
- "lights.setPort(ControlPort);"
- }
- }
- Transition tr0: running -> running {
- triggers {
- <setCarLights: ControlPort>
- }
- action {
- "carLights.setState(state);"
- }
- }
- Transition tr1: running -> running {
- triggers {
- <setPedLights: ControlPort>
- }
- action {
- "pedLights.setState(state);"
- }
- }
- State running
- }
- }
- }
-
- ActorClass Controller {
- Interface {
- Port ControlPort: PedControlProtocol
- }
- Structure {
- usercode1 {
- "import PedLightGUI.*;"
- }
- external Port ControlPort
- SAP timer: room.basic.service.timing.PTimeout
- }
- Behavior {
- StateMachine {
- Transition init: initial -> off { }
- Transition tr0: off -> carsGreen {
- triggers {
- <start: ControlPort>
- }
- action {
- "timer.Start(700);"
- "ControlPort.setCarLights(TrafficLight3.GREEN);"
- "ControlPort.setPedLights(TrafficLight2.RED);"
- }
- }
- Transition tr1: carsGreen -> carsYellow {
- triggers {
- <timeoutTick: timer>
- }
- action {
- "timer.Start(700);"
- "ControlPort.setCarLights(TrafficLight3.YELLOW);"
- "ControlPort.setPedLights(TrafficLight2.RED);"
- }
- }
- Transition tr2: carsYellow -> carsRed {
- triggers {
- <timeoutTick: timer>
- }
- action {
- "timer.Start(1500);"
- "ControlPort.setCarLights(TrafficLight3.RED);"
- "ControlPort.setPedLights(TrafficLight2.GREEN);"
- }
- }
- Transition tr3: carsRed -> carsYellowRed {
- triggers {
- <timeoutTick: timer>
- }
- action {
- "timer.Start(700);"
- "ControlPort.setCarLights(TrafficLight3.YELLOW_RED);"
- "ControlPort.setPedLights(TrafficLight2.RED);"
- }
- }
- Transition tr4: carsYellowRed -> carsGreen2 {
- triggers {
- <timeoutTick: timer>
- }
- action {
- "timer.Start(700);"
- "ControlPort.setCarLights(TrafficLight3.GREEN);"
- "ControlPort.setPedLights(TrafficLight2.RED);"
- }
- }
- Transition tr5: carsGreen2 -> off {
- triggers {
- <timeoutTick: timer>
- }
- action {
- "ControlPort.setCarLights(TrafficLight3.OFF);"
- "ControlPort.setPedLights(TrafficLight2.OFF);"
- }
- }
- State off
- State carsGreen
- State carsYellow
- State carsRed
- State carsYellowRed
- State carsGreen2
- }
- }
- }
-
- ProtocolClass PedControlProtocol {
- incoming {
- Message start()
- }
- outgoing {
- Message setCarLights(state: int32)
- Message setPedLights(state: int32)
- }
- }
-}
-bq.
-
-* Arrange the Structure and the Statemachines to understand the model
+* Copy the model from /org.eclipse.etrice.tutorials/model/PedLightsController to your model file, or run the model directly in the tutorial directory:
+* Arrange the Structure and the Statemachines to understand the model
!images/030-PedLights01.PNG!
The ??GuiAdapter?? represents the interface to the external code. It registers its ??ControlPort?? by the external code.