From 29585440e1f38ed0f5457001c4702521ef031a3d Mon Sep 17 00:00:00 2001 From: Antti Villberg Date: Tue, 10 Sep 2019 11:45:43 +0300 Subject: [PATCH] An action for experiment activation gitlab #378 Change-Id: Ie52f085a94d71905044dc32debae3fc46732e8a1 --- .../graph/ModelingViewpoint.pgraph | 9 +++++++++ .../org.simantics.modeling/scl/Simantics/Simulation.scl | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph b/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph index 98b7aa981..b97753e5f 100644 --- a/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph +++ b/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph @@ -457,6 +457,13 @@ MOD.Contributions.ActivateModel : VP.ActionContribution VP.ActionContribution.HasNodeType SIMU.Model VP.ActionContribution.HasAction ACTIONS.ActivateModel +MOD.Contributions.ActivateExperiment : VP.ActionContribution + L0.HasLabel "Activate" + VP.ActionContribution.HasImage SILK.bullet_go + VP.ActionContribution.HasCategory VP.EditActionCategory + VP.ActionContribution.HasNodeType SIMU.Experiment + VP.ActionContribution.HasAction ACTIONS.ActivateExperiment + MOD.Contributions.Help : VP.ActionContribution L0.HasLabel "Help" VP.ActionContribution.HasImage SILK.help @@ -727,6 +734,8 @@ ACTIONS.NewSheetBook @MOD.sclAction "createSpreadsheetBookAction" ACTIONS.ActivateModel @MOD.sclAction "activateModelAction" +ACTIONS.ActivateExperiment + @MOD.sclAction "activateExperimentAction" ACTIONS.MigrateComponentType : ACT.Action ACTIONS.CompilePGraphs : ACT.Action //ACTIONS.MigrateMasterTypical : ACT.Action diff --git a/bundles/org.simantics.modeling/scl/Simantics/Simulation.scl b/bundles/org.simantics.modeling/scl/Simantics/Simulation.scl index 2a721ee21..e61b161ad 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Simulation.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Simulation.scl @@ -13,6 +13,11 @@ importJava "org.simantics.simulation.experiment.ExperimentUtil" where createExperimentRun :: Resource -> Resource createExperimentRunWithType :: Resource -> Resource -> Resource activateRun :: Resource -> () + +activateExperimentAction :: Resource -> () +activateExperimentAction experiment = do + syncWrite (\() -> activateExperiment experiment) + () importJava "org.simantics.simulation.experiment.IExperiment" where data IExperiment -- 2.47.1