]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
An action for experiment activation 33/3233/1
authorAntti Villberg <antti.villberg@semantum.fi>
Tue, 10 Sep 2019 08:45:43 +0000 (11:45 +0300)
committerAntti Villberg <antti.villberg@semantum.fi>
Tue, 10 Sep 2019 08:45:43 +0000 (11:45 +0300)
gitlab #378

Change-Id: Ie52f085a94d71905044dc32debae3fc46732e8a1

bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph
bundles/org.simantics.modeling/scl/Simantics/Simulation.scl

index 98b7aa98120c69217aba16c8a9cf709a98bccbf0..b97753e5fc5c920061de1be78cd1f8b7adde20d9 100644 (file)
@@ -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
index 2a721ee21d69f873b024b9506466f262d64490d5..e61b161ad18b2b54186a17498379228d2a274b38 100644 (file)
@@ -13,6 +13,11 @@ importJava "org.simantics.simulation.experiment.ExperimentUtil" where
     createExperimentRun :: Resource -> <WriteGraph> Resource
     createExperimentRunWithType :: Resource -> Resource -> <WriteGraph> Resource
     activateRun :: Resource -> <WriteGraph> ()
+
+activateExperimentAction :: Resource -> <Proc> ()
+activateExperimentAction experiment = do
+  syncWrite (\() -> activateExperiment experiment)
+  ()
     
 importJava "org.simantics.simulation.experiment.IExperiment" where
     data IExperiment