ComponentObserverConsumer.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: euc-jp -*-
3 
4 
17 
18 import sys
19 sys.path.insert(1,".")
20 
21 import RTC
22 import OpenRTM
23 import OpenRTM_aist
24 
25 
31  """
32  """
33 
34 
41  def __init__(self):
42  self._rtobj = None
43  self._profile = None
44  self._observer = OpenRTM_aist.CorbaConsumer(interfaceType=OpenRTM.ComponentObserver)
45  self._observed = [ False for i in range(OpenRTM.STATUS_KIND_NUM._v)]
46 
47  self._compstat = self.CompStatMsg(self)
48  self._portaction = self.PortAction(self)
49  self._ecaction = self.ECAction(self)
50  self._configMsg = self.ConfigAction(self)
51 
53  self._heartbeat = False
54  self._hblistenerid = None
55 
56  # このタイマーはいずれグローバルなタイマにおきかえる self._timer = OpenRTM_aist.Timer(self._interval) return ## # @if jp # @brief dtor # @else # @brief dtor # @endif # def __del__(self): self.unsetComponentProfileListeners() self.unsetComponentStatusListeners() self.unsetPortProfileListeners() self.unsetExecutionContextListeners() self.unsetConfigurationListeners() self.unsetHeartbeat() del self._timer return ## # @if jp # @brief 初期化 # @else # @brief Initialization # @endif # # virtual bool init(RTObject_impl& rtobj, # const SDOPackage::ServiceProfile& profile); def init(self, rtobj, profile): if not self._observer.setObject(profile.service): # narrowing failed return False self._rtobj = rtobj self._profile = profile prop = OpenRTM_aist.Properties() OpenRTM_aist.NVUtil.copyToProperties(prop, profile.properties) self.setHeartbeat(prop) self.setListeners(prop) return True ## # @if jp # @brief 再初期化 # @else # @brief Re-initialization # @endif # # virtual bool reinit(const SDOPackage::ServiceProfile& profile); def reinit(self, profile): if not self._observer._ptr()._is_equivalent(profile.service): tmp = OpenRTM_aist.CorbaConsumer(interfaceType=OpenRTM.ComponentObserver) if not tmp.setObject(profile.service): return False self._observer.releaseObject() self._observer.setObject(profile.service) self._profile= profile prop = OpenRTM_aist.Properties() OpenRTM_aist.NVUtil.copyToProperties(prop, profile.properties) self.setHeartbeat(prop) self.setListeners(prop) return True ## # @if jp # @brief ServiceProfile を取得する # @else # @brief getting ServiceProfile # @endif # # virtual const SDOPackage::ServiceProfile& getProfile() const; def getProfile(self): return self._profile ## # @if jp # @brief 終了処理 # @else # @brief Finalization # @endif # # virtual void finalize(); def finalize(self): self.unsetComponentProfileListeners() self.unsetComponentStatusListeners() self.unsetPortProfileListeners() self.unsetExecutionContextListeners() self.unsetConfigurationListeners() self.unsetHeartbeat() return ## # @if jp # @brief リモートオブジェクトコール # @else # @brief Calling remote object # @endif # # inline void updateStatus(OpenRTM::StatusKind statuskind, const char* msg) def updateStatus(self, statuskind, msg): try: self._observer._ptr().update_status(statuskind, msg) except: self._rtobj.removeSdoServiceConsumer(self._profile.id) return ## # @if jp # @brief Kindを文字列へ変換する # @else # @brief Converting kind to string # @endif # # inline const char* toString(OpenRTM::StatusKind kind) def toString(self, kind): kinds = ["COMPONENT_PROFILE", "RTC_STATUS", "EC_STATUS", "PORT_PROFILE", "CONFIGURATION", "HEARTBEAT"] if kind._v < OpenRTM.STATUS_KIND_NUM._v: return kinds[kind._v] return "" ## # @if jp # @brief RTObjectへのリスナ接続処理 # @else # @brief Connectiong listeners to RTObject # @endif # # void setListeners(coil::Properties& prop); def setListeners(self, prop): if not prop.getProperty("observed_status"): prop.setProperty("observed_status", "ALL") observed_ = [s.strip() for s in prop.getProperty("observed_status").split(",")] flags_ = [ False for i in range(OpenRTM.STATUS_KIND_NUM._v) ] for i in range(len(observed_)): observed_[i] = observed_[i].upper() if observed_[i] == "COMPONENT_PROFILE": flags_[OpenRTM.COMPONENT_PROFILE._v] = True elif observed_[i] == "RTC_STATUS": flags_[OpenRTM.RTC_STATUS._v] = True elif observed_[i] == "EC_STATUS": flags_[OpenRTM.EC_STATUS._v] = True elif observed_[i] == "PORT_PROFILE": flags_[OpenRTM.PORT_PROFILE._v] = True elif observed_[i] == "CONFIGURATION": flags_[OpenRTM.CONFIGURATION._v] = True elif observed_[i] == "ALL": for j in range(OpenRTM.STATUS_KIND_NUM._v): flags_[j] = True break self.switchListeners(flags_[OpenRTM.COMPONENT_PROFILE._v], self._observed, OpenRTM.COMPONENT_PROFILE._v, self.setComponentProfileListeners, self.unsetComponentProfileListeners) self.switchListeners(flags_[OpenRTM.RTC_STATUS._v], self._observed, OpenRTM.RTC_STATUS._v, self.setComponentStatusListeners, self.unsetComponentStatusListeners) self.switchListeners(flags_[OpenRTM.EC_STATUS._v], self._observed, OpenRTM.EC_STATUS._v, self.setExecutionContextListeners, self.unsetExecutionContextListeners) self.switchListeners(flags_[OpenRTM.PORT_PROFILE._v], self._observed, OpenRTM.PORT_PROFILE._v, self.setPortProfileListeners, self.unsetPortProfileListeners) self.switchListeners(flags_[OpenRTM.CONFIGURATION._v], self._observed, OpenRTM.CONFIGURATION._v, self.setConfigurationListeners, self.unsetConfigurationListeners) return ## # @if jp # @brief リスナ接続・切断スイッチング処理 # @else # @brief Switching listeners connecting/disconnecting # @endif # # void switchListeners(bool& next, bool& pre, # void (ComponentObserverConsumer::*setfunc)(), # void (ComponentObserverConsumer::*unsetfunc)()); def switchListeners(self, next, pre, pre_idx, setfunc, unsetfunc): if (not pre[pre_idx]) and next: setfunc() pre[pre_idx] = True elif pre[pre_idx] and (not next): unsetfunc() pre[pre_idx] = False return #============================================================ # Heartbeat related functions ## # @if jp # @brief ハートビートをオブザーバに伝える # @else # @brief Sending a heartbeart signal to observer # @endif # # void heartbeat(); def heartbeat(self): self.updateStatus(OpenRTM.HEARTBEAT, "") return ## # @if jp # @brief ハートビートを設定する # @else # @brief Setting heartbeat # @endif # # void setHeartbeat(coil::Properties& prop); def setHeartbeat(self, prop): if OpenRTM_aist.toBool(prop.getProperty("heartbeat.enable"), "YES", "NO", False): interval_ = prop.getProperty("heartbeat.interval") if not interval_: self._interval.set_time(1.0) else: tmp_ = float(interval_) self._interval.set_time(tmp_) tm_ = self._interval self._hblistenerid = self._timer.registerListenerObj(self, ComponentObserverConsumer.heartbeat, tm_) if not self._heartbeat: self._timer.start() self._heartbeat = True else: if self._heartbeat and self._hblistenerid: self.unsetHeartbeat() return ## # @if jp # @brief ハートビートを解除する # @else # @brief Unsetting heartbeat # @endif # # void unsetHeartbeat(); def unsetHeartbeat(self): self._timer.unregisterListener(self._hblistenerid) self._hblistenerid = 0 self._timer.stop() self._heartbeat = False return #============================================================ # Component status related functions ## # @if jp # @brief RTC状態変化リスナの設定処理 # @else # @brief Setting RTC status listeners # @endif # # void setComponentStatusListeners(); def setComponentStatusListeners(self): postclistener_ = OpenRTM_aist.PostComponentActionListenerType if not self._compstat.activatedListener: self._compstat.activatedListener = \ self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_ACTIVATED, self._compstat.onActivated) if not self._compstat.deactivatedListener: self._compstat.deactivatedListener = \ self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_DEACTIVATED, self._compstat.onDeactivated) if not self._compstat.resetListener: self._compstat.resetListener = \ self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_RESET, self._compstat.onReset) if not self._compstat.abortingListener: self._compstat.abortingListener = \ self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_ABORTING, self._compstat.onAborting) if not self._compstat.finalizeListener: self._compstat.finalizeListener = \ self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_FINALIZE, self._compstat.onFinalize) return ## # @if jp # @brief RTC状態変化リスナの解除処理 # @else # @brief Unsetting RTC status listeners # @endif # # void unsetComponentStatusListeners(); def unsetComponentStatusListeners(self): postclistener_ = OpenRTM_aist.PostComponentActionListenerType if self._compstat.activatedListener: self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_ACTIVATED, self._compstat.activatedListener) self._compstat.activatedListener = None if self._compstat.deactivatedListener: self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_DEACTIVATED, self._compstat.deactivatedListener) self._compstat.deactivatedListener = None if self._compstat.resetListener: self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_RESET, self._compstat.resetListener) self._compstat.resetListener = None if self._compstat.abortingListener: self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_ABORTING, self._compstat.abortingListener) self._compstat.abortingListener = None if self._compstat.finalizeListener: self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_FINALIZE, self._compstat.finalizeListener) self._compstat.finalizeListener = None return #============================================================ # Port profile related functions ## # @if jp # @brief Portプロファイル変化リスナの設定処理 # @else # @brief Setting port profile listener # @endif # # void setPortProfileListeners(); def setPortProfileListeners(self): plistener_ = OpenRTM_aist.PortActionListenerType if not self._portaction.portAddListener: self._portaction.portAddListener = \ self._rtobj.addPortActionListener(plistener_.ADD_PORT, self._portaction.onAddPort) if not self._portaction.portRemoveListener: self._portaction.portRemoveListener = \ self._rtobj.addPortActionListener(plistener_.REMOVE_PORT, self._portaction.onRemovePort) pclistener_ = OpenRTM_aist.PortConnectRetListenerType if not self._portaction.portConnectListener: self._portaction.portConnectListener = \ self._rtobj.addPortConnectRetListener(pclistener_.ON_CONNECTED, self._portaction.onConnect) if not self._portaction.portDisconnectListener: self._portaction.portDisconnectListener = \ self._rtobj.addPortConnectRetListener(pclistener_.ON_DISCONNECTED, self._portaction.onDisconnect) return ## # @if jp # @brief Portプロファイル変化リスナの解除処理 # @else # @brief Unsetting port profile listener # @endif # # void unsetPortProfileListeners(); def unsetPortProfileListeners(self): plistener_ = OpenRTM_aist.PortActionListenerType if self._portaction.portAddListener: self._rtobj.removePortActionListener(plistener_.ADD_PORT, self._portaction.portAddListener) self._portaction.portAddListener = None if self._portaction.portRemoveListener: self._rtobj.removePortActionListener(plistener_.REMOVE_PORT, self._portaction.portRemoveListener) self._portaction.portRemoveListener = None pclistener_ = OpenRTM_aist.PortConnectRetListenerType if self._portaction.portConnectListener: self._rtobj.removePortConnectRetListener(pclistener_.ON_CONNECTED, self._portaction.portConnectListener) self._portaction.portConnectListener = None if self._portaction.portDisconnectListener: self._rtobj.removePortConnectRetListener(pclistener_.ON_DISCONNECTED, self._portaction.portDisconnectListener) self._portaction.portDisconnectListener = None return #============================================================ # EC profile related functions ## # @if jp # @brief ECの状態変化リスナの設定 # @else # @brief Setting EC status listener # @endif # # void setExecutionContextListeners(); def setExecutionContextListeners(self): ectype_ = OpenRTM_aist.ExecutionContextActionListenerType if not self._ecaction.ecAttached: self._ecaction.ecAttached = \ self._rtobj.addExecutionContextActionListener(ectype_.EC_ATTACHED, self._ecaction.onAttached) if not self._ecaction.ecDetached: self._ecaction.ecDetached = \ self._rtobj.addExecutionContextActionListener(ectype_.EC_DETACHED, self._ecaction.onDetached) pcaltype_ = OpenRTM_aist.PostComponentActionListenerType if not self._ecaction.ecRatechanged: self._ecaction.ecRatechanged = \ self._rtobj.addPostComponentActionListener(pcaltype_.POST_ON_RATE_CHANGED, self._ecaction.onRateChanged) if not self._ecaction.ecStartup: self._ecaction.ecStartup = \ self._rtobj.addPostComponentActionListener(pcaltype_.POST_ON_STARTUP, self._ecaction.onStartup) if not self._ecaction.ecShutdown: self._ecaction.ecShutdown = \ self._rtobj.addPostComponentActionListener(pcaltype_.POST_ON_SHUTDOWN, self._ecaction.onShutdown) return ## # @if jp # @brief ECの状態変化リスナの解除 # @else # @brief Unsetting EC status listener # @endif # # void unsetExecutionContextListeners(); def unsetExecutionContextListeners(self): ectype_ = OpenRTM_aist.ExecutionContextActionListenerType if self._ecaction.ecAttached: self._rtobj.removeExecutionContextActionListener(ectype_.EC_ATTACHED, self._ecaction.ecAttached) if self._ecaction.ecDetached: self._rtobj.removeExecutionContextActionListener(ectype_.EC_ATTACHED, self._ecaction.ecDetached) pcaltype_ = OpenRTM_aist.PostComponentActionListenerType if self._ecaction.ecRatechanged: self._rtobj.removePostComponentActionListener(pcaltype_.POST_ON_RATE_CHANGED, self._ecaction.ecRatechanged) if self._ecaction.ecStartup: self._rtobj.removePostComponentActionListener(pcaltype_.POST_ON_STARTUP, self._ecaction.ecStartup) if self._ecaction.ecShutdown: self._rtobj.removePostComponentActionListener(pcaltype_.POST_ON_SHUTDOWN, self._ecaction.ecShutdown) return #============================================================ # ComponentProfile related functions ## # @if jp # @brief ComponentProfile状態変化リスナの設定 # @else # @brief Setting ComponentProfile listener # @endif # # void setComponentProfileListeners(); def setComponentProfileListeners(self): pass ## # @if jp # @brief ComponentProfile状態変化リスナの解除 # @else # @brief Unsetting ComponentProfile listener # @endif # # void unsetComponentProfileListeners(); def unsetComponentProfileListeners(self): pass #============================================================ # Configuration related functions ## # @if jp # @brief Configuration状態変化リスナの設定 # @else # @brief Setting Configuration listener # @endif # # void setConfigurationListeners(); def setConfigurationListeners(self): confprmlistenertype_ = OpenRTM_aist.ConfigurationParamListenerType self._configMsg.updateConfigParamListener = \ self._rtobj.addConfigurationParamListener(confprmlistenertype_.ON_UPDATE_CONFIG_PARAM, self._configMsg.updateConfigParam) confsetlistenertype_ = OpenRTM_aist.ConfigurationSetListenerType self._configMsg.setConfigSetListener = \ self._rtobj.addConfigurationSetListener(confsetlistenertype_.ON_SET_CONFIG_SET, self._configMsg.setConfigSet) self._configMsg.addConfigSetListener = \ self._rtobj.addConfigurationSetListener(confsetlistenertype_.ON_ADD_CONFIG_SET, self._configMsg.addConfigSet) confsetnamelistenertype_ = OpenRTM_aist.ConfigurationSetNameListenerType self._configMsg.updateConfigSetListener = \ self._rtobj.addConfigurationSetNameListener(confsetnamelistenertype_.ON_UPDATE_CONFIG_SET, self._configMsg.updateConfigSet) self._configMsg.removeConfigSetListener = \ self._rtobj.addConfigurationSetNameListener(confsetnamelistenertype_.ON_REMOVE_CONFIG_SET, self._configMsg.removeConfigSet) self._configMsg.activateConfigSetListener = \ self._rtobj.addConfigurationSetNameListener(confsetnamelistenertype_.ON_ACTIVATE_CONFIG_SET, self._configMsg.activateConfigSet) return ## # @if jp # @brief Configuration状態変化リスナの解除 # @else # @brief Unsetting Configurationlistener # @endif # # void unsetConfigurationListeners(); def unsetConfigurationListeners(self): confprmlistenertype_ = OpenRTM_aist.ConfigurationParamListenerType if self._configMsg.updateConfigParamListener: self._rtobj.removeConfigurationParamListener(confprmlistenertype_.ON_UPDATE_CONFIG_PARAM, self._configMsg.updateConfigParamListener) self._configMsg.updateConfigParamListener = None confsetlistenertype_ = OpenRTM_aist.ConfigurationSetListenerType if self._configMsg.setConfigSetListener: self._rtobj.removeConfigurationSetListener(confsetlistenertype_.ON_SET_CONFIG_SET, self._configMsg.setConfigSetListener) self._configMsg.setConfigSetListener = None if self._configMsg.addConfigSetListener: self._rtobj.removeConfigurationSetListener(confsetlistenertype_.ON_ADD_CONFIG_SET, self._configMsg.addConfigSetListener) self._configMsg.addConfigSetListener = None confsetnamelistenertype_ = OpenRTM_aist.ConfigurationSetNameListenerType if self._configMsg.updateConfigSetListener: self._rtobj.removeConfigurationSetNameListener(confsetnamelistenertype_.ON_UPDATE_CONFIG_SET, self._configMsg.updateConfigSetListener) self._configMsg.updateConfigSetListener = None if self._configMsg.removeConfigSetListener: self._rtobj.removeConfigurationSetNameListener(confsetnamelistenertype_.ON_REMOVE_CONFIG_SET, self._configMsg.removeConfigSetListener) self._configMsg.removeConfigSetListener = None if self._configMsg.activateConfigSetListener: self._rtobj.removeConfigurationSetNameListener(confsetnamelistenertype_.ON_ACTIVATE_CONFIG_SET, self._configMsg.activateConfigSetListener) self._configMsg.activateConfigSetListener = None return ## # @if jp # @brief PostComponentActionListener class # @else # @brief PostComponentActionListener class # @endif # class CompStatMsg: """ """ #CompStatMsg(ComponentObserverConsumer& coc) def __init__(self, coc): self.activatedListener = None self.deactivatedListener = None self.resetListener = None self.abortingListener = None self.finalizeListener = None self._coc = coc return def __del__(self): del self._coc return #void onGeneric(const char* msgprefix, UniqueId ec_id, ReturnCode_t ret) def onGeneric(self, msgprefix, ec_id, ret): if ret == RTC.RTC_OK: msg_ = msgprefix msg_ += str(ec_id) self._coc.updateStatus(OpenRTM.RTC_STATUS, msg_) return #void onActivated(UniqueId ec_id, ReturnCode_t ret) def onActivated(self, ec_id, ret): self.onGeneric("ACTIVE:", ec_id, ret) return #void onDeactivated(UniqueId ec_id, ReturnCode_t ret) def onDeactivated(self, ec_id, ret): self.onGeneric("INACTIVE:", ec_id, ret) return #void onReset(UniqueId ec_id, ReturnCode_t ret) def onReset(self, ec_id, ret): self.onGeneric("INACTIVE:", ec_id, ret) return #void onAborting(UniqueId ec_id, ReturnCode_t ret) def onAborting(self, ec_id, ret): self.onGeneric("ERROR:", ec_id, ret) return #void onFinalize(UniqueId ec_id, ReturnCode_t ret) def onFinalize(self, ec_id, ret): self.onGeneric("FINALIZE:", ec_id, ret) return ## # @if jp # @brief PortActionListener # @else # @brief PortActionListener # @endif # class PortAction: """ """ #PortAction(ComponentObserverConsumer& coc) def __init__(self, coc): self.portAddListener = None self.portRemoveListener = None self.portConnectListener = None self.portDisconnectListener = None self._coc = coc return def __del__(self): del self._coc return #void onGeneric(const char* _msg, const char* portname) def onGeneric(self, _msg, portname): msg_ = _msg msg_ += portname self._coc.updateStatus(OpenRTM.PORT_PROFILE, msg_) return #void onAddPort(const ::RTC::PortProfile& pprof) def onAddPort(self, pprof): self.onGeneric("ADD:", str(pprof.name)) return #void onRemovePort(const ::RTC::PortProfile& pprof) def onRemovePort(self, pprof): self.onGeneric("REMOVE:", str(pprof.name)) return #void onConnect(const char* portname, # ::RTC::ConnectorProfile& pprof, ReturnCode_t ret) def onConnect(self, portname, pprof, ret): if ret == RTC.RTC_OK: self.onGeneric("CONNECT:", portname) return #void onDisconnect(const char* portname, # ::RTC::ConnectorProfile& pprof, ReturnCode_t ret) def onDisconnect(self, portname, pprof, ret): if ret == RTC.RTC_OK: self.onGeneric("DISCONNECT:", portname) return ## # @if jp # @brief ExecutionContextActionListener # @else # @brief ExecutionContextActionListener # @endif # class ECAction: """ """ #ECAction(ComponentObserverConsumer& coc) def __init__(self, coc): self.ecAttached = None self.ecDetached = None self.ecRatechanged = None self.ecStartup = None self.ecShutdown = None self._coc = coc return def __del__(self): del self._coc return #void onGeneric(const char* _msg, UniqueId ec_id) def onGeneric(self, _msg, ec_id): msg_ = _msg + str(ec_id) self._coc.updateStatus(OpenRTM.EC_STATUS, msg_) return #void onAttached(UniqueId ec_id) def onAttached(self, ec_id): self.onGeneric("ATTACHED:", ec_id) return #void onDetached(UniqueId ec_id) def onDetached(self, ec_id): self.onGeneric("DETACHED:", ec_id) return #void onRateChanged(UniqueId ec_id, ReturnCode_t ret) def onRateChanged(self, ec_id, ret): if ret == RTC.RTC_OK: self.onGeneric("RATE_CHANGED:", ec_id) return #void onStartup(UniqueId ec_id, ReturnCode_t ret) def onStartup(self, ec_id, ret): if ret == RTC.RTC_OK: self.onGeneric("STARTUP:", ec_id) return #void onShutdown(UniqueId ec_id, ReturnCode_t ret) def onShutdown(self, ec_id, ret): if ret == RTC.RTC_OK: self.onGeneric("SHUTDOWN:", ec_id) return ## # @if jp # @brief ConfigActionListener # @else # @brief ConfigActionListener # @endif # class ConfigAction: """ """ #ConfigAction(ComponentObserverConsumer& coc) def __init__(self, coc): self.updateConfigParamListener = None self.setConfigSetListener = None self.addConfigSetListener = None self.updateConfigSetListener = None self.removeConfigSetListener = None self.activateConfigSetListener = None self._coc = coc def __del__(self): del self._coc return #void updateConfigParam(const char* configsetname, # const char* configparamname) def updateConfigParam(self, configsetname, configparamname): msg_ = "UPDATE_CONFIG_PARAM: " msg_ += configsetname msg_ += "." msg_ += configparamname self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_) return #void setConfigSet(const coil::Properties& config_set) def setConfigSet(self, config_set): msg_ = "SET_CONFIG_SET: " msg_ += config_set.getName() self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_) return #void addConfigSet(const coil::Properties& config_set) def addConfigSet(self, config_set): msg_ = "ADD_CONFIG_SET: " msg_ += config_set.getName() self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_) return #void updateConfigSet(const char* config_set_name) def updateConfigSet(self, config_set_name): msg_ = "UPDATE_CONFIG_SET: " msg_ += config_set_name self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_) return #void removeConfigSet(const char* config_set_name) def removeConfigSet(self, config_set_name): msg_ = "REMOVE_CONFIG_SET: " msg_ += config_set_name self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_) return #void activateConfigSet(const char* config_set_name) def activateConfigSet(self, config_set_name): msg_ = "ACTIVATE_CONFIG_SET: " msg_ += config_set_name self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_) return def ComponentObserverConsumerInit(mgr=None): factory = OpenRTM_aist.SdoServiceConsumerFactory.instance() factory.addFactory(OpenRTM.ComponentObserver._NP_RepositoryId, ComponentObserverConsumer, OpenRTM_aist.Delete) return
58  return
59 
60 
61 
68  def __del__(self):
74  self.unsetHeartbeat()
75  del self._timer
76  return
77 
78 
79 
88  def init(self, rtobj, profile):
89  if not self._observer.setObject(profile.service):
90  # narrowing failed
91  return False
92 
93  self._rtobj = rtobj
94  self._profile = profile
96  OpenRTM_aist.NVUtil.copyToProperties(prop, profile.properties)
97  self.setHeartbeat(prop)
98  self.setListeners(prop)
99  return True
100 
101 
102 
110  def reinit(self, profile):
111  if not self._observer._ptr()._is_equivalent(profile.service):
112  tmp = OpenRTM_aist.CorbaConsumer(interfaceType=OpenRTM.ComponentObserver)
113  if not tmp.setObject(profile.service):
114  return False
115  self._observer.releaseObject()
116  self._observer.setObject(profile.service)
117 
118  self._profile= profile
119  prop = OpenRTM_aist.Properties()
120  OpenRTM_aist.NVUtil.copyToProperties(prop, profile.properties)
121  self.setHeartbeat(prop)
122  self.setListeners(prop)
123  return True
124 
125 
126 
134  def getProfile(self):
135  return self._profile
136 
137 
138 
146  def finalize(self):
152  self.unsetHeartbeat()
153  return
154 
155 
156 
164  def updateStatus(self, statuskind, msg):
165  try:
166  self._observer._ptr().update_status(statuskind, msg)
167  except:
168  self._rtobj.removeSdoServiceConsumer(self._profile.id)
169  return
170 
171 
179  def toString(self, kind):
180  kinds = ["COMPONENT_PROFILE",
181  "RTC_STATUS",
182  "EC_STATUS",
183  "PORT_PROFILE",
184  "CONFIGURATION",
185  "HEARTBEAT"]
186  if kind._v < OpenRTM.STATUS_KIND_NUM._v:
187  return kinds[kind._v]
188  return ""
189 
190 
191 
199  def setListeners(self, prop):
200  if not prop.getProperty("observed_status"):
201  prop.setProperty("observed_status", "ALL")
202 
203  observed_ = [s.strip() for s in prop.getProperty("observed_status").split(",")]
204  flags_ = [ False for i in range(OpenRTM.STATUS_KIND_NUM._v) ]
205 
206  for i in range(len(observed_)):
207  observed_[i] = observed_[i].upper()
208  if observed_[i] == "COMPONENT_PROFILE":
209  flags_[OpenRTM.COMPONENT_PROFILE._v] = True
210  elif observed_[i] == "RTC_STATUS":
211  flags_[OpenRTM.RTC_STATUS._v] = True
212  elif observed_[i] == "EC_STATUS":
213  flags_[OpenRTM.EC_STATUS._v] = True
214  elif observed_[i] == "PORT_PROFILE":
215  flags_[OpenRTM.PORT_PROFILE._v] = True
216  elif observed_[i] == "CONFIGURATION":
217  flags_[OpenRTM.CONFIGURATION._v] = True
218  elif observed_[i] == "ALL":
219  for j in range(OpenRTM.STATUS_KIND_NUM._v):
220  flags_[j] = True
221  break
222 
223  self.switchListeners(flags_[OpenRTM.COMPONENT_PROFILE._v],
224  self._observed,
225  OpenRTM.COMPONENT_PROFILE._v,
228 
229  self.switchListeners(flags_[OpenRTM.RTC_STATUS._v],
230  self._observed,
231  OpenRTM.RTC_STATUS._v,
234 
235  self.switchListeners(flags_[OpenRTM.EC_STATUS._v],
236  self._observed,
237  OpenRTM.EC_STATUS._v,
240 
241  self.switchListeners(flags_[OpenRTM.PORT_PROFILE._v],
242  self._observed,
243  OpenRTM.PORT_PROFILE._v,
246 
247  self.switchListeners(flags_[OpenRTM.CONFIGURATION._v],
248  self._observed,
249  OpenRTM.CONFIGURATION._v,
252 
253  return
254 
255 
256 
266  def switchListeners(self, next, pre, pre_idx, setfunc, unsetfunc):
267  if (not pre[pre_idx]) and next:
268  setfunc()
269  pre[pre_idx] = True
270  elif pre[pre_idx] and (not next):
271  unsetfunc()
272  pre[pre_idx] = False
273 
274  return
275 
276 
277  #============================================================
278  # Heartbeat related functions
279 
280 
288  def heartbeat(self):
289  self.updateStatus(OpenRTM.HEARTBEAT, "")
290  return
291 
292 
293 
301  def setHeartbeat(self, prop):
302  if OpenRTM_aist.toBool(prop.getProperty("heartbeat.enable"), "YES", "NO", False):
303  interval_ = prop.getProperty("heartbeat.interval")
304  if not interval_:
305  self._interval.set_time(1.0)
306  else:
307  tmp_ = float(interval_)
308  self._interval.set_time(tmp_)
309 
310  tm_ = self._interval
311  self._hblistenerid = self._timer.registerListenerObj(self,
312  ComponentObserverConsumer.heartbeat,
313  tm_)
314  if not self._heartbeat:
315  self._timer.start()
316  self._heartbeat = True
317 
318  else:
319  if self._heartbeat and self._hblistenerid:
320  self.unsetHeartbeat()
321 
322  return
323 
324 
325 
333  def unsetHeartbeat(self):
334  self._timer.unregisterListener(self._hblistenerid)
335  self._hblistenerid = 0
336  self._timer.stop()
337  self._heartbeat = False
338  return
339 
340 
341  #============================================================
342  # Component status related functions
343 
344 
354  if not self._compstat.activatedListener:
355  self._compstat.activatedListener = \
356  self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_ACTIVATED,
357  self._compstat.onActivated)
358  if not self._compstat.deactivatedListener:
359  self._compstat.deactivatedListener = \
360  self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_DEACTIVATED,
361  self._compstat.onDeactivated)
362 
363  if not self._compstat.resetListener:
364  self._compstat.resetListener = \
365  self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_RESET,
366  self._compstat.onReset)
367 
368  if not self._compstat.abortingListener:
369  self._compstat.abortingListener = \
370  self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_ABORTING,
371  self._compstat.onAborting)
372 
373  if not self._compstat.finalizeListener:
374  self._compstat.finalizeListener = \
375  self._rtobj.addPostComponentActionListener(postclistener_.POST_ON_FINALIZE,
376  self._compstat.onFinalize)
377 
378  return
379 
380 
381 
391  if self._compstat.activatedListener:
392  self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_ACTIVATED,
393  self._compstat.activatedListener)
394  self._compstat.activatedListener = None
395 
396  if self._compstat.deactivatedListener:
397  self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_DEACTIVATED,
398  self._compstat.deactivatedListener)
399  self._compstat.deactivatedListener = None
400 
401  if self._compstat.resetListener:
402  self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_RESET,
403  self._compstat.resetListener)
404  self._compstat.resetListener = None
405 
406  if self._compstat.abortingListener:
407  self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_ABORTING,
408  self._compstat.abortingListener)
409  self._compstat.abortingListener = None
410 
411  if self._compstat.finalizeListener:
412  self._rtobj.removePostComponentActionListener(postclistener_.POST_ON_FINALIZE,
413  self._compstat.finalizeListener)
414  self._compstat.finalizeListener = None
415 
416  return
417 
418 
419  #============================================================
420  # Port profile related functions
421 
422 
432  if not self._portaction.portAddListener:
433  self._portaction.portAddListener = \
434  self._rtobj.addPortActionListener(plistener_.ADD_PORT,
435  self._portaction.onAddPort)
436 
437  if not self._portaction.portRemoveListener:
438  self._portaction.portRemoveListener = \
439  self._rtobj.addPortActionListener(plistener_.REMOVE_PORT,
440  self._portaction.onRemovePort)
441 
443  if not self._portaction.portConnectListener:
444  self._portaction.portConnectListener = \
445  self._rtobj.addPortConnectRetListener(pclistener_.ON_CONNECTED,
446  self._portaction.onConnect)
447 
448  if not self._portaction.portDisconnectListener:
449  self._portaction.portDisconnectListener = \
450  self._rtobj.addPortConnectRetListener(pclistener_.ON_DISCONNECTED,
451  self._portaction.onDisconnect)
452 
453  return
454 
455 
465  if self._portaction.portAddListener:
466  self._rtobj.removePortActionListener(plistener_.ADD_PORT,
467  self._portaction.portAddListener)
468  self._portaction.portAddListener = None
469 
470  if self._portaction.portRemoveListener:
471  self._rtobj.removePortActionListener(plistener_.REMOVE_PORT,
472  self._portaction.portRemoveListener)
473  self._portaction.portRemoveListener = None
474 
476  if self._portaction.portConnectListener:
477  self._rtobj.removePortConnectRetListener(pclistener_.ON_CONNECTED,
478  self._portaction.portConnectListener)
479  self._portaction.portConnectListener = None
480 
481  if self._portaction.portDisconnectListener:
482  self._rtobj.removePortConnectRetListener(pclistener_.ON_DISCONNECTED,
483  self._portaction.portDisconnectListener)
484  self._portaction.portDisconnectListener = None
485 
486  return
487 
488 
489  #============================================================
490  # EC profile related functions
491 
492 
502  if not self._ecaction.ecAttached:
503  self._ecaction.ecAttached = \
504  self._rtobj.addExecutionContextActionListener(ectype_.EC_ATTACHED,
505  self._ecaction.onAttached)
506 
507  if not self._ecaction.ecDetached:
508  self._ecaction.ecDetached = \
509  self._rtobj.addExecutionContextActionListener(ectype_.EC_DETACHED,
510  self._ecaction.onDetached)
511 
513  if not self._ecaction.ecRatechanged:
514  self._ecaction.ecRatechanged = \
515  self._rtobj.addPostComponentActionListener(pcaltype_.POST_ON_RATE_CHANGED,
516  self._ecaction.onRateChanged)
517 
518  if not self._ecaction.ecStartup:
519  self._ecaction.ecStartup = \
520  self._rtobj.addPostComponentActionListener(pcaltype_.POST_ON_STARTUP,
521  self._ecaction.onStartup)
522 
523  if not self._ecaction.ecShutdown:
524  self._ecaction.ecShutdown = \
525  self._rtobj.addPostComponentActionListener(pcaltype_.POST_ON_SHUTDOWN,
526  self._ecaction.onShutdown)
527 
528  return
529 
530 
531 
541  if self._ecaction.ecAttached:
542  self._rtobj.removeExecutionContextActionListener(ectype_.EC_ATTACHED,
543  self._ecaction.ecAttached)
544 
545  if self._ecaction.ecDetached:
546  self._rtobj.removeExecutionContextActionListener(ectype_.EC_ATTACHED,
547  self._ecaction.ecDetached)
548 
550  if self._ecaction.ecRatechanged:
551  self._rtobj.removePostComponentActionListener(pcaltype_.POST_ON_RATE_CHANGED,
552  self._ecaction.ecRatechanged)
553 
554  if self._ecaction.ecStartup:
555  self._rtobj.removePostComponentActionListener(pcaltype_.POST_ON_STARTUP,
556  self._ecaction.ecStartup)
557 
558  if self._ecaction.ecShutdown:
559  self._rtobj.removePostComponentActionListener(pcaltype_.POST_ON_SHUTDOWN,
560  self._ecaction.ecShutdown)
561 
562  return
563 
564 
565  #============================================================
566  # ComponentProfile related functions
567 
568 
577  pass
578 
579 
580 
589  pass
590 
591 
592  #============================================================
593  # Configuration related functions
594 
595 
604  confprmlistenertype_ = OpenRTM_aist.ConfigurationParamListenerType
605  self._configMsg.updateConfigParamListener = \
606  self._rtobj.addConfigurationParamListener(confprmlistenertype_.ON_UPDATE_CONFIG_PARAM,
607  self._configMsg.updateConfigParam)
608 
609  confsetlistenertype_ = OpenRTM_aist.ConfigurationSetListenerType
610  self._configMsg.setConfigSetListener = \
611  self._rtobj.addConfigurationSetListener(confsetlistenertype_.ON_SET_CONFIG_SET,
612  self._configMsg.setConfigSet)
613 
614  self._configMsg.addConfigSetListener = \
615  self._rtobj.addConfigurationSetListener(confsetlistenertype_.ON_ADD_CONFIG_SET,
616  self._configMsg.addConfigSet)
617 
618  confsetnamelistenertype_ = OpenRTM_aist.ConfigurationSetNameListenerType
619  self._configMsg.updateConfigSetListener = \
620  self._rtobj.addConfigurationSetNameListener(confsetnamelistenertype_.ON_UPDATE_CONFIG_SET,
621  self._configMsg.updateConfigSet)
622 
623  self._configMsg.removeConfigSetListener = \
624  self._rtobj.addConfigurationSetNameListener(confsetnamelistenertype_.ON_REMOVE_CONFIG_SET,
625  self._configMsg.removeConfigSet)
626  self._configMsg.activateConfigSetListener = \
627  self._rtobj.addConfigurationSetNameListener(confsetnamelistenertype_.ON_ACTIVATE_CONFIG_SET,
628  self._configMsg.activateConfigSet)
629  return
630 
631 
632 
641  confprmlistenertype_ = OpenRTM_aist.ConfigurationParamListenerType
642  if self._configMsg.updateConfigParamListener:
643  self._rtobj.removeConfigurationParamListener(confprmlistenertype_.ON_UPDATE_CONFIG_PARAM,
644  self._configMsg.updateConfigParamListener)
645  self._configMsg.updateConfigParamListener = None
646 
647  confsetlistenertype_ = OpenRTM_aist.ConfigurationSetListenerType
648  if self._configMsg.setConfigSetListener:
649  self._rtobj.removeConfigurationSetListener(confsetlistenertype_.ON_SET_CONFIG_SET,
650  self._configMsg.setConfigSetListener)
651  self._configMsg.setConfigSetListener = None
652 
653  if self._configMsg.addConfigSetListener:
654  self._rtobj.removeConfigurationSetListener(confsetlistenertype_.ON_ADD_CONFIG_SET,
655  self._configMsg.addConfigSetListener)
656  self._configMsg.addConfigSetListener = None
657 
658  confsetnamelistenertype_ = OpenRTM_aist.ConfigurationSetNameListenerType
659  if self._configMsg.updateConfigSetListener:
660  self._rtobj.removeConfigurationSetNameListener(confsetnamelistenertype_.ON_UPDATE_CONFIG_SET,
661  self._configMsg.updateConfigSetListener)
662  self._configMsg.updateConfigSetListener = None
663 
664  if self._configMsg.removeConfigSetListener:
665  self._rtobj.removeConfigurationSetNameListener(confsetnamelistenertype_.ON_REMOVE_CONFIG_SET,
666  self._configMsg.removeConfigSetListener)
667  self._configMsg.removeConfigSetListener = None
668 
669  if self._configMsg.activateConfigSetListener:
670  self._rtobj.removeConfigurationSetNameListener(confsetnamelistenertype_.ON_ACTIVATE_CONFIG_SET,
671  self._configMsg.activateConfigSetListener)
672  self._configMsg.activateConfigSetListener = None
673 
674  return
675 
676 
677 
684  class CompStatMsg:
685  """
686  """
687 
688  #CompStatMsg(ComponentObserverConsumer& coc)
689  def __init__(self, coc):
690  self.activatedListener = None
692  self.resetListener = None
693  self.abortingListener = None
694  self.finalizeListener = None
695  self._coc = coc
696  return
697 
698  def __del__(self):
699  del self._coc
700  return
701 
702  #void onGeneric(const char* msgprefix, UniqueId ec_id, ReturnCode_t ret)
703  def onGeneric(self, msgprefix, ec_id, ret):
704  if ret == RTC.RTC_OK:
705  msg_ = msgprefix
706  msg_ += str(ec_id)
707  self._coc.updateStatus(OpenRTM.RTC_STATUS, msg_)
708  return
709 
710  #void onActivated(UniqueId ec_id, ReturnCode_t ret)
711  def onActivated(self, ec_id, ret):
712  self.onGeneric("ACTIVE:", ec_id, ret)
713  return
714 
715  #void onDeactivated(UniqueId ec_id, ReturnCode_t ret)
716  def onDeactivated(self, ec_id, ret):
717  self.onGeneric("INACTIVE:", ec_id, ret)
718  return
719 
720  #void onReset(UniqueId ec_id, ReturnCode_t ret)
721  def onReset(self, ec_id, ret):
722  self.onGeneric("INACTIVE:", ec_id, ret)
723  return
724 
725  #void onAborting(UniqueId ec_id, ReturnCode_t ret)
726  def onAborting(self, ec_id, ret):
727  self.onGeneric("ERROR:", ec_id, ret)
728  return
729 
730  #void onFinalize(UniqueId ec_id, ReturnCode_t ret)
731  def onFinalize(self, ec_id, ret):
732  self.onGeneric("FINALIZE:", ec_id, ret)
733  return
734 
735 
742  class PortAction:
743  """
744  """
745 
746  #PortAction(ComponentObserverConsumer& coc)
747  def __init__(self, coc):
748  self.portAddListener = None
749  self.portRemoveListener = None
752  self._coc = coc
753  return
754 
755  def __del__(self):
756  del self._coc
757  return
758 
759  #void onGeneric(const char* _msg, const char* portname)
760  def onGeneric(self, _msg, portname):
761  msg_ = _msg
762  msg_ += portname
763  self._coc.updateStatus(OpenRTM.PORT_PROFILE, msg_)
764  return
765 
766  #void onAddPort(const ::RTC::PortProfile& pprof)
767  def onAddPort(self, pprof):
768  self.onGeneric("ADD:", str(pprof.name))
769  return
770 
771  #void onRemovePort(const ::RTC::PortProfile& pprof)
772  def onRemovePort(self, pprof):
773  self.onGeneric("REMOVE:", str(pprof.name))
774  return
775 
776  #void onConnect(const char* portname,
777  # ::RTC::ConnectorProfile& pprof, ReturnCode_t ret)
778  def onConnect(self, portname, pprof, ret):
779  if ret == RTC.RTC_OK:
780  self.onGeneric("CONNECT:", portname)
781  return
782 
783  #void onDisconnect(const char* portname,
784  # ::RTC::ConnectorProfile& pprof, ReturnCode_t ret)
785  def onDisconnect(self, portname, pprof, ret):
786  if ret == RTC.RTC_OK:
787  self.onGeneric("DISCONNECT:", portname)
788  return
789 
790 
791 
798  class ECAction:
799  """
800  """
801 
802  #ECAction(ComponentObserverConsumer& coc)
803  def __init__(self, coc):
804  self.ecAttached = None
805  self.ecDetached = None
806  self.ecRatechanged = None
807  self.ecStartup = None
808  self.ecShutdown = None
809  self._coc = coc
810  return
811 
812  def __del__(self):
813  del self._coc
814  return
815 
816  #void onGeneric(const char* _msg, UniqueId ec_id)
817  def onGeneric(self, _msg, ec_id):
818  msg_ = _msg + str(ec_id)
819  self._coc.updateStatus(OpenRTM.EC_STATUS, msg_)
820  return
821 
822  #void onAttached(UniqueId ec_id)
823  def onAttached(self, ec_id):
824  self.onGeneric("ATTACHED:", ec_id)
825  return
826 
827  #void onDetached(UniqueId ec_id)
828  def onDetached(self, ec_id):
829  self.onGeneric("DETACHED:", ec_id)
830  return
831 
832  #void onRateChanged(UniqueId ec_id, ReturnCode_t ret)
833  def onRateChanged(self, ec_id, ret):
834  if ret == RTC.RTC_OK:
835  self.onGeneric("RATE_CHANGED:", ec_id)
836  return
837 
838  #void onStartup(UniqueId ec_id, ReturnCode_t ret)
839  def onStartup(self, ec_id, ret):
840  if ret == RTC.RTC_OK:
841  self.onGeneric("STARTUP:", ec_id)
842  return
843 
844  #void onShutdown(UniqueId ec_id, ReturnCode_t ret)
845  def onShutdown(self, ec_id, ret):
846  if ret == RTC.RTC_OK:
847  self.onGeneric("SHUTDOWN:", ec_id)
848  return
849 
850 
851 
859  """
860  """
861 
862  #ConfigAction(ComponentObserverConsumer& coc)
863  def __init__(self, coc):
870  self._coc = coc
871 
872  def __del__(self):
873  del self._coc
874  return
875 
876  #void updateConfigParam(const char* configsetname,
877  # const char* configparamname)
878  def updateConfigParam(self, configsetname, configparamname):
879  msg_ = "UPDATE_CONFIG_PARAM: "
880  msg_ += configsetname
881  msg_ += "."
882  msg_ += configparamname
883  self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_)
884  return
885 
886  #void setConfigSet(const coil::Properties& config_set)
887  def setConfigSet(self, config_set):
888  msg_ = "SET_CONFIG_SET: "
889  msg_ += config_set.getName()
890  self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_)
891  return
892 
893  #void addConfigSet(const coil::Properties& config_set)
894  def addConfigSet(self, config_set):
895  msg_ = "ADD_CONFIG_SET: "
896  msg_ += config_set.getName()
897  self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_)
898  return
899 
900  #void updateConfigSet(const char* config_set_name)
901  def updateConfigSet(self, config_set_name):
902  msg_ = "UPDATE_CONFIG_SET: "
903  msg_ += config_set_name
904  self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_)
905  return
906 
907  #void removeConfigSet(const char* config_set_name)
908  def removeConfigSet(self, config_set_name):
909  msg_ = "REMOVE_CONFIG_SET: "
910  msg_ += config_set_name
911  self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_)
912  return
913 
914  #void activateConfigSet(const char* config_set_name)
915  def activateConfigSet(self, config_set_name):
916  msg_ = "ACTIVATE_CONFIG_SET: "
917  msg_ += config_set_name
918  self._coc.updateStatus(OpenRTM.CONFIGURATION, msg_)
919  return
920 
922  factory = OpenRTM_aist.SdoServiceConsumerFactory.instance()
923  factory.addFactory(OpenRTM.ComponentObserver._NP_RepositoryId,
924  ComponentObserverConsumer,
925  OpenRTM_aist.Delete)
926  return
def reinit(self, profile)
Re-initializationvirtual bool reinit(const SDOPackage::ServiceProfile& profile);. ...
def unsetPortProfileListeners(self)
Unsetting port profile listenervoid unsetPortProfileListeners();.
def split(input, delimiter)
Split string by delimiter.
Definition: StringUtil.py:323
def updateStatus(self, statuskind, msg)
Calling remote objectinline void updateStatus(OpenRTM::StatusKind statuskind, const char* msg) ...
def copyToProperties(prop, nvlist)
Copy to Proeprties from NVList.
Definition: NVUtil.py:118
def toString(self, kind)
Converting kind to stringinline const char* toString(OpenRTM::StatusKind kind)
The Properties class represents a persistent set of properties.
Definition: Properties.py:83
def init(self, rtobj, profile)
Initializationvirtual bool init(RTObject_impl& rtobj, const SDOPackage::ServiceProfile& profile);...
def setListeners(self, prop)
Connectiong listeners to RTObjectvoid setListeners(coil::Properties& prop);.
def switchListeners(self, next, pre, pre_idx, setfunc, unsetfunc)
Switching listeners connecting/disconnectingvoid switchListeners(bool& next, bool& pre...
def unsetConfigurationListeners(self)
Unsetting Configurationlistenervoid unsetConfigurationListeners();.
def setHeartbeat(self, prop)
Setting heartbeatvoid setHeartbeat(coil::Properties& prop);.
Timer class.
Definition: Timer.py:44
def heartbeat(self)
Sending a heartbeart signal to observervoid heartbeat();.
def setComponentStatusListeners(self)
Setting RTC status listenersvoid setComponentStatusListeners();.
def setComponentProfileListeners(self)
Setting ComponentProfile listenervoid setComponentProfileListeners();.
def unsetComponentStatusListeners(self)
Unsetting RTC status listenersvoid unsetComponentStatusListeners();.
def unsetComponentProfileListeners(self)
Unsetting ComponentProfile listenervoid unsetComponentProfileListeners();.
def setPortProfileListeners(self)
Setting port profile listenervoid setPortProfileListeners();.
def unsetExecutionContextListeners(self)
Unsetting EC status listenervoid unsetExecutionContextListeners();.
def setConfigurationListeners(self)
Setting Configuration listenervoid setConfigurationListeners();.
def setExecutionContextListeners(self)
Setting EC status listenervoid setExecutionContextListeners();.
def getProfile(self)
getting ServiceProfilevirtual const SDOPackage::ServiceProfile& getProfile() const; ...


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Jun 6 2019 19:11:34