瀏覽代碼

Changed run cycle execution to send TraceBeginRunCycle and TraceEndRunCycle after every run-to-completion step, so every step gets correctly evaluated whenstepping through the simulation. * Related to Yakindu/sctpro#1377 * Related to Yakindu/sctpro#1386 (#1966)

Robert Rudi 7 年之前
父節點
當前提交
ee902d87e6

+ 3 - 3
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/interpreter/DefaultExecutionFlowInterpreter.xtend

@@ -94,7 +94,7 @@ class DefaultExecutionFlowInterpreter implements IExecutionFlowInterpreter, IEve
 	protected List<Step> executionStack
 	protected int activeStateIndex
 	protected boolean useInternalEventQueue
-	
+
 	protected static final Trace beginRunCycleTrace = SexecFactory.eINSTANCE.createTraceBeginRunCycle
 	protected static final Trace endRunCycleTrace = SexecFactory.eINSTANCE.createTraceEndRunCycle
 
@@ -153,9 +153,9 @@ class DefaultExecutionFlowInterpreter implements IExecutionFlowInterpreter, IEve
 	}
 
 	override runCycle() {
-		traceInterpreter.evaluate(beginRunCycleTrace, executionContext)
 		var Event event = null
 		do {
+			traceInterpreter.evaluate(beginRunCycleTrace, executionContext)
 			// activate an event if there is one
 			if (event !== null) {
 				event.event.raised = true
@@ -166,8 +166,8 @@ class DefaultExecutionFlowInterpreter implements IExecutionFlowInterpreter, IEve
 			rtcStep
 			// get next event if available
 			if(! internalEventQueue.empty) event = internalEventQueue.poll
+			traceInterpreter.evaluate(endRunCycleTrace, executionContext)
 		} while (event !== null)
-		traceInterpreter.evaluate(endRunCycleTrace, executionContext)
 	}
 
 	def rtcStep() {