Skip to content

Commit 1c7dc3d

Browse files
Release 1.2.0 (#3)
# Release 1.2.0 ## New features - 'OnExpired' blocks to provide, periodically triggered via events. Multiple blocks can be used. (Replaces former 'OnNewValue' block) - Logic blocks to solve simple logic operations directly within a flow - New event 'OnStopFlowConfigProviders' to inform other modules to stop their FlowConfig related providers, e.g. via UI button (related modules need to be updated to support this feature)
1 parent 0850bb3 commit 1c7dc3d

13 files changed

+1735
-204
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## Release 1.2.0
5+
6+
### New features
7+
- 'OnExpired' blocks to provide, periodically triggered via events. Multiple blocks can be used. (Replaces former 'OnNewValue' block)
8+
- Logic blocks to solve simple logic operations directly within a flow
9+
- New event 'OnStopFlowConfigProviders' to inform other modules to stop their FlowConfig related providers, e.g. via UI button (related modules need to be updated to support this feature)
10+
11+
### Improvement
12+
- App property 'LuaLoadAllEngineAPI' set to false
13+
414
## Release 1.1.0
515

616
### Improvement
Binary file not shown.

CSK_Module_FlowConfig/project.mf.xml

Lines changed: 115 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ Check the UI of this CSK module to configure the system. +</desc>
1616
<item desc="This will save the configuration of the flow and additionally triggers for all CSK modules used within the flow to save their current configuration in PersistentData" name="FLOW">FLOW</item>
1717
<item desc="This will only save the configuration of the flow in PersistentData. Configurations done in other CSK modules need to be saved additionally" name="MODULE">MODULE</item>
1818
</enum>
19+
<enum name="LogicOperator" trait="released" type="string">
20+
<desc>Logical operators</desc>
21+
<item desc="AND operation" name="AND">AND</item>
22+
<item desc="OR operation" name="OR">OR</item>
23+
<item desc="Invert incoming boolean value." name="INVERT">INVERT</item>
24+
<item desc="Check if value is greater than definition of criteriaA." name="GREATER">GREATER</item>
25+
<item desc="Check if value is greater or equal as definition of criteriaA." name="GREATER_EQUAL">GREATER_EQUAL</item>
26+
<item desc="Check if value is less than definition of criteriaA." name="LESS">LESS</item>
27+
<item desc="Check if value is less or equal as definition of criteriaA." name="LESS_EQUAL">LESS_EQUAL</item>
28+
<item desc="Check if value is greater/equal as critieriaA and smaller/equal as critieriaB." name="WITHIN_RANGE">WITHIN_RANGE</item>
29+
<item desc="Check if value is smaller/equal as critieriaA and bigger/equal as critieriaB." name="OUT_OF_RANGE">OUT_OF_RANGE</item>
30+
<item desc="Check if value is equal to criteriaA." name="EQUAL">EQUAL</item>
31+
<item desc="Check if value changed." name="CHANGED">CHANGED</item>
32+
<item desc="Continuous AND operation (keeps previous received status and directly compares with this)" name="AND_PREV">AND_PREV</item>
33+
<item desc="Continuous OR operation (keeps previous received status and directly compares with this)" name="OR_PREV">OR_PREV</item>
34+
</enum>
1935
<serves>
2036
<event name="OnNewStatusLoadParameterOnReboot">
2137
<desc>Notify status if parameters should be loaded on app/device boot up.</desc>
@@ -111,6 +127,30 @@ Check the UI of this CSK module to configure the system. +</desc>
111127
<event name="OnNewStatusFlowConfigReady">
112128
<desc>Notify that FlowConfig module is ready.</desc>
113129
</event>
130+
<event name="OnExpired_TYPE_TIME_VALUE">
131+
<desc>Example of dynamically served event to periodically notify a value to trigger other features. +
132+
TYPE, TIME and VALUE will be replaced by the name of the added expression (e.g. "CSK_FlowConfig.OnExpired_BOOL_100_TRUE"). +
133+
INFO: Other modules can check via "Script.isServedAsFunction" if event exists. +</desc>
134+
<param desc="Value" multiplicity="1" name="value" type="auto"/>
135+
<param desc="Timestamp" multiplicity="1" name="timestamp" type="int"/>
136+
</event>
137+
<event name="OnNewLogicResult_ID">
138+
<desc>Example of dynamically served event to notify result of logic operation. +
139+
ID will be replaced by internal set identifier of logic block (e.g. "CSK_FlowConfig.OnNewLogicResult_2"). +
140+
INFO: Other modules can check via "Script.isServedAsFunction" if event exists. +</desc>
141+
<param desc="Value" multiplicity="1" name="value" type="auto"/>
142+
<param desc="Timestamp" multiplicity="1" name="timestamp" type="int"/>
143+
</event>
144+
<event name="OnNewValueToForward_ID">
145+
<desc>Example of dynamically served event to notify the checked value of a logic operation if its result was successfull. +
146+
ID will be replaced by internal set identifier of logic block (e.g. "CSK_FlowConfig.OnNewValueToForward_2"). +
147+
INFO: Other modules can check via "Script.isServedAsFunction" if event exists. +</desc>
148+
<param desc="Value" multiplicity="1" name="value" type="auto"/>
149+
<param desc="Timestamp" multiplicity="1" name="timestamp" type="int"/>
150+
</event>
151+
<event name="OnStopFlowConfigProviders">
152+
<desc>Notify event to stop FlowConfig relevant providers.</desc>
153+
</event>
114154
<function name="setParameterName">
115155
<desc>Function to set the name of the parameters if saved/loaded via the CSK_PersistentData module.</desc>
116156
<param desc="Name of the parameter." multiplicity="1" name="name" type="string"/>
@@ -190,6 +230,24 @@ Check the UI of this CSK module to configure the system. +</desc>
190230
<desc>Function to set if important information regarding the FlowConfig should be shown within the UI at page reload.</desc>
191231
<param desc="Status" multiplicity="1" name="status" type="bool"/>
192232
</function>
233+
<function name="addTimer">
234+
<desc>Function to add a cyclic timer to trigger events.</desc>
235+
<param desc="Value to send via event.&#10;For 'BOOL' values use &quot;true&quot; or &quot;false&quot;" multiplicity="1" name="value" type="string"/>
236+
<param desc="Type of value to send." multiplicity="1" name="valueType" type="string"/>
237+
<param desc="Cycle time in ms ('0' for single trigger)" multiplicity="1" name="cycleTime" type="int"/>
238+
</function>
239+
<function name="addLogicBlock">
240+
<desc>Function to internally add logic blocks.</desc>
241+
<param desc="Internally set instance identifier." multiplicity="1" name="instance" type="string"/>
242+
<param desc="Logic to use." multiplicity="1" name="logic" ref="CSK_FlowConfig.LogicOperator" type="enum"/>
243+
<param desc="Source for value1." multiplicity="1" name="source1" type="string"/>
244+
<param desc="Optional source for value2." multiplicity="?" name="source2" type="string"/>
245+
<param desc="Optional criteriaA, used by some operators (see info for logic)." multiplicity="?" name="criteriaA" type="string"/>
246+
<param desc="Optional valueB, used by some operators (see info for logic)." multiplicity="?" name="valueB" type="string"/>
247+
</function>
248+
<function name="stopFlowProviders">
249+
<desc>Function to trigger event to stop FlowConfig relevant providers.</desc>
250+
</function>
193251
</serves>
194252
</crown>
195253
<crown name="FlowConfig_FC">
@@ -204,11 +262,13 @@ Check the UI of this CSK module to configure the system. +</desc>
204262
<serves/>
205263
<crown name="OnNewValue">
206264
<trait>released</trait>
207-
<desc>Provide values. Especially helpful for testing purposes.</desc>
265+
<desc>DEPRECATED - Use 'OnExpired' block instead.
266+
Provide values. Especially helpful for testing purposes.</desc>
208267
<serves>
209268
<event name="OnNewValue">
210269
<include>data-flow</include>
211-
<desc>Provide values. Especially helpful for testing purposes.
270+
<desc>DEPRECATED - Use 'OnExpired' block instead.
271+
Provide values. Especially helpful for testing purposes.
212272
Will send current timestamp as 2nd parameter.</desc>
213273
<param desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
214274
<param desc="'CSK_FlowConfig.OnNewValue'&#10;&#10;Parameter:&#10;1: Value (STRING or NUMBER or BOOL)&#10;2: Timestamp (INT)" multiplicity="1" name="OnNewValue" type="string"/>
@@ -231,14 +291,65 @@ Will send current timestamp as 2nd parameter.</desc>
231291
</function>
232292
</serves>
233293
</crown>
294+
<crown name="OnExpired">
295+
<trait>released</trait>
296+
<desc>Periodically notify values. Especially helpful for testing purposes.
297+
Will send current timestamp as 2nd parameter.</desc>
298+
<serves>
299+
<event name="OnExpired">
300+
<include>data-flow</include>
301+
<desc>Periodically notify values. Especially helpful for testing purposes.
302+
Will send current timestamp as 2nd parameter.</desc>
303+
<param desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
304+
<param desc="'CSK_FlowConfig.OnExpired_[TYPE]_[TIME]_[VALUE]'&#10;&#10;Parameter:&#10;1: Value (STRING or NUMBER or BOOL)&#10;2: Timestamp (INT)" multiplicity="1" name="OnExpired" type="string"/>
305+
</event>
306+
<function name="create">
307+
<trait>released</trait>
308+
<desc>Internally used CSK_FlowConfig create function.</desc>
309+
<param desc="Cycle time in ms ('0' for single trigger)" multiplicity="1" name="CycleTime" type="int"/>
310+
<param desc="Type of value to send." multiplicity="1" name="ValueType" ref="FlowConfig_FC.ValueType" type="enum"/>
311+
<param desc="Value to send via event.&#10;For 'BOOL' values use &quot;true&quot;, &quot;false&quot; or &quot;toggle&quot;." multiplicity="1" name="Value" type="string"/>
312+
<return desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
313+
</function>
314+
<function name="register">
315+
<trait>released</trait>
316+
<desc>Internally used CSK_FlowConfig register function.</desc>
317+
<param desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
318+
<param desc="Internal parameter (not used)." multiplicity="1" name="eventname" type="string"/>
319+
<param desc="Internally used callback function." multiplicity="1" name="callback" type="string"/>
320+
<return desc="Success of register process." multiplicity="1" name="success" type="bool"/>
321+
</function>
322+
</serves>
323+
</crown>
324+
<crown name="ProcessLogic">
325+
<desc>Check incoming value(s) with a logical operator. Return result and optionally forward processed value if succesfull.</desc>
326+
<serves>
327+
<function name="create">
328+
<desc>Internally used CSK_FlowConfig create function.</desc>
329+
<param constraint="1-99" desc="Type of logic operator.&#10;&#10;AND&#10;valueA AND valueB&#10;AND_PREV&#10;valueA AND valueB (keep previous status)&#10;CHANGED&#10;valueA =! previous valueA&#10;EQUAL&#10;valueA == critieraA&#10;GREATER&#10;valueA &gt; criteriaA&#10;GREATER_EQUAL&#10;valueA &gt;= criteriaA&#10;INVERT&#10;not valueA&#10;LESS&#10;valueA &lt; criteriaA&#10;LESS_EQUAL&#10;valueA &lt;= criteriaA&#10;OR&#10;valueA OR valueB&#10;OR_PREV&#10;valueA OR valueB (keep previous status)&#10;OUT_OF_RANGE&#10;valueA &lt; critieriaA OR valueA &gt; critieriaB&#10;WITHIN_RANGE&#10;criteriaA &gt;= valueA &lt;= critieriaB" multiplicity="1" name="Logic" ref="CSK_FlowConfig.LogicOperator" type="enum"/>
330+
<param desc="Optional criteriaA (see info of logic)." multiplicity="?" name="criteriaA" type="string"/>
331+
<param desc="Optional criteriaB (see info of logic)." multiplicity="?" name="criteriaB" type="string"/>
332+
<return desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
333+
</function>
334+
<function name="processLogic">
335+
<include>data-flow</include>
336+
<desc>Check incoming value(s) with a logical operator. Return result and optionally forward processed value if succesfull.</desc>
337+
<param desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
338+
<param desc="Set source of valueA.&#10;&#10;Parameter:&#10;1: value (AUTO)" multiplicity="?" name="sourceA" type="string"/>
339+
<param desc="Set source of valueB.&#10;&#10;Parameter:&#10;1: value (AUTO)" multiplicity="?" name="sourceB" type="string"/>
340+
<return desc="'CSK_FlowConfig.OnNewLogicResult_[NUM]'&#10;(NUM is set internally)&#10;&#10;Parameter:&#10;1: (optional) Result (BOOL)" multiplicity="1" name="OnNewLogicResult" type="string"/>
341+
<return desc="Forward checked value (ONLY if operation was successfull).&#10;'CSK_FlowConfig.OnNewValueToForward_[NUM]'&#10;(NUM is set internally)&#10;&#10;Parameter:&#10;1: (optional) Result (AUTO)" multiplicity="1" name="OnNewValueToForward" type="string"/>
342+
</function>
343+
</serves>
344+
</crown>
234345
</crown>
235346
<meta key="author">SICK AG</meta>
236-
<meta key="version">1.1.0</meta>
347+
<meta key="version">1.2.0</meta>
237348
<meta key="priority">low</meta>
238349
<meta key="copy-protected">false</meta>
239350
<meta key="read-protected">false</meta>
240351
<meta key="crown2-flow-engine">false</meta>
241-
<meta key="LuaLoadAllEngineAPI">true</meta>
352+
<meta key="LuaLoadAllEngineAPI">false</meta>
242353
<entry default="CSK_Module_FlowConfig.lua" path="scripts"/>
243354
</application>
244355
</manifest>

CSK_Module_FlowConfig/scripts/CSK_FlowConfig_FlowConfig.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
-- This specific script will run in its own thread (special use case, see FlowConfig_Model.lua)
55
--*****************************************************************
66

7-
require('Communication.FlowConfig.Features.FlowConfig_OnNewValue')
7+
_G.availableAPIs = require('Communication/FlowConfig/helper/checkAPIs')
8+
9+
require('Communication.FlowConfig.Features.FlowConfig_OnNewValue')
10+
require('Communication.FlowConfig.Features.FlowConfig_OnExpired')
11+
require('Communication.FlowConfig.Features.FlowConfig_ProcessLogic')

0 commit comments

Comments
 (0)