OpenRTM-aist-Python 2.0.0
|
Classes | |
class | find_conf |
Public Member Functions | |
def | __init__ (self, configsets) |
Constructor More... | |
def | __del__ (self) |
def | bindParameter (self, param_name, var, def_val, trans=None) |
def | unbindParameter (self, param_name) |
def | update (self, config_set=None, config_param=None) |
void update(void); More... | |
def | isExist (self, param_name) |
def | isChanged (self) |
def | changedParameters (self) |
def | getActiveId (self) |
def | haveConfig (self, config_id) |
def | isActive (self) |
def | getConfigurationSets (self) |
def | getConfigurationSet (self, config_id) |
def | setConfigurationSetValues (self, config_set) |
def | getActiveConfigurationSet (self) |
def | addConfigurationSet (self, configset) |
def | removeConfigurationSet (self, config_id) |
def | activateConfigurationSet (self, config_id) |
def | setOnUpdate (self, cb) |
def | setOnUpdateParam (self, cb) |
def | setOnSetConfigurationSet (self, cb) |
def | setOnAddConfigurationSet (self, cb) |
def | setOnRemoveConfigurationSet (self, cb) |
def | setOnActivateSet (self, cb) |
def | addConfigurationParamListener (self, type, listener) |
def | removeConfigurationParamListener (self, type, listener) |
def | addConfigurationSetListener (self, type, listener) |
def | removeConfigurationSetListener (self, type, listener) |
def | addConfigurationSetNameListener (self, type, listener) |
def | removeConfigurationSetNameListener (self, type, listener) |
def | onUpdate (self, config_set) |
def | onUpdateParam (self, config_param, config_value) |
def | onSetConfigurationSet (self, config_set) |
def | onAddConfigurationSet (self, config_set) |
def | onRemoveConfigurationSet (self, config_id) |
def | onActivateSet (self, config_id) |
ConfigAdmin class
Class to manage various configuration information. Now terms for this class are defined as follows.
The following two configuration informations are stored in this class.
Basically, the purpose of this class is to set one of the configuration-set in the list of (1) into parameter variables of (2). Usually, configuration parameter variables manipulation is performed with two-phases of configuration-set setting and parameter variables setting.
The configuration-set manipulations are performed by the following functions.
Modification, addition, deletion, acquisition and activation of configuration-set are performed by these functions. In order to reflect configuration-set, which is manipulated by these functions, on parameter variables that are used from RTC activities, the following update() functions are used .
Callback functors can be given to hook configuration operation. Operations to be hooked are as follows.
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.__init__ | ( | self, | |
configsets | |||
) |
Constructor
self | |
prop | The target property name for setup |
ConfigAdmin(coil::Properties& prop);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.__del__ | ( | self | ) |
Destructor
self |
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.activateConfigurationSet | ( | self, | |
config_id | |||
) |
Activate the configuration set
Activate the configuration set of specified ID Return empty configuration set, if a configuration set of specified ID doesn't exist.
self | |
config_id | ID of the target configuration set for remove |
bool activateConfigurationSet(const char* config_id);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationParamListener | ( | self, | |
type, | |||
listener | |||
) |
Adding ConfigurationParamListener
This function adds a listener object which is called when update(const char* config_set, const char* config_param) is called. In the type argument, currently only ON_UPDATE_CONFIG_PARAM is allowed.
type | ConfigurationParamListenerType value ON_UPDATE_CONFIG_PARAM is only allowed. |
listener | ConfigurationParamListener listener object. |
void addConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener* listener);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationSet | ( | self, | |
configset | |||
) |
Add the configuration value to configuration set
Add the configuration value to configuration set
self | |
configuration_set | Property to add |
bool addConfigurationSet(const coil::Properties& configuration_set);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationSetListener | ( | self, | |
type, | |||
listener | |||
) |
Adding ConfigurationSetListener
This function add a listener object which is called when ConfigurationSet is updated. Available events are the followings.
type | ConfigurationSetListenerType value |
listener | ConfigurationSetListener listener object. |
void addConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener* listener);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationSetNameListener | ( | self, | |
type, | |||
listener | |||
) |
Adding ConfigurationSetNameListener
This function add a listener object which is called when ConfigurationSetName is updated. Available events are the followings.
type | ConfigurationSetNameListenerType value |
listener | ConfigurationSetNameListener listener object. |
void addConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener* listener);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.bindParameter | ( | self, | |
param_name, | |||
var, | |||
def_val, | |||
trans = None |
|||
) |
Setup for configuration parameters
Bind configuration parameter to its variable. Return false, if configuration parameter of specified name has already existed.
self | |
param_name | Configuration parameter name |
var | Configuration parameter variable |
def_val | Default value of configuration parameter |
trans | Function to transform configuration parameter type into string format |
template <typename VarType> bool bindParameter(const char* param_name, VarType& var, const char* def_val, bool (trans)(VarType&, const char) = coil::stringTo)
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.changedParameters | ( | self | ) |
Changed parameters list
This operation returns parameter list which are changed.
coil::vstring& changedParameters() { return m_changedParam; }
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getActiveConfigurationSet | ( | self | ) |
Get the active configuration set
Get the current active configuration set. Return empty configuration set, if an active configuration set doesn't exist.
self |
const coil::Properties& getActiveConfigurationSet(void);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getActiveId | ( | self | ) |
Get ID of active configuration set
Get ID of the current active configuration set.
self |
const char* getActiveId(void);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getConfigurationSet | ( | self, | |
config_id | |||
) |
Get a configuration set by specified ID
Get a configuration set that was specified by ID Return empty configuration set, if a configuration set of specified ID doesn't exist.
self | |
config_id | ID of the target configuration set for getting |
const coil::Properties& getConfigurationSet(const char* config_id);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getConfigurationSets | ( | self | ) |
Get all configuration sets
Get all specified configuration sets
self |
const std::vector<coil::Properties*>& getConfigurationSets(void);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.haveConfig | ( | self, | |
config_id | |||
) |
Check the existence of configuration set
Check the existence of specified configuration set.
self | |
config_id | ID of target configuration set for confirmation |
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.isActive | ( | self | ) |
Confirm to activate configuration set
Confirm that configuration set has been activated.
self |
bool isActive(void);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.isChanged | ( | self | ) |
Confirm to change configuration parameters
Confirm that configuration parameters have changed.
self |
bool isChanged(void) {return m_changed;}
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.isExist | ( | self, | |
param_name | |||
) |
Check the existence of configuration parameters
Check the existence of configuration parameters of specified name.
self | |
name | Configuration parameter name |
bool isExist(const char* name);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onActivateSet | ( | self, | |
config_id | |||
) |
Called when the configuration set is made active
Call the set callback object.
self | |
config_id | property |
void onActivateSet(const char* config_id);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onAddConfigurationSet | ( | self, | |
config_set | |||
) |
Called when a set value is added to the configuration set
Call the set callback object.
self | |
configuration_set | property |
void onAddConfigurationSet(const coil::Properties& config_set);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onRemoveConfigurationSet | ( | self, | |
config_id | |||
) |
Called when the configuration set has been deleted
Call the set callback object.
self | |
config_id | property |
void onRemoveConfigurationSet(const char* config_id);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onSetConfigurationSet | ( | self, | |
config_set | |||
) |
Called when the property is added to the configuration set
Call the set callback object.
self | |
configuration_set | property |
void onSetConfigurationSet(const coil::Properties& config_set);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onUpdate | ( | self, | |
config_set | |||
) |
When the configuration parameter is updated, it is called.
Call the set callback object.
self | |
config_set | The target configuration set's ID to setup |
void onUpdate(const char* config_set);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onUpdateParam | ( | self, | |
config_param, | |||
config_value | |||
) |
When the configuration parameter is updated, it is called.
Call the set callback object.
self | |
config_param | configuration parameter name. |
config_value | configuration value. |
void onUpdateParam(const char* config_param, const char* config_value);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationParamListener | ( | self, | |
type, | |||
listener | |||
) |
Removing ConfigurationParamListener
This function removes a listener object which is added by addConfigurationParamListener() function.
type | ConfigurationParamListenerType value ON_UPDATE_CONFIG_PARAM is only allowed. |
listener | a pointer to ConfigurationParamListener listener object. |
void removeConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener* listener);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationSet | ( | self, | |
config_id | |||
) |
Remove the configuration set
Remove the configuration set of specified ID Return empty configuration set, if a configuration set of specified ID doesn't exist.
The configuration-sets that can be removed by this function are only configuration-sets newly added by the addConfigurationSet() function. The configuration that can be removed by this function is only newly added configuration-set by addConfigurationSet() function. The "default" configuration-set and configurationi-sets that is loaded from configuration file cannot be removed.
If the specified configuration is active currently, any configurations are not deleted.
Callback functions that are set by addOnRemovedConfigurationSet() will be called if a configuration-set is deleted actually by this function.
self | |
config_id | ID of the target configuration set for remove |
bool removeConfigurationSet(const char* config_id);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationSetListener | ( | self, | |
type, | |||
listener | |||
) |
Removing ConfigurationSetListener
This function removes a listener object which is added by addConfigurationSetListener() function.
type | ConfigurationSetListenerType value |
listener | a pointer to ConfigurationSetListener listener object. |
void removeConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener* listener);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationSetNameListener | ( | self, | |
type, | |||
listener | |||
) |
Removing ConfigurationSetNameListener
This function removes a listener object which is added by addConfigurationSetNameListener() function.
type | ConfigurationSetNameListenerType value ON_UPDATE_CONFIG_PARAM is only allowed. |
listener | a pointer to ConfigurationSetNameListener listener object. |
void removeConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener* listener);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setConfigurationSetValues | ( | self, | |
config_set | |||
) |
Add to configuration set from specified property
Add specified property to configuration set.
self | |
configuration_set | Property to add |
bool setConfigurationSetValues(const coil::Properties& config_set)
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnActivateSet | ( | self, | |
cb | |||
) |
Set callback that is called by OnActivateSet.
self | |
cb | OnActivateSetCallback type object |
void setOnActivateSet(OnActivateSetCallback* cb);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnAddConfigurationSet | ( | self, | |
cb | |||
) |
Set callback that is called by OnSetConfiguration.
self | |
cb | OnSetConfigurationSetCallback type object |
void setOnAddConfigurationSet(OnAddConfigurationAddCallback* cb);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnRemoveConfigurationSet | ( | self, | |
cb | |||
) |
Set callback that is called by OnRemoveConfigurationSet.
self | |
cb | OnRemoveConfigurationSetCallback type object |
void setOnRemoveConfigurationSet(OnRemoveConfigurationSetCallback* cb);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnSetConfigurationSet | ( | self, | |
cb | |||
) |
Set callback that is called by OnSetConfiguration.
self | |
cb | OnSetConfigurationSetCallback type object |
void setOnSetConfigurationSet(OnSetConfigurationSetCallback* cb);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnUpdate | ( | self, | |
cb | |||
) |
Set callback that is called by OnUpdate.
self | |
cb | OnUpdateCallback type object |
void setOnUpdate(OnUpdateCallback* cb);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnUpdateParam | ( | self, | |
cb | |||
) |
Set callback that is called by OnUpdateParam.
self | |
cb | OnUpdateParamCallback type object |
void setOnUpdateParam(OnUpdateParamCallback* cb);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.unbindParameter | ( | self, | |
param_name | |||
) |
Unbinding configuration parameters
Unbind configuration parameter from its variable. It returns false, if configuration parameter of specified name has already existed.
param_name | Configuration parameter name |
bool unbindParameter(const char* param_name);
def OpenRTM_aist.ConfigAdmin.ConfigAdmin.update | ( | self, | |
config_set = None , |
|||
config_param = None |
|||
) |
void update(void);
Update the values of configuration parameters (Active configuration set)
When configuration set is updated, update the configuration parameter value to the value that is set to the current active configuration. This update will be executed, only when an active configuration set exists and the content of the configuration set has been updated from the last update.
void update(const char* config_set);
Update configuration parameter (By ID)
This operation updates configuration variables by the configuration-set with specified ID. This operation does not change current active configuration-set. Since this operation causes inconsistency between current active configuration set and actual values of configuration variables, user should carefully use it.
This operation ends without doing anything, if the configuration-set does not exist.
config_set | The target configuration set's ID to setup |
void update(const char* config_set, const char* config_param);
Update the values of configuration parameters (By name)
This operation updates a configuration variable by the specified configuration parameter in the configuration-set. This operation does not change current active configuration-set. Since this operation causes inconsistency between current active configuration set and actual values of configuration variables, user should carefully use it.
This operation ends without doing anything, if the configuration-set or the configuration parameter do not exist.
config_set | configuration-set ID. |
config_param | configuration parameter name. |