Document metadata

Application name

CSK_Module_PersistentData

Version

4.2.0

Date

2025-01-24

Author

SICK AG

Crowns

CSK_Module_PersistentData

Short description

This is an automatically generated CROWN (description not necessary).

CSK_PersistentData

Short description

Module to provide data storage functionality incl. complex data types like Images, EdgeMatcher etc.

Function scope :
1) Possibility to save tables into persistent data.
1.1) Main DataSet with sub parameters of each available / configured module.
1.2) Will be handled internally as Container + table content.
1.3) Saves data as a binary file.

2) This module will provide a (loaded) DataSet for other CSK modules.
2.1) This DataSet can hold multiple ParameterSets by name.
2.1.1) Internally, this is one Container with multiple Sub-Containers.
2.2) The module can provide SubContainer content to other modules, selected by its name.

3) Other modules can define inside of the parameters, if they should load their parameters on app reboot.

4) This module will notify a "CSK_PersistentData.OnInitialDataLoaded" event, so that other modules can register on that event to load their specific parameters as soon as they are available.

5) Other modules can react on 'CSK_PersistentData.OnResetAllModules' event, to load their default setup.

How to use:
Save
1) Via "addParameter" it is possible to send (multiple times) data as a Container to this module and to store it with a specific parameter name. (e.g. "cameraSetup1").
2) Via "setModuleParameterName" it can be defined, which parameter should be loaded for a specific module during app/device reboot and if this should be active.
3) Via "setPath" it can be defined, where to store the full parameter dataset (including all available module parameters).
4) Via "saveData" the module will save the parameter dataset within a file defined with "setPath".

INFO: It is also possible to trigger all other CSK modules to send their currenty used parameters by calling "saveAllModuleConfigs".
After that, do not forget to save the received data as stated in step 4.

Load
1) Try to load saved parameter dataset via "loadContent" (see documentation) out of file defined via "setPath".
1.1) Info: With app/device reboot, the module will try this automatically and will notify the event "OnInitialDataLoaded" if successful.
2) Other modules can now load their specific parameter via "getParameter".
2.1) To trigger all other modules to set the new loaded parameters, call 'saveData' and 'reloadApps'.

Remove specific parameter
1) Remove a specific parameter within the currently active DataSet via "removeParameter".

Remove full DataSet
1) Internally clear data of current active DataSet with "removeData". This will not change the parameters within the persistent data file (see next step).
2) Make sure to save the new DataSet to the persistent data file via "saveData".

Overview

Functions

CSK_PersistentData.addParameter()
Short description

Add incoming parameters (from other CSK modules) to current persistent data.

Parameters
Name Type Multiplicity Description

data

OBJECT
Container

1

Parameters to store

name

STRING

1

identification name to store the parameters.

Sample (auto-generated)
CSK_PersistentData.addParameter(data, name)
CSK_PersistentData.createNewDataSet()
Short description

Create new CSK_PersistentData dataset.

Sample (auto-generated)
CSK_PersistentData.createNewDataSet()
CSK_PersistentData.fileUploadFinished()
Short description

Check if upload transfer was succesfull.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status of file transfer

Sample (auto-generated)
CSK_PersistentData.fileUploadFinished(status)
CSK_PersistentData.getCurrentParameterInfo()
Short description

Function to get info what parameter file is currently in use.

Return values
Name Type Multiplicity Description

parameterName

STRING

1

Name of parameter file.

Sample (auto-generated)
parameterName = CSK_PersistentData.getCurrentParameterInfo()
CSK_PersistentData.getModuleParameterName()
Short description

Function to get parameter. Can be used by other modules to receive their parameters.

Parameters
Name Type Multiplicity Description

module

STRING

1

Module to get name of parameters dataset to use.

instance

STRING

?

Number of instance (for multi modules only).

Return values
Name Type Multiplicity Description

name

STRING

?

Name of the dataset to use.

loadOnReboot

BOOL

?

Status if parameter should be loaded on device / app reboot.

totalInstances

INT

?

Number of amount of available instances.

Sample (auto-generated)
name, loadOnReboot, totalInstances = CSK_PersistentData.getModuleParameterName(module, instance)
CSK_PersistentData.getParameter()
Short description

Provide parameters of current persistent data by name.

Parameters
Name Type Multiplicity Description

name

STRING

1

identification name of the parameters to provide.

Return values
Name Type Multiplicity Description

dataContent

OBJECT
Container

?

Parameters

Sample (auto-generated)
dataContent = CSK_PersistentData.getParameter(name)
CSK_PersistentData.getParameterList()
Short description

Provide list of available parameters.

Return values
Name Type Multiplicity Description

list

STRING

1

List of identification names of the available parameters.

Sample (auto-generated)
list = CSK_PersistentData.getParameterList()
CSK_PersistentData.getStatusModuleActive()
Short description

Function to get status if module is active.

Return values
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
status = CSK_PersistentData.getStatusModuleActive()
CSK_PersistentData.getVersion()
Short description

Get version of module.

Return values
Name Type Multiplicity Description

version

STRING

1

Version of module.

Sample (auto-generated)
version = CSK_PersistentData.getVersion()
CSK_PersistentData.loadContent()
Short description

Load set of parameters out of path (see "setPath").

Parameters
Name Type Multiplicity Description

noModuleUpdate

BOOL

?

Optionally select if other modules should be triggered to load their parameters (as long as their "Load on reboot" flag ist active).

Return values
Name Type Multiplicity Description

success

BOOL

1

Success of loading parameter set.

Sample (auto-generated)
success = CSK_PersistentData.loadContent(noModuleUpdate)
CSK_PersistentData.overwriteData()
Short description

Function to overwrite current parameters by uploaded parameters.

Sample (auto-generated)
CSK_PersistentData.overwriteData()
CSK_PersistentData.pageCalled()
Short description

Function to register "OnResume" of the module UI (only as helper function).

Return values
Name Type Multiplicity Description

empty

STRING

1

Empty string (only needed to simplify binding).

Sample (auto-generated)
empty = CSK_PersistentData.pageCalled()
CSK_PersistentData.rebootDevice()
Short description

Function to reboot device.

Sample (auto-generated)
CSK_PersistentData.rebootDevice()
CSK_PersistentData.reloadApps()
Short description

Function to reload all apps.

Sample (auto-generated)
CSK_PersistentData.reloadApps()
CSK_PersistentData.removeData()
Short description

Remove all data of current DataSet.
To make this permanent, it is needed to save the persistent data afterwards (see 'saveData').

Sample (auto-generated)
CSK_PersistentData.removeData()
CSK_PersistentData.removeParameter()
Short description

Delete parameter of current parameter set by identification name.

Parameters
Name Type Multiplicity Description

name

STRING

1

Identification name

Sample (auto-generated)
CSK_PersistentData.removeParameter(name)
CSK_PersistentData.removeParameterViaUI()
Short description

Remove selected parameter dataset via UI.

Sample (auto-generated)
CSK_PersistentData.removeParameterViaUI()
CSK_PersistentData.resetAllModules()
Short description

Function to reset all modules (other modules need a function called 'resetModule').

Sample (auto-generated)
CSK_PersistentData.resetAllModules()
CSK_PersistentData.saveAllModuleConfigs()
Short description

Function to trigger all CSK modules to save their configuration and additionally activate their "Load config on app start" flag.

Parameters
Name Type Multiplicity Description

moduleList

OBJECT
Container

?

Optional list of modules to save.

Sample (auto-generated)
CSK_PersistentData.saveAllModuleConfigs(moduleList)
CSK_PersistentData.saveData()
Short description

Save current parameter set.

Return values
Name Type Multiplicity Description

success

BOOL

1

Success of saving parameters.

Sample (auto-generated)
success = CSK_PersistentData.saveData()
CSK_PersistentData.sendParameterToModuleViaUI()
Short description

Function to trigger a module to load currently selected parameters (optionally for specific instance). Needs to be preconfigured via 'setModuleToSendParameters' and (optionally) 'setModuleInstanceToSendParameters'.

Sample (auto-generated)
CSK_PersistentData.sendParameterToModuleViaUI()
CSK_PersistentData.setModuleInstanceToSendParameters()
Short description

Function to select instance of selected module to send parameters.

Parameters
Name Type Multiplicity Description

selection

INT

1

Instance of module.

Sample (auto-generated)
CSK_PersistentData.setModuleInstanceToSendParameters(selection)
CSK_PersistentData.setModuleParameterName()
Short description

Set parameter name for a module.

Parameters
Name Type Multiplicity Description

module

STRING

1

Module to save the parameter name for.

name

STRING

1

Name of the parameter dataset.

loadOnReboot

BOOL

1

Status if parameter should be loaded on device / app reboot.

instance

STRING

?

Number of instance (for multi modules only).

totalInstances

INT

?

Amount of total available instances.

Sample (auto-generated)
CSK_PersistentData.setModuleParameterName(module, name, loadOnReboot, instance, totalInstances)
CSK_PersistentData.setModuleToSendParameters()
Short description

Function to select module to send parameters.

Parameters
Name Type Multiplicity Description

selection

STRING

1

Module to select.

Sample (auto-generated)
CSK_PersistentData.setModuleToSendParameters(selection)
CSK_PersistentData.setNewValueForSelectedParameter()
Short description

Function to preset value for selected parameter.

Parameters
Name Type Multiplicity Description

value

AUTO

1

Value (can be string, nnumber or boolean).

Sample (auto-generated)
CSK_PersistentData.setNewValueForSelectedParameter(value)
CSK_PersistentData.setNewValueToParameterViaUI()
Short description

Function to set preconfigured value to parameter.

Sample (auto-generated)
CSK_PersistentData.setNewValueToParameterViaUI()
CSK_PersistentData.setParameterSelectionWithinTable()
Short description

Function to set selected parameter within selected parameter set table.

Parameters
Name Type Multiplicity Description

selection

STRING

1

Selection

Sample (auto-generated)
CSK_PersistentData.setParameterSelectionWithinTable(selection)
CSK_PersistentData.setPath()
Short description

Set the path to load/save the parameter set.

Parameters
Name Type Multiplicity Description

path

STRING

1

Path of the parameter set.

Sample (auto-generated)
CSK_PersistentData.setPath(path)
CSK_PersistentData.setSelectedParameterName()
Short description

Select dataset to list its parameters.

Parameters
Name Type Multiplicity Description

selection

STRING

?

Parameter dataset to list

Sample (auto-generated)
CSK_PersistentData.setSelectedParameterName(selection)
CSK_PersistentData.setSelectedParameterWithinTableViaUI()
Short description

Function to select parameter within UI.

Parameters
Name Type Multiplicity Description

selection

STRING

1

Selection

Sample (auto-generated)
CSK_PersistentData.setSelectedParameterWithinTableViaUI(selection)
CSK_PersistentData.setUIStyle()
Short description

Function to set UI style.

Parameters
Name Type Multiplicity Description

style

STRING

1

Style

Sample (auto-generated)
CSK_PersistentData.setUIStyle(style)

Events

CSK_PersistentData.OnInitialDataLoaded
Short description

Notify that inital parameter set was loaded after app/device reboot.

Sample (auto-generated)
function handleOnInitialDataLoaded()
  -- Do something
end

Script.register("CSK_PersistentData.OnInitialDataLoaded", "handleOnInitialDataLoaded")
CSK_PersistentData.OnInstanceAmountAvailable
Short description

Notify if amount of instances are available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnInstanceAmountAvailable(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnInstanceAmountAvailable", "handleOnInstanceAmountAvailable")
CSK_PersistentData.OnNewContent
Short description

Notify new content in parameter set.

Callback arguments
Name Type Multiplicity Description

list

STRING

1

List of content.

Sample (auto-generated)
function handleOnNewContent(list)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewContent", "handleOnNewContent")
CSK_PersistentData.OnNewDataPath
Short description

Notify path of parameter set.

Callback arguments
Name Type Multiplicity Description

parameterPath

STRING

1

Path of the parameters.

Sample (auto-generated)
function handleOnNewDataPath(parameterPath)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewDataPath", "handleOnNewDataPath")
CSK_PersistentData.OnNewDatasetList
Short description

Notify list of dataset entries.

Callback arguments
Name Type Multiplicity Description

list

STRING

?

List of entries.

Sample (auto-generated)
function handleOnNewDatasetList(list)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewDatasetList", "handleOnNewDatasetList")
CSK_PersistentData.OnNewDataToLoad
Short description

Notify event to trigger other modules to load their related data.

Callback arguments
Name Type Multiplicity Description

data

OBJECT
Container

1

Data container with parameters to load.

Sample (auto-generated)
function handleOnNewDataToLoad(data)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewDataToLoad", "handleOnNewDataToLoad")
CSK_PersistentData.OnNewFeedbackStatus
Short description

Notify current module status.

Callback arguments
Name Type Multiplicity Description

status

STRING

1

Status of the module.

Sample (auto-generated)
function handleOnNewFeedbackStatus(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewFeedbackStatus", "handleOnNewFeedbackStatus")
CSK_PersistentData.OnNewParameterSelection
Short description

Notify current parameter dataset selection. E.g. used within the UI to select what content to show.

Callback arguments
Name Type Multiplicity Description

parameterName

STRING

1

Name of the parameter dataset.

Sample (auto-generated)
function handleOnNewParameterSelection(parameterName)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewParameterSelection", "handleOnNewParameterSelection")
CSK_PersistentData.OnNewParameterTableInfo
Short description

Notify table info of parameters. Used within the UI to show content.

Callback arguments
Name Type Multiplicity Description

content

STRING

1

Data content of selected dataset.

Sample (auto-generated)
function handleOnNewParameterTableInfo(content)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewParameterTableInfo", "handleOnNewParameterTableInfo")
CSK_PersistentData.OnNewStatusBooleanValueOfSelecteParameter
Short description

Notify string value of currently selected parameter.

Callback arguments
Name Type Multiplicity Description

value

BOOL

1

Value

Sample (auto-generated)
function handleOnNewStatusBooleanValueOfSelecteParameter(value)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusBooleanValueOfSelecteParameter", "handleOnNewStatusBooleanValueOfSelecteParameter")
CSK_PersistentData.OnNewStatusCSKStyle
Short description

Notify UI style to use for CSK modules.

Callback arguments
Name Type Multiplicity Description

theme

STRING

1

UI style

Sample (auto-generated)
function handleOnNewStatusCSKStyle(theme)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusCSKStyle", "handleOnNewStatusCSKStyle")
CSK_PersistentData.OnNewStatusListOfModules
Short description

Notify list of available CSK modules.

Callback arguments
Name Type Multiplicity Description

list

STRING

1

List of CSK modules.

Sample (auto-generated)
function handleOnNewStatusListOfModules(list)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusListOfModules", "handleOnNewStatusListOfModules")
CSK_PersistentData.OnNewStatusListOfTableParameters
Short description

Notify list of parameter names within parameter table.

Callback arguments
Name Type Multiplicity Description

list

STRING

1

List of parameter names.

Sample (auto-generated)
function handleOnNewStatusListOfTableParameters(list)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusListOfTableParameters", "handleOnNewStatusListOfTableParameters")
CSK_PersistentData.OnNewStatusModuleIsActive
Short description

Notify if module can be used on device.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusModuleIsActive(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusModuleIsActive", "handleOnNewStatusModuleIsActive")
CSK_PersistentData.OnNewStatusModuleVersion
Short description

Notify version of module.

Callback arguments
Name Type Multiplicity Description

version

STRING

1

Version

Sample (auto-generated)
function handleOnNewStatusModuleVersion(version)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusModuleVersion", "handleOnNewStatusModuleVersion")
CSK_PersistentData.OnNewStatusNumberValueOfSelecteParameter
Short description

Notify number value of currently selected parameter.

Callback arguments
Name Type Multiplicity Description

value

FLOAT

1

Value

Sample (auto-generated)
function handleOnNewStatusNumberValueOfSelecteParameter(value)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusNumberValueOfSelecteParameter", "handleOnNewStatusNumberValueOfSelecteParameter")
CSK_PersistentData.OnNewStatusParameterTypeSelected
Short description

Notify what parameter type was selected within a parameter set.

Callback arguments
Name Type Multiplicity Description

parameterType

STRING

1

Type of parameter.

Sample (auto-generated)
function handleOnNewStatusParameterTypeSelected(parameterType)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusParameterTypeSelected", "handleOnNewStatusParameterTypeSelected")
CSK_PersistentData.OnNewStatusSelectedModuleInstanceToSendParameter
Short description

Notify instance of preselected module to send currently selected parameter.

Callback arguments
Name Type Multiplicity Description

instance

INT

1

Instance identifier.

Sample (auto-generated)
function handleOnNewStatusSelectedModuleInstanceToSendParameter(instance)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusSelectedModuleInstanceToSendParameter", "handleOnNewStatusSelectedModuleInstanceToSendParameter")
CSK_PersistentData.OnNewStatusSelectedModuleToSendParameter
Short description

Notify preselected module to send currently selected parameter.

Callback arguments
Name Type Multiplicity Description

module

STRING

1

Module

Sample (auto-generated)
function handleOnNewStatusSelectedModuleToSendParameter(module)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusSelectedModuleToSendParameter", "handleOnNewStatusSelectedModuleToSendParameter")
CSK_PersistentData.OnNewStatusSelectedParameterIsTable
Short description

Notfiy if currently selected parameter holds table data.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusSelectedParameterIsTable(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusSelectedParameterIsTable", "handleOnNewStatusSelectedParameterIsTable")
CSK_PersistentData.OnNewStatusSelectedParameterWithinTable
Short description

Notify name of selected parameter within parameter table.

Callback arguments
Name Type Multiplicity Description

name

STRING

1

Name

Sample (auto-generated)
function handleOnNewStatusSelectedParameterWithinTable(name)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusSelectedParameterWithinTable", "handleOnNewStatusSelectedParameterWithinTable")
CSK_PersistentData.OnNewStatusSelectionIsMultiModule
Short description

Notify if selected module to send parameters is a multi module.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusSelectionIsMultiModule(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusSelectionIsMultiModule", "handleOnNewStatusSelectionIsMultiModule")
CSK_PersistentData.OnNewStatusSendParametersToModule
Short description

Notify event to trigger a module to load specific parameters.

Callback arguments
Name Type Multiplicity Description

moduleName

STRING

1

Name of module.

parameterName

STRING

1

Name of parameters to load.

instance

INT

?

Optional number of instance of module.

Sample (auto-generated)
function handleOnNewStatusSendParametersToModule(moduleName, parameterName, instance)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusSendParametersToModule", "handleOnNewStatusSendParametersToModule")
CSK_PersistentData.OnNewStatusStringValueOfSelecteParameter
Short description

Notify string value of currently selected parameter.

Callback arguments
Name Type Multiplicity Description

value

STRING

1

Value

Sample (auto-generated)
function handleOnNewStatusStringValueOfSelecteParameter(value)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusStringValueOfSelecteParameter", "handleOnNewStatusStringValueOfSelecteParameter")
CSK_PersistentData.OnNewStatusTempFileAvailable
Short description

Notify if temporary uploaded parameter file is available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusTempFileAvailable(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewStatusTempFileAvailable", "handleOnNewStatusTempFileAvailable")
CSK_PersistentData.OnNewThreadFeedbackStatus
Short description

Notify current thread status.

Callback arguments
Name Type Multiplicity Description

status

STRING

1

Status of the module.

Sample (auto-generated)
function handleOnNewThreadFeedbackStatus(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnNewThreadFeedbackStatus", "handleOnNewThreadFeedbackStatus")
CSK_PersistentData.OnNewUserManagementTrigger
Short description

Notify trigger to update UserManagement status.

Sample (auto-generated)
function handleOnNewUserManagementTrigger()
  -- Do something
end

Script.register("CSK_PersistentData.OnNewUserManagementTrigger", "handleOnNewUserManagementTrigger")
CSK_PersistentData.OnResetAllModules
Short description

Notify event to trigger a reset for all CSK modules.

Sample (auto-generated)
function handleOnResetAllModules()
  -- Do something
end

Script.register("CSK_PersistentData.OnResetAllModules", "handleOnResetAllModules")
CSK_PersistentData.OnUserLevelAdminActive
Short description

Status of Admin userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelAdminActive(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
CSK_PersistentData.OnUserLevelMaintenanceActive
Short description

Status of Maintenance userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelMaintenanceActive(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
CSK_PersistentData.OnUserLevelOperatorActive
Short description

Status of Operator userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelOperatorActive(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
CSK_PersistentData.OnUserLevelServiceActive
Short description

Status of Service userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelServiceActive(status)
  -- Do something
end

Script.register("CSK_PersistentData.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")