From 9c99893df7e0526ad637d3281c68340c72b144cc Mon Sep 17 00:00:00 2001 From: Thomas Schuetz Date: Thu, 24 Mar 2011 07:07:56 +0100 Subject: modellib: XText bug changed the order of the ROOM classes --- .../models/TimingService.room | 150 +++++++++++---------- 1 file 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 { + + } + action { + "// start timeout" + "taskCount++;" + "if (taskCount>PURGE_LIMIT) timerService.purge();" + "timerService.schedule(((PTimeoutPort)ifitem).getTask(), time_ms);" + } + } + Transition tr2: Operational -> Operational { + triggers { + + } + // nothing to do to kill timeout (handled by timerService) + } + Transition tr3: Operational -> Operational { + triggers { + + } + action { + "// start timer" + "taskCount++;" + "if (taskCount>PURGE_LIMIT) timerService.purge();" + "timerService.scheduleAtFixedRate(((PTimerPort)ifitem).getTask(), time_ms, time_ms);" + } + } + Transition tr4: Operational -> Operational { + triggers { + + } + // 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 { - - } - action { - "// start timeout" - "taskCount++;" - "if (taskCount>PURGE_LIMIT) timerService.purge();" - "timerService.schedule(((PTimeoutPort)ifitem).getTask(), time_ms);" - } - } - Transition tr2: Operational -> Operational { - triggers { - - } - // nothing to do to kill timeout (handled by timerService) - } - Transition tr3: Operational -> Operational { - triggers { - - } - action { - "// start timer" - "taskCount++;" - "if (taskCount>PURGE_LIMIT) timerService.purge();" - "timerService.scheduleAtFixedRate(((PTimerPort)ifitem).getTask(), time_ms, time_ms);" - } - } - Transition tr4: Operational -> Operational { - triggers { - - } - // nothing to do to kill timer (handled by timer) - } - } - } - } + } + } \ No newline at end of file -- cgit v1.2.3