Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
rtctree.component.Component Class Reference

Component node object. More...

Inheritance diagram for rtctree.component.Component:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def activate_conf_set
 Configuration set management.
def activate_in_ec
def active_conf_set
def active_conf_set_name
def add_logger
def add_members
 Composite component information and management.
def alive
def category
 Component information.
def composite_parent
def conf_sets
def connected_inports
def connected_outports
def connected_ports
def connected_svcports
def deactivate_in_ec
def description
def disconnect_all
 Port management.
def exit
 State management.
def exit
def get_ec
def get_ec_index
def get_port_by_name
def get_port_by_ref
def get_state_in_ec_string
def get_state_string
def has_port_by_name
def has_port_by_ref
def heartbeat_time
 Node functionality.
def inports
def instance_name
def is_component
def is_composite
def is_composite_member
def is_member
def loggers
def members
def object
def org_ids
def organisations
def outports
def owned_ec_states
def owned_ecs
def parent_object
def parent_org_ids
def parent_org_sdo_ids
def parent_organisations
def participating_ec_states
def participating_ecs
def plain_state_string
def ports
def properties
def refresh_state_in_ec
def remove_logger
def remove_members
def reparse
def reparse_conf_sets
def reparse_ecs
def reparse_owned_ecs
def reparse_participating_ecs
def reparse_ports
def reparse_profile
def reset_in_ec
def set_conf_set_value
def state
def state_in_ec
def state_string
def svcports
def type_name
def vendor
def version

Public Attributes

 members
 obj
 org_id
 sdo_id
 state

Static Public Attributes

int ACTIVE = 2
int CFG_ACTIVATE_SET = 36
int CFG_ADD_SET = 34
int CFG_REMOVE_SET = 35
int CFG_SET_SET = 33
int CFG_UPDATE_PARAM = 32
int CFG_UPDATE_SET = 31
int CREATED = 5
int EC_ATTACHED = 11
int EC_DETACHED = 12
int EC_RATE_CHANGED = 13
int EC_SHUTDOWN = 15
int EC_STARTUP = 14
int ERROR = 3
int INACTIVE = 1
int PORT_ADD = 21
int PORT_CONNECT = 23
int PORT_DISCONNECT = 24
int PORT_REMOVE = 22
int UNKNOWN = 4

Private Member Functions

def _add_child
 Internal API.
def _config_event
def _ec_event
def _enable_dynamic
def _get_ec_state
def _heartbeat
def _parse_configuration
def _parse_profile
def _port_event
def _profile_update
def _reset_composite
def _reset_conf_sets
def _reset_data
def _reset_owned_ec_states
def _reset_owned_ecs
def _reset_participating_ec_states
def _reset_participating_ecs
def _reset_ports
def _set_state_in_ec

Private Attributes

 _active_conf_set
 _category
 _conf
 _conf_sets
 _description
 _dynamic
 _instance_name
 _last_heartbeat
 _loggers
 _members
 _obj
 _obs
 _obs_id
 _orgs
 _owned_ec_states
 _owned_ecs
 _parent_obj
 _parent_orgs
 _participating_ec_states
 _participating_ecs
 _ports
 _properties
 _type_name
 _vendor
 _version

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Definition at line 1072 of file component.py.

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.

Definition at line 1171 of file component.py.

Definition at line 1137 of file component.py.

def rtctree.component.Component._reset_data (   self) [private]

Definition at line 1142 of file component.py.

Definition at line 1154 of file component.py.

Definition at line 1149 of file component.py.

Definition at line 1163 of file component.py.

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.

The currently-active configuration set.

Definition at line 918 of file component.py.

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.

Is this component alive?

Definition at line 596 of file component.py.

Component information.

The category in which the component belongs.

Definition at line 140 of file component.py.

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.

The dictionary of configuration sets in this component, if any.

Definition at line 938 of file component.py.

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.

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.

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.

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.

The component's description.

Definition at line 146 of file component.py.

Port management.

Disconnect all connections to all ports of this component.

Definition at line 708 of file component.py.

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.

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.

Node functionality.

The time of the last heartbeat.

Updated only when the node is dynamic.

Definition at line 814 of file component.py.

The list of all input ports belonging to this component.

Definition at line 787 of file component.py.

Instance name of the component.

Definition at line 152 of file component.py.

Is this node a component?

Reimplemented from rtctree.node.TreeNode.

Definition at line 823 of file component.py.

Is the component a composite component.

Definition at line 246 of file component.py.

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.

Returns the list of logger IDs attached to this component.

Definition at line 828 of file component.py.

Member components if this component is composite.

Definition at line 281 of file component.py.

The LightweightRTObject this object wraps.

Definition at line 833 of file component.py.

The organisation IDs of this composition.

Definition at line 315 of file component.py.

The organisations of this composition.

Definition at line 292 of file component.py.

The list of all output ports belonging to this component.

Definition at line 792 of file component.py.

The state of each execution context this component owns.

Definition at line 606 of file component.py.

A list of the execution contexts owned by this component.

Definition at line 620 of file component.py.

The name of the component's parent object (typically another
component), if it has one.

Definition at line 158 of file component.py.

The organisation IDs of the compositions this RTC belongs to.

Definition at line 321 of file component.py.

The SDO IDs of the compositions this RTC belongs to.

Definition at line 327 of file component.py.

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.

A list of the execution contexts this component is participating in.

Definition at line 647 of file component.py.

The state of this component as a string without colour.

Definition at line 659 of file component.py.

The list of all ports belonging to this component.

Definition at line 797 of file component.py.

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.

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.

Delayed reparse configuration sets.

Definition at line 111 of file component.py.

Delayed reparse all execution contexts.

Definition at line 115 of file component.py.

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.

Delayed reparse ports.

Definition at line 128 of file component.py.

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.

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.

The state of this component as a colourised string.

Definition at line 701 of file component.py.

The list of all service ports belonging to this component.

Definition at line 806 of file component.py.

Type name of the component.

Definition at line 173 of file component.py.

The component's vendor.

Definition at line 179 of file component.py.

The component's version.

Definition at line 185 of file component.py.


Member Data Documentation

Definition at line 952 of file component.py.

Definition at line 1085 of file component.py.

Definition at line 1072 of file component.py.

Definition at line 1072 of file component.py.

Definition at line 1085 of file component.py.

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.

Definition at line 82 of file component.py.

Definition at line 281 of file component.py.

Definition at line 82 of file component.py.

Definition at line 82 of file component.py.

Definition at line 82 of file component.py.

Definition at line 197 of file component.py.

Definition at line 606 of file component.py.

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.

Definition at line 797 of file component.py.

Definition at line 1085 of file component.py.

Definition at line 1085 of file component.py.

Definition at line 1085 of file component.py.

Definition at line 1085 of file component.py.

Definition at line 1193 of file component.py.

Definition at line 1232 of file component.py.

Definition at line 1228 of file component.py.

Definition at line 1230 of file component.py.

Definition at line 1226 of file component.py.

Definition at line 1224 of file component.py.

Definition at line 1222 of file component.py.

Definition at line 1199 of file component.py.

Definition at line 1202 of file component.py.

Definition at line 1204 of file component.py.

Definition at line 1206 of file component.py.

Definition at line 1210 of file component.py.

Definition at line 1208 of file component.py.

Definition at line 1195 of file component.py.

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.

Definition at line 1213 of file component.py.

Definition at line 1217 of file component.py.

Definition at line 1219 of file component.py.

Definition at line 1215 of file component.py.

Definition at line 292 of file component.py.

Definition at line 469 of file component.py.

Definition at line 1197 of file component.py.


The documentation for this class was generated from the following file:


rtctree
Author(s): Geoffrey Biggs
autogenerated on Wed Aug 26 2015 16:13:08