Component node object. More...
Component node object.
Node representing a component on a name server. Component nodes can occur below name server and directory nodes. They cannot contain any children. Component nodes store all the properties of a component, as well as references to the actual objects and object types used in the component. This node can be made dynamic by setting the 'dynamic' property to True. The following callbacks are available on this node type when it is dynamic: - rtc_status(ec_handle, status) The component's state has changed in the specified execution context. The new status is one of Component.INACTIVE, Component.ACTIVE, Component.ERROR, Component.UNKNOWN and Component.CREATED. - component_profile(items) One or more members of the component's profiles have been updated. The updated items are listed in the "items" argument. - ec_event(ec_handle, event) A change in one of the attached execution contexts has occurred. The event is one of Component.EC_ATTACHED, Component.EC_DETACHED, Component.EC_RATE_CHANGED, Component.EC_STARTUP, and Component.EC_SHUTDOWN. - port_event(port_name, event) A change on the specified port has occurred. The event is one of Component.PORT_ADD, Component.PORT_REMOVE, Component.PORT_CONNECT and Component.PORT_DISCONNECT. - config_event(config_set_name, event) A change in the component's configuration sets has occurred. The event is one of Component.CFG_UPDATE_SET, Component.CFG_UPDATE_PARAM, Component.CFG_UPDATE_PARAM_IN_ACTIVE, Component.CFG_ADD_SET, Component.CFG_REMOVE_SET and Component.CFG_ACTIVATE_SET. - heartbeat(time) A heartbeat was received from the component. The time the beat was received is passed.
Definition at line 38 of file component.py.
def rtctree.component.Component.__init__ | ( | self, | |
name = None , |
|||
parent = None , |
|||
obj = None , |
|||
args, | |||
kwargs | |||
) |
Constructor. @param name Name of this component (i.e. its entry in the path). @param parent The parent node of this node, if any. @param obj The CORBA LightweightRTObject object to wrap.
Definition at line 76 of file component.py.
def rtctree.component.Component._add_child | ( | self | ) | [private] |
Internal API.
Definition at line 948 of file component.py.
def rtctree.component.Component._config_event | ( | self, | |
name, | |||
event | |||
) | [private] |
Definition at line 952 of file component.py.
def rtctree.component.Component._ec_event | ( | self, | |
ec_handle, | |||
event | |||
) | [private] |
Definition at line 1008 of file component.py.
def rtctree.component.Component._enable_dynamic | ( | self, | |
enable = True |
|||
) | [private] |
Reimplemented from rtctree.node.TreeNode.
Definition at line 981 of file component.py.
def rtctree.component.Component._get_ec_state | ( | self, | |
ec | |||
) | [private] |
Definition at line 1052 of file component.py.
def rtctree.component.Component._heartbeat | ( | self | ) | [private] |
Definition at line 1067 of file component.py.
def rtctree.component.Component._parse_configuration | ( | self | ) | [private] |
Definition at line 1072 of file component.py.
def rtctree.component.Component._parse_profile | ( | self | ) | [private] |
Definition at line 1085 of file component.py.
def rtctree.component.Component._port_event | ( | self, | |
port_name, | |||
event | |||
) | [private] |
Definition at line 1102 of file component.py.
def rtctree.component.Component._profile_update | ( | self, | |
items | |||
) | [private] |
Definition at line 1131 of file component.py.
def rtctree.component.Component._reset_composite | ( | self | ) | [private] |
Definition at line 1171 of file component.py.
def rtctree.component.Component._reset_conf_sets | ( | self | ) | [private] |
Definition at line 1137 of file component.py.
def rtctree.component.Component._reset_data | ( | self | ) | [private] |
Definition at line 1142 of file component.py.
def rtctree.component.Component._reset_owned_ec_states | ( | self | ) | [private] |
Definition at line 1154 of file component.py.
def rtctree.component.Component._reset_owned_ecs | ( | self | ) | [private] |
Definition at line 1149 of file component.py.
def rtctree.component.Component._reset_participating_ec_states | ( | self | ) | [private] |
Definition at line 1163 of file component.py.
def rtctree.component.Component._reset_participating_ecs | ( | self | ) | [private] |
Definition at line 1158 of file component.py.
def rtctree.component.Component._reset_ports | ( | self | ) | [private] |
Definition at line 1167 of file component.py.
def rtctree.component.Component._set_state_in_ec | ( | self, | |
ec_handle, | |||
state | |||
) | [private] |
Definition at line 1177 of file component.py.
def rtctree.component.Component.activate_conf_set | ( | self, | |
set_name | |||
) |
Configuration set management.
Activate a configuration set by name. @raises NoSuchConfSetError
Definition at line 887 of file component.py.
def rtctree.component.Component.activate_in_ec | ( | self, | |
ec_index | |||
) |
Activate this component in an execution context. @param ec_index The index of the execution context to activate in. This index is into the total array of contexts, that is both owned and participating contexts. If the value of ec_index is greater than the length of @ref owned_ecs, that length is subtracted from ec_index and the result used as an index into @ref participating_ecs.
Definition at line 369 of file component.py.
def rtctree.component.Component.active_conf_set | ( | self | ) |
The currently-active configuration set.
Definition at line 918 of file component.py.
def rtctree.component.Component.active_conf_set_name | ( | self | ) |
The name of the currently-active configuration set.
Definition at line 928 of file component.py.
def rtctree.component.Component.add_logger | ( | self, | |
cb, | |||
level = 'NORMAL' , |
|||
filters = 'ALL' |
|||
) |
Add a callback to receive log events from this component. @param cb The callback function to receive log events. It must have the signature cb(name, time, source, level, message), where name is the name of the component the log record came from, time is a floating-point time stamp, source is the name of the logger that provided the log record, level is the log level of the record and message is a text string. @param level The maximum level of log records to receive. @param filters Filter the objects from which to receive log messages. @return An ID for this logger. Use this ID in future operations such as removing this logger. @raises AddLoggerError
Definition at line 838 of file component.py.
def rtctree.component.Component.add_members | ( | self, | |
rtcs | |||
) |
Composite component information and management.
Add other RT Components to this composite component as members. This component must be a composite component.
Definition at line 193 of file component.py.
def rtctree.component.Component.alive | ( | self | ) |
Is this component alive?
Definition at line 596 of file component.py.
def rtctree.component.Component.category | ( | self | ) |
Component information.
The category in which the component belongs.
Definition at line 140 of file component.py.
def rtctree.component.Component.composite_parent | ( | self | ) |
The parent component in the composition. None if this component is not a member of a composition.
Definition at line 237 of file component.py.
def rtctree.component.Component.conf_sets | ( | self | ) |
The dictionary of configuration sets in this component, if any.
Definition at line 938 of file component.py.
def rtctree.component.Component.connected_inports | ( | self | ) |
The list of all input ports belonging to this component that are connected to one or more other ports.
Definition at line 751 of file component.py.
def rtctree.component.Component.connected_outports | ( | self | ) |
The list of all output ports belonging to this component that are connected to one or more other ports.
Definition at line 760 of file component.py.
def rtctree.component.Component.connected_ports | ( | self | ) |
The list of all ports belonging to this component that are connected to one or more other ports.
Definition at line 770 of file component.py.
def rtctree.component.Component.connected_svcports | ( | self | ) |
The list of all service ports belonging to this component that are connected to one or more other ports.
Definition at line 778 of file component.py.
def rtctree.component.Component.deactivate_in_ec | ( | self, | |
ec_index | |||
) |
Deactivate this component in an execution context. @param ec_index The index of the execution context to deactivate in. This index is into the total array of contexts, that is both owned and participating contexts. If the value of ec_index is greater than the length of @ref owned_ecs, that length is subtracted from ec_index and the result used as an index into @ref participating_ecs.
Definition at line 391 of file component.py.
def rtctree.component.Component.description | ( | self | ) |
The component's description.
Definition at line 146 of file component.py.
def rtctree.component.Component.disconnect_all | ( | self | ) |
Port management.
Disconnect all connections to all ports of this component.
Definition at line 708 of file component.py.
def rtctree.component.Component.exit | ( | self | ) |
State management.
Stop the component's execution contexts and finalise it. This will have flow-on effects to any other components using this component's execution contexts and any child components. @return The result of attempting to exit.
Definition at line 357 of file component.py.
def rtctree.component.Component.exit | ( | self | ) |
Make a component exit. This function will make the component exit, shutting down its CORBA object in the process. It will not remove the node from the tree; a reparse is necessary to do that.
Definition at line 413 of file component.py.
def rtctree.component.Component.get_ec | ( | self, | |
ec_handle | |||
) |
Get a reference to the execution context with the given handle. @param ec_handle The handle of the execution context to look for. @type ec_handle str @return A reference to the ExecutionContext object corresponding to the ec_handle. @raises NoECWithHandleError
Definition at line 423 of file component.py.
def rtctree.component.Component.get_ec_index | ( | self, | |
ec_handle | |||
) |
Get the index of the execution context with the given handle. @param ec_handle The handle of the execution context to look for. @type ec_handle str @return The index into the owned + participated arrays, suitable for use in methods such as @ref activate_in_ec, or -1 if the EC was not found. @raises NoECWithHandleError
Definition at line 443 of file component.py.
def rtctree.component.Component.get_port_by_name | ( | self, | |
port_name | |||
) |
Get a port of this component by name.
Definition at line 714 of file component.py.
def rtctree.component.Component.get_port_by_ref | ( | self, | |
port_ref | |||
) |
Get a port of this component by reference to a CORBA PortService object.
Definition at line 722 of file component.py.
def rtctree.component.Component.get_state_in_ec_string | ( | self, | |
ec_index, | |||
add_colour = True |
|||
) |
Get the state of the component in an execution context as a string. @param ec_index The index of the execution context to check the state in. This index is into the total array of contexts, that is both owned and participating contexts. If the value of ec_index is greater than the length of @ref owned_ecs, that length is subtracted from ec_index and the result used as an index into @ref participating_ecs.
Definition at line 488 of file component.py.
def rtctree.component.Component.get_state_string | ( | self, | |
add_colour = True |
|||
) |
Get the state of this component as an optionally-coloured string. @param add_colour If True, ANSI colour codes will be added to the string. @return A string describing the state of this component.
Definition at line 463 of file component.py.
def rtctree.component.Component.has_port_by_name | ( | self, | |
port_name | |||
) |
Check if this component has a port by the given name.
Definition at line 733 of file component.py.
def rtctree.component.Component.has_port_by_ref | ( | self, | |
port_ref | |||
) |
Check if this component has a port by the given reference to a CORBA PortService object.
Definition at line 740 of file component.py.
def rtctree.component.Component.heartbeat_time | ( | self | ) |
Node functionality.
The time of the last heartbeat. Updated only when the node is dynamic.
Definition at line 814 of file component.py.
def rtctree.component.Component.inports | ( | self | ) |
The list of all input ports belonging to this component.
Definition at line 787 of file component.py.
def rtctree.component.Component.instance_name | ( | self | ) |
Instance name of the component.
Definition at line 152 of file component.py.
def rtctree.component.Component.is_component | ( | self | ) |
Is this node a component?
Reimplemented from rtctree.node.TreeNode.
Definition at line 823 of file component.py.
def rtctree.component.Component.is_composite | ( | self | ) |
Is the component a composite component.
Definition at line 246 of file component.py.
def rtctree.component.Component.is_composite_member | ( | self | ) |
Is the component a member of a composite component.
Definition at line 251 of file component.py.
def rtctree.component.Component.is_member | ( | self, | |
rtc | |||
) |
Is the given component a member of this composition? rtc may be a Component object or a string containing a component's instance name. Component objects are more reliable. Returns False if the given component is not a member of this composition. Raises NotCompositeError if this component is not a composition.
Definition at line 255 of file component.py.
def rtctree.component.Component.loggers | ( | self | ) |
Returns the list of logger IDs attached to this component.
Definition at line 828 of file component.py.
def rtctree.component.Component.members | ( | self | ) |
Member components if this component is composite.
Definition at line 281 of file component.py.
def rtctree.component.Component.object | ( | self | ) |
The LightweightRTObject this object wraps.
Definition at line 833 of file component.py.
def rtctree.component.Component.org_ids | ( | self | ) |
The organisation IDs of this composition.
Definition at line 315 of file component.py.
def rtctree.component.Component.organisations | ( | self | ) |
The organisations of this composition.
Definition at line 292 of file component.py.
def rtctree.component.Component.outports | ( | self | ) |
The list of all output ports belonging to this component.
Definition at line 792 of file component.py.
def rtctree.component.Component.owned_ec_states | ( | self | ) |
The state of each execution context this component owns.
Definition at line 606 of file component.py.
def rtctree.component.Component.owned_ecs | ( | self | ) |
A list of the execution contexts owned by this component.
Definition at line 620 of file component.py.
def rtctree.component.Component.parent_object | ( | self | ) |
The name of the component's parent object (typically another component), if it has one.
Definition at line 158 of file component.py.
def rtctree.component.Component.parent_org_ids | ( | self | ) |
The organisation IDs of the compositions this RTC belongs to.
Definition at line 321 of file component.py.
def rtctree.component.Component.parent_org_sdo_ids | ( | self | ) |
The SDO IDs of the compositions this RTC belongs to.
Definition at line 327 of file component.py.
def rtctree.component.Component.parent_organisations | ( | self | ) |
The organisations this RTC belongs to.
Definition at line 333 of file component.py.
The state of each execution context this component is participating in.
Definition at line 630 of file component.py.
def rtctree.component.Component.participating_ecs | ( | self | ) |
A list of the execution contexts this component is participating in.
Definition at line 647 of file component.py.
def rtctree.component.Component.plain_state_string | ( | self | ) |
The state of this component as a string without colour.
Definition at line 659 of file component.py.
def rtctree.component.Component.ports | ( | self | ) |
The list of all ports belonging to this component.
Definition at line 797 of file component.py.
def rtctree.component.Component.properties | ( | self | ) |
The component's extra properties dictionary.
Definition at line 167 of file component.py.
def rtctree.component.Component.refresh_state_in_ec | ( | self, | |
ec_index | |||
) |
Get the up-to-date state of the component in an execution context. This function will update the state, rather than using the cached value. This may take time, if the component is executing on a remote node. @param ec_index The index of the execution context to check the state in. This index is into the total array of contexts, that is both owned and participating contexts. If the value of ec_index is greater than the length of @ref owned_ecs, that length is subtracted from ec_index and the result used as an index into @ref participating_ecs.
Definition at line 567 of file component.py.
def rtctree.component.Component.remove_logger | ( | self, | |
cb_id | |||
) |
Remove a logger. @param cb_id The ID of the logger to remove. @raises NoLoggerError
Definition at line 871 of file component.py.
def rtctree.component.Component.remove_members | ( | self, | |
rtcs | |||
) |
Remove other RT Components from this composite component. rtcs is a list of components to remove. Each element must be either an rtctree.Component object or a string containing a component's instance name. rtctree.Component objects are more reliable. This component must be a composite component.
Definition at line 209 of file component.py.
def rtctree.component.Component.reparse | ( | self | ) |
Reparse the component's information. This will cause a delayed reparse of most information. This means that a piece of information, such as the list of ports, will be cleared and remain empty until it is next requested, at which point a fresh list will be retrieved from the component. If you only want to reparse a specific piece of information, use one of the reparse_X() methods.
Definition at line 96 of file component.py.
def rtctree.component.Component.reparse_conf_sets | ( | self | ) |
Delayed reparse configuration sets.
Definition at line 111 of file component.py.
def rtctree.component.Component.reparse_ecs | ( | self | ) |
Delayed reparse all execution contexts.
Definition at line 115 of file component.py.
def rtctree.component.Component.reparse_owned_ecs | ( | self | ) |
Delayed reparse only owned execution contexts.
Definition at line 120 of file component.py.
Delayed reparse only participating execution contexts.
Definition at line 124 of file component.py.
def rtctree.component.Component.reparse_ports | ( | self | ) |
Delayed reparse ports.
Definition at line 128 of file component.py.
def rtctree.component.Component.reparse_profile | ( | self | ) |
Delayed reparse the component's profile.
Definition at line 132 of file component.py.
def rtctree.component.Component.reset_in_ec | ( | self, | |
ec_index | |||
) |
Reset this component in an execution context. @param ec_index The index of the execution context to reset in. This index is into the total array of contexts, that is both owned and participating contexts. If the value of ec_index is greater than the length of @ref owned_ecs, that length is subtracted from ec_index and the result used as an index into @ref participating_ecs.
Definition at line 525 of file component.py.
def rtctree.component.Component.set_conf_set_value | ( | self, | |
set_name, | |||
param, | |||
value | |||
) |
Set a configuration set parameter value. @param set_name The name of the configuration set the destination parameter is in. @param param The name of the parameter to set. @param value The new value for the parameter. @raises NoSuchConfSetError, NoSuchConfParamError
Definition at line 898 of file component.py.
def rtctree.component.Component.state | ( | self | ) |
The merged state of all the execution context states, which can be used as the overall state of this component. The order of precedence is: Error > Active > Inactive > Created > Unknown
Definition at line 664 of file component.py.
def rtctree.component.Component.state_in_ec | ( | self, | |
ec_index | |||
) |
Get the state of the component in an execution context. @param ec_index The index of the execution context to check the state in. This index is into the total array of contexts, that is both owned and participating contexts. If the value of ec_index is greater than the length of @ref owned_ecs, that length is subtracted from ec_index and the result used as an index into @ref participating_ecs.
Definition at line 546 of file component.py.
def rtctree.component.Component.state_string | ( | self | ) |
The state of this component as a colourised string.
Definition at line 701 of file component.py.
def rtctree.component.Component.svcports | ( | self | ) |
The list of all service ports belonging to this component.
Definition at line 806 of file component.py.
def rtctree.component.Component.type_name | ( | self | ) |
Type name of the component.
Definition at line 173 of file component.py.
def rtctree.component.Component.vendor | ( | self | ) |
The component's vendor.
Definition at line 179 of file component.py.
def rtctree.component.Component.version | ( | self | ) |
The component's version.
Definition at line 185 of file component.py.
Definition at line 952 of file component.py.
rtctree::component.Component::_category [private] |
Definition at line 1085 of file component.py.
rtctree::component.Component::_conf [private] |
Definition at line 1072 of file component.py.
rtctree::component.Component::_conf_sets [private] |
Definition at line 1072 of file component.py.
Definition at line 1085 of file component.py.
rtctree::component.Component::_dynamic [private] |
Reimplemented from rtctree.node.TreeNode.
Definition at line 981 of file component.py.
Definition at line 1085 of file component.py.
Definition at line 82 of file component.py.
rtctree::component.Component::_loggers [private] |
Definition at line 82 of file component.py.
rtctree::component.Component::_members [private] |
Definition at line 281 of file component.py.
rtctree::component.Component::_obj [private] |
Definition at line 82 of file component.py.
rtctree::component.Component::_obs [private] |
Definition at line 82 of file component.py.
rtctree::component.Component::_obs_id [private] |
Definition at line 82 of file component.py.
rtctree::component.Component::_orgs [private] |
Definition at line 197 of file component.py.
Definition at line 606 of file component.py.
rtctree::component.Component::_owned_ecs [private] |
Definition at line 620 of file component.py.
Definition at line 1085 of file component.py.
Definition at line 1171 of file component.py.
Definition at line 633 of file component.py.
Definition at line 649 of file component.py.
rtctree::component.Component::_ports [private] |
Definition at line 797 of file component.py.
Definition at line 1085 of file component.py.
rtctree::component.Component::_type_name [private] |
Definition at line 1085 of file component.py.
rtctree::component.Component::_vendor [private] |
Definition at line 1085 of file component.py.
rtctree::component.Component::_version [private] |
Definition at line 1085 of file component.py.
int rtctree::component.Component::ACTIVE = 2 [static] |
Definition at line 1193 of file component.py.
int rtctree::component.Component::CFG_ACTIVATE_SET = 36 [static] |
Definition at line 1232 of file component.py.
int rtctree::component.Component::CFG_ADD_SET = 34 [static] |
Definition at line 1228 of file component.py.
int rtctree::component.Component::CFG_REMOVE_SET = 35 [static] |
Definition at line 1230 of file component.py.
int rtctree::component.Component::CFG_SET_SET = 33 [static] |
Definition at line 1226 of file component.py.
int rtctree::component.Component::CFG_UPDATE_PARAM = 32 [static] |
Definition at line 1224 of file component.py.
int rtctree::component.Component::CFG_UPDATE_SET = 31 [static] |
Definition at line 1222 of file component.py.
int rtctree::component.Component::CREATED = 5 [static] |
Definition at line 1199 of file component.py.
int rtctree::component.Component::EC_ATTACHED = 11 [static] |
Definition at line 1202 of file component.py.
int rtctree::component.Component::EC_DETACHED = 12 [static] |
Definition at line 1204 of file component.py.
int rtctree::component.Component::EC_RATE_CHANGED = 13 [static] |
Definition at line 1206 of file component.py.
int rtctree::component.Component::EC_SHUTDOWN = 15 [static] |
Definition at line 1210 of file component.py.
int rtctree::component.Component::EC_STARTUP = 14 [static] |
Definition at line 1208 of file component.py.
int rtctree::component.Component::ERROR = 3 [static] |
Definition at line 1195 of file component.py.
int rtctree::component.Component::INACTIVE = 1 [static] |
Definition at line 1191 of file component.py.
Definition at line 292 of file component.py.
Definition at line 292 of file component.py.
Definition at line 292 of file component.py.
int rtctree::component.Component::PORT_ADD = 21 [static] |
Definition at line 1213 of file component.py.
int rtctree::component.Component::PORT_CONNECT = 23 [static] |
Definition at line 1217 of file component.py.
int rtctree::component.Component::PORT_DISCONNECT = 24 [static] |
Definition at line 1219 of file component.py.
int rtctree::component.Component::PORT_REMOVE = 22 [static] |
Definition at line 1215 of file component.py.
Definition at line 292 of file component.py.
Definition at line 469 of file component.py.
int rtctree::component.Component::UNKNOWN = 4 [static] |
Definition at line 1197 of file component.py.