Skip to content

Commit 62cfff1

Browse files
Release 5.1.0 (#3)
# Release 5.1.0 ## New features - Check if persistent data to load provides all relevant parameters. Otherwise add default values ## Improvements - Better instance handling regarding FlowConfig ## Bugfix - Legacy bindings of ValueDisplay elements and FileUpload feature 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 of iFrame was visible
1 parent 254f8fc commit 62cfff1

14 files changed

Lines changed: 172 additions & 112 deletions

CHANGELOG.md

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

4+
## Release 5.1.0
5+
6+
### New features
7+
- Check if persistent data to load provides all relevant parameters. Otherwise add default values
8+
9+
### Improvements
10+
- Better instance handling regarding FlowConfig
11+
12+
### Bugfix
13+
- Legacy bindings of ValueDisplay elements and FileUpload feature within UI did not work if deployed with VS Code AppSpace SDK
14+
- UI differs if deployed via Appstudio or VS Code AppSpace SDK
15+
- Fullscreen icon of iFrame was visible
16+
417
## Release 5.0.0
518

619
### New features
@@ -17,7 +30,7 @@ All notable changes to this project will be documented in this file.
1730
- 'loadParameters' returns its success
1831
- 'sendParameters' can control if sent data should be saved directly by CSK_Module_PersistentData
1932
- Changed log level of some messages from 'info' to 'fine'
20-
- Sample images converted to JPG
33+
- Sample images moved to CSK_Module_ImagePlayer app
2134
- Added UI icon and browser tab information
2235

2336
### Bugfix

CSK_Module_MultiDeepLearning/pages/pages/CSK_Module_MultiDeepLearning/CSK_Module_MultiDeepLearning.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.myViewer_CSK_Module_MultiDeepLearning > div > div {
2-
max-height: 600px;
3-
min-height: 600px;
1+
.myViewer_CSK_Module_MultiDeepLearning {
2+
width: 98%;
3+
height: 600px;
4+
margin: auto;
45
}
56

67
.myCustomSpacerVert10_CSK_Module_MultiDeepLearning {
@@ -113,5 +114,5 @@
113114

114115
.myCustomButton_CSK_Module_MultiDeepLearning {
115116
border-radius: 30px;
116-
padding-right: 0px;
117+
padding: 11px;
117118
}

CSK_Module_MultiDeepLearning/pages/pages/CSK_Module_MultiDeepLearning/CSK_Module_MultiDeepLearning.html

Lines changed: 63 additions & 67 deletions
Large diffs are not rendered by default.

CSK_Module_MultiDeepLearning/pages/src/converter.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ export function changeID(id) {
1212
export function changeStyle(theme) {
1313
const style: HTMLStyleElement = document.createElement('style');
1414
style.id ='blub'
15+
16+
const toggleSW = document.querySelectorAll("davinci-toggle-switch")
17+
toggleSW.forEach((userItem) => {
18+
const shadowToggle = userItem.shadowRoot
19+
const finalToggleSW = shadowToggle?.querySelector('div')
20+
finalToggleSW?.classList.add('hasIcon')
21+
});
22+
1523
if (theme == 'CSK_Style'){
1624
var headerToolbar = `.sopasjs-ui-header-toolbar-wrapper { background-color: #FFFFFF; }`
1725
var uiHeader = `.sopasjs-ui-header>.app-logo { margin-right:0px; }`

CSK_Module_MultiDeepLearning/pages/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ document.addEventListener('sopasjs-ready', () => {
1212
page_Setup.remove();
1313

1414
setTimeout(() => {
15+
const element = document.querySelector("div.sjs-wrapper > div > div.sjs-fullscreen-toggle")
16+
if(element) {
17+
element.parentElement.removeChild(element)
18+
}
1519
document.title = 'CSK_Module_MultiDeepLearning'
1620
}, 500);
1721
})

CSK_Module_MultiDeepLearning/project.mf.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ IMPORTANT: As instances start their own threads, the module needs to be restarte
362362
</crown>
363363
</crown>
364364
<meta key="author">SICK AG</meta>
365-
<meta key="version">5.0.0</meta>
365+
<meta key="version">5.1.0</meta>
366366
<meta key="priority">low</meta>
367367
<meta key="copy-protected">false</meta>
368368
<meta key="read-protected">false</meta>

CSK_Module_MultiDeepLearning/scripts/CSK_Module_MultiDeepLearning.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ local multiDeepLearning_Instances = {} -- Handle all instances
5252
local multiDeepLearningController = require('ImageProcessing/MultiDeepLearning/MultiDeepLearning_Controller')
5353

5454
if _G.availableAPIs.default and _G.availableAPIs.specific then
55-
local setInstanceHandle = require('ImageProcessing/MultiDeepLearning/FlowConfig/MultiDeepLearning_FlowConfig')
55+
require('ImageProcessing/MultiDeepLearning/FlowConfig/MultiDeepLearning_FlowConfig')
5656
table.insert(multiDeepLearning_Instances, multiDeepLearning_Model.create(1)) -- create(deepLearningInstanceNo:int)
5757
multiDeepLearningController.setMultiDeepLearning_Instances_Handle(multiDeepLearning_Instances) -- share handle of instances
58-
setInstanceHandle(multiDeepLearning_Instances)
5958
else
6059
_G.logger:warning("CSK_MultiDeepLearning: Relevant CROWN(s) not available on device. Module is not supported...")
6160
end
@@ -83,7 +82,7 @@ local function startProcessing()
8382
-- Option A --> prepare an event to trigger processing via this one
8483
-- Following event is already served inside of the Controler script
8584
-- --Script.serveEvent("CSK_MultiDeepLearning.TestImage", "TestImage") --> Create event to listen to receive a image to process
86-
--CSK_MultiDeepLearning.setRegisterEvent('CSK_MultiDeepLearning.TestImage') --> Register processing to the event
85+
--CSK_MultiDeepLearning.setRegisterEvent('CSK_ImagePlayer.OnNewImage') --> Register processing to the event
8786
8887
for i = 1, 2 do
8988
local imgOK = Image.load('resources/CSK_Module_MultiDeepLearningSampleData/OK_' .. tostring(i) .. '.bmp')

CSK_Module_MultiDeepLearning/scripts/ImageProcessing/MultiDeepLearning/FlowConfig/MultiDeepLearning_FlowConfig.lua

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,10 @@ require('ImageProcessing.MultiDeepLearning.FlowConfig.MultiDeepLearning_ImageSou
77
require('ImageProcessing.MultiDeepLearning.FlowConfig.MultiDeepLearning_OnNewResult')
88
require('ImageProcessing.MultiDeepLearning.FlowConfig.MultiDeepLearning_Process')
99

10-
-- Reference to the multiImageFilter_Instances handle
11-
local multiDeepLearning_Instances
12-
1310
--- Function to react if FlowConfig was updated
1411
local function handleOnClearOldFlow()
1512
if _G.availableAPIs.default and _G.availableAPIs.specific then
16-
for i = 1, #multiDeepLearning_Instances do
17-
if multiDeepLearning_Instances[i].parameters.flowConfigPriority then
18-
CSK_MultiDeepLearning.clearFlowConfigRelevantConfiguration()
19-
break
20-
end
21-
end
13+
CSK_MultiDeepLearning.clearFlowConfigRelevantConfiguration()
2214
end
2315
end
2416
Script.register('CSK_FlowConfig.OnClearOldFlow', handleOnClearOldFlow)
25-
26-
--- Function to get access to the multiDeepLearning_Instances
27-
---@param handle handle Handle of multiDeepLearning_Instances object
28-
local function setMultiDeepLearning_Instances_Handle(handle)
29-
multiDeepLearning_Instances = handle
30-
end
31-
32-
return setMultiDeepLearning_Instances_Handle

CSK_Module_MultiDeepLearning/scripts/ImageProcessing/MultiDeepLearning/MultiDeepLearning_Controller.lua

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,11 @@ Script.serveFunction('CSK_MultiDeepLearning.getStatusModuleActive', getStatusMod
375375

376376
local function clearFlowConfigRelevantConfiguration()
377377
for i = 1, #multiDeepLearning_Instances do
378-
multiDeepLearning_Instances[i].parameters.registeredEvent = ''
379-
Script.notifyEvent('MultiDeepLearning_OnNewImageProcessingParameter', i, 'deregisterFromEvent', '')
380-
Script.notifyEvent('MultiDeepLearning_OnNewStatusRegisteredEvent', '')
378+
if multiDeepLearning_Instances[i].parameters.flowConfigPriority then
379+
multiDeepLearning_Instances[i].parameters.registeredEvent = ''
380+
Script.notifyEvent('MultiDeepLearning_OnNewImageProcessingParameter', i, 'deregisterFromEvent', '')
381+
Script.notifyEvent('MultiDeepLearning_OnNewStatusRegisteredEvent', '')
382+
end
381383
end
382384
end
383385
Script.serveFunction('CSK_MultiDeepLearning.clearFlowConfigRelevantConfiguration', clearFlowConfigRelevantConfiguration)
@@ -428,6 +430,9 @@ local function loadParameters()
428430
if data then
429431
_G.logger:info(nameOfModule .. ": Loaded parameters for deepLearningInstance " .. tostring(selectedInstance) .. " from CSK_PersistentData module.")
430432
multiDeepLearning_Instances[selectedInstance].parameters = helperFuncs.convertContainer2Table(data)
433+
434+
multiDeepLearning_Instances[selectedInstance].parameters = helperFuncs.checkParameters(multiDeepLearning_Instances[selectedInstance].parameters, helperFuncs.defaultParameters.getParameters())
435+
431436
updateProcessingParameters()
432437
pageCalled()
433438
return true
@@ -513,7 +518,11 @@ Script.register("CSK_PersistentData.OnInitialDataLoaded", handleOnInitialDataLoa
513518

514519
local function resetModule()
515520
if _G.availableAPIs.default and _G.availableAPIs.specific then
516-
clearFlowConfigRelevantConfiguration()
521+
for i = 1, #multiDeepLearning_Instances do
522+
multiDeepLearning_Instances[i].parameters.registeredEvent = ''
523+
Script.notifyEvent('MultiDeepLearning_OnNewImageProcessingParameter', i, 'deregisterFromEvent', '')
524+
Script.notifyEvent('MultiDeepLearning_OnNewStatusRegisteredEvent', '')
525+
end
517526
pageCalled()
518527
end
519528
end

CSK_Module_MultiDeepLearning/scripts/ImageProcessing/MultiDeepLearning/MultiDeepLearning_Model.lua

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,7 @@ function multiDeepLearning.create(deepLearningInstanceNo)
6060

6161
-- Parameters to be saved permanently
6262
self.parameters = {}
63-
self.parameters.flowConfigPriority = CSK_FlowConfig ~= nil or false -- Status if FlowConfig should have priority for FlowConfig relevant configurations
64-
self.parameters.modelPath = '/public/CSK_DeepLearning_Models/' -- Path to search for DNN models
65-
self.parameters.modelName = '-' -- Name of selected model
66-
self.parameters.validScore = 80 -- Score to decide if image is from a class
67-
self.parameters.showImage = false -- Show image on UI
68-
self.parameters.forwardResultWithImage = false -- Forward image incl. processing result
69-
self.parameters.processWithScores = false -- Return the scores for all classes in the processing result
70-
self.parameters.sortResultByIndex = false -- Sort processing result by class index instead of highest score
71-
self.parameters.registeredEvent = 'e.g. CSK_MultiRemoteCamera.OnNewImageCamera' .. self.deepLearningInstanceNoString -- Event to register to get images to process
72-
self.parameters.processingFile = 'MultiDeepLearning_Processing' -- Script to use for processing in thread
63+
self.parameters = self.helperFuncs.defaultParameters.getParameters() -- Load default parameters
7364

7465
-- Parameters to give to the image processing
7566
self.multiDeepLearningProcessingParams = Container.create()

0 commit comments

Comments
 (0)