Backend Source-code¶
LoggerPlugin.py¶
This class is imported by any plugin written for RTOC.
It includes all functions to interact with RTOC. Every plugin must inherit this class! Your plugin must look like this
::
from RTOC.LoggerPlugin import LoggerPlugin
class Plugin(LoggerPlugin):
def __init__(self, *args, **kwargs):
LoggerPlugin.__init__(self, *args, **kwargs)
...
...
If you need to pass arguments to your class initialization, use kwargs. (‘stream’, ‘plot’, ‘event’, ‘telegramBot’ cannot be used as kwarg-name)
jsonsocket.py¶
RTOC.RTLogger Submodules¶
RTOC.RTLogger.Daemon module¶
Generic linux daemon base class for python 3.x.
Source: https://web.archive.org/web/20160320091458/http://www.jejik.com/files/examples/daemon3x.py
RTOC.RTLogger.DeviceFunctions module¶
RTOC.RTLogger.EventActionFunctions module¶
-
class
EventActionFunctions
[source]¶ Bases:
object
This class contains all global event/action-specific functions of RTLogger
-
addGlobalAction
(name='testAction', listenID='testID', script='', parameters='', active=True)[source]¶
-
addGlobalEvent
(name='testEvent', cond='', text='TestEvent', priority=0, retur='', id='testID', trigger='rising', sname='', dname='', active=True)[source]¶
-
checkGlobalActions
(actions)[source]¶ Checks if actions are valid. Will add the key ‘errors’ to each event. ‘errors’ will be True, if it’s not valid.
Parameters: actions (dict) – actions to be checked. Returns: Input-actions + ‘errors’-key Return type: actions (dict)
-
checkGlobalEvents
(events)[source]¶ Checks if events are valid. Will add the key ‘errors’ to each event. ‘errors’ will be True, if it’s not valid.
Parameters: events (dict) – events to be checked. Returns: Input-events + ‘errors’-key Return type: events (dict)
-
editGlobalAction
(name='testAction', listenID='testID', script='', parameters='', active=True)[source]¶
-
editGlobalEvent
(name='testEvent', cond='', text='TestEvent', priority=0, retur='', id='testID', trigger='rising', sname='', dname='', active=True)[source]¶
-
loadGlobalActions
()[source]¶ Loads global actions from file and stores them in dict ‘self.globalActions’
-
loadGlobalEvents
()[source]¶ Loads global events from file and stores them in dict ‘self.globalEvents’
-
performGlobalEvents
(y, unit, devicename, signalname, x=None)[source]¶ Performs global events, if their conditions are fullfilled. This function is called any time data is added to signals.
Parameters: - y (float) – y-value of signal (not needed)
- unit (str) – unit of signal (not needed)
- devicename (str) – devicename of signal
- signalname (str) – signalname of signal
- x (float) – x-value of signal (not needed)
-
RTOC.RTLogger.NetworkFunctions module¶
RTOC.RTLogger.RTLogger module¶
RTOC.RTLogger.RTOC_Web module¶
RTOC.RTLogger.RTOC_Web_standalone module¶
RTOC.RTLogger.RTRemote module¶
RTOC.RTLogger.RT_data module¶
RTOC.RTLogger.ScriptFunctions module¶
RTOC.RTLogger.importCode module¶
-
importCode
(code, name, add_to_sys_modules=0)[source]¶ Import dynamically generated code as a module. code is the object containing the code (a string, a file handle or an actual compiled code object, same types as accepted by an exec statement). The name is the name to give to the module, and the final argument says wheter to add it to sys.modules or not. If it is added, a subsequent import statement using name will return this module. If it is not added to sys.modules import will try to load it in the normal fashion.
import foo
is equivalent to
foofile = open(“/path/to/foo.py”) foo = importCode(foofile,”foo”,1)
Returns a newly generated module.