From 0c7851aadf339384f59b601b7bfea728e22884dd Mon Sep 17 00:00:00 2001 From: lehtonen Date: Sun, 21 Dec 2014 08:05:18 +0000 Subject: [PATCH] Changed SysdynModel to not get expeirment activation in an eternally waiting situation. refs #5484 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/1.8@30717 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/sysdyn/manager/SysdynModel.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java index 93df521e..891983ba 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java @@ -22,6 +22,8 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.simantics.Simantics; import org.simantics.databoard.Bindings; import org.simantics.db.ReadGraph; @@ -51,6 +53,7 @@ import org.simantics.simulation.project.ExperimentRuns; import org.simantics.simulation.project.IExperimentActivationListener; import org.simantics.simulation.project.IExperimentManager; import org.simantics.structural.stubs.StructuralResource2; +import org.simantics.sysdyn.Activator; import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.adapter.VariableValueSubscription; import org.simantics.sysdyn.representation.Configuration; @@ -451,6 +454,10 @@ public class SysdynModel implements IModel, IMappingListener, VariableSubscripti exp = new OldSysdynExperiment(experiment, modelResource); } } else { + if (listener != null) { + listener.onMessage(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Experiment type is not supported: " + NameUtils.getSafeName(g, experiment))); + listener.onFailure(new UnsupportedOperationException("Experiment type is not supported: " + NameUtils.getSafeName(g, experiment))); + } return null; } -- 2.47.1