瀏覽代碼

Added Interpreter Bugfix for History-States

Andreas Mülder 12 年之前
父節點
當前提交
c37c72997e

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

@@ -195,7 +195,7 @@ class DefaultExecutionFlowInterpreter implements IExecutionFlowInterpreter {
 	}
 
 	def dispatch Object execute(HistoryEntry entry) {
-		if (historyStateConfiguration.get(entry.region) != null) {
+		if (historyStateConfiguration.get(entry.region.historyVector.offset) != null) {
 			entry.historyStep?.execute
 		} else {
 			entry.initialStep?.execute
@@ -206,7 +206,7 @@ class DefaultExecutionFlowInterpreter implements IExecutionFlowInterpreter {
 	def dispatch Object execute(StateSwitch stateSwitch) {
 		val historyRegion = stateSwitch.historyRegion
 		if (historyRegion != null) {
-			val historyState = historyStateConfiguration.get(historyRegion)
+			val historyState = historyStateConfiguration.get(historyRegion.historyVector.offset)
 			stateSwitch.cases.filter[it.state == historyState].forEach[step.schedule]
 		} else {
 			stateSwitch.cases.filter[activeStateConfiguration.contains(state)].forEach[step.schedule]

+ 4 - 2
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/interpreter/JavaOperationMockup.java

@@ -36,12 +36,14 @@ import com.google.inject.Inject;
  */
 public class JavaOperationMockup implements IOperationMockup {
 
-	@Inject
+	@Inject(optional = true)
 	private ILaunch launch;
-	
+
 	private List<Object> callbacks;
 
 	private void initOperationCallbacks() {
+		if (launch == null)
+			return;
 		callbacks = Lists.newArrayList();
 		IFile file = WorkspaceSynchronizer.getFile(((EObject) launch.getAdapter(EObject.class)).eResource());
 		ClassLoader classLoader = new WorkspaceClassLoaderFactory().createClassLoader(file.getProject(), getClass()