]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Applied r30717 to sysdyn trunk as well to prevent the system getting stuck in Sheet...
authorlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Sun, 21 Dec 2014 08:07:27 +0000 (08:07 +0000)
committerlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Sun, 21 Dec 2014 08:07:27 +0000 (08:07 +0000)
refs #5484

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30719 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java

index 93df521edd922040c6ddd910180dc3eb182c6302..891983bae245ca60214f3de9c605423c906f7acd 100644 (file)
@@ -22,6 +22,8 @@ import java.util.Map;
 import java.util.Set;\r
 import java.util.concurrent.CopyOnWriteArrayList;\r
 \r
+import org.eclipse.core.runtime.IStatus;\r
+import org.eclipse.core.runtime.Status;\r
 import org.simantics.Simantics;\r
 import org.simantics.databoard.Bindings;\r
 import org.simantics.db.ReadGraph;\r
@@ -51,6 +53,7 @@ import org.simantics.simulation.project.ExperimentRuns;
 import org.simantics.simulation.project.IExperimentActivationListener;\r
 import org.simantics.simulation.project.IExperimentManager;\r
 import org.simantics.structural.stubs.StructuralResource2;\r
+import org.simantics.sysdyn.Activator;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.adapter.VariableValueSubscription;\r
 import org.simantics.sysdyn.representation.Configuration;\r
@@ -451,6 +454,10 @@ public class SysdynModel implements IModel, IMappingListener, VariableSubscripti
                        exp = new OldSysdynExperiment(experiment, modelResource);\r
                }\r
             } else {\r
+                if (listener != null) {\r
+                    listener.onMessage(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Experiment type is not supported: " + NameUtils.getSafeName(g, experiment)));\r
+                    listener.onFailure(new UnsupportedOperationException("Experiment type is not supported: " + NameUtils.getSafeName(g, experiment)));\r
+                }\r
                 return null;\r
             }\r
             \r