From: Tuukka Lehtonen Date: Tue, 24 Sep 2019 11:44:57 +0000 (+0300) Subject: Added two new user component SCL script simulation stages X-Git-Tag: v1.43.0~136^2~65 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=1653df0843d89e68b8e476bda2133e781a667c04;p=simantics%2Fplatform.git Added two new user component SCL script simulation stages 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 --- diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java index c3152692d..208c9f76f 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java @@ -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 diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java index e84c6ffaf..7890358fd 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java @@ -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; diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties index 72f6b3b56..406ebfed6 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties @@ -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)