Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2011-03-24 02:07:56 -0400
committerThomas Schuetz2011-03-24 02:07:56 -0400
commit9c99893df7e0526ad637d3281c68340c72b144cc (patch)
treef49daf6d8c6fa522f91939e2ae1429d439ee9f21
parent081e859ef73c56567aaee024ecccac1717324932 (diff)
downloadorg.eclipse.etrice-9c99893df7e0526ad637d3281c68340c72b144cc.tar.gz
org.eclipse.etrice-9c99893df7e0526ad637d3281c68340c72b144cc.tar.xz
org.eclipse.etrice-9c99893df7e0526ad637d3281c68340c72b144cc.zip
modellib: XText bug changed the order of the ROOM classes
-rw-r--r--modellib/org.eclipse.etrice.modellib/models/TimingService.room150
1 files changed, 76 insertions, 74 deletions
diff --git a/modellib/org.eclipse.etrice.modellib/models/TimingService.room b/modellib/org.eclipse.etrice.modellib/models/TimingService.room
index fbd392452..08ddc1d9c 100644
--- a/modellib/org.eclipse.etrice.modellib/models/TimingService.room
+++ b/modellib/org.eclipse.etrice.modellib/models/TimingService.room
@@ -1,4 +1,77 @@
-RoomModel room.basic.service.timing {
+RoomModel room.basic.service.timing {
+
+ ActorClass ATimingService {
+ Interface {
+ SPP timer: PTimer
+ SPP timeout: PTimeout
+ }
+ Structure {
+ usercode1 {
+ "import java.util.Timer;"
+ }
+ usercode2 {
+ "private Timer timerService = null;"
+ "private int taskCount = 0;"
+ "private static final int PURGE_LIMIT = 1000;"
+ }
+ ServiceImplementation of timer
+ ServiceImplementation of timeout
+ }
+ Behavior {
+ Operation stop() {
+ "System.out.println(toString() + \"::stop()\");"
+ "timerService.cancel();"
+ "timerService = null;"
+ }
+ StateMachine {
+ Transition tr0: initial -> Operational {
+ action {
+ "timerService = new Timer();"
+ }
+ }
+ Transition tr1: Operational -> Operational {
+ triggers {
+ <Start:timeout>
+ }
+ action {
+ "// start timeout"
+ "taskCount++;"
+ "if (taskCount>PURGE_LIMIT) timerService.purge();"
+ "timerService.schedule(((PTimeoutPort)ifitem).getTask(), time_ms);"
+ }
+ }
+ Transition tr2: Operational -> Operational {
+ triggers {
+ <Kill:timeout>
+ }
+ // nothing to do to kill timeout (handled by timerService)
+ }
+ Transition tr3: Operational -> Operational {
+ triggers {
+ <Start:timer>
+ }
+ action {
+ "// start timer"
+ "taskCount++;"
+ "if (taskCount>PURGE_LIMIT) timerService.purge();"
+ "timerService.scheduleAtFixedRate(((PTimerPort)ifitem).getTask(), time_ms, time_ms);"
+ }
+ }
+ Transition tr4: Operational -> Operational {
+ triggers {
+ <Kill:timer>
+ }
+ // nothing to do to kill timer (handled by timer)
+ }
+ State Operational {
+ entry {
+ "// prepare"
+ }
+ }
+ }
+ }
+ }
+
ProtocolClass PTimer {
usercode1 {
"import java.util.TimerTask;"
@@ -236,77 +309,6 @@ RoomModel room.basic.service.timing {
}"
}
}
- }
-
- ActorClass ATimingService {
- Interface {
- SPP timer: PTimer
- SPP timeout: PTimeout
- }
- Structure {
- usercode1 {
- "import java.util.Timer;"
- }
- usercode2 {
- "private Timer timerService = null;"
- "private int taskCount = 0;"
- "private static final int PURGE_LIMIT = 1000;"
- }
- ServiceImplementation of timer
- ServiceImplementation of timeout
- }
- Behavior {
- Operation stop() {
- "System.out.println(toString() + \"::stop()\");"
- "timerService.cancel();"
- "timerService = null;"
- }
- StateMachine {
- State Operational {
- entry {
- "// prepare"
- }
- }
- Transition tr0: initial -> Operational {
- action {
- "timerService = new Timer();"
- }
- }
- Transition tr1: Operational -> Operational {
- triggers {
- <Start:timeout>
- }
- action {
- "// start timeout"
- "taskCount++;"
- "if (taskCount>PURGE_LIMIT) timerService.purge();"
- "timerService.schedule(((PTimeoutPort)ifitem).getTask(), time_ms);"
- }
- }
- Transition tr2: Operational -> Operational {
- triggers {
- <Kill:timeout>
- }
- // nothing to do to kill timeout (handled by timerService)
- }
- Transition tr3: Operational -> Operational {
- triggers {
- <Start:timer>
- }
- action {
- "// start timer"
- "taskCount++;"
- "if (taskCount>PURGE_LIMIT) timerService.purge();"
- "timerService.scheduleAtFixedRate(((PTimerPort)ifitem).getTask(), time_ms, time_ms);"
- }
- }
- Transition tr4: Operational -> Operational {
- triggers {
- <Kill:timer>
- }
- // nothing to do to kill timer (handled by timer)
- }
- }
- }
- }
+ }
+
} \ No newline at end of file

Back to the top