dp3.common.base_module ¶
BaseModule ¶
Base class for platform modules. Every module must inherit this abstract class for automatic loading of module!
Attributes:
Name | Type | Description |
---|---|---|
refresh |
SharedFlag
|
SharedFlag that is set to True when module should refresh its attributes values |
log |
Logger
|
Logger for the module |
Initialize the module and register callbacks.
self.load_config()
is called in the base class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
platform_config
|
PlatformConfig
|
Platform configuration class |
required |
module_config
|
dict
|
Configuration of the module,
equivalent of |
required |
registrar
|
CallbackRegistrar
|
A callback / hook registration interface |
required |
Source code in dp3/common/base_module.py
load_config ¶
Load module configuration.
Is called on module initialization and on refresh request via /control
API.
start ¶
Run the module - used to run own thread if needed.
Called after initialization, may be used to create and run a separate thread if needed by the module. Do nothing unless overridden.
stop ¶
Stop the module - used to stop own thread.
Called before program exit, may be used to finalize and stop the separate thread if it is used. Do nothing unless overridden.