Settings, Modules and Restart

Everything that is not about one module is under hdvisionsystems/<app>/system/. The apps come in two families that handle their modules differently. The code readers have only system/meta/subscription-schema there (see Streams).

Cam Driver, AI Object Matching, Calibration: settings files

Their modules are the module files that the application settings file lists.

Node Kind What it does

system/settings

string, read and write

All loaded settings as one JSON document: the application file, with each listed module file inlined (passwords shown as *). Writing it saves the changed files - each checked by the app first, the old one kept as .bak - and marks a restart as required

system/restart-required

bool, read-only

true after a saved change, until the app restarts. Meanwhile every module reports status -5 (restartRequired), and its methods answer ResourceUnavailable (ctrlX DL_RESOURCE_UNAVAILABLE)

system/control/restart/execute

method

stops the app and starts it again. The app’s nodes disappear until it is up: wait until system/restart-required can be read again

system/control/create-module/execute

method, inputs control/create-module/input/module-id and content

writes <module-id>.json. Refused when the file exists

system/control/activate-module/execute, system/control/deactivate-module/execute

method, input control/<function>/input/module-id

adds the file to, or removes it from, the application file’s list. The file stays. Needs a restart

system/found-modules, system/status-text

read-only

the modules served; why none are

The Cam Driver adds camera discovery: system/found-camera-modules, found-camera-serials, found-camera-mac-addresses, found-camera-ip-addresses, and the system/force-ip/ handshake. AI Object Matching serves one module at most: activate-module refuses a second.

Example - add the camera module camera2 to the Cam Driver:

  1. Write the module’s JSON to hdvisionsystems/lumiscan-cam-driver/system/control/create-module/input/content and camera2 to control/create-module/input/module-id, then call control/create-module/execute.

  2. Write camera2 to control/activate-module/input/module-id, then call control/activate-module/execute.

  3. Call hdvisionsystems/lumiscan-cam-driver/system/control/restart/execute.

A module file can also be changed on disk. AI Object Matching and Calibration read their module file again on reset; otherwise a change applies at the next start.

Template Finder, Object Finder, Area Detector, Text Reader: modules at run time

Their modules are made and removed while the app runs.

Node Kind What it does

system/modules

string[], read-only

the modules now

system/create-module/execute

method, input input/module-id

a new module with default inputs, at once. Gone after a restart unless saved

system/remove-module/execute

method, input input/module-id

removes the module

system/save-current-modules/execute

method

writes the module list into the application file, and deletes the input files of modules no longer in it

system/save-module-inputs/execute

method, input input/module-id

writes the module’s inputs to <module-id>.json, restored at the next start

Each finder adds its own functions, for example Template Finder system/create-template and system/set-template-dir, Text Reader system/set-tessdata-dir and system/refresh-languages. See the app’s manual.

Note that create-module means two different things: in the settings-file apps a file applied at the next restart, in the finders a live module lost at the next restart unless saved.

What is kept across a restart

What Kept

A finder module’s inputs

when saved with system/save-module-inputs/execute; restored at start

A finder app’s module list

when saved with system/save-current-modules/execute

Settings of the Cam Driver, AI Object Matching and Calibration written to system/settings

yes, applied at the next start

Folders chosen at run time (template, object and tessdata folders)

yes, saved automatically in the application file

A consumer’s stream

yes, see Streams

The Cam Driver’s stream and the camera connection

no: start them again after every start

Values written to input/ of the Cam Driver, AI Object Matching and Calibration

no: write them again

There is no load method: nothing reads a saved file again without a restart, except the reset of AI Object Matching and Calibration.