Skip to content

Commit 830b19d

Browse files
Release 3.1.0 (#2)
# Release 3.1.0 ## Improvements - Automatically start image provider after 3 seconds if used within FlowConfig - React on "OnStopFlowConfigProviders" event of FlowConfig module to stop provider - Optionally setup image path, type and cycle time within FlowConfig block - Prevent changing of image type if player is currently active
1 parent 7cc0bf1 commit 830b19d

8 files changed

Lines changed: 113 additions & 14 deletions

File tree

CHANGELOG.md

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

4+
## Release 3.1.0
5+
6+
### Improvements
7+
- Automatically start image provider after 3 seconds if used within FlowConfig
8+
- React on "OnStopFlowConfigProviders" event of FlowConfig module to stop provider
9+
- Optionally setup image path, type and cycle time within FlowConfig block
10+
- Prevent changing of image type if player is currently active
11+
412
## Release 3.0.0
513

614
### New features

CSK_Module_ImagePlayer/pages/pages/CSK_Module_ImagePlayer/CSK_Module_ImagePlayer.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,13 @@
285285
class="myCustomFrameLabel_CSK_Module_ImagePlayer"
286286
label="Configuration" style="align-self: flex-start">
287287
</davinci-value-display>
288+
<curie-callout id="DC_FlowConfigInfo" type="info"
289+
value="FlowConfig priority active.">
290+
<crown-edpws-binding property="hidden"
291+
name="CSK_ImagePlayer/OnNewStatusFlowConfigPriority"
292+
update-on-resume converter="function(value) {return !value;}">
293+
</crown-edpws-binding>
294+
</curie-callout>
288295
<layout-row id="RowLayout9"
289296
style="justify-content: space-between; align-items: center">
290297
<layout-column id="ColumnLayout13" style="align-items: stretch">
@@ -383,6 +390,9 @@
383390
name="CSK_ImagePlayer/setImageType"
384391
path="param/args/imgType" auto-commit>
385392
</crown-binding>
393+
<crown-edpws-binding property="disabled"
394+
name="CSK_ImagePlayer/OnPlayerActive" update-on-resume>
395+
</crown-edpws-binding>
386396
</davinci-drop-down>
387397
</layout-column>
388398
</layout-row>

CSK_Module_ImagePlayer/project.mf.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ INFO: If the internal resizeFactor is changed, this module will notify the "OnNe
206206
<function name="create">
207207
<trait>released</trait>
208208
<desc>Internally used CSK_FlowConfig create function.</desc>
209+
<param desc="Path to load images.&#10;(e.g. &quot;resources/CSK_Module_ImagePlayer/ColorPins&quot; (default) or &quot;public/Images&quot;)" multiplicity="?" name="Path" type="string"/>
210+
<param desc="Image type (jpg is default)" multiplicity="?" name="ImageType" ref="CSK_ImagePlayer.ImageTypes" type="enum"/>
211+
<param desc="Cycle time to trigger new image in ms (1000 is default)." multiplicity="?" name="CycleTime" type="int"/>
209212
<return desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
210213
</function>
211214
<function name="register">
@@ -220,7 +223,7 @@ INFO: If the internal resizeFactor is changed, this module will notify the "OnNe
220223
</crown>
221224
</crown>
222225
<meta key="author">SICK AG</meta>
223-
<meta key="version">3.0.0</meta>
226+
<meta key="version">3.1.0</meta>
224227
<meta key="priority">low</meta>
225228
<meta key="copy-protected">false</meta>
226229
<meta key="read-protected">false</meta>

CSK_Module_ImagePlayer/scripts/Sensors/ImagePlayer/FlowConfig/ImagePlayer_FlowConfig.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
require('Sensors.ImagePlayer.FlowConfig.ImagePlayer_OnNewImage')
99

10-
--- Function to react if FlowConfig was updated
10+
--- Function to react if FlowConfig was updated or stopped
1111
local function handleOnClearOldFlow()
1212
if _G.availableAPIs.default and _G.availableAPIs.specific then
1313
if imagePlayer_Model.parameters.flowConfigPriority then
1414
CSK_ImagePlayer.clearFlowConfigRelevantConfiguration()
1515
end
1616
end
1717
end
18-
Script.register('CSK_FlowConfig.OnClearOldFlow', handleOnClearOldFlow)
18+
Script.register('CSK_FlowConfig.OnClearOldFlow', handleOnClearOldFlow)
19+
Script.register('CSK_FlowConfig.OnStopFlowConfigProviders', handleOnStopProvider)

CSK_Module_ImagePlayer/scripts/Sensors/ImagePlayer/FlowConfig/ImagePlayer_OnNewImage.lua

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
local BLOCK_NAMESPACE = "ImagePlayer_FC.OnNewImage"
33
local nameOfModule = 'CSK_ImagePlayer'
44

5+
-- Timer to start image provdider
6+
local tmrStartProvider = Timer.create()
7+
tmrStartProvider:setExpirationTime(3000)
8+
tmrStartProvider:setPeriodic(false)
9+
10+
--- Function to start image timer
11+
local function startImageTimer()
12+
CSK_ImagePlayer.startProvider()
13+
end
14+
Timer.register(tmrStartProvider, "OnExpired", startImageTimer)
15+
516
--*************************************************************
617
--*************************************************************
718

@@ -10,6 +21,25 @@ local function register(handle, _ , callback)
1021
Container.remove(handle, "CB_Function")
1122
Container.add(handle, "CB_Function", callback)
1223

24+
local imageType = Container.get(handle, 'ImageType')
25+
local cycleTime = Container.get(handle, 'CycleTime')
26+
local path = Container.get(handle, 'Path')
27+
28+
if imageType ~= '' then
29+
CSK_ImagePlayer.setImageType(imageType)
30+
end
31+
32+
if cycleTime ~= '' then
33+
local time = tonumber(cycleTime)
34+
if time then
35+
CSK_ImagePlayer.setCycleTime(time)
36+
end
37+
end
38+
39+
if path ~= '' then
40+
CSK_ImagePlayer.setPath(path)
41+
end
42+
1343
local function localCallback()
1444
if callback ~= nil then
1545
Script.callFunction(callback, 'CSK_ImagePlayer.OnNewImage')
@@ -19,15 +49,20 @@ local function register(handle, _ , callback)
1949
end
2050
Script.register('CSK_FlowConfig.OnNewFlowConfig', localCallback)
2151

52+
tmrStartProvider:start()
53+
2254
return true
2355
end
2456
Script.serveFunction(BLOCK_NAMESPACE ..".register", register)
2557

2658
--*************************************************************
2759
--*************************************************************
2860

29-
local function create()
61+
local function create(path, imageType, cycleTime)
3062
local container = Container.create()
63+
Container.add(container, "Path", path or "")
64+
Container.add(container, "ImageType", imageType or "")
65+
Container.add(container, "CycleTime", cycleTime or "")
3166
Container.add(container, "CB_Function", "")
3267
return(container)
3368
end

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Tested on
1515

1616
|Device|Firmware|Module version|
1717
|--|--|--|
18+
|SICK AppEngine|V1.7.0|V3.1.0|
1819
|SICK AppEngine|V1.7.0|V3.0.0|
1920
|SICK AppEngine|V1.3.2|<V3.0.0|
2021
|SIM1012|V2.4.2|V3.0.0|

docu/CSK_Module_ImagePlayer.html

Lines changed: 51 additions & 10 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_ImagePlayer 3.0.0</title>
9+
<title>Documentation - CSK_Module_ImagePlayer 3.1.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_ImagePlayer 3.0.0</h1>
618+
<h1>Documentation - CSK_Module_ImagePlayer 3.1.0</h1>
619619
<div class="details">
620620
<span id="author" class="author">SICK AG</span><br>
621-
<span id="revnumber">version 3.0.0,</span>
622-
<span id="revdate">2024-10-11</span>
621+
<span id="revnumber">version 3.1.0,</span>
622+
<span id="revdate">2025-02-18</span>
623623
</div>
624624
<div id="toc" class="toc2">
625625
<div id="toctitle">Table of Contents</div>
@@ -736,11 +736,11 @@ <h2 id="_document_metadata">Document metadata</h2>
736736
</tr>
737737
<tr>
738738
<th class="tableblock halign-left valign-top"><p class="tableblock">Version</p></th>
739-
<td class="tableblock halign-left valign-top"><p class="tableblock">3.0.0</p></td>
739+
<td class="tableblock halign-left valign-top"><p class="tableblock">3.1.0</p></td>
740740
</tr>
741741
<tr>
742742
<th class="tableblock halign-left valign-top"><p class="tableblock">Date</p></th>
743-
<td class="tableblock halign-left valign-top"><p class="tableblock">2024-10-11</p></td>
743+
<td class="tableblock halign-left valign-top"><p class="tableblock">2025-02-18</p></td>
744744
</tr>
745745
<tr>
746746
<th class="tableblock halign-left valign-top"><p class="tableblock">Author</p></th>
@@ -2735,6 +2735,47 @@ <h6 id="_short_description_46">Short description</h6>
27352735
</div>
27362736
</div>
27372737
<div class="sect5">
2738+
<h6 id="_parameters_11">Parameters</h6>
2739+
<table class="tableblock frame-all grid-all stretch">
2740+
<colgroup>
2741+
<col style="width: 25%;">
2742+
<col style="width: 25%;">
2743+
<col style="width: 12.5%;">
2744+
<col style="width: 37.5%;">
2745+
</colgroup>
2746+
<thead>
2747+
<tr>
2748+
<th class="tableblock halign-left valign-top">Name</th>
2749+
<th class="tableblock halign-left valign-top">Type</th>
2750+
<th class="tableblock halign-left valign-top">Multiplicity</th>
2751+
<th class="tableblock halign-left valign-top">Description</th>
2752+
</tr>
2753+
</thead>
2754+
<tbody>
2755+
<tr>
2756+
<td class="tableblock halign-left valign-top"><p class="tableblock">Path</p></td>
2757+
<td class="tableblock halign-left valign-top"><p class="tableblock">STRING</p></td>
2758+
<td class="tableblock halign-left valign-top"><p class="tableblock">?</p></td>
2759+
<td class="tableblock halign-left valign-top"><p class="tableblock">Path to load images.
2760+
(e.g. "resources/CSK_Module_ImagePlayer/ColorPins" (default) or "public/Images")</p></td>
2761+
</tr>
2762+
<tr>
2763+
<td class="tableblock halign-left valign-top"><p class="tableblock">ImageType</p></td>
2764+
<td class="tableblock halign-left valign-top"><p class="tableblock">ENUM<br>
2765+
<a href="#API:Enum:CSK_ImagePlayer.ImageTypes">CSK_ImagePlayer.ImageTypes</a></p></td>
2766+
<td class="tableblock halign-left valign-top"><p class="tableblock">?</p></td>
2767+
<td class="tableblock halign-left valign-top"><p class="tableblock">Image type (jpg is default)</p></td>
2768+
</tr>
2769+
<tr>
2770+
<td class="tableblock halign-left valign-top"><p class="tableblock">CycleTime</p></td>
2771+
<td class="tableblock halign-left valign-top"><p class="tableblock">INT</p></td>
2772+
<td class="tableblock halign-left valign-top"><p class="tableblock">?</p></td>
2773+
<td class="tableblock halign-left valign-top"><p class="tableblock">Cycle time to trigger new image in ms (1000 is default).</p></td>
2774+
</tr>
2775+
</tbody>
2776+
</table>
2777+
</div>
2778+
<div class="sect5">
27382779
<h6 id="_return_values_5">Return values</h6>
27392780
<table class="tableblock frame-all grid-all stretch">
27402781
<colgroup>
@@ -2765,7 +2806,7 @@ <h6 id="_return_values_5">Return values</h6>
27652806
<h6 id="_sample_auto_generated_42">Sample (auto-generated)</h6>
27662807
<div class="listingblock">
27672808
<div class="content">
2768-
<pre class="CodeRay highlight"><code data-lang="lua">handle = ImagePlayer_FC.OnNewImage.create()</code></pre>
2809+
<pre class="CodeRay highlight"><code data-lang="lua">handle = ImagePlayer_FC.OnNewImage.create(Path, ImageType, CycleTime)</code></pre>
27692810
</div>
27702811
</div>
27712812
</div>
@@ -2779,7 +2820,7 @@ <h6 id="_short_description_47">Short description</h6>
27792820
</div>
27802821
</div>
27812822
<div class="sect5">
2782-
<h6 id="_parameters_11">Parameters</h6>
2823+
<h6 id="_parameters_12">Parameters</h6>
27832824
<table class="tableblock frame-all grid-all stretch">
27842825
<colgroup>
27852826
<col style="width: 25%;">
@@ -2977,8 +3018,8 @@ <h3 id="API:Enum:CSK_ImagePlayer.ImageTypes"><span class="api-enum">CSK_ImagePla
29773018
</div>
29783019
<div id="footer">
29793020
<div id="footer-text">
2980-
Version 3.0.0<br>
2981-
Last updated 2024-10-11 10:46:16 +0200
3021+
Version 3.1.0<br>
3022+
Last updated 2025-02-18 13:44:15 +0100
29823023
</div>
29833024
</div>
29843025
<script type="text/javascript">

docu/media/UI_Screenshot.png

205 KB
Loading

0 commit comments

Comments
 (0)