Added two new user component SCL script simulation stages 76/3276/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 24 Sep 2019 11:44:57 +0000 (14:44 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 24 Sep 2019 11:44:57 +0000 (14:44 +0300)
1. pre-step: executed during each simulation step,
   before native simulation stepping
2. post-step: executed during each simulation step,
   after native and all other stepping logics

The purpose of these is to allow simulation step initialization and
finalization with UC SCL scripts.

gitlab #389

Change-Id: Idbd818f80f30c3bdaefdf75a6c11f0747a9a6a26

bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java
bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties

index c3152692d097dc91f26407cf8e28f00102d3eaf3..208c9f76f5208cb417e2e176baa997a13c733b23 100644 (file)
@@ -39,7 +39,6 @@ import org.simantics.db.layer0.request.combinations.Combinators;
 import org.simantics.db.request.Read;
 import org.simantics.layer0.Layer0;
 import org.simantics.scl.ui.editor.SCLSourceViewerConfigurationNew;
-import org.simantics.scl.ui.editor.SharedTextColorsNew;
 import org.simantics.structural.stubs.StructuralResource2;
 import org.simantics.ui.workbench.IResourceEditorInput;
 import org.simantics.ui.workbench.TitleUpdater;
@@ -103,14 +102,18 @@ public class ComponentTypeScriptEditor extends SCLModuleEditor {
     }
     
     private static final String[] EXECUTION_PHASES = new String[] {
+        "pre-step", //$NON-NLS-1$
         "step", //$NON-NLS-1$
+        "post-step", //$NON-NLS-1$
         "analogAutomation", //$NON-NLS-1$
         "binaryAutomation", //$NON-NLS-1$
         "preparation" //$NON-NLS-1$
     };
     
     private static final String[] EXECUTION_PHASE_LABELS = new String[] {
+        Messages.ComponentTypeScriptEditor_ExecuteBeforeEachStep,
         Messages.ComponentTypeScriptEditor_ExecuteAtEachStep,
+        Messages.ComponentTypeScriptEditor_ExecuteAfterEachStep,
         Messages.ComponentTypeScriptEditor_ExecuteAnalogAutomation,
         Messages.ComponentTypeScriptEditor_ExecuteBinaryAutomation,
         Messages.ComponentTypeScriptEditor_ExecuteDuringPreparation
index e84c6ffafda039b9da5659c67bbea7967c692e6c..7890358fd41e1f0d2257fb32803fb752f840e17c 100644 (file)
@@ -6,7 +6,9 @@ public class Messages extends NLS {
        private static final String BUNDLE_NAME = "org.simantics.modeling.ui.componentTypeEditor.messages"; //$NON-NLS-1$
        public static String ComponentTypeEditor_UserComponentInterface;
        public static String ComponentTypeScriptEditor_ExecuteAnalogAutomation;
+       public static String ComponentTypeScriptEditor_ExecuteAfterEachStep;
        public static String ComponentTypeScriptEditor_ExecuteAtEachStep;
+       public static String ComponentTypeScriptEditor_ExecuteBeforeEachStep;
        public static String ComponentTypeScriptEditor_ExecuteBinaryAutomation;
        public static String ComponentTypeScriptEditor_ExecuteDuringPreparation;
        public static String ComponentTypeViewer_OpenedInReadOnly;
index 72f6b3b56e14f9a13a8681cd32839d2beaee912b..406ebfed6363f013ec81b324fecf3a5158e5eac4 100644 (file)
@@ -1,6 +1,8 @@
 ComponentTypeEditor_UserComponentInterface=User Component Interface
 ComponentTypeScriptEditor_ExecuteAnalogAutomation=Execute together with analog automation
+ComponentTypeScriptEditor_ExecuteAfterEachStep=Execute after each step
 ComponentTypeScriptEditor_ExecuteAtEachStep=Execute at each step
+ComponentTypeScriptEditor_ExecuteBeforeEachStep=Execute before each step
 ComponentTypeScriptEditor_ExecuteBinaryAutomation=Execute together with binary automation
 ComponentTypeScriptEditor_ExecuteDuringPreparation=Execute during preparation
 ComponentTypeViewer_OpenedInReadOnly=(Opened in read-only mode)