Skip to content

Commit 912b067

Browse files
Release 1.3.0 (#4)
# Release 1.3.0 ## New features - New logic 'RISING_EDGE' available within logic block ## Improvement - Full UI usable via iFrame in other SensorApps - Include all internal blocks to show info that no extra UI exists ## Bugfixes - Legacy bindings of ValueDisplay elements within UI did not work if deployed with VS Code AppSpace SDK - UI differs if deployed via Appstudio or VS Code AppSpace SDK - Fullscreen icon was visible within iFrame - Button for unsupported "Global parameters" was visible - Manifest check was not compatible with VS Code AppSpacek SDK - UI Bindings did not work with HTTPS
1 parent 1c7dc3d commit 912b067

9 files changed

Lines changed: 80 additions & 23 deletions

File tree

CHANGELOG.md

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

4+
## Release 1.3.0
5+
6+
### New features
7+
- New logic 'RISING_EDGE' available within logic block
8+
9+
### Improvement
10+
- Full UI usable via iFrame in other SensorApps
11+
- Include all internal blocks to show info that no extra UI exists
12+
13+
### Bugfixes
14+
- Legacy bindings of ValueDisplay elements within UI did not work if deployed with VS Code AppSpace SDK
15+
- UI differs if deployed via Appstudio or VS Code AppSpace SDK
16+
- Fullscreen icon was visible within iFrame
17+
- Button for unsupported "Global parameters" was visible
18+
- Manifest check was not compatible with VS Code AppSpacek SDK
19+
- UI Bindings did not work with HTTPS
20+
421
## Release 1.2.0
522

623
### New features
16.1 KB
Binary file not shown.

CSK_Module_FlowConfig/project.mf.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ It makes use of a BlocksEditor within the UI to take care of the configuration.
1212
Check the UI of this CSK module to configure the system. +</desc>
1313
<enum name="SaveMode" trait="released">
1414
<desc>Mode of saving configuration</desc>
15-
<item desc="This will save the configuration of the flow and additionally triggers for all CSK modules available on the device to save their current configuration in PersistentData" name="ALL">ALL</item>
16-
<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>
15+
<item desc="This will save the configuration of the flow and additionally triggers all CSK modules available on the device to save their current configuration in PersistentData" name="ALL">ALL</item>
16+
<item desc="This will save the configuration of the flow and additionally triggers 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>
1919
<enum name="LogicOperator" trait="released" type="string">
2020
<desc>Logical operators</desc>
21-
<item desc="AND operation" name="AND">AND</item>
22-
<item desc="OR operation" name="OR">OR</item>
21+
<item desc="AND operation (will be evaluated when both states have changed)" name="AND">AND</item>
22+
<item desc="OR operation (will be evaluated when both states have changed)" name="OR">OR</item>
2323
<item desc="Invert incoming boolean value." name="INVERT">INVERT</item>
2424
<item desc="Check if value is greater than definition of criteriaA." name="GREATER">GREATER</item>
2525
<item desc="Check if value is greater or equal as definition of criteriaA." name="GREATER_EQUAL">GREATER_EQUAL</item>
@@ -31,6 +31,7 @@ Check the UI of this CSK module to configure the system. +</desc>
3131
<item desc="Check if value changed." name="CHANGED">CHANGED</item>
3232
<item desc="Continuous AND operation (keeps previous received status and directly compares with this)" name="AND_PREV">AND_PREV</item>
3333
<item desc="Continuous OR operation (keeps previous received status and directly compares with this)" name="OR_PREV">OR_PREV</item>
34+
<item desc="Check if value changed from FALSE to TRUE." name="RISING_EDGE">RISING_EDGE</item>
3435
</enum>
3536
<serves>
3637
<event name="OnNewStatusLoadParameterOnReboot">
@@ -326,7 +327,7 @@ Will send current timestamp as 2nd parameter.</desc>
326327
<serves>
327328
<function name="create">
328329
<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 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;RISING_EDGE&#10;valueA == TRUE (was FALSE before)&#10;WITHIN_RANGE&#10;criteriaA &gt;= valueA &lt;= critieriaB" multiplicity="1" name="Logic" ref="CSK_FlowConfig.LogicOperator" type="enum"/>
330331
<param desc="Optional criteriaA (see info of logic)." multiplicity="?" name="criteriaA" type="string"/>
331332
<param desc="Optional criteriaB (see info of logic)." multiplicity="?" name="criteriaB" type="string"/>
332333
<return desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
@@ -344,7 +345,7 @@ Will send current timestamp as 2nd parameter.</desc>
344345
</crown>
345346
</crown>
346347
<meta key="author">SICK AG</meta>
347-
<meta key="version">1.2.0</meta>
348+
<meta key="version">1.3.0</meta>
348349
<meta key="priority">low</meta>
349350
<meta key="copy-protected">false</meta>
350351
<meta key="read-protected">false</meta>

CSK_Module_FlowConfig/scripts/CSK_FlowConfig_LogicProcessing.lua

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,20 @@ local function runOperator(instance)
6161
if type(parameters[instance]['values']['1']) == 'number' then
6262
result = parameters[instance]['values']['1'] <= tonumber(parameters[instance]['criteria']['1'])
6363
end
64+
elseif parameters[instance]['logic'] == 'RISING_EDGE' then
65+
if type(parameters[instance]['values']['1']) == 'boolean' then
66+
if parameters[instance]['values']['1'] == true then
67+
if parameters[instance]['values']['2'] == false then
68+
result = true
69+
else
70+
result = false
71+
end
72+
parameters[instance]['values']['2'] = true
73+
else
74+
result = false
75+
parameters[instance]['values']['2'] = false
76+
end
77+
end
6478
elseif parameters[instance]['logic'] == 'WITHIN_RANGE' then
6579
if type(parameters[instance]['values']['1']) == 'number' then
6680
result = parameters[instance]['values']['1'] >= tonumber(parameters[instance]['criteria']['1']) and parameters[instance]['values']['1'] <= tonumber(parameters[instance]['criteria']['2'])
@@ -79,7 +93,13 @@ local function runOperator(instance)
7993
if result == nil then
8094
_G.logger:warning("CSK_FlowConfig: Error within operartor")
8195
else
82-
Script.notifyEvent(parameters[instance]['event'], result)
96+
if parameters[instance]['logic'] == 'RISING_EDGE' then
97+
if result == true then
98+
Script.notifyEvent(parameters[instance]['event'], true)
99+
end
100+
else
101+
Script.notifyEvent(parameters[instance]['event'], result)
102+
end
83103

84104
if result == true then
85105
if parameters[instance]['logic'] == 'EQUAL' or parameters[instance]['logic'] == 'GREATER' or parameters[instance]['logic'] == 'GREATER_EQUAL' or parameters[instance]['logic'] == 'SMALLER' or parameters[instance]['logic'] == 'SMALLER_EQUAL' or parameters[instance]['logic'] == 'WITHIN_RANGE' or parameters[instance]['logic'] == 'OUT_OF_RANGE' or parameters[instance]['logic'] == 'CHANGED' then
@@ -90,7 +110,9 @@ local function runOperator(instance)
90110

91111
if parameters[instance]['logic'] ~= 'AND_PREV' and parameters[instance]['logic'] ~= 'OR_PREV' then
92112
parameters[instance]['values']['1'] = ''
93-
parameters[instance]['values']['2'] = ''
113+
if parameters[instance]['logic'] ~= 'RISING_EDGE' then
114+
parameters[instance]['values']['2'] = ''
115+
end
94116
end
95117
end
96118

@@ -120,6 +142,10 @@ local function addLogicBlock(instance, logic, source1, source2, criteriaA, crite
120142
parameters[instance]['values']['1'] = ''
121143
parameters[instance]['values']['2'] = ''
122144

145+
if logic == 'RISING_EDGE' then
146+
parameters[instance]['values']['2'] = false
147+
end
148+
123149
parameters[instance]['oldValue'] = ''
124150

125151
parameters[instance]['criteria'] = {}

CSK_Module_FlowConfig/scripts/Communication/FlowConfig/FlowConfig_Controller.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ end
220220
Timer.register(triggerTimer, 'OnExpired', handleOnExpiredTriggerTimer)
221221

222222
local function openUI(nameOfBlock)
223-
if nameOfBlock == 'FlowConfig_FC.OnNewValue.OnNewValue' then
223+
if nameOfBlock == 'FlowConfig_FC.OnNewValue.OnNewValue' or nameOfBlock == 'FlowConfig_FC.OnExpired.OnExpired' or nameOfBlock == 'FlowConfig_FC.ProcessLogic.processLogic' then
224224
Script.notifyEvent("FlowConfig_OnNewStatusFlowActiveUIInfo", 'noUI')
225225
tmrUIMessage:start()
226226
end

CSK_Module_FlowConfig/scripts/Communication/FlowConfig/FlowConfig_Model.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ local function buildManifest()
150150
end
151151
end
152152
end
153-
startPos = enumPos + 1
153+
if enumPos > refPos then
154+
startPos = enumPos + 1
155+
else
156+
startPos = refPos + 1
157+
end
154158
else
155159
break
156160
end

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ UI sources are not included in this repository.
3737
Tested on:
3838
|Device|Firmware|Module version|
3939
|--|--|--|
40-
|SICK AppEngine|V1.7.0|V1.0.0|
40+
|SIM1012|V2.4.2|V1.3.0|
4141
|SIM1012|V2.4.2|V1.0.0|
42+
|SICK AppEngine|V1.7.0|V1.3.0|
43+
|SICK AppEngine|V1.7.0|V1.0.0|
4244

4345
This module is part of the SICK AppSpace Coding Starter Kit developing approach.
4446
It is programmed in an object oriented way. Some of the modules use kind of "classes" in Lua to make it possible to reuse code / classes in other projects.

docu/CSK_Module_FlowConfig.html

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="generator" content="Asciidoctor 2.0.12">
88
<meta name="author" content="SICK AG">
9-
<title>Documentation - CSK_Module_FlowConfig 1.2.0</title>
9+
<title>Documentation - CSK_Module_FlowConfig 1.3.0</title>
1010
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
1111
<style>
1212
/* Stylesheet for CodeRay to match GitHub theme | MIT License | http://foundation.zurb.com */
@@ -615,11 +615,11 @@
615615
</head>
616616
<body class="article toc2 toc-left">
617617
<div id="header">
618-
<h1>Documentation - CSK_Module_FlowConfig 1.2.0</h1>
618+
<h1>Documentation - CSK_Module_FlowConfig 1.3.0</h1>
619619
<div class="details">
620620
<span id="author" class="author">SICK AG</span><br>
621-
<span id="revnumber">version 1.2.0,</span>
622-
<span id="revdate">2025-01-27</span>
621+
<span id="revnumber">version 1.3.0,</span>
622+
<span id="revdate">2025-05-20</span>
623623
</div>
624624
<div id="toc" class="toc2">
625625
<div id="toctitle">Table of Contents</div>
@@ -778,11 +778,11 @@ <h2 id="_document_metadata">Document metadata</h2>
778778
</tr>
779779
<tr>
780780
<th class="tableblock halign-left valign-top"><p class="tableblock">Version</p></th>
781-
<td class="tableblock halign-left valign-top"><p class="tableblock">1.2.0</p></td>
781+
<td class="tableblock halign-left valign-top"><p class="tableblock">1.3.0</p></td>
782782
</tr>
783783
<tr>
784784
<th class="tableblock halign-left valign-top"><p class="tableblock">Date</p></th>
785-
<td class="tableblock halign-left valign-top"><p class="tableblock">2025-01-27</p></td>
785+
<td class="tableblock halign-left valign-top"><p class="tableblock">2025-05-20</p></td>
786786
</tr>
787787
<tr>
788788
<th class="tableblock halign-left valign-top"><p class="tableblock">Author</p></th>
@@ -3766,6 +3766,8 @@ <h6 id="_parameters_17">Parameters</h6>
37663766
valueA OR valueB (keep previous status)
37673767
OUT_OF_RANGE
37683768
valueA &lt; critieriaA OR valueA &gt; critieriaB
3769+
RISING_EDGE
3770+
valueA == TRUE (was FALSE before)
37693771
WITHIN_RANGE
37703772
criteriaA &gt;= valueA &#8656; critieriaB</p></td>
37713773
</tr>
@@ -3977,12 +3979,12 @@ <h3 id="API:Enum:CSK_FlowConfig.LogicOperator"><span class="api-enum">CSK_FlowCo
39773979
<tr>
39783980
<td class="tableblock halign-left valign-top"><div class="literal"><pre>AND</pre></div></td>
39793981
<td class="tableblock halign-left valign-top"><p class="tableblock">AND</p></td>
3980-
<td class="tableblock halign-left valign-top"><p class="tableblock">AND operation</p></td>
3982+
<td class="tableblock halign-left valign-top"><p class="tableblock">AND operation (will be evaluated when both states have changed)</p></td>
39813983
</tr>
39823984
<tr>
39833985
<td class="tableblock halign-left valign-top"><div class="literal"><pre>OR</pre></div></td>
39843986
<td class="tableblock halign-left valign-top"><p class="tableblock">OR</p></td>
3985-
<td class="tableblock halign-left valign-top"><p class="tableblock">OR operation</p></td>
3987+
<td class="tableblock halign-left valign-top"><p class="tableblock">OR operation (will be evaluated when both states have changed)</p></td>
39863988
</tr>
39873989
<tr>
39883990
<td class="tableblock halign-left valign-top"><div class="literal"><pre>INVERT</pre></div></td>
@@ -4039,6 +4041,11 @@ <h3 id="API:Enum:CSK_FlowConfig.LogicOperator"><span class="api-enum">CSK_FlowCo
40394041
<td class="tableblock halign-left valign-top"><p class="tableblock">OR_PREV</p></td>
40404042
<td class="tableblock halign-left valign-top"><p class="tableblock">Continuous OR operation (keeps previous received status and directly compares with this)</p></td>
40414043
</tr>
4044+
<tr>
4045+
<td class="tableblock halign-left valign-top"><div class="literal"><pre>RISING_EDGE</pre></div></td>
4046+
<td class="tableblock halign-left valign-top"><p class="tableblock">RISING_EDGE</p></td>
4047+
<td class="tableblock halign-left valign-top"><p class="tableblock">Check if value changed from FALSE to TRUE.</p></td>
4048+
</tr>
40424049
</tbody>
40434050
</table>
40444051
</div>
@@ -4065,12 +4072,12 @@ <h3 id="API:Enum:CSK_FlowConfig.SaveMode"><span class="api-enum">CSK_FlowConfig.
40654072
<tr>
40664073
<td class="tableblock halign-left valign-top"><div class="literal"><pre>ALL</pre></div></td>
40674074
<td class="tableblock halign-left valign-top"><p class="tableblock">ALL</p></td>
4068-
<td class="tableblock halign-left valign-top"><p class="tableblock">This will save the configuration of the flow and additionally triggers for all CSK modules available on the device to save their current configuration in PersistentData</p></td>
4075+
<td class="tableblock halign-left valign-top"><p class="tableblock">This will save the configuration of the flow and additionally triggers all CSK modules available on the device to save their current configuration in PersistentData</p></td>
40694076
</tr>
40704077
<tr>
40714078
<td class="tableblock halign-left valign-top"><div class="literal"><pre>FLOW</pre></div></td>
40724079
<td class="tableblock halign-left valign-top"><p class="tableblock">FLOW</p></td>
4073-
<td class="tableblock halign-left valign-top"><p class="tableblock">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</p></td>
4080+
<td class="tableblock halign-left valign-top"><p class="tableblock">This will save the configuration of the flow and additionally triggers all CSK modules used within the flow to save their current configuration in PersistentData</p></td>
40744081
</tr>
40754082
<tr>
40764083
<td class="tableblock halign-left valign-top"><div class="literal"><pre>MODULE</pre></div></td>
@@ -4123,8 +4130,8 @@ <h3 id="API:Enum:FlowConfig_FC.ValueType"><span class="api-enum">FlowConfig_FC.V
41234130
</div>
41244131
<div id="footer">
41254132
<div id="footer-text">
4126-
Version 1.2.0<br>
4127-
Last updated 2025-01-27 09:37:59 +0100
4133+
Version 1.3.0<br>
4134+
Last updated 2025-05-20 16:34:11 +0200
41284135
</div>
41294136
</div>
41304137
<script type="text/javascript">

docu/media/UI_Screenshot.png

-2.63 KB
Loading

0 commit comments

Comments
 (0)