Qudi
|
The Manager object is responsible for: More...
Public Member Functions | |
def | __init__ (self, args, kwargs) |
Constructor for Qudi main management class. More... | |
def | getMainDir (self) |
Returns the absolut path to the directory of the main software. More... | |
def | readConfig (self, configFile) |
Read configuration file and sort entries into categories. More... | |
def | configure (self, cfg) |
Sort modules from configuration into categories. More... | |
def | readConfigFile (self, fileName, missingOk=True) |
Actually check if the configuration file exists and read it. More... | |
def | writeConfigFile (self, data, fileName) |
Write a file into the currently used config directory. More... | |
def | configFileName (self, name) |
Get the full path of a configuration file from its filename. More... | |
def | saveConfig (self, filename) |
Save configuration to a file. More... | |
def | loadConfig (self, filename, restart=False) |
Load configuration from file. More... | |
def | reloadConfigPart (self, base, mod) |
Reread the configuration file and update the internal configuration of module. More... | |
def | importModule (self, baseName, module) |
Module loading #. More... | |
def | configureModule (self, moduleObject, baseName, className, instanceName, configuration=None) |
Instantiate an object from the class that makes up a Qudi module from a loaded python module object. More... | |
def | connectModule (self, base, mkey) |
Connects the given module in mkey to main object with the help of base. More... | |
def | loadConfigureModule (self, base, key) |
Loads the configuration Module in key with the help of base class. More... | |
def | reloadConfigureModule (self, base, key) |
Reloads the configuration module in key with the help of base class. More... | |
def | isModuleDefined (self, base, name) |
Check if module is present in module definition. More... | |
def | isModuleLoaded (self, base, name) |
Check if module was loaded. More... | |
def | isModuleActive (self, base, name) |
Returns whether a given module is active. More... | |
def | findBase (self, name) |
Find base for a given module name. More... | |
def | activateModule (self, base, name) |
Activate the module given in key with the help of base class. More... | |
def | deactivateModule (self, base, name) |
Activated the module given in key with the help of base class. More... | |
def | getReverseRecursiveModuleDependencies (self, base, module, deps=None) |
Based on input connector declarations, determine in which other modules need to be removed when stopping. More... | |
def | getRecursiveModuleDependencies (self, base, key) |
Based on input connector declarations, determine in which other modules are needed for a specific module to run. More... | |
def | getAllRecursiveModuleDependencies (self, allmods) |
Build a dependency tre for defined or loaded modules. More... | |
def | startModule (self, base, key) |
Figure out the module dependencies in terms of connections, load and activate module. More... | |
def | stopModule (self, base, key) |
Figure out the module dependencies in terms of connections and deactivate module. More... | |
def | restartModuleRecursive (self, base, key) |
Figure out the module dependencies in terms of connections, reload and activate module. More... | |
def | startAllConfiguredModules (self) |
Connect all Qudi modules from the currently loaded configuration and activate them. | |
def | getStatusDir (self) |
Get the directory where the app state is saved, create it if necessary. More... | |
def | saveStatusVariables (self, base, module, variables) |
If a module has status variables, save them to a file in the application status directory. More... | |
def | loadStatusVariables (self, base, module) |
If a status variable file exists for a module, load it into a dictionary. More... | |
def | removeStatusFile (self, base, module) |
def | quit (self) |
Nicely request that all modules shut down. More... | |
def | realQuit (self) |
Stop all modules, no questions asked. More... | |
def | restart (self) |
Nicely request that all modules shut down for application restart. More... | |
def | registerTaskRunner (self, reference) |
Register/deregister/replace a task runner object. More... | |
Public Attributes | |
lock | |
tree | |
hasGui | |
currentDir | |
baseDir | |
alreadyQuit | |
remote_server | |
tm | |
tr | |
gui | |
configDir | |
rm | |
configFile | |
The Manager object is responsible for:
sigConfigChanged: the configuration has changed, please reread your configuration sigModulesChanged: the available modules have changed sigModuleHasQuit: the module whose name is passed is now deactivated sigAbortAll: abort all running things as quicly as possible sigManagerQuit: the manager is quitting sigManagerShow: show whatever part of the GUI is important
def core.manager.Manager.__init__ | ( | self, | |
args, | |||
kwargs | |||
) |
Constructor for Qudi main management class.
args | argparse command line arguments |
def core.manager.Manager.activateModule | ( | self, | |
base, | |||
name | |||
) |
Activate the module given in key with the help of base class.
string | base: module base package (hardware, logic or gui) |
string | name: module which is going to be activated. |
def core.manager.Manager.configFileName | ( | self, | |
name | |||
) |
Get the full path of a configuration file from its filename.
string | name: filename of file in configuration directory |
def core.manager.Manager.configure | ( | self, | |
cfg | |||
) |
Sort modules from configuration into categories.
dict | cfg: dictionary from configuration file |
There are the main categories hardware, logic, gui, startup and global. Startup modules can be logic or gui and are loaded directly on 'startup'. 'global' contains settings for the whole application. hardware, logic and gui contain configuration of and for loadable modules.
def core.manager.Manager.configureModule | ( | self, | |
moduleObject, | |||
baseName, | |||
className, | |||
instanceName, | |||
configuration = None |
|||
) |
Instantiate an object from the class that makes up a Qudi module from a loaded python module object.
object | moduleObject: loaded python module |
string | baseName: module base package (hardware, logic or gui) |
string | className: name of the class we want an object from (same as module name usually) |
string | instanceName: unique name thet the Qudi module instance was given in the configuration |
dict | configuration: configuration options for the Qudi module |
This method will add the resulting Qudi module instance to internal bookkeeping.
def core.manager.Manager.connectModule | ( | self, | |
base, | |||
mkey | |||
) |
Connects the given module in mkey to main object with the help of base.
string | base: module base package (hardware, logic or gui) |
string | mkey: module which you want to connect |
def core.manager.Manager.deactivateModule | ( | self, | |
base, | |||
name | |||
) |
Activated the module given in key with the help of base class.
string | base: module base package (hardware, logic or gui) |
string | name: module which is going to be activated. |
def core.manager.Manager.findBase | ( | self, | |
name | |||
) |
Find base for a given module name.
str | name: module name |
def core.manager.Manager.getAllRecursiveModuleDependencies | ( | self, | |
allmods | |||
) |
Build a dependency tre for defined or loaded modules.
dict | allmods: dictionary containing module bases (self.tree['loaded'] equivalent) |
def core.manager.Manager.getMainDir | ( | self | ) |
Returns the absolut path to the directory of the main software.
def core.manager.Manager.getRecursiveModuleDependencies | ( | self, | |
base, | |||
key | |||
) |
Based on input connector declarations, determine in which other modules are needed for a specific module to run.
str | base: Module category |
str | key: Unique configured module name for module where we want the dependencies |
def core.manager.Manager.getReverseRecursiveModuleDependencies | ( | self, | |
base, | |||
module, | |||
deps = None |
|||
) |
Based on input connector declarations, determine in which other modules need to be removed when stopping.
str | base: Module category |
str | key: Unique configured module name for module where we want the dependencies |
def core.manager.Manager.getStatusDir | ( | self | ) |
Get the directory where the app state is saved, create it if necessary.
def core.manager.Manager.importModule | ( | self, | |
baseName, | |||
module | |||
) |
Module loading #.
Load a python module that is a loadable Qudi module.
@param string baseName: the module base package (hardware, logic, or gui) @param string module: the python module name inside the base package @return object: the loaded python module
def core.manager.Manager.isModuleActive | ( | self, | |
base, | |||
name | |||
) |
Returns whether a given module is active.
string | base: module base package (hardware, logic or gui) |
string | key: module which is going to be activated. |
def core.manager.Manager.isModuleDefined | ( | self, | |
base, | |||
name | |||
) |
Check if module is present in module definition.
str | base: module base package |
str | name: unique module name |
def core.manager.Manager.isModuleLoaded | ( | self, | |
base, | |||
name | |||
) |
Check if module was loaded.
str | base: module base package |
str | name: unique module name |
def core.manager.Manager.loadConfig | ( | self, | |
filename, | |||
restart = False |
|||
) |
Load configuration from file.
str | filename: path of file to be loaded |
def core.manager.Manager.loadConfigureModule | ( | self, | |
base, | |||
key | |||
) |
Loads the configuration Module in key with the help of base class.
string | base: module base package (hardware, logic or gui) |
string | key: module which is going to be loaded |
def core.manager.Manager.loadStatusVariables | ( | self, | |
base, | |||
module | |||
) |
If a status variable file exists for a module, load it into a dictionary.
str | base: the module category |
str | module: the unique mduel name |
def core.manager.Manager.quit | ( | self | ) |
Nicely request that all modules shut down.
def core.manager.Manager.readConfig | ( | self, | |
configFile | |||
) |
Read configuration file and sort entries into categories.
string | configFile: path to configuration file |
def core.manager.Manager.readConfigFile | ( | self, | |
fileName, | |||
missingOk = True |
|||
) |
Actually check if the configuration file exists and read it.
string | fileName: path to configuration file |
bool | missingOk: suppress exception if file does not exist |
def core.manager.Manager.realQuit | ( | self | ) |
Stop all modules, no questions asked.
def core.manager.Manager.registerTaskRunner | ( | self, | |
reference | |||
) |
Register/deregister/replace a task runner object.
object | reference: reference to a task runner or null class |
If a reference is passed that is not None, it is kept and passed out as the task runner instance. If a None is passed, the reference is discarded. Id another reference is passed, the current one is replaced.
def core.manager.Manager.reloadConfigPart | ( | self, | |
base, | |||
mod | |||
) |
Reread the configuration file and update the internal configuration of module.
str modname: name of module where config file should be reloaded.
def core.manager.Manager.reloadConfigureModule | ( | self, | |
base, | |||
key | |||
) |
Reloads the configuration module in key with the help of base class.
string | base: module base package (hardware, logic or gui) |
string | key: module which is going to be loaded |
def core.manager.Manager.restart | ( | self | ) |
Nicely request that all modules shut down for application restart.
def core.manager.Manager.restartModuleRecursive | ( | self, | |
base, | |||
key | |||
) |
Figure out the module dependencies in terms of connections, reload and activate module.
str | base: Module category |
str | key: Unique configured module name |
def core.manager.Manager.saveConfig | ( | self, | |
filename | |||
) |
Save configuration to a file.
str | filename: path where the config flie should be saved |
def core.manager.Manager.saveStatusVariables | ( | self, | |
base, | |||
module, | |||
variables | |||
) |
If a module has status variables, save them to a file in the application status directory.
str | base: the module category |
str | module: the unique module name |
dict | variables: a dictionary of status variable names and values |
def core.manager.Manager.startModule | ( | self, | |
base, | |||
key | |||
) |
Figure out the module dependencies in terms of connections, load and activate module.
str | base: Module category |
str | key: Unique module name |
If the module is already loaded, just activate it. If the module is an active GUI module, show its window.
def core.manager.Manager.stopModule | ( | self, | |
base, | |||
key | |||
) |
Figure out the module dependencies in terms of connections and deactivate module.
str | base: Module category |
str | key: Unique module name |
def core.manager.Manager.writeConfigFile | ( | self, | |
data, | |||
fileName | |||
) |
Write a file into the currently used config directory.
dict | data: dictionary to write into file |
string | fileName: path for filr to be written |