Skip to content

Commit 08a1f8e

Browse files
committed
Version 1.0.0
- Initial version
1 parent ea9b0a4 commit 08a1f8e

14 files changed

Lines changed: 4342 additions & 589 deletions

File tree

CHANGELOG.md

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

4-
## Release 0.1.0
5-
- Initial commit
6-
7-
### New features
8-
- ...
9-
10-
### Improvements
11-
- ...
12-
13-
### Bugfix
14-
- ...
4+
## Release 1.0.0
5+
- Initial commit
185 KB
Loading

CSK_Module_MultiSerialCom/pages/pages/CSK_Module_MultiSerialCom/CSK_Module_MultiSerialCom.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
margin: 6px;
66
}
77

8-
.myCustomCssClass_CSK_Module_MultiSerialCom {
8+
.myCustomMinHeight200px_CSK_Module_MultiSerialCom {
9+
min-height: 300px;
10+
}
11+
12+
.myCustomMargin_CSK_Module_MultiSerialCom {
13+
margin: 5px;
914
}

CSK_Module_MultiSerialCom/pages/pages/CSK_Module_MultiSerialCom/CSK_Module_MultiSerialCom.html

Lines changed: 715 additions & 125 deletions
Large diffs are not rendered by default.

CSK_Module_MultiSerialCom/project.mf.xml

Lines changed: 359 additions & 25 deletions
Large diffs are not rendered by default.

CSK_Module_MultiSerialCom/scripts/CSK_Module_MultiSerialCom.lua

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@
2222

2323
---@diagnostic disable: undefined-global, redundant-parameter, missing-parameter
2424

25-
--
2625
-- CreationTemplateVersion: 3.6.0
2726
--**************************************************************************
2827
--**********************Start Global Scope *********************************
2928
--**************************************************************************
3029

3130
-- If app property "LuaLoadAllEngineAPI" is FALSE, use this to load and check for required APIs
3231
-- This can improve performance of garbage collection
33-
34-
-- _G.availableAPIs = require('Communication/MultiSerialCom/helper/checkAPIs') -- can be used to adjust function scope of the module related on available APIs of the device
32+
_G.availableAPIs = require('Communication/MultiSerialCom/helper/checkAPIs') -- can be used to adjust function scope of the module related on available APIs of the device
3533
-----------------------------------------------------------
3634
-- Logger
3735
_G.logger = Log.SharedLogger.create('ModuleLogger')
@@ -47,44 +45,25 @@ _G.logHandle:applyConfig()
4745
local multiSerialCom_Model = require('Communication/MultiSerialCom/MultiSerialCom_Model')
4846

4947
local multiSerialCom_Instances = {} -- Handle all instances
50-
table.insert(multiSerialCom_Instances, multiSerialCom_Model.create(1)) -- Create at least 1 instance
5148

5249
-- Load script to communicate with the MultiSerialCom_Model UI
5350
-- Check / edit this script to see/edit functions which communicate with the UI
5451
local multiSerialComController = require('Communication/MultiSerialCom/MultiSerialCom_Controller')
55-
multiSerialComController.setMultiSerialCom_Instances_Handle(multiSerialCom_Instances) -- share handle of instances
52+
53+
-- Check if specific APIs are available on device
54+
if availableAPIs.specific then
55+
table.insert(multiSerialCom_Instances, multiSerialCom_Model.create(1)) -- Create at least 1 instance
56+
multiSerialComController.setMultiSerialCom_Instances_Handle(multiSerialCom_Instances) -- share handle of instances
57+
else
58+
_G.logger:warning("CSK_SerialCom : Features of this module are not supported on this device. Missing APIs/interfaces.")
59+
end
5660

5761
--**************************************************************************
5862
--**********************End Global Scope ***********************************
5963
--**************************************************************************
6064
--**********************Start Function Scope *******************************
6165
--**************************************************************************
6266

63-
--[[
64-
--- Function to show how this module could be used
65-
local function startProcessing()
66-
67-
CSK_MultiSerialCom.setSelectedInstance(1) --> select instance of module
68-
CSK_MultiSerialCom.doSomething() --> preparation
69-
70-
-- Option A --> prepare an event to trigger processing via this one
71-
--Script.serveEvent("CSK_MultiSerialCom.OnNewTestEvent", "MultiSerialCom_OnNewTestEvent") --> Create event to listen to and process forwarded object
72-
--CSK_MultiSerialCom.setRegisterEvent('CSK_MultiSerialCom.OnNewTestEvent') --> Register processing to the event
73-
74-
--Script.notifyEvent('OnNewTestEvent', data)
75-
76-
-- Option B --> trigger processing via function call
77-
local result = CSK_MultiSerialCom.processSomething(data)
78-
79-
end
80-
end
81-
82-
-- Call processing function after persistent data was loaded
83-
--Script.register("CSK_MultiSerialCom.OnDataLoadedOnReboot", startProcessing)
84-
]]
85-
86-
--OR
87-
8867
--- Function to react on startup event of the app
8968
local function main()
9069

@@ -97,9 +76,31 @@ local function main()
9776
-- If so, the app will trigger the "OnDataLoadedOnReboot" event if ready after loading parameters
9877
--
9978
-- Can be used e.g. like this
79+
--
80+
--[[
81+
CSK_MultiSerialCom.setSelectedInstance(1)
82+
CSK_MultiSerialCom.setInterface('SER1')
83+
CSK_MultiSerialCom.setType('RS232')
84+
CSK_MultiSerialCom.setBaudrate(9600)
85+
CSK_MultiSerialCom.setParity('N')
86+
CSK_MultiSerialCom.setHandshake(false)
87+
CSK_MultiSerialCom.setDataBits(8)
88+
CSK_MultiSerialCom.setStopBits(1)
89+
CSK_MultiSerialCom.setTermination(false)
90+
91+
CSK_MultiSerialCom.setActive(true)
92+
93+
CSK_MultiSerialCom.transmitInstance1('Test') -- Send data on instance 1
94+
CSK_MultiSerialCom.receiveInstance1() -- Receive data on instance 1
95+
96+
--Register on event 'CSK_MultiSerialCom.OnNewData1' to get incoming data
97+
]]
98+
10099
----------------------------------------------------------------------------------------
101100

102-
--startProcessing() --> see above
101+
if availableAPIs.specific then
102+
CSK_MultiSerialCom.setSelectedInstance(1)
103+
end
103104
CSK_MultiSerialCom.pageCalled() -- Update UI
104105

105106
end

0 commit comments

Comments
 (0)