From: Antti Villberg Date: Tue, 10 Sep 2019 08:45:43 +0000 (+0300) Subject: An action for experiment activation X-Git-Tag: v1.43.0~136^2~74^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=29585440e1f38ed0f5457001c4702521ef031a3d;p=simantics%2Fplatform.git An action for experiment activation gitlab #378 Change-Id: Ie52f085a94d71905044dc32debae3fc46732e8a1 --- 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