X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.simulation%2Fsrc%2Forg%2Fsimantics%2Fsimulation%2Fexperiment%2FExperimentUtil.java;h=449afe59f3209d26e229b57c0da30bb4c05ccc95;hb=refs%2Ftags%2Fv1.28.0;hp=24f6065c5117a6e6660d336edfeefa3c56f43593;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java b/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java index 24f6065c5..449afe59f 100644 --- a/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java +++ b/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/ExperimentUtil.java @@ -47,6 +47,10 @@ public final class ExperimentUtil { ((IDynamicExperiment)experiment).simulate(enabled); } + public static ExperimentState getExperimentState(ReadGraph graph, IExperiment experiment) throws DatabaseException { + return experiment.getState(graph); + } + public static void disposeExperiment(final IExperiment experiment) { if(experiment instanceof IDynamicExperiment) { @@ -132,17 +136,20 @@ public final class ExperimentUtil { protected IStatus run(final IProgressMonitor monitor) { try { experiment.shutdown(monitor); - if (callback != null) - callback.accept(null); return Status.OK_STATUS; } finally { monitor.done(); + if (callback != null) + callback.accept(null); } } }; job.setProperty(IProgressConstants2.SHOW_IN_TASKBAR_ICON_PROPERTY, Boolean.TRUE); job.setUser(true); job.schedule(); + } else { + if (callback != null) + callback.accept(null); } }