RTObject.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: euc-jp -*-
3 
4 
16 
17 
18 
19 import string
20 import sys
21 import copy
22 
23 from omniORB import any
24 from omniORB import CORBA
25 
26 import OpenRTM__POA
27 import RTC
28 import SDOPackage
29 import OpenRTM_aist
30 
31 ECOTHER_OFFSET = 1000
32 
33 default_conf = [
34  "implementation_id","",
35  "type_name", "",
36  "description", "",
37  "version", "",
38  "vendor", "",
39  "category", "",
40  "activity_type", "",
41  "max_instance", "",
42  "language", "",
43  "lang_type", "",
44  "conf", "",
45  "" ]
46 
47 
48 
49 
68 class RTObject_impl(OpenRTM__POA.DataFlowComponent):
69  """
70  """
71 
72 
91  def __init__(self, manager=None, orb=None, poa=None):
92  if manager:
93  self._manager = manager
94  self._orb = self._manager.getORB()
95  self._poa = self._manager.getPOA()
96  self._portAdmin = OpenRTM_aist.PortAdmin(self._manager.getORB(),self._manager.getPOA())
97  else:
98  self._manager = None
99  self._orb = orb
100  self._poa = poa
101  self._portAdmin = OpenRTM_aist.PortAdmin(self._orb,self._poa)
102 
103  if self._manager:
104  self._rtcout = self._manager.getLogbuf("rtobject")
105  else:
106  self._rtcout = OpenRTM_aist.Manager.instance().getLogbuf("rtobject")
107 
108  self._created = True
109  self._properties = OpenRTM_aist.Properties(defaults_str=default_conf)
110  self._configsets = OpenRTM_aist.ConfigAdmin(self._properties.getNode("conf"))
111  self._profile = RTC.ComponentProfile("","","","","","",[],None,[])
112 
116  self._execContexts = []
117  self._objref = self._this()
118  self._sdoOwnedOrganizations = [] #SDOPackage.OrganizationList()
119  self._sdoSvcProfiles = [] #SDOPackage.ServiceProfileList()
120  self._sdoOrganizations = [] #SDOPackage.OrganizationList()
121  self._sdoStatus = [] #SDOPackage.NVList()
122  self._ecMine = []
123  self._ecOther = []
124  self._eclist = []
125  self._exiting = False
126  self._readAll = False
127  self._writeAll = False
128  self._readAllCompletion = False
129  self._writeAllCompletion = False
130  self._inports = []
131  self._outports = []
134  return
135 
136 
137 
149  def __del__(self):
150  return
151 
152 
153  #============================================================
154  # Overridden functions
155  #============================================================
156 
157 
175  def onInitialize(self):
176  self._rtcout.RTC_TRACE("onInitialize()")
177  return RTC.RTC_OK
178 
179 
180 
198  def onFinalize(self):
199  self._rtcout.RTC_TRACE("onFinalize()")
200  return RTC.RTC_OK
201 
202 
203 
222  def onStartup(self, ec_id):
223  self._rtcout.RTC_TRACE("onStartup(%d)",ec_id)
224  return RTC.RTC_OK
225 
226 
227 
246  def onShutdown(self, ec_id):
247  self._rtcout.RTC_TRACE("onShutdown(%d)",ec_id)
248  return RTC.RTC_OK
249 
250 
251 
270  def onActivated(self, ec_id):
271  self._rtcout.RTC_TRACE("onActivated(%d)",ec_id)
272  return RTC.RTC_OK
273 
274 
275 
294  def onDeactivated(self, ec_id):
295  self._rtcout.RTC_TRACE("onDeactivated(%d)",ec_id)
296  return RTC.RTC_OK
297 
298 
299 
320  def onExecute(self, ec_id):
321  self._rtcout.RTC_TRACE("onExecute(%d)",ec_id)
322  return RTC.RTC_OK
323 
324 
325 
344  def onAborting(self, ec_id):
345  self._rtcout.RTC_TRACE("onAborting(%d)",ec_id)
346  return RTC.RTC_OK
347 
348 
349 
367  def onError(self, ec_id):
368  self._rtcout.RTC_TRACE("onError(%d)",ec_id)
369  return RTC.RTC_OK
370 
371 
372 
390  def onReset(self, ec_id):
391  self._rtcout.RTC_TRACE("onReset(%d)",ec_id)
392  return RTC.RTC_OK
393 
394 
395 
416  def onStateUpdate(self, ec_id):
417  self._rtcout.RTC_TRACE("onStateupdate(%d)",ec_id)
418  return RTC.RTC_OK
419 
420 
421 
442  def onRateChanged(self, ec_id):
443  self._rtcout.RTC_TRACE("onRatechanged(%d)",ec_id)
444  return RTC.RTC_OK
445 
446 
447  #============================================================
448  # RTC::LightweightRTObject
449  #============================================================
450 
451 
487  def initialize(self):
488  self._rtcout.RTC_TRACE("initialize()")
489 
490  ec_args = self._properties.getProperty("exec_cxt.periodic.type")
491  ec_args += "?"
492  ec_args += "rate="
493  ec_args += self._properties.getProperty("exec_cxt.periodic.rate")
494 
495  ec = OpenRTM_aist.Manager.instance().createContext(ec_args)
496  if ec is None:
497  return RTC.RTC_ERROR
498 
499  ec.set_rate(float(self._properties.getProperty("exec_cxt.periodic.rate")))
500  self._eclist.append(ec)
501  ecv = ec.getObjRef()
502  if CORBA.is_nil(ecv):
503  return RTC.RTC_ERROR
504 
505  ec.bindComponent(self)
506 
507  # at least one EC must be attached
508  if len(self._ecMine) == 0:
509  return RTC.PRECONDITION_NOT_MET
510 
511  ret = self.on_initialize()
512  if ret is not RTC.RTC_OK:
513  return ret
514  self._created = False
515 
516  # -- entering alive state --
517  for i in range(len(self._ecMine)):
518  self._rtcout.RTC_DEBUG("EC[%d] starting.", i)
519  self._ecMine[i].start()
520 
521  # ret must be RTC_OK
522  return ret
523 
524 
525 
570  def finalize(self):
571  self._rtcout.RTC_TRACE("finalize()")
572  if self._created or not self._exiting:
573  return RTC.PRECONDITION_NOT_MET
574 
575  # Return RTC::PRECONDITION_NOT_MET,
576  # When the component is registered in ExecutionContext.
577  if len(self._ecOther) != 0:
578  for ec in self._ecOther:
579  if not CORBA.is_nil(ec):
580  return RTC.PRECONDITION_NOT_MET
581 
582  self._ecOther = []
583 
584  ret = self.on_finalize()
585  self.shutdown()
586  return ret
587 
588 
589 
633  def exit(self):
634  self._rtcout.RTC_TRACE("exit()")
635  if self._created:
636  return RTC.PRECONDITION_NOT_MET
637 
638  # deactivate myself on owned EC
640  self.deactivate_comps(self._objref))
641  # deactivate myself on other EC
643  self.deactivate_comps(self._objref))
644 
645  # stop and detach myself from owned EC
646  for ec in self._ecMine:
647  if not CORBA.is_nil(ec) or not ec._non_existent():
648  # ret = ec.stop()
649  # ec.remove_component(self._this())
650  pass
651 
652  # detach myself from other EC
653  for ec in self._ecOther:
654  if not CORBA.is_nil(ec):
655  # ec.stop()
656  ec.remove_component(self._this())
657 
658  self._exiting = True
659  return self.finalize()
660 
661 
662 
698  def is_alive(self, exec_context):
699  self._rtcout.RTC_TRACE("is_alive()")
700  for ec in self._ecMine:
701  if exec_context._is_equivalent(ec):
702  return True
703 
704  for ec in self._ecOther:
705  if not CORBA.is_nil(ec):
706  if exec_context._is_equivalent(ec):
707  return True
708 
709  return False
710 
711 
712 
734 
735 
736 
764  def get_context(self, ec_id):
765  global ECOTHER_OFFSET
766 
767  self._rtcout.RTC_TRACE("get_context(%d)", ec_id)
768  # owned EC
769  if ec_id < ECOTHER_OFFSET:
770  if ec_id < len(self._ecMine):
771  return self._ecMine[ec_id]
772  else:
773  return RTC.ExecutionContext._nil
774 
775  # participating EC
776  index = ec_id - ECOTHER_OFFSET
777 
778  if index < len(self._ecOther):
779  if not CORBA.is_nil(self._ecOther[index]):
780  return self._ecOther[index]
781 
782  return RTC.ExecutionContext._nil
783 
784 
785 
804  self._rtcout.RTC_TRACE("get_owned_contexts()")
805  execlist = []
807  return execlist
808 
809 
828  self._rtcout.RTC_TRACE("get_participating_contexts()")
829  execlist = []
831  return execlist
832 
833 
834  #
835  # @if jp
836  # @brief [CORBA interface] ExecutionContext ¤Î¥Ï¥ó¥É¥ë¤òÊÖ¤¹
837  #
838  # @param ExecutionContext ¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È # # @return ExecutionContextHandle # # Í¿¤¨¤é¤ì¤¿¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Ï¥ó¥É¥ë¤òÊÖ¤¹¡£ # # @else # @brief [CORBA interface] Return a handle of a ExecutionContext # # @param ExecutionContext # # @return ExecutionContextHandle # # This operation returns a handle that is associated with the given # execution context. # # @endif # # virtual ExecutionContextHandle_t # get_context_handle(ExecutionContext_ptr cxt) def get_context_handle(self, cxt): self._rtcout.RTC_TRACE("get_context_handle()") num = OpenRTM_aist.CORBA_SeqUtil.find(self._ecMine, self.ec_find(cxt)) if num != -1: return int(num) num = OpenRTM_aist.CORBA_SeqUtil.find(self._ecOther, self.ec_find(cxt)) if num != -1: return int(num) return int(-1) #============================================================ # RTC::RTObject #============================================================ ## # @if jp # # @brief [RTObject CORBA interface] ¥³¥ó¥Ý¡¼¥Í¥ó¥È¥×¥í¥Õ¥¡¥¤¥ë¤ò¼èÆÀ¤¹¤ë # # Åö³º¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î¥×¥í¥Õ¥¡¥¤¥ë¾ðÊó¤òÊÖ¤¹¡£ # # @param self # # @return ¥³¥ó¥Ý¡¼¥Í¥ó¥È¥×¥í¥Õ¥¡¥¤¥ë # # @else # # @brief [RTObject CORBA interface] Get RTC's profile # # This operation returns the ComponentProfile of the RTC # # @return ComponentProfile # # @endif # virtual ComponentProfile* get_component_profile() def get_component_profile(self): self._rtcout.RTC_TRACE("get_component_profile()") try: prop_ = RTC.ComponentProfile(self._properties.getProperty("instance_name"), self._properties.getProperty("type_name"), self._properties.getProperty("description"), self._properties.getProperty("version"), self._properties.getProperty("vendor"), self._properties.getProperty("category"), self._portAdmin.getPortProfileList(), self._profile.parent, self._profile.properties) OpenRTM_aist.NVUtil.copyFromProperties(self._profile.properties, self._properties) return prop_ # return RTC.ComponentProfile(self._profile.instance_name, # self._profile.type_name, # self._profile.description, # self._profile.version, # self._profile.vendor, # self._profile.category, # self._portAdmin.getPortProfileList(), # self._profile.parent, # self._profile.properties) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) assert(False) return None ## # @if jp # # @brief [RTObject CORBA interface] ¥Ý¡¼¥È¤ò¼èÆÀ¤¹¤ë # # Åö³º¥³¥ó¥Ý¡¼¥Í¥ó¥È¤¬ÊÝÍ­¤¹¤ë¥Ý¡¼¥È¤Î»²¾È¤òÊÖ¤¹¡£ # # @param self # # @return ¥Ý¡¼¥È¥ê¥¹¥È # # @else # # @brief [RTObject CORBA interface] Get Ports # # This operation returns a list of the RTCs ports. # # @return PortList # # @endif # virtual PortServiceList* get_ports() def get_ports(self): self._rtcout.RTC_TRACE("get_ports()") try: return self._portAdmin.getPortServiceList() except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) assert(False) return [] # RTC::ComponentAction ## # @if jp # @brief [CORBA interface] ExecutionContext¤òattach¤¹¤ë # # »ØÄꤷ¤¿ ExecutionContext ¤Ë¤³¤Î RTC ¤ò½ê°¤µ¤»¤ë¡£¤³¤Î RTC ¤È´ØÏ¢¤¹¤ë # ExecutionContext ¤Î¥Ï¥ó¥É¥ë¤òÊÖ¤¹¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï¡¢ExecutionContextOperations::add_component ¤¬¸Æ¤Ð¤ì¤¿ # ºÝ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ÊÖ¤µ¤ì¤¿¥Ï¥ó¥É¥ë¤Ï¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ç»ÈÍѤ¹¤ë¤³¤È¤òÁÛÄê # ¤·¤Æ¤¤¤Ê¤¤¡£ # # @param self # @param exec_context ½ê°Àè ExecutionContext # # @return ExecutionContext ¥Ï¥ó¥É¥ë # # @else # @brief [CORBA interface] Attach ExecutionContext. # # Inform this RTC that it is participating in the given execution context. # Return a handle that represents the association of this RTC with the # context. # This operation is intended to be invoked by # ExecutionContextOperations::add_component. It is not intended for use by # other clients. # # @param exec_context Prticipating ExecutionContext # # @return ExecutionContext Handle # # @endif # UniqueId attach_context(ExecutionContext_ptr exec_context) def attach_context(self, exec_context): global ECOTHER_OFFSET self._rtcout.RTC_TRACE("attach_context()") # ID: 0 - (offset-1) : owned ec # ID: offset - : participating ec # owned ec index = ID # participate ec index = ID - offset ecs = exec_context._narrow(RTC.ExecutionContextService) if CORBA.is_nil(ecs): return -1 # if m_ecOther has nil element, insert attached ec to there. for i in range(len(self._ecOther)): if CORBA.is_nil(self._ecOther[i]): self._ecOther[i] = ecs ec_id = i + ECOTHER_OFFSET self.onAttachExecutionContext(ec_id) return ec_id # no space in the list, push back ec to the last. OpenRTM_aist.CORBA_SeqUtil.push_back(self._ecOther,ecs) ec_id = int(len(self._ecOther) - 1 + ECOTHER_OFFSET) self.onAttachExecutionContext(ec_id) return ec_id # UniqueId bindContext(ExecutionContext_ptr exec_context); def bindContext(self, exec_context): global ECOTHER_OFFSET self._rtcout.RTC_TRACE("bindContext()") # ID: 0 - (offset-1) : owned ec # ID: offset - : participating ec # owned ec index = ID # participate ec index = ID - offset ecs = exec_context._narrow(RTC.ExecutionContextService) if CORBA.is_nil(ecs): return -1 # if m_ecMine has nil element, insert attached ec to there. for i in range(len(self._ecMine)): if CORBA.is_nil(self._ecMine[i]): self._ecMine[i] = ecs self.onAttachExecutionContext(i) return i #return i + ECOTHER_OFFSET # no space in the list, push back ec to the last. OpenRTM_aist.CORBA_SeqUtil.push_back(self._ecMine,ecs) return int(len(self._ecMine) - 1) #return long(len(self._ecMine) - 1 + ECOTHER_OFFSET) ## # @if jp # @brief [CORBA interface] ExecutionContext¤òdetach¤¹¤ë # # »ØÄꤷ¤¿ ExecutionContext ¤«¤é¤³¤Î RTC ¤Î½ê°¤ò²ò½ü¤¹¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï¡¢ExecutionContextOperations::remove_component ¤¬¸Æ¤Ð # ¤ì¤¿ºÝ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ÊÖ¤µ¤ì¤¿¥Ï¥ó¥É¥ë¤Ï¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ç»ÈÍѤ¹¤ë¤³¤È¤ò # ÁÛÄꤷ¤Æ¤¤¤Ê¤¤¡£ # # À©Ìó # - »ØÄꤵ¤ì¤¿ ExecutionContext ¤Ë RTC ¤¬¤¹¤Ç¤Ë½ê°¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ # ReturnCode_t::PRECONDITION_NOT_MET ¤¬ÊÖ¤µ¤ì¤ë¡£ # - »ØÄꤵ¤ì¤¿ ExecutionContext ¤Ë¤¿¤·¤¤¤ÆÂФ·¤Æ RTC ¤¬Active ¾õÂ֤Ǥ¢¤ë¾ì # ¹ç¤Ë¤Ï¡¢ ReturnCode_t::PRECONDITION_NOT_MET ¤¬ÊÖ¤µ¤ì¤ë¡£ # # @param self # @param ec_id ²ò½üÂÐ¾Ý ExecutionContext¥Ï¥ó¥É¥ë # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # @brief [CORBA interface] Attach ExecutionContext. # # Inform this RTC that it is no longer participating in the given execution # context. # This operation is intended to be invoked by # ExecutionContextOperations::remove_component. It is not intended for use # by other clients. # Constraints # - This operation may not be invoked if this RTC is not already # participating in the execution context. Such a call shall fail with # ReturnCode_t::PRECONDITION_NOT_MET. # - This operation may not be invoked if this RTC is Active in the indicated # execution context. Otherwise, it shall fail with # ReturnCode_t::PRECONDITION_NOT_MET. # # @param ec_id Dettaching ExecutionContext Handle # # @return # # @endif # ReturnCode_t detach_context(UniqueId exec_handle) def detach_context(self, ec_id): global ECOTHER_OFFSET self._rtcout.RTC_TRACE("detach_context(%d)", ec_id) len_ = len(self._ecOther) # ID: 0 - (offset-1) : owned ec # ID: offset - : participating ec # owned ec index = ID # participate ec index = ID - offset if (int(ec_id) < int(ECOTHER_OFFSET)) or \ (int(ec_id - ECOTHER_OFFSET) > len_): return RTC.BAD_PARAMETER index = int(ec_id - ECOTHER_OFFSET) if index < 0 or CORBA.is_nil(self._ecOther[index]): return RTC.BAD_PARAMETER #OpenRTM_aist.CORBA_SeqUtil.erase(self._ecOther, index) self._ecOther[index] = RTC.ExecutionContextService._nil self.onDetachExecutionContext(ec_id) return RTC.RTC_OK ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤Î½é´ü²½ # # RTC ¤¬½é´ü²½¤µ¤ì¡¢Alive ¾õÂÖ¤ËÁ«°Ü¤¹¤ë¡£ # RTC ¸ÇÍ­¤Î½é´ü²½½èÍý¤Ï¤³¤³¤Ç¼Â¹Ô¤¹¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onInitialize() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # @param self # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] Initialize RTC # # The RTC has been initialized and entered the Alive state. # Any RTC-specific initialization logic should be performed here. # # @return # # @endif def on_initialize(self): self._rtcout.RTC_TRACE("on_initialize()") ret = RTC.RTC_ERROR try: self.preOnInitialize(0) ret = self.onInitialize() except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR active_set = self._properties.getProperty("configuration.active_config", "default") if self._configsets.haveConfig(active_set): self._configsets.update(active_set) else: self._configsets.update("default") self.postOnInitialize(0,ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤Î½ªÎ» # # RTC ¤¬ÇË´þ¤µ¤ì¤ë¡£ # RTC ¸ÇÍ­¤Î½ªÎ»½èÍý¤Ï¤³¤³¤Ç¼Â¹Ô¤¹¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onFinalize() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # @param self # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] Finalize RTC # # The RTC is being destroyed. # Any final RTC-specific tear-down logic should be performed here. # # @return # # @endif def on_finalize(self): self._rtcout.RTC_TRACE("on_finalize()") ret = RTC.RTC_ERROR try: self.preOnFinalize(0) ret = self.onFinalize() except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnFinalize(0, ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤Î³«»Ï # # RTC ¤¬½ê°¤¹¤ë ExecutionContext ¤¬ Stopped ¾õÂÖ¤«¤é Running ¾õÂÖ¤ØÁ«°Ü # ¤·¤¿¾ì¹ç¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onStartup() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # @param self # @param ec_id ¾õÂÖÁ«°Ü¤·¤¿ ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] StartUp RTC # # The given execution context, in which the RTC is participating, has # transitioned from Stopped to Running. # # @param ec_id # # @return # # @endif def on_startup(self, ec_id): self._rtcout.RTC_TRACE("on_startup(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnStartup(ec_id) ret = self.onStartup(ec_id) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnStartup(ec_id, ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤ÎÄä»ß # # RTC ¤¬½ê°¤¹¤ë ExecutionContext ¤¬ Running ¾õÂÖ¤«¤é Stopped ¾õÂÖ¤ØÁ«°Ü # ¤·¤¿¾ì¹ç¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onShutdown() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # @param self # @param ec_id ¾õÂÖÁ«°Ü¤·¤¿ ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] ShutDown RTC # # The given execution context, in which the RTC is participating, has # transitioned from Running to Stopped. # # @param ec_id # # @return # # @endif def on_shutdown(self, ec_id): self._rtcout.RTC_TRACE("on_shutdown(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnShutdown(ec_id) ret = self.onShutdown(ec_id) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnShutdown(ec_id, ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤Î³èÀ­²½ # # ½ê°¤¹¤ë ExecutionContext ¤«¤é RTC ¤¬³èÀ­²½¤µ¤ì¤¿ºÝ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onActivated() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # @param self # @param ec_id ³èÀ­²½ ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] Activate RTC # # The RTC has been activated in the given execution context. # # @param ec_id # # @return # # @endif def on_activated(self, ec_id): self._rtcout.RTC_TRACE("on_activated(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnActivated(ec_id) self._configsets.update() ret = self.onActivated(ec_id) self._portAdmin.activatePorts() except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnActivated(ec_id, ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤ÎÈó³èÀ­²½ # # ½ê°¤¹¤ë ExecutionContext ¤«¤é RTC ¤¬Èó³èÀ­²½¤µ¤ì¤¿ºÝ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onDeactivated() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # @param self # @param ec_id Èó³èÀ­²½ ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] Deactivate RTC # # The RTC has been deactivated in the given execution context. # # @param ec_id # # @return # # @endif def on_deactivated(self, ec_id): self._rtcout.RTC_TRACE("on_deactivated(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnDeactivated(ec_id) self._portAdmin.deactivatePorts() ret = self.onDeactivated(ec_id) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnDeactivated(ec_id, ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤Î¥¨¥é¡¼¾õÂ֤ؤÎÁ«°Ü # # RTC ¤¬½ê°¤¹¤ë ExecutionContext ¤¬ Active ¾õÂÖ¤«¤é Error ¾õÂÖ¤ØÁ«°Ü¤·¤¿ # ¾ì¹ç¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï RTC ¤¬ Error ¾õÂÖ¤ËÁ«°Ü¤·¤¿ºÝ¤Ë°ìÅÙ¤À¤±¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onAborting() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # @param self # @param ec_id ¾õÂÖÁ«°Ü¤·¤¿ ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] Transition Error State # # The RTC is transitioning from the Active state to the Error state in some # execution context. # This callback is invoked only a single time for time that the RTC # transitions into the Error state from another state. This behavior is in # contrast to that of on_error. # # @param ec_id # # @return # # @endif def on_aborting(self, ec_id): self._rtcout.RTC_TRACE("on_aborting(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnAborting(ec_id) ret = self.onAborting(ec_id) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnAborting(ec_id, ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤Î¥¨¥é¡¼½èÍý # # RTC ¤¬¥¨¥é¡¼¾õÂ֤ˤ¤¤ëºÝ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # RTC ¤¬¥¨¥é¡¼¾õÂ֤ξì¹ç¤Ë¡¢ÂоݤȤʤë ExecutionContext ¤ÎExecutionKind ¤Ë # ±þ¤¸¤¿¥¿¥¤¥ß¥ó¥°¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¡£Î㤨¤Ð¡¢ # - ExecutionKind ¤¬ PERIODIC ¤Î¾ì¹ç¡¢ËÜ¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï # DataFlowComponentAction::on_execute ¤È on_state_update ¤ÎÂØ¤ï¤ê¤Ë¡¢ # ÀßÄꤵ¤ì¤¿½çÈÖ¡¢ÀßÄꤵ¤ì¤¿¼þ´ü¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # - ExecutionKind ¤¬ EVENT_DRIVEN ¤Î¾ì¹ç¡¢ËÜ¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï # FsmParticipantAction::on_action ¤¬¸Æ¤Ð¤ì¤¿ºÝ¤Ë¡¢Âؤï¤ê¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onError() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬¸Æ¤Ó½Ð # ¤µ¤ì¤ë¡£ # # @param self # @param ec_id ÂÐ¾Ý ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] Error Processing of RTC # # The RTC remains in the Error state. # If the RTC is in the Error state relative to some execution context when # it would otherwise be invoked from that context (according to the # context¡Çs ExecutionKind), this callback shall be invoked instead. # For example, # - If the ExecutionKind is PERIODIC, this operation shall be invoked in # sorted order at the rate of the context instead of # DataFlowComponentAction::on_execute and on_state_update. # - If the ExecutionKind is EVENT_DRIVEN, this operation shall be invoked # whenever FsmParticipantAction::on_action would otherwise have been # invoked. # # @param ec_id # # @return # # @endif def on_error(self, ec_id): self._rtcout.RTC_TRACE("on_error(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnError(ec_id) ret = self.onError(ec_id) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self._configsets.update() self.postOnError(ec_id, ret) return ret ## # @if jp # # @brief [ComponentAction CORBA interface] RTC ¤Î¥ê¥»¥Ã¥È # # Error ¾õÂ֤ˤ¢¤ë RTC ¤Î¥ê¥«¥Ð¥ê½èÍý¤ò¼Â¹Ô¤·¡¢Inactive ¾õÂÖ¤ËÉüµ¢¤µ¤»¤ë # ¾ì¹ç¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # RTC ¤Î¥ê¥«¥Ð¥ê½èÍý¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï Inactive ¾õÂÖ¤ËÉüµ¢¤¹¤ë¤¬¡¢¤½¤ì°Ê³°¤Î # ¾ì¹ç¤Ë¤Ï Error ¾õÂÖ¤Ëα¤Þ¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onReset() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬¸Æ¤Ó # ½Ð¤µ¤ì¤ë¡£ # # @param self # @param ec_id ¥ê¥»¥Ã¥ÈÂÐ¾Ý ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [ComponentAction CORBA interface] Resetting RTC # # The RTC is in the Error state. An attempt is being made to recover it such # that it can return to the Inactive state. # If the RTC was successfully recovered and can safely return to the # Inactive state, this method shall complete with ReturnCode_t::OK. Any # other result shall indicate that the RTC should remain in the Error state. # # @param ec_id # # @return # # @endif def on_reset(self, ec_id): self._rtcout.RTC_TRACE("on_reset(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnReset(ec_id) ret = self.onReset(ec_id) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnReset(ec_id, ret) return ret ## # @if jp # # @brief [DataFlowComponentAction CORBA interface] RTC ¤ÎÄê¾ï½èÍý(Âè°ì¼þ´ü) # # °Ê²¼¤Î¾õÂÖ¤¬ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ÀßÄꤵ¤ì¤¿¼þ´ü¤ÇÄê´üŪ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # - RTC ¤Ï Alive ¾õÂ֤Ǥ¢¤ë¡£ # - »ØÄꤵ¤ì¤¿ ExecutionContext ¤¬ Running ¾õÂ֤Ǥ¢¤ë¡£ # ËÜ¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï¡¢Two-Pass Execution ¤ÎÂè°ì¼þ´ü¤Ç¼Â¹Ô¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onExecute() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬¸Æ¤Ó # ½Ð¤µ¤ì¤ë¡£ # # À©Ìó # - »ØÄꤵ¤ì¤¿ ExecutionContext ¤Î ExecutionKind ¤Ï¡¢ PERIODIC ¤Ç¤Ê¤±¤ì¤Ð¤Ê # ¤é¤Ê¤¤ # # @param self # @param ec_id Äê¾ï½èÍýÂÐ¾Ý ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [DataFlowComponentAction CORBA interface] Primary Periodic # Operation of RTC # # This operation will be invoked periodically at the rate of the given # execution context as long as the following conditions hold: # - The RTC is Active. # - The given execution context is Running # This callback occurs during the first execution pass. # # Constraints # - The execution context of the given context shall be PERIODIC. # # @param ec_id # # @return # # @endif def on_execute(self, ec_id): self._rtcout.RTC_TRACE("on_execute(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnExecute(ec_id) if self._readAll: self.readAll() ret = self.onExecute(ec_id) if self._writeAll: self.writeAll() except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnExecute(ec_id, ret) return ret ## # @if jp # # @brief [DataFlowComponentAction CORBA interface] RTC ¤ÎÄê¾ï½èÍý(ÂèÆó¼þ´ü) # # °Ê²¼¤Î¾õÂÖ¤¬ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ÀßÄꤵ¤ì¤¿¼þ´ü¤ÇÄê´üŪ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # - RTC ¤Ï Alive ¾õÂ֤Ǥ¢¤ë¡£ # - »ØÄꤵ¤ì¤¿ ExecutionContext ¤¬ Running ¾õÂ֤Ǥ¢¤ë¡£ # ËÜ¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï¡¢Two-Pass Execution ¤ÎÂèÆó¼þ´ü¤Ç¼Â¹Ô¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onStateUpdate() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # À©Ìó # - »ØÄꤵ¤ì¤¿ ExecutionContext ¤Î ExecutionKind ¤Ï¡¢ PERIODIC ¤Ç¤Ê¤±¤ì¤Ð¤Ê # ¤é¤Ê¤¤ # # @param self # @param ec_id Äê¾ï½èÍýÂÐ¾Ý ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [DataFlowComponentAction CORBA interface] Secondary Periodic # Operation of RTC # # This operation will be invoked periodically at the rate of the given # execution context as long as the following conditions hold: # - The RTC is Active. # - The given execution context is Running # This callback occurs during the second execution pass. # # Constraints # - The execution context of the given context shall be PERIODIC. # # @param ec_id # # @return # # @endif def on_state_update(self, ec_id): self._rtcout.RTC_TRACE("on_state_update(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnStateUpdate(ec_id) ret = self.onStateUpdate(ec_id) self._configsets.update() except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnStateUpdate(ec_id, ret) return ret ## # @if jp # # @brief [DataFlowComponentAction CORBA interface] ¼Â¹Ô¼þ´üÊѹ¹ÄÌÃÎ # # ËÜ¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï¡¢ExecutionContext ¤Î¼Â¹Ô¼þ´ü¤¬Êѹ¹¤µ¤ì¤¿¤³¤È¤òÄÌÃΤ¹¤ë # ºÝ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¸Æ¤Ó½Ð¤·¤Î·ë²Ì¤È¤·¤Æ onRateChanged() ¥³¡¼¥ë¥Ð¥Ã¥¯´Ø¿ô¤¬ # ¸Æ¤Ó½Ð¤µ¤ì¤ë¡£ # # À©Ìó # - »ØÄꤵ¤ì¤¿ ExecutionContext ¤Î ExecutionKind ¤Ï¡¢ PERIODIC ¤Ç¤Ê¤±¤ì¤Ð¤Ê # ¤é¤Ê¤¤ # # @param self # @param ec_id Äê¾ï½èÍýÂÐ¾Ý ExecutionContext ¤Î ID # # @return ReturnCode_t ·¿¤Î¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [DataFlowComponentAction CORBA interface] Notify rate chenged # # This operation is a notification that the rate of the indicated execution # context has changed. # # Constraints # - The execution context of the given context shall be PERIODIC. # # @param ec_id # # @return # # @endif def on_rate_changed(self, ec_id): self._rtcout.RTC_TRACE("on_rate_changed(%d)", ec_id) ret = RTC.RTC_ERROR try: self.preOnRateChanged(ec_id) ret = self.onRateChanged(ec_id) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) ret = RTC.RTC_ERROR self.postOnRateChanged(ec_id, ret) return ret #============================================================ # SDOPackage::SdoSystemElement #============================================================ ## # @if jp # # @brief [SDO interface] Organization ¥ê¥¹¥È¤Î¼èÆÀ # # SDOSystemElement ¤Ï0¸Ä¤â¤·¤¯¤Ï¤½¤ì°Ê¾å¤Î Organization ¤ò½êÍ­¤¹¤ë¤³¤È¤¬ # ½ÐÍè¤ë¡£ SDOSystemElement ¤¬1¤Ä°Ê¾å¤Î Organization ¤ò½êÍ­¤·¤Æ¤¤¤ë¾ì¹ç # ¤Ë¤Ï¡¢¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï½êÍ­¤¹¤ë Organization ¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£ # ¤â¤·Organization¤ò°ì¤Ä¤â½êÍ­¤·¤Æ¤¤¤Ê¤¤¤±¤ì¤Ð¶õ¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£ # # @param self # # @return ½êÍ­¤·¤Æ¤¤¤ë Organization ¥ê¥¹¥È # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting Organizations # # SDOSystemElement can be the owner of zero or more organizations. # If the SDOSystemElement owns one or more Organizations, this operation # returns the list of Organizations that the SDOSystemElement owns. # If it does not own any Organization, it returns empty list. # # @return Owned Organization List # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable if the target SDO is reachable but cannot # respond. # @exception InternalError if the target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual SDOPackage::OrganizationList* get_owned_organizations() def get_owned_organizations(self): self._rtcout.RTC_TRACE("get_owned_organizations()") try: return self._sdoOwnedOrganizations except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.NotAvailable("NotAvailable: get_owned_organizations") return [] #============================================================ # SDOPackage::SDO #============================================================ ## # @if jp # # @brief [SDO interface] SDO ID ¤Î¼èÆÀ # # SDO ID ¤òÊÖ¤¹¥ª¥Ú¥ì¡¼¥·¥ç¥ó¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï°Ê²¼¤Î·¿¤ÎÎã³°¤òȯÀ¸¤µ¤»¤ë¡£ # # @param self # # @return ¥ê¥½¡¼¥¹¥Ç¡¼¥¿¥â¥Ç¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë SDO ¤Î ID # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting SDO ID # # This operation returns id of the SDO. # This operation throws SDOException with one of the following types. # # @return id of the SDO defined in the resource data model. # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable if the target SDO is reachable but cannot # respond. # @exception InternalError if the target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual char* get_sdo_id() def get_sdo_id(self): self._rtcout.RTC_TRACE("get_sdo_id()") try: return self._profile.instance_name except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_sdo_id()") ## # @if jp # # @brief [SDO interface] SDO ¥¿¥¤¥×¤Î¼èÆÀ # # SDO Type ¤òÊÖ¤¹¥ª¥Ú¥ì¡¼¥·¥ç¥ó¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï°Ê²¼¤Î·¿¤ÎÎã³°¤òȯÀ¸¤µ¤»¤ë¡£ # # @param self # # @return ¥ê¥½¡¼¥¹¥Ç¡¼¥¿¥â¥Ç¥ë¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë SDO ¤Î Type # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting SDO type # # This operation returns sdoType of the SDO. # This operation throws SDOException with one of the following types. # # @return Type of the SDO defined in the resource data model. # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable if the target SDO is reachable but cannot # respond. # @exception InternalError if the target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual char* get_sdo_type() def get_sdo_type(self): self._rtcout.RTC_TRACE("get_sdo_type()") try: return self._profile.description except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_sdo_type()") return "" ## # @if jp # # @brief [SDO interface] SDO DeviceProfile ¥ê¥¹¥È¤Î¼èÆÀ # # SDO ¤Î DeviceProfile ¤òÊÖ¤¹¥ª¥Ú¥ì¡¼¥·¥ç¥ó¡£ SDO ¤¬¥Ï¡¼¥É¥¦¥¨¥¢¥Ç¥Ð¥¤¥¹ # ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¶õ¤Î DeviceProfile ¤¬ÊÖ¤µ¤ì¤ë¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï°Ê²¼¤Î·¿¤ÎÎã³°¤òȯÀ¸¤µ¤»¤ë¡£ # # @param self # # @return SDO DeviceProfile # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting SDO DeviceProfile # # This operation returns the DeviceProfile of the SDO. If the SDO does not # represent any hardware device, then a DeviceProfile with empty values # are returned. # This operation throws SDOException with one of the following types. # # @return The DeviceProfile of the SDO. # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable if the target SDO is reachable but cannot # respond. # @exception InternalError if the target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual SDOPackage::DeviceProfile* get_device_profile() def get_device_profile(self): self._rtcout.RTC_TRACE("get_device_profile()") try: return self._SdoConfigImpl.getDeviceProfile() except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_device_profile()") return SDOPackage.DeviceProfile("","","","",[]) ## # @if jp # # @brief [SDO interface] SDO ServiceProfile ¤Î¼èÆÀ # # SDO ¤¬½êÍ­¤·¤Æ¤¤¤ë Service ¤Î ServiceProfile ¤òÊÖ¤¹¥ª¥Ú¥ì¡¼¥·¥ç¥ó¡£ # SDO ¤¬¥µ¡¼¥Ó¥¹¤ò°ì¤Ä¤â½êÍ­¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¶õ¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï°Ê²¼¤Î·¿¤ÎÎã³°¤òȯÀ¸¤µ¤»¤ë¡£ # # @param self # # @return SDO ¤¬Ä󶡤¹¤ëÁ´¤Æ¤Î Service ¤Î ServiceProfile¡£ # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting SDO ServiceProfile # # This operation returns a list of ServiceProfiles that the SDO has. # If the SDO does not provide any service, then an empty list is returned. # This operation throws SDOException with one of the following types. # # @return List of ServiceProfiles of all the services the SDO is # providing. # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable if the target SDO is reachable but cannot # respond. # @exception InternalError if the target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual SDOPackage::ServiceProfileList* get_service_profiles() def get_service_profiles(self): self._rtcout.RTC_TRACE("get_service_profiles()") self._sdoSvcProfiles = self._SdoConfigImpl.getServiceProfiles() try: return self._sdoSvcProfiles except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_service_profiles()") return [] ## # @if jp # # @brief [SDO interface] ÆÃÄê¤ÎServiceProfile¤Î¼èÆÀ # # °ú¿ô "id" ¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Î¥µ¡¼¥Ó¥¹¤Î ServiceProfile ¤òÊÖ¤¹¡£ # # @param self # @param _id SDO Service ¤Î ServiceProfile ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¼±Ê̻ҡ£ # # @return »ØÄꤵ¤ì¤¿ SDO Service ¤Î ServiceProfile¡£ # # @exception InvalidParameter "id" ¤Ç»ØÄꤷ¤¿ ServiceProfile ¤¬Â¸ºß¤·¤Ê¤¤¡£ # "id" ¤¬ null¡£ # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting Organizations # # This operation returns the ServiceProfile that is specified by the # argument "id." # # @param _id The identifier referring to one of the ServiceProfiles. # # @return The profile of the specified service. # # @exception InvalidParameter if the ServiceProfile that is specified by # the argument 'id' does not exist or if 'id' # is 'null.' # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable If the target SDO is reachable but cannot # respond. # @exception InternalError If the target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual SDOPackage::ServiceProfile* get_service_profile(const char* id) def get_service_profile(self, _id): self._rtcout.RTC_TRACE("get_service_profile(%s)", _id) self._sdoSvcProfiles = self._SdoConfigImpl.getServiceProfiles() if not _id: raise SDOPackage.InvalidParameter("get_service_profile(): Empty name.") try: index = OpenRTM_aist.CORBA_SeqUtil.find(self._sdoSvcProfiles, self.svc_name(_id)) if index < 0: raise SDOPackage.InvalidParameter("get_service_profile(): Not found") return self._sdoSvcProfiles[index] except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_service_profile()") return SDOPackage.ServiceProfile("", "", [], None) ## # @if jp # # @brief [SDO interface] »ØÄꤵ¤ì¤¿ SDO Service ¤Î¼èÆÀ # # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï°ú¿ô "id" ¤Ç»ØÄꤵ¤ì¤¿Ì¾Á°¤Ë¤è¤Ã¤Æ¶èÊ̤µ¤ì¤ë # SDO ¤Î Service ¤Ø¤Î¥ª¥Ö¥¸¥§¥¯¥È»²¾È¤òÊÖ¤¹¡£ SDO ¤Ë¤è¤êÄ󶡤µ¤ì¤ë # Service ¤Ï¤½¤ì¤¾¤ì°ì°Õ¤Î¼±Ê̻Ҥˤè¤ê¶èÊ̤µ¤ì¤ë¡£ # # @param self # @param _id SDO Service ¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¼±Ê̻ҡ£ # # @return Í׵ᤵ¤ì¤¿ SDO Service ¤Ø¤Î»²¾È¡£ # # # @exception InvalidParameter "id" ¤Ç»ØÄꤷ¤¿ ServiceProfile ¤¬Â¸ºß¤·¤Ê¤¤¡£ # "id" ¤¬ null¡£ # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting specified SDO Service's reference # # This operation returns an object implementing an SDO's service that # is identified by the identifier specified as an argument. Different # services provided by an SDO are distinguished with different # identifiers. See OMG SDO specification Section 2.2.8, "ServiceProfile," # on page 2-12 for more details. # # @param _id The identifier referring to one of the SDO Service # @return The object implementing the requested service. # @exception InvalidParameter if argument ¡Èid¡É is null, or if the # ServiceProfile that is specified by argument # ¡Èid¡É does not exist. # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable If the target SDO is reachable but cannot # respond. # @exception InternalError If the target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual SDOPackage::SDOService_ptr get_sdo_service(const char* id) def get_sdo_service(self, _id): self._rtcout.RTC_TRACE("get_sdo_service(%s)", _id) self._sdoSvcProfiles = self._SdoConfigImpl.getServiceProfiles() if not _id: raise SDOPackage.InvalidParameter("get_service(): Empty name.") index = OpenRTM_aist.CORBA_SeqUtil.find(self._sdoSvcProfiles, self.svc_name(_id)) if index < 0: raise SDOPackage.InvalidParameter("get_service(): Not found") try: return self._sdoSvcProfiles[index].service except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_service()") return SDOPackage.SDOService._nil ## # @if jp # # @brief [SDO interface] Configuration ¥ª¥Ö¥¸¥§¥¯¥È¤Î¼èÆÀ # # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï Configuration interface ¤Ø¤Î»²¾È¤òÊÖ¤¹¡£ # Configuration interface ¤Ï³Æ SDO ¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î # ¤Ò¤È¤Ä¤Ç¤¢¤ë¡£¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï DeviceProfile, ServiceProfile, # Organization ¤ÇÄêµÁ¤µ¤ì¤¿ SDO ¤Î°À­ÃͤòÀßÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£ # Configuration ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢OMG SDO specification # ¤Î 2.3.5Àá, p.2-24 ¤ò»²¾È¤Î¤³¤È¡£ # # @param self # # @return SDO ¤Î Configuration ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ø¤Î»²¾È # # @exception InterfaceNotImplemented SDO¤ÏConfiguration¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò # »ý¤¿¤Ê¤¤¡£ # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Getting Configuration object # # This operation returns an object implementing the Configuration # interface. The Configuration interface is one of the interfaces that # each SDO maintains. The interface is used to configure the attributes # defined in DeviceProfile, ServiceProfile, and Organization. # See OMG SDO specification Section 2.3.5, "Configuration Interface," # on page 2-24 for more details about the Configuration interface. # # @return The Configuration interface of an SDO. # # @exception InterfaceNotImplemented The target SDO has no Configuration # interface. # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable The target SDO is reachable but cannot respond. # @exception InternalError The target SDO cannot execute the operation # completely due to some internal error. # @endif # virtual SDOPackage::Configuration_ptr get_configuration() def get_configuration(self): self._rtcout.RTC_TRACE("get_configuration()") if self._SdoConfig is None: raise SODPackage.InterfaceNotImplemented("InterfaceNotImplemented: get_configuration") try: return self._SdoConfig except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_configuration()") return SDOPackage.Configuration._nil ## # @if jp # # @brief [SDO interface] Monitoring ¥ª¥Ö¥¸¥§¥¯¥È¤Î¼èÆÀ # # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï Monitoring interface ¤Ø¤Î»²¾È¤òÊÖ¤¹¡£ # Monitoring interface ¤Ï SDO ¤¬´ÉÍý¤¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î°ì¤Ä¤Ç¤¢¤ë¡£ # ¤³¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï SDO ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¥â¥Ë¥¿¥ê¥ó¥°¤¹¤ë¤¿¤á¤Ë # »ÈÍѤµ¤ì¤ë¡£ # Monitoring interface ¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï OMG SDO specification ¤Î # 2.3.7Àá "Monitoring Interface" p.2-35 ¤ò»²¾È¤Î¤³¤È¡£ # # @param self # # @return SDO ¤Î Monitoring interface ¤Ø¤Î»²¾È # # @exception InterfaceNotImplemented SDO¤ÏConfiguration¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò # »ý¤¿¤Ê¤¤¡£ # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Get Monitoring object # # This operation returns an object implementing the Monitoring interface. # The Monitoring interface is one of the interfaces that each SDO # maintains. The interface is used to monitor the properties of an SDO. # See OMG SDO specification Section 2.3.7, "Monitoring Interface," on # page 2-35 for more details about the Monitoring interface. # # @return The Monitoring interface of an SDO. # # @exception InterfaceNotImplemented The target SDO has no Configuration # interface. # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable The target SDO is reachable but cannot respond. # @exception InternalError The target SDO cannot execute the operation # completely due to some internal error. # @endif # virtual SDOPackage::Monitoring_ptr get_monitoring() def get_monitoring(self): self._rtcout.RTC_TRACE("get_monitoring()") raise SDOPackage.InterfaceNotImplemented("Exception: get_monitoring") return SDOPackage.Monitoring._nil ## # @if jp # # @brief [SDO interface] Organization ¥ê¥¹¥È¤Î¼èÆÀ # # SDO ¤Ï0¸Ä°Ê¾å¤Î Organization (ÁÈ¿¥)¤Ë½ê°¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ ¤â¤· SDO ¤¬ # 1¸Ä°Ê¾å¤Î Organization ¤Ë½ê°¤·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï½ê°¤¹¤ë # Organization ¤Î¥ê¥¹¥È¤òÊÖ¤¹¡£SDO ¤¬ ¤É¤Î Organization ¤Ë¤â½ê°¤·¤Æ¤¤¤Ê¤¤ # ¾ì¹ç¤Ë¤Ï¡¢¶õ¤Î¥ê¥¹¥È¤¬ÊÖ¤µ¤ì¤ë¡£ # # @param self # # @return SDO ¤¬½ê°¤¹¤ë Organization ¤Î¥ê¥¹¥È¡£ # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # @else # # @brief [SDO interface] Getting Organizations # # An SDO belongs to zero or more organizations. If the SDO belongs to one # or more organizations, this operation returns the list of organizations # that the SDO belongs to. An empty list is returned if the SDO does not # belong to any Organizations. # # @return The list of Organizations that the SDO belong to. # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable The target SDO is reachable but cannot respond. # @exception InternalError The target SDO cannot execute the operation # completely due to some internal error. # @endif # virtual SDOPackage::OrganizationList* get_organizations() def get_organizations(self): self._rtcout.RTC_TRACE("get_organizations()") self._sdoOrganizations = self._SdoConfigImpl.getOrganizations() try: return self._sdoOrganizations except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_organizations()") return [] ## # @if jp # # @brief [SDO interface] SDO Status ¥ê¥¹¥È¤Î¼èÆÀ # # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï SDO ¤Î¥¹¥Æ¡¼¥¿¥¹¤òɽ¤¹ NVList ¤òÊÖ¤¹¡£ # # @param self # # @return SDO ¤Î¥¹¥Æ¡¼¥¿¥¹¡£ # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # # @else # # @brief [SDO interface] Get SDO Status # # This operation returns an NVlist describing the status of an SDO. # # @return The actual status of an SDO. # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable The target SDO is reachable but cannot respond. # @exception InternalError The target SDO cannot execute the operation # completely due to some internal error. # # @endif # virtual SDOPackage::NVList* get_status_list() def get_status_list(self): self._rtcout.RTC_TRACE("get_status_list()") try: return self._sdoStatus except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_status_list()") return [] ## # @if jp # # @brief [SDO interface] SDO Status ¤Î¼èÆÀ # # This operation returns the value of the specified status parameter. # # @param self # @param name SDO ¤Î¥¹¥Æ¡¼¥¿¥¹¤òÄêµÁ¤¹¤ë¥Ñ¥é¥á¡¼¥¿¡£ # # @return »ØÄꤵ¤ì¤¿¥Ñ¥é¥á¡¼¥¿¤Î¥¹¥Æ¡¼¥¿¥¹ÃÍ¡£ # # @exception SDONotExists ¥¿¡¼¥²¥Ã¥È¤ÎSDO¤¬Â¸ºß¤·¤Ê¤¤¡£(ËÜÎã³°¤Ï¡¢CORBAɸ½à # ¥·¥¹¥Æ¥àÎã³°¤ÎOBJECT_NOT_EXIST¤Ë¥Þ¥Ã¥Ô¥ó¥°¤µ¤ì¤ë) # @exception NotAvailable SDO¤Ï¸ºß¤¹¤ë¤¬±þÅú¤¬¤Ê¤¤¡£ # @exception InvalidParameter °ú¿ô "name" ¤¬ null ¤¢¤ë¤¤¤Ï¸ºß¤·¤Ê¤¤¡£ # @exception InternalError ÆâÉôŪ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£ # @else # # @brief [SDO interface] Get SDO Status # # @param name One of the parameters defining the "status" of an SDO. # # @return The value of the specified status parameter. # # @exception SDONotExists if the target SDO does not exist.(This exception # is mapped to CORBA standard system exception # OBJECT_NOT_EXIST.) # @exception NotAvailable The target SDO is reachable but cannot respond. # @exception InvalidParameter The parameter defined by "name" is null or # does not exist. # @exception InternalError The target SDO cannot execute the operation # completely due to some internal error. # # # @endif # virtual CORBA::Any* get_status(const char* name) def get_status(self, name): self._rtcout.RTC_TRACE("get_status(%s)", name) index = OpenRTM_aist.CORBA_SeqUtil.find(self._sdoStatus, self.nv_name(name)) if index < 0: raise SDOPackage.InvalidParameter("get_status(): Not found") try: return any.to_any(self._sdoStatus[index].value) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) raise SDOPackage.InternalError("get_status()") return any.to_any("") #============================================================ # Local interfaces #============================================================ ## # @if jp # # @brief [local interface] ¥¤¥ó¥¹¥¿¥ó¥¹Ì¾¤Î¼èÆÀ # # ComponentProfile ¤ËÀßÄꤵ¤ì¤¿¥¤¥ó¥¹¥¿¥ó¥¹Ì¾¤òÊÖ¤¹¡£ # # @param self # # @return ¥¤¥ó¥¹¥¿¥ó¥¹Ì¾ # # @else # # @endif # const char* getInstanceName() def getInstanceName(self): self._rtcout.RTC_TRACE("getInstanceName()") return self._profile.instance_name ## # @if jp # # @brief [local interface] ¥¤¥ó¥¹¥¿¥ó¥¹Ì¾¤ÎÀßÄê # # ComponentProfile ¤Ë»ØÄꤵ¤ì¤¿¥¤¥ó¥¹¥¿¥ó¥¹Ì¾¤òÀßÄꤹ¤ë¡£ # # @param self # # @param instance_name ¥¤¥ó¥¹¥¿¥ó¥¹Ì¾ # # @else # # @endif # void setInstanceName(const char* instance_name); def setInstanceName(self, instance_name): self._rtcout.RTC_TRACE("setInstanceName(%s)", instance_name) self._properties.setProperty("instance_name",instance_name) self._profile.instance_name = self._properties.getProperty("instance_name") ## # @if jp # # @brief [local interface] ·¿Ì¾¤Î¼èÆÀ # # ComponentProfile ¤ËÀßÄꤵ¤ì¤¿·¿Ì¾¤òÊÖ¤¹¡£ # # @param self # # @return ·¿Ì¾ # # @else # # @endif # const char* getTypeName() def getTypeName(self): self._rtcout.RTC_TRACE("getTypeName()") return self._profile.type_name ## # @if jp # # @brief [local interface] Description ¤Î¼èÆÀ # # ComponentProfile ¤ËÀßÄꤵ¤ì¤¿ Description ¤òÊÖ¤¹¡£ # # @param self # # @return Description # # @else # # @endif # const char* getDescription() def getDescription(self): self._rtcout.RTC_TRACE("getDescription()") return self._profile.description ## # @if jp # # @brief [local interface] ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤Î¼èÆÀ # # ComponentProfile ¤ËÀßÄꤵ¤ì¤¿¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òÊÖ¤¹¡£ # # @param self # # @return ¥Ð¡¼¥¸¥ç¥ó¾ðÊó # # @else # # @endif # const char* getVersion() def getVersion(self): self._rtcout.RTC_TRACE("getVersion()") return self._profile.version ## # @if jp # # @brief [local interface] ¥Ù¥ó¥À¡¼¾ðÊó¤Î¼èÆÀ # # ComponentProfile ¤ËÀßÄꤵ¤ì¤¿¥Ù¥ó¥À¡¼¾ðÊó¤òÊÖ¤¹¡£ # # @param self # # @return ¥Ù¥ó¥À¡¼¾ðÊó # # @else # # @endif # const char* getVendor() def getVendor(self): self._rtcout.RTC_TRACE("getVendor()") return self._profile.vendor ## # @if jp # # @brief [local interface] ¥«¥Æ¥´¥ê¾ðÊó¤Î¼èÆÀ # # ComponentProfile ¤ËÀßÄꤵ¤ì¤¿¥«¥Æ¥´¥ê¾ðÊó¤òÊÖ¤¹¡£ # # @param self # # @return ¥«¥Æ¥´¥ê¾ðÊó # # @else # # @endif # const char* getCategory() def getCategory(self): self._rtcout.RTC_TRACE("getCategory()") return self._profile.category ## # @if jp # # @brief [local interface] Naming Server ¾ðÊó¤Î¼èÆÀ # # ÀßÄꤵ¤ì¤¿ Naming Server ¾ðÊó¤òÊÖ¤¹¡£ # # @param self # # @return Naming Server ¥ê¥¹¥È # # @else # # @endif # std::vector<std::string> getNamingNames(); def getNamingNames(self): self._rtcout.RTC_TRACE("getNamingNames()") return [s.strip() for s in self._properties.getProperty("naming.names").split(",")] ## # @if jp # # @brief [local interface] ¥ª¥Ö¥¸¥§¥¯¥È¥ê¥Õ¥¡¥ì¥ó¥¹¤ÎÀßÄê # # RTC ¤Î CORBA ¥ª¥Ö¥¸¥§¥¯¥È¥ê¥Õ¥¡¥ì¥ó¥¹¤òÀßÄꤹ¤ë¡£ # # @param self # @param rtobj ¥ª¥Ö¥¸¥§¥¯¥È¥ê¥Õ¥¡¥ì¥ó¥¹ # # @else # # @endif # void setObjRef(const RTObject_ptr rtobj); def setObjRef(self, rtobj): self._rtcout.RTC_TRACE("setObjRef()") self._objref = rtobj return ## # @if jp # # @brief [local interface] ¥ª¥Ö¥¸¥§¥¯¥È¥ê¥Õ¥¡¥ì¥ó¥¹¤Î¼èÆÀ # # ÀßÄꤵ¤ì¤¿ CORBA ¥ª¥Ö¥¸¥§¥¯¥È¥ê¥Õ¥¡¥ì¥ó¥¹¤ò¼èÆÀ¤¹¤ë¡£ # # @param self # # @return ¥ª¥Ö¥¸¥§¥¯¥È¥ê¥Õ¥¡¥ì¥ó¥¹ # # @else # # @endif # RTObject_ptr getObjRef() const; def getObjRef(self): self._rtcout.RTC_TRACE("getObjRef()") return self._objref ## # @if jp # # @brief [local interface] RTC ¤Î¥×¥í¥Ñ¥Æ¥£¤òÀßÄꤹ¤ë # # RTC ¤¬ÊÝ»ý¤¹¤Ù¤­¥×¥í¥Ñ¥Æ¥£¤òÀßÄꤹ¤ë¡£Í¿¤¨¤é¤ì¤ë¥×¥í¥Ñ¥Æ¥£¤Ï¡¢ # ComponentProfile Åù¤ËÀßÄꤵ¤ì¤ë¤Ù¤­¾ðÊó¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # ¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤ÏÄ̾ï RTC ¤¬½é´ü²½¤µ¤ì¤ëºÝ¤Ë Manager ¤«¤é # ¸Æ¤Ð¤ì¤ë¤³¤È¤ò°Õ¿Þ¤·¤Æ¤¤¤ë¡£ # # @param self # @param prop RTC ¤Î¥×¥í¥Ñ¥Æ¥£ # # @else # # @brief [local interface] Set RTC property # # This operation sets the properties to the RTC. The given property # values should include information for ComponentProfile. # Generally, this operation is designed to be called from Manager, when # RTC is initialized # # @param prop Property for RTC. # # @endif # void setProperties(const coil::Properties& prop); def setProperties(self, prop): self._rtcout.RTC_TRACE("setProperties()") self._properties.mergeProperties(prop) self._profile.instance_name = self._properties.getProperty("instance_name") self._profile.type_name = self._properties.getProperty("type_name") self._profile.description = self._properties.getProperty("description") self._profile.version = self._properties.getProperty("version") self._profile.vendor = self._properties.getProperty("vendor") self._profile.category = self._properties.getProperty("category") ## # @if jp # # @brief [local interface] RTC ¤Î¥×¥í¥Ñ¥Æ¥£¤ò¼èÆÀ¤¹¤ë # # RTC ¤¬ÊÝ»ý¤·¤Æ¤¤¤ë¥×¥í¥Ñ¥Æ¥£¤òÊÖ¤¹¡£ # RTC¤¬¥×¥í¥Ñ¥Æ¥£¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ï¶õ¤Î¥×¥í¥Ñ¥Æ¥£¤¬ÊÖ¤µ¤ì¤ë¡£ # # @param self # # @return RTC ¤Î¥×¥í¥Ñ¥Æ¥£ # # @else # # @brief [local interface] Get RTC property # # This operation returns the properties of the RTC. # Empty property would be returned, if RTC has no property. # # @return Property for RTC. # # @endif # coil::Properties& getProperties(); def getProperties(self): self._rtcout.RTC_TRACE("getProperties()") return self._properties ## # @if jp # # @brief ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê # # ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿¤ÈÊÑ¿ô¤ò¥Ð¥¤¥ó¥É¤¹¤ë # <VarType>¤È¤·¤Æ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿¤Î¥Ç¡¼¥¿·¿¤ò»ØÄꤹ¤ë¡£ # # @param self # @param param_name ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿Ì¾ # @param var ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿³ÊǼÍÑÊÑ¿ô # @param def_val ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿¥Ç¥Õ¥©¥ë¥ÈÃÍ # @param trans ʸ»úÎóÊÑ´¹ÍÑ´Ø¿ô(¥Ç¥Õ¥©¥ë¥ÈÃÍ:None) # # @return ÀßÄê·ë²Ì(ÀßÄêÀ®¸ù:true¡¤ÀßÄ꼺ÇÔ:false) # # @else # # @endif # template <typename VarType> # bool bindParameter(const char* param_name, VarType& var, # const char* def_val, # bool (*trans)(VarType&, const char*) = coil::stringTo) def bindParameter(self, param_name, var, def_val, trans=None): self._rtcout.RTC_TRACE("bindParameter()") if trans is None: trans_ = OpenRTM_aist.stringTo else: trans_ = trans self._configsets.bindParameter(param_name, var, def_val, trans_) return True ## # @if jp # # @brief ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿¤Î¹¹¿·(ID»ØÄê) # # »ØÄꤷ¤¿ID¤Î¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥»¥Ã¥È¤ËÀßÄꤷ¤¿Ãͤǡ¢ # ¥³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥Ñ¥é¥á¡¼¥¿¤ÎÃͤò¹¹¿·¤¹¤ë # # @param self # @param config_set ÀßÄêÂоݤΥ³¥ó¥Õ¥£¥®¥å¥ì¡¼¥·¥ç¥ó¥»¥Ã¥ÈID # # @else # # @endif # void updateParameters(const char* config_set); def updateParameters(self, config_set): self._rtcout.RTC_TRACE("updateParameters(%s)", config_set) self._configsets.update(config_set) return ## # @if jp # # @brief [local interface] Port ¤òÅÐÏ¿¤¹¤ë # # RTC ¤¬ÊÝ»ý¤¹¤ëPort¤òÅÐÏ¿¤¹¤ë¡£ # Port ¤ò³°Éô¤«¤é¥¢¥¯¥»¥¹²Äǽ¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¤³¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ë¤è¤ê # ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ÅÐÏ¿¤µ¤ì¤ë Port ¤Ï¤³¤Î RTC ÆâÉô¤Ë¤ª¤¤¤Æ # PortProfile.name ¤Ë¤è¤ê¶èÊ̤µ¤ì¤ë¡£¤·¤¿¤¬¤Ã¤Æ¡¢Port ¤Ï RTC Æâ¤Ë¤ª¤¤¤Æ¡¢ # ¥æ¥Ë¡¼¥¯¤Ê PortProfile.name ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # ÅÐÏ¿¤µ¤ì¤¿ Port ¤ÏÆâÉô¤ÇŬÀڤ˥¢¥¯¥Æ¥£¥Ö²½¤µ¤ì¤¿¸å¡¢¤½¤Î»²¾È¤È # ¥ª¥Ö¥¸¥§¥¯¥È»²¾È¤¬¥ê¥¹¥ÈÆâ¤ËÊݸ¤µ¤ì¤ë¡£ # # @param self # @param port RTC ¤ËÅÐÏ¿¤¹¤ë Port # @param port_type if port is PortBase, port_type is None, # if port is PortService, port_type is True # # @else # # @brief [local interface] Register Port # # This operation registers a Port to be held by this RTC. # In order to enable access to the Port from outside of RTC, the Port # must be registered by this operation. The Port that is registered by # this operation would be identified by PortProfile.name in the inside of # RTC. Therefore, the Port should have unique PortProfile.name in the RTC. # The registering Port would be activated properly, and the reference # and the object reference would be stored in lists in RTC. # # @param port Port which is registered in the RTC # # @endif # void registerPort(PortBase& port); def registerPort(self, port): self._rtcout.RTC_TRACE("registerPort()") if not self.addPort(port): self._rtcout.RTC_ERROR("addPort(PortBase&) failed.") return # void registerPort(PortService_ptr port); # def registerPortByReference(self, port_ref): # self._rtcout.RTC_TRACE("registerPortByReference()") # self.addPortByReference(port_ref) # return # new interface. since 1.0.0-RELEASE # void addPort(PortBase& port); def addPort(self, port): self._rtcout.RTC_TRACE("addPort()") if isinstance(port, OpenRTM_aist.CorbaPort): self._rtcout.RTC_TRACE("addPort(CorbaPort)") propkey = "port.corbaport." prop = self._properties.getNode(propkey) if prop: self._properties.getNode(propkey).mergeProperties(self._properties.getNode("port.corba")) port.init(self._properties.getNode(propkey)) port.setOwner(self.getObjRef()) elif isinstance(port, OpenRTM_aist.PortBase): self._rtcout.RTC_TRACE("addPort(PortBase)") port.setOwner(self.getObjRef()) port.setPortConnectListenerHolder(self._portconnListeners) self.onAddPort(port.getPortProfile()) elif isinstance(port, RTC._objref_PortService): self._rtcout.RTC_TRACE("addPort(PortService)") return self._portAdmin.addPort(port) # new interface. since 1.0.0-RELEASE # void addPort(PortService_ptr port); # def addPortByReference(self, port_ref): # self._rtcout.RTC_TRACE("addPortByReference()") # self._portAdmin.registerPortByReference(port_ref) # return ## # @if jp # # @brief [local interface] DataInPort ¤òÅÐÏ¿¤¹¤ë # # RTC ¤¬ÊÝ»ý¤¹¤ë DataInPort ¤òÅÐÏ¿¤¹¤ë¡£ # Port ¤Î¥×¥í¥Ñ¥Æ¥£¤Ë¥Ç¡¼¥¿¥Ý¡¼¥È¤Ç¤¢¤ë¤³¤È("port.dataport")¡¢ # TCP¤ò»ÈÍѤ¹¤ë¤³¤È("tcp_any")¤òÀßÄꤹ¤ë¤È¤È¤â¤Ë¡¢ DataInPort ¤Î # ¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¡¢ÅÐÏ¿¤¹¤ë¡£ # # @param self # @param name port ̾¾Î # @param inport ÅÐÏ¿ÂÐ¾Ý DataInPort # # @else # # @endif def registerInPort(self, name, inport): self._rtcout.RTC_TRACE("registerInPort(%s)", name) if not self.addInPort(name, inport): self._rtcout.RTC_ERROR("addInPort(%s) failed.", name) return # new interface. since 1.0.0-RELEASE def addInPort(self, name, inport): self._rtcout.RTC_TRACE("addInPort(%s)", name) propkey = "port.inport." + name prop_ = copy.copy(self._properties.getNode(propkey)) prop_.mergeProperties(self._properties.getNode("port.inport.dataport")) ret = self.addPort(inport) if not ret: self._rtcout.RTC_ERROR("addInPort() failed.") return ret inport.init(self._properties.getNode(propkey)) self._inports.append(inport) return ret ## # @if jp # # @brief [local interface] DataOutPort ¤òÅÐÏ¿¤¹¤ë # # RTC ¤¬ÊÝ»ý¤¹¤ë DataOutPor t¤òÅÐÏ¿¤¹¤ë¡£ # Port ¤Î¥×¥í¥Ñ¥Æ¥£¤Ë¥Ç¡¼¥¿¥Ý¡¼¥È¤Ç¤¢¤ë¤³¤È("port.dataport")¡¢ # TCP¤ò»ÈÍѤ¹¤ë¤³¤È("tcp_any")¤òÀßÄꤹ¤ë¤È¤È¤â¤Ë¡¢ DataOutPort ¤Î # ¥¤¥ó¥¹¥¿¥ó¥¹¤òÀ¸À®¤·¡¢ÅÐÏ¿¤¹¤ë¡£ # # @param self # @param name port ̾¾Î # @param outport ÅÐÏ¿ÂÐ¾Ý DataInPort # # @else # # @endif # void registerOutPort(const char* name, OutPortBase& outport); def registerOutPort(self, name, outport): self._rtcout.RTC_TRACE("registerOutPort(%s)", name) if not self.addOutPort(name, outport): self._rtcout.RTC_ERROR("addOutPort(%s) failed.", name) return # new interface. since 1.0.0-RELEASE # void addOutPort(const char* name, OutPortBase& outport); def addOutPort(self, name, outport): self._rtcout.RTC_TRACE("addOutPort(%s)", name) propkey = "port.outport." + name prop_ = copy.copy(self._properties.getNode(propkey)) prop_.mergeProperties(self._properties.getNode("port.outport.dataport")) ret = self.addPort(outport) if not ret: self._rtcout.RTC_ERROR("addOutPort() failed.") return ret outport.init(self._properties.getNode(propkey)) self._outports.append(outport) return ret ## # @if jp # # @brief [local interface] InPort ¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë # # RTC ¤¬ÊÝ»ý¤¹¤ëInPort¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë¡£ # # @param port ºï½üÂÐ¾Ý Port # @return ºï½ü·ë²Ì(ºï½üÀ®¸ù:true¡¤ºï½ü¼ºÇÔ:false) # # @else # # @brief [local interface] Unregister InPort # # This operation unregisters a InPort held by this RTC. # # @param port Port which is unregistered # @return Unregister result (Successful:true, Failed:false) # # @endif # # bool removeInPort(InPortBase& port); def removeInPort(self, port): self._rtcout.RTC_TRACE("removeInPort()") ret = self.removePort(inport) if ret: for inport in self._inports: if port == inport: try: self._inports.remove(port) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) return True return False ## # @if jp # # @brief [local interface] OutPort ¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë # # RTC ¤¬ÊÝ»ý¤¹¤ëOutPort¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë¡£ # # @param port ºï½üÂÐ¾Ý Port # @return ºï½ü·ë²Ì(ºï½üÀ®¸ù:true¡¤ºï½ü¼ºÇÔ:false) # # @else # # @brief [local interface] Unregister OutPort # # This operation unregisters a OutPort held by this RTC. # # @param port Port which is unregistered # @return Unregister result (Successful:true, Failed:false) # # @endif # # bool removeOutPort(OutPortBase& port); def removeOutPort(self, port): self._rtcout.RTC_TRACE("removeOutPort()") ret = self.removePort(outport) if ret: for outport in self._outports: if port == outport: try: self._outports.remove(port) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) return True return False ## # @if jp # # @brief [local interface] Port ¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë # # RTC ¤¬ÊÝ»ý¤¹¤ëPort¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë¡£ # # @param self # @param port ºï½üÂÐ¾Ý Port # # @else # # @brief [local interface] Unregister Port # # This operation unregisters a Port to be held by this RTC. # # @param port Port which is unregistered in the RTC # # @endif # void RTObject_impl::deletePort(PortBase& port) def deletePort(self, port): self._rtcout.RTC_TRACE("deletePort()") if not self.removePort(port): self._rtcout.RTC_ERROR("removePort() failed.") return # new interface. since 1.0.0-RELEASE def removePort(self, port): self._rtcout.RTC_TRACE("removePort()") if isinstance(port, OpenRTM_aist.PortBase) or isinstance(port, OpenRTM_aist.CorbaPort): self.onRemovePort(port.getPortProfile()) return self._portAdmin.removePort(port) ## # @if jp # # @brief [local interface] ̾Á°»ØÄê¤Ë¤è¤ê Port ¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë # # ̾¾Î¤ò»ØÄꤷ¤Æ RTC ¤¬ÊÝ»ý¤¹¤ëPort¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë¡£ # # @param self # @param port_name ºï½üÂÐ¾Ý Port ̾ # # @else # # @endif def deletePortByName(self, port_name): self._rtcout.RTC_TRACE("deletePortByName(%s)", port_name) self._portAdmin.deletePortByName(port_name) return ## # @if jp # # @brief [local interface] ¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤ò¼èÆÀ¤¹¤ë # # get_context() ¤ÈƱ¤¸µ¡Ç½¤Î¥í¡¼¥«¥ëÈÇ¡£°ã¤¤¤Ï¤Ê¤¤¡£ # ¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î´Ø¿ôÆâ¤Ç¸Æ¤Ð¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # ¤³¤Î´Ø¿ô¤Î°ú¿ô¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Î°ú¿ô UniquieID exec_handle ¤Ç¤Ê¤± # ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # # @param ec_id ¾åµ­´Ø¿ô¤ÎÂè1°ú¿ô exec_handle ¤òÅϤ¹É¬Íפ¬¤¢¤ë¡£ # # @else # # @brief [local interface] Getting current execution context # # This function is the local version of get_context(). completely # same as get_context() function. This function is assumed to be # called from the following functions. # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # The argument of this function should be the first argument # (UniqueId ec_id) of the above functions. # # @param ec_id The above functions' first argument "exec_handle." # # @endif # # ExecutionContext_ptr getExecutionContext(RTC::UniqueId ec_id); def getExecutionContext(self, ec_id): return self.get_context(ec_id) ## # @if jp # # @brief [local interface] ¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î¼Â¹Ô¥ì¡¼¥È¤ò¼èÆÀ¤¹¤ë # # ¸½ºß¼Â¹ÔÃæ¤Î¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î¼Â¹Ô¥ì¡¼¥È¤ò¼èÆÀ¤¹¤ë¡£¼Â¹Ô¥³¥ó¥Æ¥­ # ¥¹¥È¤ÎKind¤¬PERIODIC°Ê³°¤Î¾ì¹ç¤Îưºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê # ²¼¤Î´Ø¿ôÆâ¤Ç¸Æ¤Ð¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # ¤³¤Î´Ø¿ô¤Î°ú¿ô¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Î°ú¿ô UniquieID exec_handle ¤Ç¤Ê¤± # ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # # @param ec_id ¾åµ­´Ø¿ô¤ÎÂè1°ú¿ô exec_handle ¤òÅϤ¹É¬Íפ¬¤¢¤ë¡£ # # @else # # @brief [local interface] Getting current context' execution rate # # This function returns current execution rate in this # context. If this context's kind is not PERIODC, behavior is not # defined. This function is assumed to be called from the # following functions. # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # The argument of this function should be the first argument # (UniqueId ec_id) of the above functions. # # @param ec_id The above functions' first argument "exec_handle." # # @endif # # double getExecutionRate(RTC::UniqueId ec_id); def getExecutionRate(self, ec_id): ec = self.getExecutionContext(ec_id) if CORBA.is_nil(ec): return 0.0 return ec.get_rate() ## # @if jp # # @brief [local interface] ¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î¼Â¹Ô¥ì¡¼¥È¤òÀßÄꤹ¤ë # # ¸½ºß¼Â¹ÔÃæ¤Î¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î¼Â¹Ô¥ì¡¼¥È¤òÀßÄꤹ¤ë¡£¼Â¹Ô¥³¥ó¥Æ¥­ # ¥¹¥È¤ÎKind¤¬PERIODIC°Ê³°¤Î¾ì¹ç¤Îưºî¤Ï̤ÄêµÁ¤Ç¤¢¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê # ²¼¤Î´Ø¿ôÆâ¤Ç¸Æ¤Ð¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # ¤³¤Î´Ø¿ô¤Î°ú¿ô¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Î°ú¿ô UniquieID exec_handle ¤Ç¤Ê¤± # ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # # @param ec_id ¾åµ­´Ø¿ô¤ÎÂè1°ú¿ô exec_handle ¤òÅϤ¹É¬Íפ¬¤¢¤ë¡£ # @param rate ¼Â¹Ô¥ì¡¼¥È¤ò [Hz] ¤ÇÍ¿¤¨¤ë # # @else # # @brief [local interface] Setting current context' execution rate # # This function sets a execution rate in the context. If this # context's kind is not PERIODC, behavior is not defined. This # function is assumed to be called from the following functions. # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # The argument of this function should be the first argument # (UniqueId ec_id) of the above functions. # # @param ec_id The above functions' first argument "exec_handle." # @param rate Execution rate in [Hz]. # # @endif # # ReturnCode_t setExecutionRate(RTC::UniqueId ec_id, double rate); def setExecutionRate(self, ec_id, rate): ec = self.getExecutionContext(ec_id) if CORBA.is_nil(ec): return RTC.RTC_ERROR ec.set_rate(rate) return RTC.RTC_OK ## # @if jp # # @brief [local interface] ¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î½êÍ­¸¢¤òÄ´¤Ù¤ë # # ¸½ºß¼Â¹ÔÃæ¤Î¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Î½êÍ­¸¢¤òÄ´¤Ù¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î´Ø # ¿ôÆâ¤Ç¸Æ¤Ð¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # ¤³¤Î´Ø¿ô¤Î°ú¿ô¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Î°ú¿ô UniquieID exec_handle ¤Ç¤Ê¤± # ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # # @param ec_id ¾åµ­´Ø¿ô¤ÎÂè1°ú¿ô exec_handle ¤òÅϤ¹É¬Íפ¬¤¢¤ë¡£ # @return true: ¼«¿È¤Î¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¡¢false: ¾¤Î¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È # # @else # # @brief [local interface] Checking if the current context is own context # # This function checks if the current context is own execution # context. This function is assumed to be called from the # following functions. # # - onStartup() # - onShutdown() # - onActivated() # - onDeactivated() # - onExecute() # - onAborting() # - onError() # - onReset() # - onStateUpdate() # - onRateChanged() # # The argument of this function should be the first argument # (UniqueId ec_id) of the above functions. # # @param ec_id The above functions' first argument "exec_handle." # @return true: Own context, false: other's context # # @endif # # bool isOwnExecutionContext(RTC::UniqueId ec_id); def isOwnExecutionContext(self, ec_id): global ECOTHER_OFFSET if ec_id < ECOTHER_OFFSET: return True return False ## # @if jp # # @brief [local interface] ¾õÂÖ¤ò Inactive ¤ËÁ«°Ü¤µ¤»¤ë # # ¾õÂÖ¤ò Active ¤«¤é Inactive ¤ËÁ«°Ü¤µ¤»¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î´Ø # ¿ôÆâ¤Ç¸Æ¤Ð¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ # # - onActivated() # - onExecute() # - onStateUpdate() # # ¤³¤Î´Ø¿ô¤Î°ú¿ô¤Ï¾åµ­¤Î´Ø¿ô¤Î°ú¿ô UniquieID exec_handle ¤Ç¤Ê¤± # ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # # @param ec_id ¾åµ­´Ø¿ô¤ÎÂè1°ú¿ô exec_handle ¤òÅϤ¹É¬Íפ¬¤¢¤ë¡£ # @return ¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [local interface] Make transition to Inactive state # # This function makes transition from Active to Inactive # state. This function is assumed to be called from the following # functions. # # - onActivated() # - onExecute() # - onStateUpdate() # # The argument of this function should be the first argument # (UniqueId ec_id) of the above function. # # @param ec_id The above functions' first argument "exec_handle." # @return Return code # # @endif # # ReturnCode_t deactivate(RTC::UniqueId ec_id); def deactivate(self, ec_id): ec = self.getExecutionContext(ec_id) if CORBA.is_nil(ec): return RTC.RTC_ERROR return ec.deactivate_component(self.getObjRef()) ## # @if jp # # @brief [local interface] ¾õÂÖ¤ò Active ¤ËÁ«°Ü¤µ¤»¤ë # # ¾õÂÖ¤ò Inactive ¤«¤é Active ¤ËÁ«°Ü¤µ¤»¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î´Ø # ¿ôÆâ¤Ç¸Æ¤Ð¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ # # - onStartup() # - onDeactivated() # # ¤³¤Î´Ø¿ô¤Î°ú¿ô¤Ï¾åµ­¤Î´Ø¿ô¤Î°ú¿ô UniquieID exec_handle ¤Ç¤Ê¤± # ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # # @param ec_id ¾åµ­´Ø¿ô¤ÎÂè1°ú¿ô exec_handle ¤òÅϤ¹É¬Íפ¬¤¢¤ë¡£ # @return ¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [local interface] Make transition to Active state # # This function makes transition from Inactive to Active # state. This function is assumed to be called from the following # functions. # # - onStartup() # - onDeactivated() # # The argument of this function should be the first argument # (UniqueId ec_id) of the above function. # # @param ec_id The above functions' first argument "exec_handle." # @return Return code # # @endif # # ReturnCode_t activate(RTC::UniqueId ec_id); def activate(self, ec_id): ec = self.getExecutionContext(ec_id) if CORBA.is_nil(ec): return RTC.RTC_ERROR return ec.activate_component(self.getObjRef()) ## # @if jp # # @brief [local interface] ¾õÂÖ¤ò¥ê¥»¥Ã¥È¤· Inactive ¤ËÁ«°Ü¤µ¤»¤ë # # ¾õÂÖ¤ò Error ¤«¤é Inactive ¤ËÁ«°Ü¤µ¤»¤ë¡£¤³¤Î´Ø¿ô¤Ï°Ê²¼¤Î´Ø # ¿ôÆâ¤Ç¸Æ¤Ð¤ì¤ë¤³¤È¤òÁ°Äó¤È¤·¤Æ¤¤¤ë¡£ # # - onError() # # ¤³¤Î´Ø¿ô¤Î°ú¿ô¤Ï¾åµ­¤Î´Ø¿ô¤Î°ú¿ô UniquieID exec_handle ¤Ç¤Ê¤± # ¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ # # @param ec_id ¾åµ­´Ø¿ô¤ÎÂè1°ú¿ô exec_handle ¤òÅϤ¹É¬Íפ¬¤¢¤ë¡£ # @return ¥ê¥¿¡¼¥ó¥³¡¼¥É # # @else # # @brief [local interface] Resetting and go to Inactive state # # This function reset RTC and makes transition from Error to Inactive # state. This function is assumed to be called from the following # functions. # # - onError() # # The argument of this function should be the first argument # (UniqueId ec_id) of the above function. # # @param ec_id The above functions' first argument "exec_handle." # @return Return code # # @endif # # ReturnCode_t reset(RTC::UniqueId ec_id); def reset(self, ec_id): ec = self.getExecutionContext(ec_id) if CORBA.is_nil(ec): return RTC.RTC_ERROR return ec.reset_component(self.getObjRef()) ## # @if jp # @brief [local interface] SDO service provider ¤ò¥»¥Ã¥È¤¹¤ë # @else # @brief [local interface] Set a SDO service provider # @endif # # bool addSdoServiceProvider(const SDOPackage::ServiceProfile& prof, # SdoServiceProviderBase* provider); def addSdoServiceProvider(self, prof, provider): return self._sdoservice.addSdoServiceProvider(prof, provider) ## # @if jp # @brief [local interface] SDO service provider ¤òºï½ü¤¹¤ë # @else # @brief [local interface] Remove a SDO service provider # @endif # # bool removeSdoServiceProvider(const char* id); def removeSdoServiceProvider(self, id): return self._sdoservice.removeSdoServiceProvider(id) ## # @if jp # @brief [local interface] SDO service consumer ¤ò¥»¥Ã¥È¤¹¤ë # @else # @brief [local interface] Set a SDO service consumer # @endif # # bool addSdoServiceConsumer(const SDOPackage::ServiceProfile& prof); def addSdoServiceConsumer(self, prof): return self._sdoservice.addSdoServiceConsumer(prof) ## # @if jp # @brief [local interface] SDO service consumer ¤òºï½ü¤¹¤ë # @else # @brief [local interface] Remove a SDO service consumer # @endif # # bool removeSdoServiceConsumer(const char* id); def removeSdoServiceConsumer(self, id): return self._sdoservice.removeSdoServiceConsumer(id) ## # @if jp # # @brief Á´ InPort ¤Î¥Ç¡¼¥¿¤òÆÉ¤ß¹þ¤à¡£ # # RTC ¤¬ÊÝ»ý¤¹¤ëÁ´¤Æ¤Î InPort ¤Î¥Ç¡¼¥¿¤òÆÉ¤ß¹þ¤à¡£ # # @return ÆÉ¤ß¹þ¤ß·ë²Ì(Á´¥Ý¡¼¥È¤ÎÆÉ¤ß¹þ¤ßÀ®¸ù:true¡¤¼ºÇÔ:false) # # @else # # @brief Readout the value from All InPorts. # # This operation read the value from all InPort # registered in the RTC. # # @return result (Successful:true, Failed:false) # # @endif # # bool readAll(); def readAll(self): self._rtcout.RTC_TRACE("readAll()") ret = True for inport in self._inports: if not inport.read(): self._rtcout.RTC_DEBUG("The error occurred in readAll().") ret = False if not self._readAllCompletion: return False return ret ## # @if jp # # @brief Á´ OutPort ¤Îwrite()¥á¥½¥Ã¥É¤ò¥³¡¼¥ë¤¹¤ë¡£ # # RTC ¤¬ÊÝ»ý¤¹¤ëÁ´¤Æ¤Î OutPort ¤Îwrite()¥á¥½¥Ã¥É¤ò¥³¡¼¥ë¤¹¤ë¡£ # # @return ÆÉ¤ß¹þ¤ß·ë²Ì(Á´¥Ý¡¼¥È¤Ø¤Î½ñ¤­¹þ¤ßÀ®¸ù:true¡¤¼ºÇÔ:false) # # @else # # @brief The write() method of all OutPort is called. # # This operation call the write() method of all OutPort # registered in the RTC. # # @return result (Successful:true, Failed:false) # # @endif # # bool writeAll(); def writeAll(self): self._rtcout.RTC_TRACE("writeAll()") ret = True for outport in self._outports: if not outport.write(): self._rtcout.RTC_DEBUG("The error occurred in writeAll().") ret = False if not self._writeAllCompletion: return False return ret ## # @if jp # # @brief onExecute()¼Â¹ÔÁ°¤Ç¤ÎreadAll()¥á¥½¥Ã¥É¤Î¸Æ½Ð¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ # # ¤³¤Î¥á¥½¥Ã¥É¤ò¥Ñ¥é¥á¡¼¥¿¤òtrue¤È¤·¤Æ¸Æ¤Ö»ö¤Ë¤è¤ê¡¢onExecute()¼Â¹ÔÁ°¤Ë # readAll()¤¬¸Æ½Ð¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ # ¥Ñ¥é¥á¡¼¥¿¤¬false¤Î¾ì¹ç¤Ï¡¢readAll()¸Æ½Ð¤ò̵¸ú¤Ë¤¹¤ë¡£ # # @param read(default:true) # (readAll()¥á¥½¥Ã¥É¸Æ½Ð¤¢¤ê:true, readAll()¥á¥½¥Ã¥É¸Æ½Ð¤Ê¤·:false) # # @param completion(default:false) # readAll()¤Ë¤Æ¡¢¤É¤ì¤«¤Î°ì¤Ä¤ÎInPort¤Îread()¤¬¼ºÇÔ¤·¤Æ¤âÁ´¤Æ¤ÎInPort¤Îread()¤ò¸Æ¤Ó½Ð¤¹:true, # readAll()¤Ë¤Æ¡¢¤É¤ì¤«¤Î°ì¤Ä¤ÎInPort¤Îread()¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤¹¤°¤Ëfalse¤ÇÈ´¤±¤ë:false # # @else # # @brief Set whether to execute the readAll() method. # # Set whether to execute the readAll() method. # # @param read(default:true) # (readAll() is called:true, readAll() isn't called:false) # # @param completion(default:false) # All InPort::read() calls are completed.:true, # If one InPort::read() is False, return false.:false # # @param completion(default:false) # # @endif # # void setReadAll(bool read=true, bool completion=false); def setReadAll(self, read=True, completion=False): self._readAll = read self._readAllCompletion = completion ## # @if jp # # @brief onExecute()¼Â¹Ô¸å¤ËwriteAll()¥á¥½¥Ã¥É¤Î¸Æ½Ð¤òÍ­¸ú¤Þ¤¿¤Ï̵¸ú¤Ë¤¹¤ë¡£ # # ¤³¤Î¥á¥½¥Ã¥É¤ò¥Ñ¥é¥á¡¼¥¿¤òtrue¤È¤·¤Æ¸Æ¤Ö»ö¤Ë¤è¤ê¡¢onExecute()¼Â¹Ô¸å¤Ë # writeAll()¤¬¸Æ½Ð¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£ # ¥Ñ¥é¥á¡¼¥¿¤¬false¤Î¾ì¹ç¤Ï¡¢writeAll()¸Æ½Ð¤ò̵¸ú¤Ë¤¹¤ë¡£ # # @param write(default:true) # (writeAll()¥á¥½¥Ã¥É¸Æ½Ð¤¢¤ê:true, writeAll()¥á¥½¥Ã¥É¸Æ½Ð¤Ê¤·:false) # # @param completion(default:false) # writeAll()¤Ë¤Æ¡¢¤É¤ì¤«¤Î°ì¤Ä¤ÎOutPort¤Îwrite()¤¬¼ºÇÔ¤·¤Æ¤âÁ´¤Æ¤ÎOutPort¤Îwrite()¤ò¸Æ¤Ó½Ð¤·¤ò¹Ô¤¦:true, # writeAll()¤Ë¤Æ¡¢¤É¤ì¤«¤Î°ì¤Ä¤ÎOutPort¤Îwrite()¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤¹¤°¤Ëfalse¤ÇÈ´¤±¤ë:false # # @else # # @brief Set whether to execute the writeAll() method. # # Set whether to execute the writeAll() method. # # @param write(default:true) # (writeAll() is called:true, writeAll() isn't called:false) # # @param completion(default:false) # All OutPort::write() calls are completed.:true, # If one OutPort::write() is False, return false.:false # # @endif # # void setWriteAll(bool write=true, bool completion=false); def setWriteAll(self, write=True, completion=False): self._writeAll = write self._writeAllCompletion = completion ## # @if jp # # @brief Á´ Port ¤ÎÅÐÏ¿¤òºï½ü¤¹¤ë # # RTC ¤¬ÊÝ»ý¤¹¤ëÁ´¤Æ¤Î Port ¤òºï½ü¤¹¤ë¡£ # # @param self # # @else # # @brief Unregister the All Portse # # This operation deactivates the all Port and deletes the all Port's # registrations in the RTC.. # # @endif def finalizePorts(self): self._rtcout.RTC_TRACE("finalizePorts()") self._portAdmin.finalizePorts() self._inports = [] self._outports = [] return def finalizeContexts(self): self._rtcout.RTC_TRACE("finalizeContexts()") len_ = len(self._eclist) for i in range(len_): idx = (len_ - 1) - i self._eclist[idx].stop() try: self._poa.deactivate_object(self._poa.servant_to_id(self._eclist[idx])) except: self._rtcout.RTC_TRACE(OpenRTM_aist.Logger.print_exception()) del self._eclist[idx] if self._eclist: self._eclist = [] return ## # @if jp # @brief PreComponentActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë # # ComponentAction ¼ÂÁõ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·Ä¾Á°¤Î¥¤¥Ù¥ó¥È¤Ë´ØÏ¢¤¹¤ë³Æ¼ï¥ê # ¥¹¥Ê¤òÀßÄꤹ¤ë¡£ # # ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê # # - PRE_ON_INITIALIZE: onInitialize ľÁ° # - PRE_ON_FINALIZE: onFinalize ľÁ° # - PRE_ON_STARTUP: onStartup ľÁ° # - PRE_ON_SHUTDOWN: onShutdown ľÁ° # - PRE_ON_ACTIVATED: onActivated ľÁ° # - PRE_ON_DEACTIVATED: onDeactivated ľÁ° # - PRE_ON_ABORTING: onAborted ľÁ° # - PRE_ON_ERROR: onError ľÁ° # - PRE_ON_RESET: onReset ľÁ° # - PRE_ON_EXECUTE: onExecute ľÁ° # - PRE_ON_STATE_UPDATE: onStateUpdate ľÁ° # # ¥ê¥¹¥Ê¤Ï PreComponentActionListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä # operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ # # PreComponentActionListener::operator()(UniqueId ec_id) # # ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï # RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢ # removePreComponentActionListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£ # ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú # ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # @brief Adding PreComponentAction type listener # # This operation adds certain listeners related to ComponentActions # pre events. # The following listener types are available. # # - PRE_ON_INITIALIZE: before onInitialize # - PRE_ON_FINALIZE: before onFinalize # - PRE_ON_STARTUP: before onStartup # - PRE_ON_SHUTDOWN: before onShutdown # - PRE_ON_ACTIVATED: before onActivated # - PRE_ON_DEACTIVATED: before onDeactivated # - PRE_ON_ABORTING: before onAborted # - PRE_ON_ERROR: before onError # - PRE_ON_RESET: before onReset # - PRE_ON_EXECUTE: before onExecute # - PRE_ON_STATE_UPDATE: before onStateUpdate # # Listeners should have the following function operator(). # # PreComponentActionListener::operator()(UniqueId ec_id) # # The ownership of the given listener object is transferred to # this RTObject object in default. The given listener object will # be destroied automatically in the RTObject's dtor or if the # listener is deleted by removePreComponentActionListener() function. # If you want to keep ownership of the listener object, give # "false" value to 3rd argument to inhibit automatic destruction. # # @param listener_type A listener type # @param memfunc member function object # @param autoclean A flag for automatic listener destruction # # @endif # # template <class Listener> # PreComponentActionListener* # addPreComponentActionListener(PreCompActionListenerType listener_type, # void (Listener::*memfunc)(UniqueId ec_id), # bool autoclean = true) def addPreComponentActionListener(self, listener_type, memfunc, autoclean = True): class Noname(OpenRTM_aist.PreComponentActionListener): def __init__(self, memfunc): self._memfunc = memfunc def __call__(self, ec_id): self._memfunc(ec_id) return listener = Noname(memfunc) self._actionListeners.preaction_[listener_type].addListener(listener, autoclean) return listener ## # @if jp # @brief PreComponentActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë # # ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # @brief Removing PreComponentAction type listener # # This operation removes a specified listener. # # @param listener_type A listener type # @param listener A pointer to a listener object # # @endif # # void # removePreComponentActionListener(PreComponentActionListenerType listener_type, # PreComponentActionListener* listener); def removePreComponentActionListener(self, listener_type, listener): self._actionListeners.preaction_[listener_type].removeListener(listener) return ## # @if jp # @brief PostComponentActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë # # ComponentAction ¼ÂÁõ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·Ä¾¸å¤Î¥¤¥Ù¥ó¥È¤Ë´ØÏ¢¤¹¤ë³Æ¼ï¥ê # ¥¹¥Ê¤òÀßÄꤹ¤ë¡£ # # ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê # # - POST_ON_INITIALIZE: onInitialize ľ¸å # - POST_ON_FINALIZE: onFinalize ľ¸å # - POST_ON_STARTUP: onStartup ľ¸å # - POST_ON_SHUTDOWN: onShutdown ľ¸å # - POST_ON_ACTIVATED: onActivated ľ¸å # - POST_ON_DEACTIVATED: onDeactivated ľ¸å # - POST_ON_ABORTING: onAborted ľ¸å # - POST_ON_ERROR: onError ľ¸å # - POST_ON_RESET: onReset ľ¸å # - POST_ON_EXECUTE: onExecute ľ¸å # - POST_ON_STATE_UPDATE: onStateUpdate ľ¸å # # ¥ê¥¹¥Ê¤Ï PostComponentActionListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä # operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ # # PostComponentActionListener::operator()(UniqueId ec_id, ReturnCode_t ret) # # ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï # RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢ # removePostComponentActionListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£ # ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú # ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # @brief Adding PostComponentAction type listener # # This operation adds certain listeners related to ComponentActions # post events. # The following listener types are available. # # - POST_ON_INITIALIZE: after onInitialize # - POST_ON_FINALIZE: after onFinalize # - POST_ON_STARTUP: after onStartup # - POST_ON_SHUTDOWN: after onShutdown # - POST_ON_ACTIVATED: after onActivated # - POST_ON_DEACTIVATED: after onDeactivated # - POST_ON_ABORTING: after onAborted # - POST_ON_ERROR: after onError # - POST_ON_RESET: after onReset # - POST_ON_EXECUTE: after onExecute # - POST_ON_STATE_UPDATE: after onStateUpdate # # Listeners should have the following function operator(). # # PostComponentActionListener::operator()(UniqueId ec_id, ReturnCode_t ret) # # The ownership of the given listener object is transferred to # this RTObject object in default. The given listener object will # be destroied automatically in the RTObject's dtor or if the # listener is deleted by removePostComponentActionListener() function. # If you want to keep ownership of the listener object, give # "false" value to 3rd argument to inhibit automatic destruction. # # @param listener_type A listener type # @param memfunc member function object # @param autoclean A flag for automatic listener destruction # # @endif # # template <class Listener> # PostComponentActionListener* # addPostComponentActionListener(PostCompActionListenerType listener_type, # void (Listener::*memfunc)(UniqueId ec_id, # ReturnCode_t ret), # bool autoclean = true) def addPostComponentActionListener(self, listener_type, memfunc, autoclean = True): class Noname(OpenRTM_aist.PostComponentActionListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, ec_id, ret): self._memfunc(ec_id, ret) return listener = Noname(memfunc) self._actionListeners.postaction_[listener_type].addListener(listener, autoclean) return listener ## # @if jp # @brief PostComponentActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë # # ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # @brief Removing PostComponentAction type listener # # This operation removes a specified listener. # # @param listener_type A listener type # @param listener A pointer to a listener object # # @endif ## # void # removePostComponentActionListener(PostComponentActionListenerType listener_type, # PostComponentActionListener* listener); def removePostComponentActionListener(self, listener_type, listener): self._actionListeners.postaction_[listener_type].removeListener(listener) return ## # @if jp # @brief PortActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë # # Port¤ÎÄɲᢺï½ü»þ¤Ë¥³¡¼¥ë¥Ð¥Ã¥¯¤µ¤ì¤ë³Æ¼ï¥ê¥¹¥Ê¤òÀßÄꤹ¤ë¡£ # # ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê # # - ADD_PORT: PortÄɲûþ # - REMOVE_PORT: Portºï½ü»þ # # ¥ê¥¹¥Ê¤Ï PortActionListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä # operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ # # PortActionListener::operator()(PortProfile& pprof) # # ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï # RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢ # removePortActionListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£ # ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú # ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # @brief Adding PortAction type listener # # This operation adds certain listeners related to ComponentActions # post events. # The following listener types are available. # # - ADD_PORT: At adding Port # - REMOVE_PORT: At removing Port # # Listeners should have the following function operator(). # # PortActionListener::operator()(RTC::PortProfile pprof) # # The ownership of the given listener object is transferred to # this RTObject object in default. The given listener object will # be destroied automatically in the RTObject's dtor or if the # listener is deleted by removePortActionListener() function. # If you want to keep ownership of the listener object, give # "false" value to 3rd argument to inhibit automatic destruction. # # @param listener_type A listener type # @param memfunc member function object # @param autoclean A flag for automatic listener destruction # # @endif # # template <class Listener> # PortActionListener* # addPortActionListener(PortActionListenerType listener_type, # void (Listener::*memfunc)(const RTC::PortProfile&), # bool autoclean=true) def addPortActionListener(self, listener_type, memfunc, autoclean = True): class Noname(OpenRTM_aist.PortActionListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, pprofile): self._memfunc(pprofile) return listener = Noname(memfunc) self._actionListeners.portaction_[listener_type].addListener(listener, autoclean) return listener ## # @if jp # @brief PortActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë # # ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # @brief Removing PortAction type listener # # This operation removes a specified listener. # # @param listener_type A listener type # @param listener A pointer to a listener object # # @endif # void # removePortActionListener(PortActionListenerType listener_type, # PortActionListener* listener); def removePortActionListener(self, listener_type, listener): self._actionListeners.portaction_[listener_type].removeListener(listener) return ## # @if jp # @brief ExecutionContextActionListener ¥ê¥¹¥Ê¤òÄɲ乤ë # # ExecutionContext¤ÎÄɲᢺï½ü»þ¤Ë¥³¡¼¥ë¥Ð¥Ã¥¯¤µ¤ì¤ë³Æ¼ï¥ê¥¹¥Ê¤òÀßÄꤹ¤ë¡£ # # ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê # # - ATTACH_EC: ExecutionContext ¥¢¥¿¥Ã¥Á»þ # - DETACH_EC: ExecutionContext ¥Ç¥¿¥Ã¥Á»þ # # ¥ê¥¹¥Ê¤Ï ExecutionContextActionListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä # operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ # # ExecutionContextActionListener::operator()(UniqueId¡¡ec_id) # # ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï # RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢ # removeExecutionContextActionListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£ # ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú # ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # @brief Adding ExecutionContextAction type listener # # This operation adds certain listeners related to ComponentActions # post events. # The following listener types are available. # # - ADD_PORT: At adding ExecutionContext # - REMOVE_PORT: At removing ExecutionContext # # Listeners should have the following function operator(). # # ExecutionContextActionListener::operator()(UniqueId ec_id) # # The ownership of the given listener object is transferred to # this RTObject object in default. The given listener object will # be destroied automatically in the RTObject's dtor or if the # listener is deleted by removeExecutionContextActionListener() function. # If you want to keep ownership of the listener object, give # "false" value to 3rd argument to inhibit automatic destruction. # # @param listener_type A listener type # @param memfunc member function object # @param autoclean A flag for automatic listener destruction # # @endif # # template <class Listener> # ECActionListener* # addExecutionContextActionListener(ECActionListenerType listener_type, # void (Listener::*memfunc)(UniqueId), # bool autoclean = true); def addExecutionContextActionListener(self, listener_type, memfunc, autoclean = True): class Noname(OpenRTM_aist.ExecutionContextActionListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, ec_id): self._memfunc(ec_id) return listener = Noname(memfunc) self._actionListeners.ecaction_[listener_type].addListener(listener, autoclean) return listener ## # @if jp # @brief ExecutionContextActionListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë # # ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # @brief Removing ExecutionContextAction type listener # # This operation removes a specified listener. # # @param listener_type A listener type # @param listener A pointer to a listener object # # @endif # # void # removeExecutionContextActionListener(ECActionListenerType listener_type, # ECActionListener* listener); def removeExecutionContextActionListener(self, listener_type, listener): self._actionListeners.ecaction_[listener_type].removeListener(listener) return ## # @if jp # @brief PortConnectListener ¥ê¥¹¥Ê¤òÄɲ乤ë # # Port¤ÎÀܳ»þ¤äÀܳ²ò½ü»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë³Æ¼ï¥ê¥¹¥Ê¤òÀßÄꤹ¤ë¡£ # # ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê # # - ON_NOTIFY_CONNECT: notify_connect() ´Ø¿ôÆâ¸Æ¤Ó½Ð¤·Ä¾¸å # - ON_NOTIFY_DISCONNECT: notify_disconnect() ¸Æ¤Ó½Ð¤·Ä¾¸å # - ON_UNSUBSCRIBE_INTERFACES: notify_disconnect() Æâ¤ÎIF¹ØÆÉ²ò½ü»þ # # ¥ê¥¹¥Ê¤Ï PortConnectListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä # operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ # # PortConnectListener::operator()(const char*, ConnectorProfile) # # ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï # RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢ # removePortConnectListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£ # ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú # ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # @brief Adding PortConnect type listener # # This operation adds certain listeners related to Port's connect actions. # The following listener types are available. # # - ON_NOTIFY_CONNECT: right after entering into notify_connect() # - ON_NOTIFY_DISCONNECT: right after entering into notify_disconnect() # - ON_UNSUBSCRIBE_INTERFACES: unsubscribing IF in notify_disconnect() # # Listeners should have the following function operator(). # # PortConnectListener::operator()(const char*, ConnectorProfile) # # The ownership of the given listener object is transferred to # this RTObject object in default. The given listener object will # be destroied automatically in the RTObject's dtor or if the # listener is deleted by removePortConnectListener() function. # If you want to keep ownership of the listener object, give # "false" value to 3rd argument to inhibit automatic destruction. # # @param listener_type A listener type # @param memfunc member function object # @param autoclean A flag for automatic listener destruction # # @endif # # template <class Listener> # PortConnectListener* # addPortConnectListener(PortConnectListenerType listener_type, # void (Listener::*memfunc)(const char*, # ConnectorProfile&), # bool autoclean = true) def addPortConnectListener(self, listener_type, memfunc, autoclean = True): class Noname(OpenRTM_aist.PortConnectListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, portname, cprofile): self._memfunc(portname, cprofile) return listener = Noname(memfunc) self._portconnListeners.portconnect_[listener_type].addListener(listener, autoclean) return listener ## # @if jp # @brief PortConnectListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë # # ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # @brief Removing PortConnect type listener # # This operation removes a specified listener. # # @param listener_type A listener type # @param listener A pointer to a listener object # # @endif # # void # removePortConnectListener(PortConnectListenerType listener_type, # PortConnectListener* listener); def removePortConnectListener(self, listener_type, listener): self._portconnListeners.portconnect_[listener_type].removeListener(listener) return ## # @if jp # @brief PortConnectRetListener ¥ê¥¹¥Ê¤òÄɲ乤ë # # Port¤ÎÀܳ»þ¤äÀܳ²ò½ü»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë³Æ¼ï¥ê¥¹¥Ê¤òÀßÄꤹ¤ë¡£ # # ÀßÄê¤Ç¤­¤ë¥ê¥¹¥Ê¤Î¥¿¥¤¥×¤È¥³¡¼¥ë¥Ð¥Ã¥¯¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤ÎÄ̤ê # # - ON_CONNECT_NEXTPORT: notify_connect() Ãæ¤Î¥«¥¹¥±¡¼¥É¸Æ¤Ó½Ð¤·Ä¾¸å # - ON_SUBSCRIBE_INTERFACES: notify_connect() Ãæ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¹ØÆÉľ¸å # - ON_CONNECTED: nofity_connect() Àܳ½èÍý´°Î»»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë # - ON_DISCONNECT_NEXT: notify_disconnect() Ãæ¤Ë¥«¥¹¥±¡¼¥É¸Æ¤Ó½Ð¤·Ä¾¸å # - ON_DISCONNECTED: notify_disconnect() ¥ê¥¿¡¼¥ó»þ # # ¥ê¥¹¥Ê¤Ï PortConnectRetListener ¤ò·Ñ¾µ¤·¡¢°Ê²¼¤Î¥·¥°¥Ë¥Á¥ã¤ò»ý¤Ä # operator() ¤ò¼ÂÁõ¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ # # PortConnectRetListener::operator()(const char*, ConnectorProfile) # # ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤ËÍ¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤Ï # RTObject¤Ë°Ü¤ê¡¢RTObject²òÂλþ¤â¤·¤¯¤Ï¡¢ # removePortConnectRetListener() ¤Ë¤è¤êºï½ü»þ¤Ë¼«Æ°Åª¤Ë²òÂΤµ¤ì¤ë¡£ # ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î½êÍ­¸¢¤ò¸Æ¤Ó½Ð¤·Â¦¤Ç°Ý»ý¤·¤¿¤¤¾ì¹ç¤Ï¡¢Âè3°ú # ¿ô¤Ë false ¤ò»ØÄꤷ¡¢¼«Æ°Åª¤Ê²òÂΤòÍÞÀ©¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Î¼«Æ°Åª²òÂΤò¹Ô¤¦¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # @brief Adding PortConnectRet type listener # # This operation adds certain listeners related to Port's connect actions. # The following listener types are available. # # - ON_CONNECT_NEXTPORT: after cascade-call in notify_connect() # - ON_SUBSCRIBE_INTERFACES: after IF subscribing in notify_connect() # - ON_CONNECTED: completed nofity_connect() connection process # - ON_DISCONNECT_NEXT: after cascade-call in notify_disconnect() # - ON_DISCONNECTED: completed notify_disconnect() disconnection process # # Listeners should have the following function operator(). # # PortConnectRetListener::operator()(const char*, ConnectorProfile) # # The ownership of the given listener object is transferred to # this RTObject object in default. The given listener object will # be destroied automatically in the RTObject's dtor or if the # listener is deleted by removePortConnectRetListener() function. # If you want to keep ownership of the listener object, give # "false" value to 3rd argument to inhibit automatic destruction. # # @param listener_type A listener type # @param memfunc member function object # @param autoclean A flag for automatic listener destruction # # @endif # # template <class Listener> # PortConnectRetListener* # addPortConnectRetListener(PortConnectRetListenerType listener_type, # void (Listener::*memfunc)(const char*, # ConnectorProfile&, # ReturnCode_t)) def addPortConnectRetListener(self, listener_type, memfunc, autoclean = True): class Noname(OpenRTM_aist.PortConnectRetListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, portname, cprofile, ret): self._memfunc(portname, cprofile, ret) return listener = Noname(memfunc) self._portconnListeners.portconnret_[listener_type].addListener(listener, autoclean) return listener ## # @if jp # @brief PortConnectRetListener ¥ê¥¹¥Ê¤òºï½ü¤¹¤ë # # ÀßÄꤷ¤¿³Æ¼ï¥ê¥¹¥Ê¤òºï½ü¤¹¤ë¡£ # # @param listener_type ¥ê¥¹¥Ê¥¿¥¤¥× # @param listener ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # @brief Removing PortConnectRet type listener # # This operation removes a specified listener. # # @param listener_type A listener type # @param listener A pointer to a listener object # # @endif # # void # removePortConnectRetListener(PortConnectRetListenerType listener_type, # PortConnectRetListener* listener); def removePortConnectRetListener(self, listener_type, listener): self._portconnListeners.portconnret_[listener_type].removeListener(listener) return ## # @if jp # # @brief ConfigurationParamListener ¤òÄɲ乤ë # # update(const char* config_set, const char* config_param) ¤¬¸Æ¤Ð¤ì¤¿ºÝ¤Ë # ¥³¡¼¥ë¤µ¤ì¤ë¥ê¥¹¥Ê ConfigurationParamListener ¤òÄɲ乤롣 # type ¤Ë¤Ï¸½ºß¤Î¤È¤³¤í ON_UPDATE_CONFIG_PARAM ¤Î¤ß¤¬Æþ¤ë¡£ # # @param type ConfigurationParamListenerType·¿¤ÎÃÍ¡£ # ON_UPDATE_CONFIG_PARAM ¤¬¤¢¤ë¡£ # # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤ò¼«Æ°¤Çºï½ü¤¹¤ë¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # # @brief Adding ConfigurationParamListener # # This function adds a listener object which is called when # update(const char* config_set, const char* config_param) is # called. In the type argument, currently only # ON_UPDATE_CONFIG_PARAM is allowed. # # @param type ConfigurationParamListenerType value # ON_UPDATE_CONFIG_PARAM is only allowed. # # @param memfunc member function object # @param autoclean a flag whether if the listener object autocleaned. # # @endif # # template <class Listener> # ConfigurationParamListener* # addConfigurationParamListener(ConfigurationParamListenerType listener_type, # void (Listener::*memfunc)(const char*, # const char*), # bool autoclean = true) def addConfigurationParamListener(self, type, memfunc, autoclean = True): class Noname(OpenRTM_aist.ConfigurationParamListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, config_set_name, config_param_name): self._memfunc(config_set_name, config_param_name) return listener = Noname(memfunc) self._configsets.addConfigurationParamListener(type, listener, autoclean) return listener ## # @if jp # # @brief ConfigurationParamListener ¤òºï½ü¤¹¤ë # # addConfigurationParamListener ¤ÇÄɲ䵤줿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ë¡£ # # @param type ConfigurationParamListenerType·¿¤ÎÃÍ¡£ # ON_UPDATE_CONFIG_PARAM ¤¬¤¢¤ë¡£ # @param listener Í¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # # @brief Removing ConfigurationParamListener # # This function removes a listener object which is added by # addConfigurationParamListener() function. # # @param type ConfigurationParamListenerType value # ON_UPDATE_CONFIG_PARAM is only allowed. # @param listener a pointer to ConfigurationParamListener listener object. # # @endif # # void removeConfigurationParamListener(ConfigurationParamListenerType type, # ConfigurationParamListener* listener); def removeConfigurationParamListener(self, type, listener): self._configsets.removeConfigurationParamListener(type, listener) return ## # @if jp # # @brief ConfigurationSetListener ¤òÄɲ乤ë # # ConfigurationSet ¤¬¹¹¿·¤µ¤ì¤¿¤È¤­¤Ê¤É¤Ë¸Æ¤Ð¤ì¤ë¥ê¥¹¥Ê # ConfigurationSetListener ¤òÄɲ乤롣ÀßÄê²Äǽ¤Ê¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤Î # 2¼ïÎब¤¢¤ë¡£ # # - ON_SET_CONFIG_SET: setConfigurationSetValues() ¤Ç # ConfigurationSet ¤ËÃͤ¬ÀßÄꤵ¤ì¤¿¾ì¹ç¡£ # - ON_ADD_CONFIG_SET: addConfigurationSet() ¤Ç¿·¤·¤¤ # ConfigurationSet ¤¬Äɲ䵤줿¾ì¹ç¡£ # # @param type ConfigurationSetListenerType·¿¤ÎÃÍ¡£ # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤ò¼«Æ°¤Çºï½ü¤¹¤ë¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # # @brief Adding ConfigurationSetListener # # This function add a listener object which is called when # ConfigurationSet is updated. Available events are the followings. # # @param type ConfigurationSetListenerType value # @param memfunc member function object # @param autoclean a flag whether if the listener object autocleaned. # # @endif # # template <class Listener> # ConfigurationSetListener* # addConfigurationSetListener(ConfigurationSetListenerType listener_type, # void (Listener::*memfunc) # (const coil::Properties& config_set)) def addConfigurationSetListener(self, listener_type, memfunc, autoclean = True): class Noname(OpenRTM_aist.ConfigurationSetListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, config_set): self._memfunc(config_set) return listener = Noname(memfunc) self._configsets.addConfigurationSetListener(listener_type, listener, autoclean) return listener ## # @if jp # # @brief ConfigurationSetListener ¤òºï½ü¤¹¤ë # # addConfigurationSetListener ¤ÇÄɲ䵤줿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤òºï½ü¤¹¤ë¡£ # # @param type ConfigurationSetListenerType·¿¤ÎÃÍ¡£ # @param listener Í¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # # @brief Removing ConfigurationSetListener # # This function removes a listener object which is added by # addConfigurationSetListener() function. # # @param type ConfigurationSetListenerType value # @param listener a pointer to ConfigurationSetListener listener object. # # @endif # # void removeConfigurationSetListener(ConfigurationSetListenerType type, # ConfigurationSetListener* listener); def removeConfigurationSetListener(self, type, listener): self._configsets.removeConfigurationSetListener(type, listener) return ## # @if jp # # @brief ConfigurationSetNameListener ¤òÄɲ乤ë # # ConfigurationSetName ¤¬¹¹¿·¤µ¤ì¤¿¤È¤­¤Ê¤É¤Ë¸Æ¤Ð¤ì¤ë¥ê¥¹¥Ê # ConfigurationSetNameListener ¤òÄɲ乤롣ÀßÄê²Äǽ¤Ê¥¤¥Ù¥ó¥È¤Ï°Ê²¼¤Î # 3¼ïÎब¤¢¤ë¡£ # # - ON_UPDATE_CONFIG_SET: ¤¢¤ë ConfigurationSet ¤¬¥¢¥Ã¥×¥Ç¡¼¥È¤µ¤ì¤¿ # - ON_REMOVE_CONFIG_SET: ¤¢¤ë ConfigurationSet ¤¬ºï½ü¤µ¤ì¤¿ # - ON_ACTIVATE_CONFIG_SET: ¤¢¤ë ConfigurationSet ¤¬¥¢¥¯¥Æ¥£¥Ö²½¤µ¤ì¤¿ # # @param type ConfigurationSetNameListenerType·¿¤ÎÃÍ¡£ # @param memfunc ´Ø¿ô¥ª¥Ö¥¸¥§¥¯¥È # @param autoclean ¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤ò¼«Æ°¤Çºï½ü¤¹¤ë¤«¤É¤¦¤«¤Î¥Õ¥é¥° # # @else # # @brief Adding ConfigurationSetNameListener # # This function add a listener object which is called when # ConfigurationSetName is updated. Available events are the followings. # # - ON_UPDATE_CONFIG_SET: A ConfigurationSet has been updated. # - ON_REMOVE_CONFIG_SET: A ConfigurationSet has been deleted. # - ON_ACTIVATE_CONFIG_SET: A ConfigurationSet has been activated. # # @param type ConfigurationSetNameListenerType value # @param memfunc member function object # @param autoclean a flag whether if the listener object autocleaned. # # @endif # # template <class Listener> # ConfigurationSetNameListener* # addConfigurationSetNameListener(ConfigurationSetNameListenerType type, # void (Listener::*memfunc)(const char*)) def addConfigurationSetNameListener(self, type, memfunc, autoclean = True): class Noname(OpenRTM_aist.ConfigurationSetNameListener): def __init__(self, memfunc): self._memfunc = memfunc return def __call__(self, config_set_name): self._memfunc(config_set_name) return listener = Noname(memfunc) self._configsets.addConfigurationSetNameListener(type, listener, autoclean) return listener ## # @if jp # # @brief ConfigurationSetNameListener ¤òºï½ü¤¹¤ë # # addConfigurationSetNameListener ¤ÇÄɲ䵤줿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤ò # ºï½ü¤¹¤ë¡£ # # @param type ConfigurationSetNameListenerType·¿¤ÎÃÍ¡£ # ON_UPDATE_CONFIG_PARAM ¤¬¤¢¤ë¡£ # @param listener Í¿¤¨¤¿¥ê¥¹¥Ê¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ # # @else # # @brief Removing ConfigurationSetNameListener # # This function removes a listener object which is added by # addConfigurationSetNameListener() function. # # @param type ConfigurationSetNameListenerType value # ON_UPDATE_CONFIG_PARAM is only allowed. # @param listener a pointer to ConfigurationSetNameListener # listener object. # # @endif # void # removeConfigurationSetNameListener(ConfigurationSetNameListenerType type, # ConfigurationSetNameListener* listener); def removeConfigurationSetNameListener(self, type, listener): self._configsets.removeConfigurationSetNameListener(type, listener) return ## # @if jp # # @brief RTC ¤ò½ªÎ»¤¹¤ë # # RTC ¤Î½ªÎ»½èÍý¤ò¼Â¹Ô¤¹¤ë¡£ # ÊÝ»ý¤·¤Æ¤¤¤ëÁ´ Port ¤ÎÅÐÏ¿¤ò²ò½ü¤¹¤ë¤È¤È¤â¤Ë¡¢³ºÅö¤¹¤ë CORBA ¥ª¥Ö¥¸¥§¥¯¥È # ¤òÈó³èÀ­²½¤·¡¢RTC ¤ò½ªÎ»¤¹¤ë¡£ # # @param self # # @else # # @endif def shutdown(self): self._rtcout.RTC_TRACE("shutdown()") try: self.finalizePorts() self.finalizeContexts() self._poa.deactivate_object(self._poa.servant_to_id(self._SdoConfigImpl)) self._poa.deactivate_object(self._poa.servant_to_id(self)) except: self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception()) if self._manager: self._rtcout.RTC_DEBUG("Cleanup on Manager") self._manager.notifyFinalized(self) return # inline void preOnInitialize(UniqueId ec_id) def preOnInitialize(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_INITIALIZE].notify(ec_id) return # inline void preOnFinalize(UniqueId ec_id) def preOnFinalize(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_FINALIZE].notify(ec_id) return # inline void preOnStartup(UniqueId ec_id) def preOnStartup(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_STARTUP].notify(ec_id) return # inline void preOnShutdown(UniqueId ec_id) def preOnShutdown(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_SHUTDOWN].notify(ec_id) return # inline void preOnActivated(UniqueId ec_id) def preOnActivated(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_ACTIVATED].notify(ec_id) return # inline void preOnDeactivated(UniqueId ec_id) def preOnDeactivated(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_DEACTIVATED].notify(ec_id) return # inline void preOnAborting(UniqueId ec_id) def preOnAborting(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_ABORTING].notify(ec_id) return # inline void preOnError(UniqueId ec_id) def preOnError(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_ERROR].notify(ec_id) return # inline void preOnReset(UniqueId ec_id) def preOnReset(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_RESET].notify(ec_id) return # inline void preOnExecute(UniqueId ec_id) def preOnExecute(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_EXECUTE].notify(ec_id) return # inline void preOnStateUpdate(UniqueId ec_id) def preOnStateUpdate(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_STATE_UPDATE].notify(ec_id) return # inline void preOnRateChanged(UniqueId ec_id) def preOnRateChanged(self, ec_id): self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_RATE_CHANGED].notify(ec_id) return # inline void postOnInitialize(UniqueId ec_id, ReturnCode_t ret) def postOnInitialize(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_INITIALIZE].notify(ec_id, ret) return # inline void postOnFinalize(UniqueId ec_id, ReturnCode_t ret) def postOnFinalize(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_FINALIZE].notify(ec_id, ret) return # inline void postOnStartup(UniqueId ec_id, ReturnCode_t ret) def postOnStartup(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_STARTUP].notify(ec_id, ret) return # inline void postOnShutdown(UniqueId ec_id, ReturnCode_t ret) def postOnShutdown(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_SHUTDOWN].notify(ec_id, ret) return # inline void postOnActivated(UniqueId ec_id, ReturnCode_t ret) def postOnActivated(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_ACTIVATED].notify(ec_id, ret) return # inline void postOnDeactivated(UniqueId ec_id, ReturnCode_t ret) def postOnDeactivated(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_DEACTIVATED].notify(ec_id, ret) return # inline void postOnAborting(UniqueId ec_id, ReturnCode_t ret) def postOnAborting(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_ABORTING].notify(ec_id, ret) return # inline void postOnError(UniqueId ec_id, ReturnCode_t ret) def postOnError(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_ERROR].notify(ec_id, ret) return # inline void postOnReset(UniqueId ec_id, ReturnCode_t ret) def postOnReset(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_RESET].notify(ec_id, ret) return # inline void postOnExecute(UniqueId ec_id, ReturnCode_t ret) def postOnExecute(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_EXECUTE].notify(ec_id, ret) return # inline void postOnStateUpdate(UniqueId ec_id, ReturnCode_t ret) def postOnStateUpdate(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_STATE_UPDATE].notify(ec_id, ret) return # inline void postOnRateChanged(UniqueId ec_id, ReturnCode_t ret) def postOnRateChanged(self, ec_id, ret): self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_RATE_CHANGED].notify(ec_id, ret) return # inline void onAddPort(const PortProfile& pprof) def onAddPort(self, pprof): self._actionListeners.portaction_[OpenRTM_aist.PortActionListenerType.ADD_PORT].notify(pprof) return # inline void onRemovePort(const PortProfile& pprof) def onRemovePort(self, pprof): self._actionListeners.portaction_[OpenRTM_aist.PortActionListenerType.REMOVE_PORT].notify(pprof) return # inline void onAttachExecutionContext(UniqueId ec_id) def onAttachExecutionContext(self, ec_id): self._actionListeners.ecaction_[OpenRTM_aist.ExecutionContextActionListenerType.EC_ATTACHED].notify(ec_id) return # inline void onDetachExecutionContext(UniqueId ec_id) def onDetachExecutionContext(self, ec_id): self._actionListeners.ecaction_[OpenRTM_aist.ExecutionContextActionListenerType.EC_DETACHED].notify(ec_id) return ## # @if jp # @class svc_name # @brief SDOService ¤Î¥×¥í¥Õ¥¡¥¤¥ë¥ê¥¹¥È¤«¤éid¤Ç¥µ¡¼¥Á¤¹¤ë¤¿¤á¤Î # ¥Õ¥¡¥ó¥¯¥¿¥¯¥é¥¹ # @else # # @endif class svc_name: def __init__(self, _id): self._id= _id def __call__(self, prof): return self._id == prof.id #------------------------------------------------------------ # Functor #------------------------------------------------------------ ## # @if jp # @class nv_name # @brief NVList ¸¡º÷ÍÑ¥Õ¥¡¥ó¥¯¥¿ # @else # # @endif class nv_name: def __init__(self, _name): self._name = _name def __call__(self, nv): return self._name == nv.name ## # @if jp # @class ec_find # @brief ExecutionContext ¸¡º÷ÍÑ¥Õ¥¡¥ó¥¯¥¿ # @else # # @endif class ec_find: def __init__(self, _ec): self._ec = _ec def __call__(self, ecs): try: if not CORBA.is_nil(ecs): ec = ecs._narrow(RTC.ExecutionContext) return self._ec._is_equivalent(ec) except: print(OpenRTM_aist.Logger.print_exception()) return False return False ## # @if jp # @class ec_copy # @brief ExecutionContext CopyÍÑ¥Õ¥¡¥ó¥¯¥¿ # @else # # @endif class ec_copy: def __init__(self, eclist): self._eclist = eclist def __call__(self, ecs): if not CORBA.is_nil(ecs): self._eclist.append(ecs) ## # @if jp # @class deactivate_comps # @brief RTC Èó³èÀ­²½ÍÑ¥Õ¥¡¥ó¥¯¥¿ # @else # # @endif class deactivate_comps: def __init__(self, comp): self._comp = comp def __call__(self, ec): try: if not CORBA.is_nil(ec) and not ec._non_existent(): ec.deactivate_component(self._comp) ec.stop() except: print(OpenRTM_aist.Logger.print_exception()) # RtcBase = RTObject_impl
839  #
840  # @return ExecutionContextHandle
841  #
842  # Í¿¤¨¤é¤ì¤¿¼Â¹Ô¥³¥ó¥Æ¥­¥¹¥È¤Ë´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥Ï¥ó¥É¥ë¤òÊÖ¤¹¡£
843  #
844  # @else
845  # @brief [CORBA interface] Return a handle of a ExecutionContext
846  #
847  # @param ExecutionContext
848  #
849  # @return ExecutionContextHandle
850  #
851  # This operation returns a handle that is associated with the given
852  # execution context.
853  #
854  # @endif
855  #
856  # virtual ExecutionContextHandle_t
857  # get_context_handle(ExecutionContext_ptr cxt)
858  def get_context_handle(self, cxt):
859  self._rtcout.RTC_TRACE("get_context_handle()")
860 
861  num = OpenRTM_aist.CORBA_SeqUtil.find(self._ecMine, self.ec_find(cxt))
862  if num != -1:
863  return int(num)
864 
865  num = OpenRTM_aist.CORBA_SeqUtil.find(self._ecOther, self.ec_find(cxt))
866  if num != -1:
867  return int(num)
868 
869  return int(-1)
870 
871 
872  #============================================================
873  # RTC::RTObject
874  #============================================================
875 
876 
898  self._rtcout.RTC_TRACE("get_component_profile()")
899  try:
900  prop_ = RTC.ComponentProfile(self._properties.getProperty("instance_name"),
901  self._properties.getProperty("type_name"),
902  self._properties.getProperty("description"),
903  self._properties.getProperty("version"),
904  self._properties.getProperty("vendor"),
905  self._properties.getProperty("category"),
906  self._portAdmin.getPortProfileList(),
907  self._profile.parent,
908  self._profile.properties)
910  return prop_
911  # return RTC.ComponentProfile(self._profile.instance_name,
912  # self._profile.type_name,
913  # self._profile.description,
914  # self._profile.version,
915  # self._profile.vendor,
916  # self._profile.category,
917  # self._portAdmin.getPortProfileList(),
918  # self._profile.parent,
919  # self._profile.properties)
920 
921  except:
922  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
923 
924  assert(False)
925  return None
926 
927 
928 
949  def get_ports(self):
950  self._rtcout.RTC_TRACE("get_ports()")
951  try:
952  return self._portAdmin.getPortServiceList()
953  except:
954  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
955 
956  assert(False)
957  return []
958 
959 
960 
961  # RTC::ComponentAction
962 
963 
994  def attach_context(self, exec_context):
995  global ECOTHER_OFFSET
996  self._rtcout.RTC_TRACE("attach_context()")
997  # ID: 0 - (offset-1) : owned ec
998  # ID: offset - : participating ec
999  # owned ec index = ID
1000  # participate ec index = ID - offset
1001  ecs = exec_context._narrow(RTC.ExecutionContextService)
1002  if CORBA.is_nil(ecs):
1003  return -1
1004 
1005  # if m_ecOther has nil element, insert attached ec to there.
1006  for i in range(len(self._ecOther)):
1007  if CORBA.is_nil(self._ecOther[i]):
1008  self._ecOther[i] = ecs
1009  ec_id = i + ECOTHER_OFFSET
1010  self.onAttachExecutionContext(ec_id)
1011  return ec_id
1012 
1013  # no space in the list, push back ec to the last.
1015  ec_id = int(len(self._ecOther) - 1 + ECOTHER_OFFSET)
1016  self.onAttachExecutionContext(ec_id)
1017  return ec_id
1018 
1019 
1020  # UniqueId bindContext(ExecutionContext_ptr exec_context);
1021  def bindContext(self, exec_context):
1022  global ECOTHER_OFFSET
1023  self._rtcout.RTC_TRACE("bindContext()")
1024  # ID: 0 - (offset-1) : owned ec
1025  # ID: offset - : participating ec
1026  # owned ec index = ID
1027  # participate ec index = ID - offset
1028  ecs = exec_context._narrow(RTC.ExecutionContextService)
1029 
1030  if CORBA.is_nil(ecs):
1031  return -1
1032 
1033  # if m_ecMine has nil element, insert attached ec to there.
1034  for i in range(len(self._ecMine)):
1035  if CORBA.is_nil(self._ecMine[i]):
1036  self._ecMine[i] = ecs
1037  self.onAttachExecutionContext(i)
1038  return i
1039  #return i + ECOTHER_OFFSET
1040 
1041  # no space in the list, push back ec to the last.
1043 
1044  return int(len(self._ecMine) - 1)
1045  #return long(len(self._ecMine) - 1 + ECOTHER_OFFSET)
1046 
1047 
1048 
1090  def detach_context(self, ec_id):
1091  global ECOTHER_OFFSET
1092  self._rtcout.RTC_TRACE("detach_context(%d)", ec_id)
1093  len_ = len(self._ecOther)
1094 
1095  # ID: 0 - (offset-1) : owned ec
1096  # ID: offset - : participating ec
1097  # owned ec index = ID
1098  # participate ec index = ID - offset
1099  if (int(ec_id) < int(ECOTHER_OFFSET)) or \
1100  (int(ec_id - ECOTHER_OFFSET) > len_):
1101  return RTC.BAD_PARAMETER
1102 
1103  index = int(ec_id - ECOTHER_OFFSET)
1104 
1105  if index < 0 or CORBA.is_nil(self._ecOther[index]):
1106  return RTC.BAD_PARAMETER
1107 
1108  #OpenRTM_aist.CORBA_SeqUtil.erase(self._ecOther, index)
1109  self._ecOther[index] = RTC.ExecutionContextService._nil
1110  self.onDetachExecutionContext(ec_id)
1111  return RTC.RTC_OK
1112 
1113 
1114 
1138  def on_initialize(self):
1139  self._rtcout.RTC_TRACE("on_initialize()")
1140  ret = RTC.RTC_ERROR
1141  try:
1142  self.preOnInitialize(0)
1143  ret = self.onInitialize()
1144  except:
1145  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1146  ret = RTC.RTC_ERROR
1147 
1148  active_set = self._properties.getProperty("configuration.active_config",
1149  "default")
1150 
1151  if self._configsets.haveConfig(active_set):
1152  self._configsets.update(active_set)
1153  else:
1154  self._configsets.update("default")
1155 
1156  self.postOnInitialize(0,ret)
1157  return ret
1158 
1159 
1160 
1184  def on_finalize(self):
1185  self._rtcout.RTC_TRACE("on_finalize()")
1186  ret = RTC.RTC_ERROR
1187  try:
1188  self.preOnFinalize(0)
1189  ret = self.onFinalize()
1190  except:
1191  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1192  ret = RTC.RTC_ERROR
1193  self.postOnFinalize(0, ret)
1194  return ret
1195 
1196 
1197 
1224  def on_startup(self, ec_id):
1225  self._rtcout.RTC_TRACE("on_startup(%d)", ec_id)
1226  ret = RTC.RTC_ERROR
1227  try:
1228  self.preOnStartup(ec_id)
1229  ret = self.onStartup(ec_id)
1230  except:
1231  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1232  ret = RTC.RTC_ERROR
1233  self.postOnStartup(ec_id, ret)
1234  return ret
1235 
1236 
1237 
1264  def on_shutdown(self, ec_id):
1265  self._rtcout.RTC_TRACE("on_shutdown(%d)", ec_id)
1266  ret = RTC.RTC_ERROR
1267  try:
1268  self.preOnShutdown(ec_id)
1269  ret = self.onShutdown(ec_id)
1270  except:
1271  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1272  ret = RTC.RTC_ERROR
1273  self.postOnShutdown(ec_id, ret)
1274  return ret
1275 
1276 
1277 
1302  def on_activated(self, ec_id):
1303  self._rtcout.RTC_TRACE("on_activated(%d)", ec_id)
1304  ret = RTC.RTC_ERROR
1305  try:
1306  self.preOnActivated(ec_id)
1307  self._configsets.update()
1308  ret = self.onActivated(ec_id)
1309  self._portAdmin.activatePorts()
1310  except:
1311  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1312  ret = RTC.RTC_ERROR
1313  self.postOnActivated(ec_id, ret)
1314  return ret
1315 
1316 
1317 
1342  def on_deactivated(self, ec_id):
1343  self._rtcout.RTC_TRACE("on_deactivated(%d)", ec_id)
1344  ret = RTC.RTC_ERROR
1345  try:
1346  self.preOnDeactivated(ec_id)
1347  self._portAdmin.deactivatePorts()
1348  ret = self.onDeactivated(ec_id)
1349  except:
1350  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1351  ret = RTC.RTC_ERROR
1352  self.postOnDeactivated(ec_id, ret)
1353  return ret
1354 
1355 
1356 
1387  def on_aborting(self, ec_id):
1388  self._rtcout.RTC_TRACE("on_aborting(%d)", ec_id)
1389  ret = RTC.RTC_ERROR
1390  try:
1391  self.preOnAborting(ec_id)
1392  ret = self.onAborting(ec_id)
1393  except:
1394  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1395  ret = RTC.RTC_ERROR
1396  self.postOnAborting(ec_id, ret)
1397  return ret
1398 
1399 
1400 
1442  def on_error(self, ec_id):
1443  self._rtcout.RTC_TRACE("on_error(%d)", ec_id)
1444  ret = RTC.RTC_ERROR
1445  try:
1446  self.preOnError(ec_id)
1447  ret = self.onError(ec_id)
1448  except:
1449  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1450  ret = RTC.RTC_ERROR
1451  self._configsets.update()
1452  self.postOnError(ec_id, ret)
1453  return ret
1454 
1455 
1456 
1488  def on_reset(self, ec_id):
1489  self._rtcout.RTC_TRACE("on_reset(%d)", ec_id)
1490  ret = RTC.RTC_ERROR
1491  try:
1492  self.preOnReset(ec_id)
1493  ret = self.onReset(ec_id)
1494  except:
1495  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1496  ret = RTC.RTC_ERROR
1497  self.postOnReset(ec_id, ret)
1498  return ret
1499 
1500 
1501 
1541  def on_execute(self, ec_id):
1542  self._rtcout.RTC_TRACE("on_execute(%d)", ec_id)
1543  ret = RTC.RTC_ERROR
1544  try:
1545  self.preOnExecute(ec_id)
1546  if self._readAll:
1547  self.readAll()
1548 
1549  ret = self.onExecute(ec_id)
1550 
1551  if self._writeAll:
1552  self.writeAll()
1553 
1554  except:
1555  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1556  ret = RTC.RTC_ERROR
1557  self.postOnExecute(ec_id, ret)
1558  return ret
1559 
1560 
1561 
1601  def on_state_update(self, ec_id):
1602  self._rtcout.RTC_TRACE("on_state_update(%d)", ec_id)
1603  ret = RTC.RTC_ERROR
1604  try:
1605  self.preOnStateUpdate(ec_id)
1606  ret = self.onStateUpdate(ec_id)
1607  self._configsets.update()
1608  except:
1609  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1610  ret = RTC.RTC_ERROR
1611  self.postOnStateUpdate(ec_id, ret)
1612  return ret
1613 
1614 
1615 
1649  def on_rate_changed(self, ec_id):
1650  self._rtcout.RTC_TRACE("on_rate_changed(%d)", ec_id)
1651  ret = RTC.RTC_ERROR
1652  try:
1653  self.preOnRateChanged(ec_id)
1654  ret = self.onRateChanged(ec_id)
1655  except:
1656  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1657  ret = RTC.RTC_ERROR
1658  self.postOnRateChanged(ec_id, ret)
1659  return ret
1660 
1661 
1662  #============================================================
1663  # SDOPackage::SdoSystemElement
1664  #============================================================
1665 
1666 
1707  self._rtcout.RTC_TRACE("get_owned_organizations()")
1708  try:
1709  return self._sdoOwnedOrganizations
1710  except:
1711  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1712  raise SDOPackage.NotAvailable("NotAvailable: get_owned_organizations")
1713 
1714  return []
1715 
1716 
1717  #============================================================
1718  # SDOPackage::SDO
1719  #============================================================
1720 
1721 
1757  def get_sdo_id(self):
1758  self._rtcout.RTC_TRACE("get_sdo_id()")
1759  try:
1760  return self._profile.instance_name
1761  except:
1762  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1763  raise SDOPackage.InternalError("get_sdo_id()")
1764 
1765 
1766 
1802  def get_sdo_type(self):
1803  self._rtcout.RTC_TRACE("get_sdo_type()")
1804  try:
1805  return self._profile.description
1806  except:
1807  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1808  raise SDOPackage.InternalError("get_sdo_type()")
1809  return ""
1810 
1811 
1812 
1852  self._rtcout.RTC_TRACE("get_device_profile()")
1853  try:
1854  return self._SdoConfigImpl.getDeviceProfile()
1855  except:
1856  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1857  raise SDOPackage.InternalError("get_device_profile()")
1858 
1859  return SDOPackage.DeviceProfile("","","","",[])
1860 
1861 
1862 
1902  self._rtcout.RTC_TRACE("get_service_profiles()")
1903  self._sdoSvcProfiles = self._SdoConfigImpl.getServiceProfiles()
1904  try:
1905  return self._sdoSvcProfiles
1906  except:
1907  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1908  raise SDOPackage.InternalError("get_service_profiles()")
1909 
1910  return []
1911 
1912 
1913 
1956  def get_service_profile(self, _id):
1957  self._rtcout.RTC_TRACE("get_service_profile(%s)", _id)
1958  self._sdoSvcProfiles = self._SdoConfigImpl.getServiceProfiles()
1959  if not _id:
1960  raise SDOPackage.InvalidParameter("get_service_profile(): Empty name.")
1961 
1962  try:
1964 
1965  if index < 0:
1966  raise SDOPackage.InvalidParameter("get_service_profile(): Not found")
1967 
1968  return self._sdoSvcProfiles[index]
1969  except:
1970  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
1971  raise SDOPackage.InternalError("get_service_profile()")
1972 
1973  return SDOPackage.ServiceProfile("", "", [], None)
1974 
1975 
1976 
2023  def get_sdo_service(self, _id):
2024  self._rtcout.RTC_TRACE("get_sdo_service(%s)", _id)
2025  self._sdoSvcProfiles = self._SdoConfigImpl.getServiceProfiles()
2026 
2027  if not _id:
2028  raise SDOPackage.InvalidParameter("get_service(): Empty name.")
2029 
2031 
2032  if index < 0:
2033  raise SDOPackage.InvalidParameter("get_service(): Not found")
2034 
2035  try:
2036  return self._sdoSvcProfiles[index].service
2037  except:
2038  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
2039  raise SDOPackage.InternalError("get_service()")
2040  return SDOPackage.SDOService._nil
2041 
2042 
2043 
2090  self._rtcout.RTC_TRACE("get_configuration()")
2091  if self._SdoConfig is None:
2092  raise SODPackage.InterfaceNotImplemented("InterfaceNotImplemented: get_configuration")
2093  try:
2094  return self._SdoConfig
2095  except:
2096  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
2097  raise SDOPackage.InternalError("get_configuration()")
2098  return SDOPackage.Configuration._nil
2099 
2100 
2101 
2146  def get_monitoring(self):
2147  self._rtcout.RTC_TRACE("get_monitoring()")
2148  raise SDOPackage.InterfaceNotImplemented("Exception: get_monitoring")
2149  return SDOPackage.Monitoring._nil
2150 
2151 
2152 
2190  self._rtcout.RTC_TRACE("get_organizations()")
2191  self._sdoOrganizations = self._SdoConfigImpl.getOrganizations()
2192  try:
2193  return self._sdoOrganizations
2194  except:
2195  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
2196  raise SDOPackage.InternalError("get_organizations()")
2197  return []
2198 
2199 
2200 
2233  def get_status_list(self):
2234  self._rtcout.RTC_TRACE("get_status_list()")
2235  try:
2236  return self._sdoStatus
2237  except:
2238  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
2239  raise SDOPackage.InternalError("get_status_list()")
2240  return []
2241 
2242 
2243 
2280  def get_status(self, name):
2281  self._rtcout.RTC_TRACE("get_status(%s)", name)
2282  index = OpenRTM_aist.CORBA_SeqUtil.find(self._sdoStatus, self.nv_name(name))
2283  if index < 0:
2284  raise SDOPackage.InvalidParameter("get_status(): Not found")
2285 
2286  try:
2287  return any.to_any(self._sdoStatus[index].value)
2288  except:
2289  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
2290  raise SDOPackage.InternalError("get_status()")
2291  return any.to_any("")
2292 
2293 
2294  #============================================================
2295  # Local interfaces
2296  #============================================================
2297 
2298 
2313  def getInstanceName(self):
2314  self._rtcout.RTC_TRACE("getInstanceName()")
2315  return self._profile.instance_name
2316 
2317 
2318 
2333  def setInstanceName(self, instance_name):
2334  self._rtcout.RTC_TRACE("setInstanceName(%s)", instance_name)
2335  self._properties.setProperty("instance_name",instance_name)
2336  self._profile.instance_name = self._properties.getProperty("instance_name")
2337 
2338 
2339 
2354  def getTypeName(self):
2355  self._rtcout.RTC_TRACE("getTypeName()")
2356  return self._profile.type_name
2357 
2358 
2359 
2374  def getDescription(self):
2375  self._rtcout.RTC_TRACE("getDescription()")
2376  return self._profile.description
2377 
2378 
2379 
2394  def getVersion(self):
2395  self._rtcout.RTC_TRACE("getVersion()")
2396  return self._profile.version
2397 
2398 
2399 
2414  def getVendor(self):
2415  self._rtcout.RTC_TRACE("getVendor()")
2416  return self._profile.vendor
2417 
2418 
2419 
2434  def getCategory(self):
2435  self._rtcout.RTC_TRACE("getCategory()")
2436  return self._profile.category
2437 
2438 
2439 
2454  def getNamingNames(self):
2455  self._rtcout.RTC_TRACE("getNamingNames()")
2456  return [s.strip() for s in self._properties.getProperty("naming.names").split(",")]
2457 
2458 
2459 
2473  def setObjRef(self, rtobj):
2474  self._rtcout.RTC_TRACE("setObjRef()")
2475  self._objref = rtobj
2476  return
2477 
2478 
2479 
2494  def getObjRef(self):
2495  self._rtcout.RTC_TRACE("getObjRef()")
2496  return self._objref
2497 
2498 
2499 
2525  def setProperties(self, prop):
2526  self._rtcout.RTC_TRACE("setProperties()")
2527  self._properties.mergeProperties(prop)
2528  self._profile.instance_name = self._properties.getProperty("instance_name")
2529  self._profile.type_name = self._properties.getProperty("type_name")
2530  self._profile.description = self._properties.getProperty("description")
2531  self._profile.version = self._properties.getProperty("version")
2532  self._profile.vendor = self._properties.getProperty("vendor")
2533  self._profile.category = self._properties.getProperty("category")
2534 
2535 
2536 
2559  def getProperties(self):
2560  self._rtcout.RTC_TRACE("getProperties()")
2561  return self._properties
2562 
2563 
2564 
2587  def bindParameter(self, param_name, var,
2588  def_val, trans=None):
2589  self._rtcout.RTC_TRACE("bindParameter()")
2590  if trans is None:
2591  trans_ = OpenRTM_aist.stringTo
2592  else:
2593  trans_ = trans
2594  self._configsets.bindParameter(param_name, var, def_val, trans_)
2595  return True
2596 
2597 
2598 
2613  def updateParameters(self, config_set):
2614  self._rtcout.RTC_TRACE("updateParameters(%s)", config_set)
2615  self._configsets.update(config_set)
2616  return
2617 
2618 
2619 
2653  def registerPort(self, port):
2654  self._rtcout.RTC_TRACE("registerPort()")
2655  if not self.addPort(port):
2656  self._rtcout.RTC_ERROR("addPort(PortBase&) failed.")
2657  return
2658 
2659  # void registerPort(PortService_ptr port);
2660  # def registerPortByReference(self, port_ref):
2661  # self._rtcout.RTC_TRACE("registerPortByReference()")
2662  # self.addPortByReference(port_ref)
2663  # return
2664 
2665  # new interface. since 1.0.0-RELEASE
2666  # void addPort(PortBase& port);
2667  def addPort(self, port):
2668  self._rtcout.RTC_TRACE("addPort()")
2669  if isinstance(port, OpenRTM_aist.CorbaPort):
2670  self._rtcout.RTC_TRACE("addPort(CorbaPort)")
2671  propkey = "port.corbaport."
2672  prop = self._properties.getNode(propkey)
2673  if prop:
2674  self._properties.getNode(propkey).mergeProperties(self._properties.getNode("port.corba"))
2675  port.init(self._properties.getNode(propkey))
2676  port.setOwner(self.getObjRef())
2677 
2678  elif isinstance(port, OpenRTM_aist.PortBase):
2679  self._rtcout.RTC_TRACE("addPort(PortBase)")
2680  port.setOwner(self.getObjRef())
2681  port.setPortConnectListenerHolder(self._portconnListeners)
2682  self.onAddPort(port.getPortProfile())
2683 
2684  elif isinstance(port, RTC._objref_PortService):
2685  self._rtcout.RTC_TRACE("addPort(PortService)")
2686  return self._portAdmin.addPort(port)
2687 
2688 
2689  # new interface. since 1.0.0-RELEASE
2690  # void addPort(PortService_ptr port);
2691  # def addPortByReference(self, port_ref):
2692  # self._rtcout.RTC_TRACE("addPortByReference()")
2693  # self._portAdmin.registerPortByReference(port_ref)
2694  # return
2695 
2696 
2697 
2714  def registerInPort(self, name, inport):
2715  self._rtcout.RTC_TRACE("registerInPort(%s)", name)
2716  if not self.addInPort(name, inport):
2717  self._rtcout.RTC_ERROR("addInPort(%s) failed.", name)
2718  return
2719 
2720  # new interface. since 1.0.0-RELEASE
2721  def addInPort(self, name, inport):
2722  self._rtcout.RTC_TRACE("addInPort(%s)", name)
2723 
2724  propkey = "port.inport." + name
2725  prop_ = copy.copy(self._properties.getNode(propkey))
2726  prop_.mergeProperties(self._properties.getNode("port.inport.dataport"))
2727 
2728  ret = self.addPort(inport)
2729 
2730  if not ret:
2731  self._rtcout.RTC_ERROR("addInPort() failed.")
2732  return ret
2733 
2734  inport.init(self._properties.getNode(propkey))
2735  self._inports.append(inport)
2736  return ret
2737 
2738 
2739 
2757  def registerOutPort(self, name, outport):
2758  self._rtcout.RTC_TRACE("registerOutPort(%s)", name)
2759  if not self.addOutPort(name, outport):
2760  self._rtcout.RTC_ERROR("addOutPort(%s) failed.", name)
2761  return
2762 
2763  # new interface. since 1.0.0-RELEASE
2764  # void addOutPort(const char* name, OutPortBase& outport);
2765  def addOutPort(self, name, outport):
2766  self._rtcout.RTC_TRACE("addOutPort(%s)", name)
2767 
2768  propkey = "port.outport." + name
2769  prop_ = copy.copy(self._properties.getNode(propkey))
2770  prop_.mergeProperties(self._properties.getNode("port.outport.dataport"))
2771 
2772  ret = self.addPort(outport)
2773 
2774  if not ret:
2775  self._rtcout.RTC_ERROR("addOutPort() failed.")
2776  return ret
2777 
2778  outport.init(self._properties.getNode(propkey))
2779  self._outports.append(outport)
2780  return ret
2781 
2782 
2783 
2805  def removeInPort(self, port):
2806  self._rtcout.RTC_TRACE("removeInPort()")
2807  ret = self.removePort(inport)
2808 
2809  if ret:
2810  for inport in self._inports:
2811  if port == inport:
2812  try:
2813  self._inports.remove(port)
2814  except:
2815  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
2816 
2817  return True
2818 
2819  return False
2820 
2821 
2822 
2844  def removeOutPort(self, port):
2845  self._rtcout.RTC_TRACE("removeOutPort()")
2846  ret = self.removePort(outport)
2847 
2848  if ret:
2849  for outport in self._outports:
2850  if port == outport:
2851  try:
2852  self._outports.remove(port)
2853  except:
2854  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
2855 
2856  return True
2857 
2858  return False
2859 
2860 
2861 
2881  def deletePort(self, port):
2882  self._rtcout.RTC_TRACE("deletePort()")
2883  if not self.removePort(port):
2884  self._rtcout.RTC_ERROR("removePort() failed.")
2885  return
2886 
2887  # new interface. since 1.0.0-RELEASE
2888  def removePort(self, port):
2889  self._rtcout.RTC_TRACE("removePort()")
2890  if isinstance(port, OpenRTM_aist.PortBase) or isinstance(port, OpenRTM_aist.CorbaPort):
2891  self.onRemovePort(port.getPortProfile())
2892  return self._portAdmin.removePort(port)
2893 
2894 
2895 
2908  def deletePortByName(self, port_name):
2909  self._rtcout.RTC_TRACE("deletePortByName(%s)", port_name)
2910  self._portAdmin.deletePortByName(port_name)
2911  return
2912 
2913 
2914 
2965  def getExecutionContext(self, ec_id):
2966  return self.get_context(ec_id)
2967 
2968 
3021  def getExecutionRate(self, ec_id):
3022  ec = self.getExecutionContext(ec_id)
3023  if CORBA.is_nil(ec):
3024  return 0.0
3025 
3026  return ec.get_rate()
3027 
3028 
3029 
3083  def setExecutionRate(self, ec_id, rate):
3084  ec = self.getExecutionContext(ec_id)
3085  if CORBA.is_nil(ec):
3086  return RTC.RTC_ERROR
3087  ec.set_rate(rate)
3088  return RTC.RTC_OK
3089 
3090 
3091 
3144  def isOwnExecutionContext(self, ec_id):
3145  global ECOTHER_OFFSET
3146  if ec_id < ECOTHER_OFFSET:
3147  return True
3148  return False
3149 
3150 
3151 
3190  def deactivate(self, ec_id):
3191  ec = self.getExecutionContext(ec_id)
3192  if CORBA.is_nil(ec):
3193  return RTC.RTC_ERROR
3194  return ec.deactivate_component(self.getObjRef())
3195 
3196 
3197 
3234  def activate(self, ec_id):
3235  ec = self.getExecutionContext(ec_id)
3236  if CORBA.is_nil(ec):
3237  return RTC.RTC_ERROR
3238  return ec.activate_component(self.getObjRef())
3239 
3240 
3241 
3276  def reset(self, ec_id):
3277  ec = self.getExecutionContext(ec_id)
3278  if CORBA.is_nil(ec):
3279  return RTC.RTC_ERROR
3280  return ec.reset_component(self.getObjRef())
3281 
3282 
3283 
3292  def addSdoServiceProvider(self, prof, provider):
3293  return self._sdoservice.addSdoServiceProvider(prof, provider)
3294 
3295 
3296 
3305  return self._sdoservice.removeSdoServiceProvider(id)
3306 
3307 
3308 
3316  def addSdoServiceConsumer(self, prof):
3317  return self._sdoservice.addSdoServiceConsumer(prof)
3318 
3319 
3320 
3329  return self._sdoservice.removeSdoServiceConsumer(id)
3330 
3331 
3332 
3353  def readAll(self):
3354  self._rtcout.RTC_TRACE("readAll()")
3355  ret = True
3356  for inport in self._inports:
3357  if not inport.read():
3358  self._rtcout.RTC_DEBUG("The error occurred in readAll().")
3359  ret = False
3360  if not self._readAllCompletion:
3361  return False
3362 
3363  return ret
3364 
3365 
3366 
3387  def writeAll(self):
3388  self._rtcout.RTC_TRACE("writeAll()")
3389  ret = True
3390  for outport in self._outports:
3391  if not outport.write():
3392  self._rtcout.RTC_DEBUG("The error occurred in writeAll().")
3393  ret = False
3394  if not self._writeAllCompletion:
3395  return False
3396 
3397  return ret
3398 
3399 
3400 
3434  def setReadAll(self, read=True, completion=False):
3435  self._readAll = read
3436  self._readAllCompletion = completion
3437 
3438 
3439 
3471  def setWriteAll(self, write=True, completion=False):
3472  self._writeAll = write
3473  self._writeAllCompletion = completion
3474 
3475 
3476 
3493  def finalizePorts(self):
3494  self._rtcout.RTC_TRACE("finalizePorts()")
3495  self._portAdmin.finalizePorts()
3496  self._inports = []
3497  self._outports = []
3498  return
3499 
3500 
3501  def finalizeContexts(self):
3502  self._rtcout.RTC_TRACE("finalizeContexts()")
3503  len_ = len(self._eclist)
3504  for i in range(len_):
3505  idx = (len_ - 1) - i
3506  self._eclist[idx].stop()
3507  try:
3508  self._poa.deactivate_object(self._poa.servant_to_id(self._eclist[idx]))
3509  except:
3510  self._rtcout.RTC_TRACE(OpenRTM_aist.Logger.print_exception())
3511  del self._eclist[idx]
3512 
3513  if self._eclist:
3514  self._eclist = []
3515  return
3516 
3517 
3518 
3595  def addPreComponentActionListener(self, listener_type,
3596  memfunc, autoclean = True):
3598  def __init__(self, memfunc):
3599  self._memfunc = memfunc
3600 
3601  def __call__(self, ec_id):
3602  self._memfunc(ec_id)
3603  return
3604 
3605  listener = Noname(memfunc)
3606  self._actionListeners.preaction_[listener_type].addListener(listener, autoclean)
3607  return listener
3608 
3609 
3610 
3632  def removePreComponentActionListener(self, listener_type, listener):
3633  self._actionListeners.preaction_[listener_type].removeListener(listener)
3634  return
3635 
3636 
3637 
3715  def addPostComponentActionListener(self, listener_type,
3716  memfunc, autoclean = True):
3718  def __init__(self, memfunc):
3719  self._memfunc = memfunc
3720  return
3721  def __call__(self, ec_id, ret):
3722  self._memfunc(ec_id, ret)
3723  return
3724 
3725  listener = Noname(memfunc)
3726  self._actionListeners.postaction_[listener_type].addListener(listener, autoclean)
3727  return listener
3728 
3729 
3730 
3752  def removePostComponentActionListener(self, listener_type, listener):
3753  self._actionListeners.postaction_[listener_type].removeListener(listener)
3754  return
3755 
3756 
3757 
3815  def addPortActionListener(self, listener_type,
3816  memfunc, autoclean = True):
3817  class Noname(OpenRTM_aist.PortActionListener):
3818  def __init__(self, memfunc):
3819  self._memfunc = memfunc
3820  return
3821 
3822  def __call__(self, pprofile):
3823  self._memfunc(pprofile)
3824  return
3825 
3826  listener = Noname(memfunc)
3827  self._actionListeners.portaction_[listener_type].addListener(listener, autoclean)
3828  return listener
3829 
3830 
3831 
3852  def removePortActionListener(self, listener_type, listener):
3853  self._actionListeners.portaction_[listener_type].removeListener(listener)
3854  return
3855 
3856 
3857 
3915  def addExecutionContextActionListener(self, listener_type,
3916  memfunc, autoclean = True):
3918  def __init__(self, memfunc):
3919  self._memfunc = memfunc
3920  return
3921 
3922  def __call__(self, ec_id):
3923  self._memfunc(ec_id)
3924  return
3925 
3926  listener = Noname(memfunc)
3927  self._actionListeners.ecaction_[listener_type].addListener(listener, autoclean)
3928  return listener
3929 
3930 
3931 
3953  def removeExecutionContextActionListener(self, listener_type, listener):
3954  self._actionListeners.ecaction_[listener_type].removeListener(listener)
3955  return
3956 
3957 
3958 
4018  def addPortConnectListener(self, listener_type,
4019  memfunc, autoclean = True):
4020  class Noname(OpenRTM_aist.PortConnectListener):
4021  def __init__(self, memfunc):
4022  self._memfunc = memfunc
4023  return
4024 
4025  def __call__(self, portname, cprofile):
4026  self._memfunc(portname, cprofile)
4027  return
4028 
4029  listener = Noname(memfunc)
4030  self._portconnListeners.portconnect_[listener_type].addListener(listener, autoclean)
4031  return listener
4032 
4033 
4034 
4056  def removePortConnectListener(self, listener_type, listener):
4057  self._portconnListeners.portconnect_[listener_type].removeListener(listener)
4058  return
4059 
4060 
4061 
4125  def addPortConnectRetListener(self, listener_type,
4126  memfunc, autoclean = True):
4128  def __init__(self, memfunc):
4129  self._memfunc = memfunc
4130  return
4131 
4132  def __call__(self, portname, cprofile, ret):
4133  self._memfunc(portname, cprofile, ret)
4134  return
4135 
4136  listener = Noname(memfunc)
4137  self._portconnListeners.portconnret_[listener_type].addListener(listener, autoclean)
4138  return listener
4139 
4140 
4141 
4163  def removePortConnectRetListener(self, listener_type, listener):
4164  self._portconnListeners.portconnret_[listener_type].removeListener(listener)
4165  return
4166 
4167 
4168 
4207  memfunc, autoclean = True):
4209  def __init__(self, memfunc):
4210  self._memfunc = memfunc
4211  return
4212 
4213  def __call__(self, config_set_name, config_param_name):
4214  self._memfunc(config_set_name, config_param_name)
4215  return
4216 
4217  listener = Noname(memfunc)
4218  self._configsets.addConfigurationParamListener(type, listener, autoclean)
4219  return listener
4220 
4221 
4222 
4248  def removeConfigurationParamListener(self, type, listener):
4249  self._configsets.removeConfigurationParamListener(type, listener)
4250  return
4251 
4252 
4253 
4289  def addConfigurationSetListener(self, listener_type,
4290  memfunc, autoclean = True):
4292  def __init__(self, memfunc):
4293  self._memfunc = memfunc
4294  return
4295 
4296  def __call__(self, config_set):
4297  self._memfunc(config_set)
4298  return
4299 
4300  listener = Noname(memfunc)
4301  self._configsets.addConfigurationSetListener(listener_type, listener, autoclean)
4302  return listener
4303 
4304 
4305 
4329  def removeConfigurationSetListener(self, type, listener):
4330  self._configsets.removeConfigurationSetListener(type, listener)
4331  return
4332 
4333 
4334 
4372  def addConfigurationSetNameListener(self, type, memfunc, autoclean = True):
4374  def __init__(self, memfunc):
4375  self._memfunc = memfunc
4376  return
4377 
4378  def __call__(self, config_set_name):
4379  self._memfunc(config_set_name)
4380  return
4381 
4382  listener = Noname(memfunc)
4383  self._configsets.addConfigurationSetNameListener(type, listener, autoclean)
4384  return listener
4385 
4386 
4387 
4415  def removeConfigurationSetNameListener(self, type, listener):
4416  self._configsets.removeConfigurationSetNameListener(type, listener)
4417  return
4418 
4419 
4420 
4434  def shutdown(self):
4435  self._rtcout.RTC_TRACE("shutdown()")
4436  try:
4437  self.finalizePorts()
4438  self.finalizeContexts()
4439  self._poa.deactivate_object(self._poa.servant_to_id(self._SdoConfigImpl))
4440  self._poa.deactivate_object(self._poa.servant_to_id(self))
4441  except:
4442  self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
4443 
4444  if self._manager:
4445  self._rtcout.RTC_DEBUG("Cleanup on Manager")
4446  self._manager.notifyFinalized(self)
4447 
4448  return
4449 
4450  # inline void preOnInitialize(UniqueId ec_id)
4451  def preOnInitialize(self, ec_id):
4452  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_INITIALIZE].notify(ec_id)
4453  return
4454 
4455  # inline void preOnFinalize(UniqueId ec_id)
4456  def preOnFinalize(self, ec_id):
4457  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_FINALIZE].notify(ec_id)
4458  return
4459 
4460  # inline void preOnStartup(UniqueId ec_id)
4461  def preOnStartup(self, ec_id):
4462  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_STARTUP].notify(ec_id)
4463  return
4464 
4465  # inline void preOnShutdown(UniqueId ec_id)
4466  def preOnShutdown(self, ec_id):
4467  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_SHUTDOWN].notify(ec_id)
4468  return
4469 
4470  # inline void preOnActivated(UniqueId ec_id)
4471  def preOnActivated(self, ec_id):
4472  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_ACTIVATED].notify(ec_id)
4473  return
4474 
4475  # inline void preOnDeactivated(UniqueId ec_id)
4476  def preOnDeactivated(self, ec_id):
4477  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_DEACTIVATED].notify(ec_id)
4478  return
4479 
4480  # inline void preOnAborting(UniqueId ec_id)
4481  def preOnAborting(self, ec_id):
4482  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_ABORTING].notify(ec_id)
4483  return
4484 
4485  # inline void preOnError(UniqueId ec_id)
4486  def preOnError(self, ec_id):
4487  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_ERROR].notify(ec_id)
4488  return
4489 
4490  # inline void preOnReset(UniqueId ec_id)
4491  def preOnReset(self, ec_id):
4492  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_RESET].notify(ec_id)
4493  return
4494 
4495  # inline void preOnExecute(UniqueId ec_id)
4496  def preOnExecute(self, ec_id):
4497  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_EXECUTE].notify(ec_id)
4498  return
4499 
4500  # inline void preOnStateUpdate(UniqueId ec_id)
4501  def preOnStateUpdate(self, ec_id):
4502  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_STATE_UPDATE].notify(ec_id)
4503  return
4504 
4505 
4506  # inline void preOnRateChanged(UniqueId ec_id)
4507  def preOnRateChanged(self, ec_id):
4508  self._actionListeners.preaction_[OpenRTM_aist.PreComponentActionListenerType.PRE_ON_RATE_CHANGED].notify(ec_id)
4509  return
4510 
4511 
4512  # inline void postOnInitialize(UniqueId ec_id, ReturnCode_t ret)
4513  def postOnInitialize(self, ec_id, ret):
4514  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_INITIALIZE].notify(ec_id, ret)
4515  return
4516 
4517 
4518  # inline void postOnFinalize(UniqueId ec_id, ReturnCode_t ret)
4519  def postOnFinalize(self, ec_id, ret):
4520  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_FINALIZE].notify(ec_id, ret)
4521  return
4522 
4523 
4524  # inline void postOnStartup(UniqueId ec_id, ReturnCode_t ret)
4525  def postOnStartup(self, ec_id, ret):
4526  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_STARTUP].notify(ec_id, ret)
4527  return
4528 
4529 
4530  # inline void postOnShutdown(UniqueId ec_id, ReturnCode_t ret)
4531  def postOnShutdown(self, ec_id, ret):
4532  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_SHUTDOWN].notify(ec_id, ret)
4533  return
4534 
4535 
4536  # inline void postOnActivated(UniqueId ec_id, ReturnCode_t ret)
4537  def postOnActivated(self, ec_id, ret):
4538  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_ACTIVATED].notify(ec_id, ret)
4539  return
4540 
4541 
4542  # inline void postOnDeactivated(UniqueId ec_id, ReturnCode_t ret)
4543  def postOnDeactivated(self, ec_id, ret):
4544  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_DEACTIVATED].notify(ec_id, ret)
4545  return
4546 
4547 
4548  # inline void postOnAborting(UniqueId ec_id, ReturnCode_t ret)
4549  def postOnAborting(self, ec_id, ret):
4550  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_ABORTING].notify(ec_id, ret)
4551  return
4552 
4553 
4554  # inline void postOnError(UniqueId ec_id, ReturnCode_t ret)
4555  def postOnError(self, ec_id, ret):
4556  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_ERROR].notify(ec_id, ret)
4557  return
4558 
4559 
4560  # inline void postOnReset(UniqueId ec_id, ReturnCode_t ret)
4561  def postOnReset(self, ec_id, ret):
4562  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_RESET].notify(ec_id, ret)
4563  return
4564 
4565 
4566  # inline void postOnExecute(UniqueId ec_id, ReturnCode_t ret)
4567  def postOnExecute(self, ec_id, ret):
4568  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_EXECUTE].notify(ec_id, ret)
4569  return
4570 
4571 
4572  # inline void postOnStateUpdate(UniqueId ec_id, ReturnCode_t ret)
4573  def postOnStateUpdate(self, ec_id, ret):
4574  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_STATE_UPDATE].notify(ec_id, ret)
4575  return
4576 
4577 
4578  # inline void postOnRateChanged(UniqueId ec_id, ReturnCode_t ret)
4579  def postOnRateChanged(self, ec_id, ret):
4580  self._actionListeners.postaction_[OpenRTM_aist.PostComponentActionListenerType.POST_ON_RATE_CHANGED].notify(ec_id, ret)
4581  return
4582 
4583 
4584  # inline void onAddPort(const PortProfile& pprof)
4585  def onAddPort(self, pprof):
4586  self._actionListeners.portaction_[OpenRTM_aist.PortActionListenerType.ADD_PORT].notify(pprof)
4587  return
4588 
4589 
4590  # inline void onRemovePort(const PortProfile& pprof)
4591  def onRemovePort(self, pprof):
4592  self._actionListeners.portaction_[OpenRTM_aist.PortActionListenerType.REMOVE_PORT].notify(pprof)
4593  return
4594 
4595 
4596  # inline void onAttachExecutionContext(UniqueId ec_id)
4597  def onAttachExecutionContext(self, ec_id):
4598  self._actionListeners.ecaction_[OpenRTM_aist.ExecutionContextActionListenerType.EC_ATTACHED].notify(ec_id)
4599  return
4600 
4601 
4602  # inline void onDetachExecutionContext(UniqueId ec_id)
4603  def onDetachExecutionContext(self, ec_id):
4604  self._actionListeners.ecaction_[OpenRTM_aist.ExecutionContextActionListenerType.EC_DETACHED].notify(ec_id)
4605  return
4606 
4607 
4608 
4616  class svc_name:
4617  def __init__(self, _id):
4618  self._id= _id
4619 
4620  def __call__(self, prof):
4621  return self._id == prof.id
4622 
4623 
4624  #------------------------------------------------------------
4625  # Functor
4626  #------------------------------------------------------------
4627 
4628 
4635  class nv_name:
4636  def __init__(self, _name):
4637  self._name = _name
4638 
4639  def __call__(self, nv):
4640  return self._name == nv.name
4641 
4642 
4643 
4650  class ec_find:
4651  def __init__(self, _ec):
4652  self._ec = _ec
4653 
4654  def __call__(self, ecs):
4655  try:
4656  if not CORBA.is_nil(ecs):
4657  ec = ecs._narrow(RTC.ExecutionContext)
4658  return self._ec._is_equivalent(ec)
4659  except:
4660  print(OpenRTM_aist.Logger.print_exception())
4661  return False
4662 
4663  return False
4664 
4665 
4666 
4673  class ec_copy:
4674  def __init__(self, eclist):
4675  self._eclist = eclist
4676 
4677  def __call__(self, ecs):
4678  if not CORBA.is_nil(ecs):
4679  self._eclist.append(ecs)
4680 
4681 
4682 
4690  def __init__(self, comp):
4691  self._comp = comp
4692 
4693  def __call__(self, ec):
4694  try:
4695  if not CORBA.is_nil(ec) and not ec._non_existent():
4696  ec.deactivate_component(self._comp)
4697  ec.stop()
4698  except:
4699  print(OpenRTM_aist.Logger.print_exception())
4700 
4701 
4702 # RtcBase = RTObject_impl
OpenRTM_aist.RTObject.RTObject_impl.get_component_profile
def get_component_profile(self)
[RTObject CORBA interface] Get RTC's profile
Definition: RTObject.py:897
OpenRTM_aist.RTObject.RTObject_impl.onShutdown
def onShutdown(self, ec_id)
Definition: RTObject.py:246
OpenRTM_aist.RTObject.RTObject_impl.postOnFinalize
def postOnFinalize(self, ec_id, ret)
Definition: RTObject.py:4519
OpenRTM_aist.RTObject.RTObject_impl._eclist
_eclist
Definition: RTObject.py:124
OpenRTM_aist.RTObject.RTObject_impl.preOnInitialize
def preOnInitialize(self, ec_id)
Definition: RTObject.py:4451
OpenRTM_aist.RTObject.RTObject_impl._objref
_objref
Definition: RTObject.py:117
OpenRTM_aist.RTObject.RTObject_impl.postOnShutdown
def postOnShutdown(self, ec_id, ret)
Definition: RTObject.py:4531
OpenRTM_aist.RTObject.RTObject_impl.getObjRef
def getObjRef(self)
RTObject_ptr getObjRef() const;.
Definition: RTObject.py:2494
OpenRTM_aist.RTObject.RTObject_impl.initialize
def initialize(self)
Initialize the RTC that realizes this interface.
Definition: RTObject.py:487
OpenRTM_aist.RTObject.RTObject_impl.ec_copy.__init__
def __init__(self, eclist)
Definition: RTObject.py:4674
OpenRTM_aist.RTObject.RTObject_impl.setInstanceName
def setInstanceName(self, instance_name)
void setInstanceName(const char* instance_name);
Definition: RTObject.py:2333
OpenRTM_aist.RTObject.RTObject_impl.on_rate_changed
def on_rate_changed(self, ec_id)
[DataFlowComponentAction CORBA interface] Notify rate chenged
Definition: RTObject.py:1649
OpenRTM_aist.RTObject.RTObject_impl._portAdmin
_portAdmin
Definition: RTObject.py:96
OpenRTM_aist.RTObject.RTObject_impl._sdoOrganizations
_sdoOrganizations
Definition: RTObject.py:120
OpenRTM_aist.RTObject.RTObject_impl.getExecutionContext
def getExecutionContext(self, ec_id)
[local interface] Getting current execution context
Definition: RTObject.py:2965
OpenRTM_aist.RTObject.RTObject_impl._writeAll
_writeAll
Definition: RTObject.py:127
OpenRTM_aist.RTObject.RTObject_impl.get_service_profiles
def get_service_profiles(self)
[SDO interface] Getting SDO ServiceProfile
Definition: RTObject.py:1901
OpenRTM_aist.RTObject.RTObject_impl.removeConfigurationSetListener
def removeConfigurationSetListener(self, type, listener)
Removing ConfigurationSetListener.
Definition: RTObject.py:4329
OpenRTM_aist.RTObject.RTObject_impl.on_execute
def on_execute(self, ec_id)
[DataFlowComponentAction CORBA interface] Primary Periodic Operation of RTC
Definition: RTObject.py:1541
OpenRTM_aist.RTObject.RTObject_impl.preOnStateUpdate
def preOnStateUpdate(self, ec_id)
Definition: RTObject.py:4501
OpenRTM_aist.RTObject.RTObject_impl.ec_find.__call__
def __call__(self, ecs)
Definition: RTObject.py:4654
OpenRTM_aist.RTObject.RTObject_impl.on_deactivated
def on_deactivated(self, ec_id)
[ComponentAction CORBA interface] Deactivate RTC
Definition: RTObject.py:1342
OpenRTM_aist.RTObject.RTObject_impl.preOnShutdown
def preOnShutdown(self, ec_id)
Definition: RTObject.py:4466
OpenRTM_aist.RTObject.RTObject_impl.registerPort
def registerPort(self, port)
[local interface] Register Port
Definition: RTObject.py:2653
OpenRTM_aist.RTObject.RTObject_impl.onDetachExecutionContext
def onDetachExecutionContext(self, ec_id)
Definition: RTObject.py:4603
OpenRTM_aist.RTObject.RTObject_impl._profile
_profile
Definition: RTObject.py:111
OpenRTM_aist.RTObject.RTObject_impl._sdoOwnedOrganizations
_sdoOwnedOrganizations
Definition: RTObject.py:118
OpenRTM_aist.RTObject.RTObject_impl.addPostComponentActionListener
def addPostComponentActionListener(self, listener_type, memfunc, autoclean=True)
Adding PostComponentAction type listener.
Definition: RTObject.py:3715
OpenRTM_aist.RTObject.RTObject_impl.setExecutionRate
def setExecutionRate(self, ec_id, rate)
[local interface] Setting current context' execution rate
Definition: RTObject.py:3083
OpenRTM_aist.RTObject.RTObject_impl.addPort
def addPort(self, port)
Definition: RTObject.py:2667
OpenRTM_aist.RTObject.RTObject_impl.updateParameters
def updateParameters(self, config_set)
void updateParameters(const char* config_set);
Definition: RTObject.py:2613
OpenRTM_aist.RTObject.RTObject_impl._outports
_outports
Definition: RTObject.py:131
OpenRTM_aist.RTObject.RTObject_impl.nv_name._name
_name
Definition: RTObject.py:4637
OpenRTM_aist.RTObject.RTObject_impl.addSdoServiceProvider
def addSdoServiceProvider(self, prof, provider)
[local interface] Set a SDO service providerbool addSdoServiceProvider(const SDOPackage::ServiceProfi...
Definition: RTObject.py:3292
OpenRTM_aist.RTObject.RTObject_impl.postOnActivated
def postOnActivated(self, ec_id, ret)
Definition: RTObject.py:4537
OpenRTM_aist.RTObject.RTObject_impl.svc_name._id
_id
Definition: RTObject.py:4618
OpenRTM_aist.RTObject.RTObject_impl.svc_name.__init__
def __init__(self, _id)
Definition: RTObject.py:4617
OpenRTM_aist.RTObject.RTObject_impl._orb
_orb
Definition: RTObject.py:94
OpenRTM_aist.RTObject.RTObject_impl.get_configuration
def get_configuration(self)
[SDO interface] Getting Configuration object
Definition: RTObject.py:2089
OpenRTM_aist.RTObject.RTObject_impl.setWriteAll
def setWriteAll(self, write=True, completion=False)
Set whether to execute the writeAll() method.
Definition: RTObject.py:3471
OpenRTM_aist.CORBA_SeqUtil.push_back
def push_back(seq, elem)
Push the new element back to the CORBA sequence.
Definition: CORBA_SeqUtil.py:113
OpenRTM_aist.RTObject.RTObject_impl.removePostComponentActionListener
def removePostComponentActionListener(self, listener_type, listener)
Removing PostComponentAction type listener.
Definition: RTObject.py:3752
OpenRTM_aist.RTObject.RTObject_impl.get_context_handle
def get_context_handle(self, cxt)
Definition: RTObject.py:858
OpenRTM_aist.RTObject.RTObject_impl.__init__
def __init__(self, manager=None, orb=None, poa=None)
Consructor.
Definition: RTObject.py:91
OpenRTM_aist.RTObject.RTObject_impl.nv_name
Definition: RTObject.py:4635
OpenRTM_aist.RTObject.RTObject_impl.registerInPort
def registerInPort(self, name, inport)
Definition: RTObject.py:2714
OpenRTM_aist.RTObject.RTObject_impl.get_participating_contexts
def get_participating_contexts(self)
[CORBA interface] Get participating ExecutionContextList.
Definition: RTObject.py:827
OpenRTM_aist.RTObject.RTObject_impl.__del__
def __del__(self)
destructor
Definition: RTObject.py:149
OpenRTM_aist.RTObject.RTObject_impl.preOnExecute
def preOnExecute(self, ec_id)
Definition: RTObject.py:4496
OpenRTM_aist.RTObject.RTObject_impl.addSdoServiceConsumer
def addSdoServiceConsumer(self, prof)
[local interface] Set a SDO service consumerbool addSdoServiceConsumer(const SDOPackage::ServiceProfi...
Definition: RTObject.py:3316
OpenRTM_aist.RTObject.RTObject_impl.preOnDeactivated
def preOnDeactivated(self, ec_id)
Definition: RTObject.py:4476
OpenRTM_aist.RTObject.RTObject_impl.ec_find.__init__
def __init__(self, _ec)
Definition: RTObject.py:4651
OpenRTM_aist.RTObject.RTObject_impl.removePortConnectRetListener
def removePortConnectRetListener(self, listener_type, listener)
Removing PortConnectRet type listener.
Definition: RTObject.py:4163
OpenRTM_aist.RTObject.RTObject_impl.on_initialize
def on_initialize(self)
[ComponentAction CORBA interface] Initialize RTC
Definition: RTObject.py:1138
OpenRTM_aist.RTObject.RTObject_impl.onReset
def onReset(self, ec_id)
Definition: RTObject.py:390
OpenRTM_aist.RTObject.RTObject_impl.onRemovePort
def onRemovePort(self, pprof)
Definition: RTObject.py:4591
OpenRTM_aist.RTObject.RTObject_impl.removeExecutionContextActionListener
def removeExecutionContextActionListener(self, listener_type, listener)
Removing ExecutionContextAction type listener.
Definition: RTObject.py:3953
OpenRTM_aist.ComponentActionListener.PreComponentActionListener
PreComponentActionListener class.
Definition: ComponentActionListener.py:107
OpenRTM_aist.RTObject.RTObject_impl.shutdown
def shutdown(self)
Definition: RTObject.py:4434
OpenRTM_aist.ComponentActionListener.ExecutionContextActionListener
ExecutionContextActionListener class.
Definition: ComponentActionListener.py:509
OpenRTM_aist.RTObject.RTObject_impl.get_monitoring
def get_monitoring(self)
[SDO interface] Get Monitoring object
Definition: RTObject.py:2146
OpenRTM_aist.SdoConfiguration.Configuration_impl
Configuration implementation class.
Definition: SdoConfiguration.py:164
OpenRTM_aist.RTObject.RTObject_impl._actionListeners
_actionListeners
Definition: RTObject.py:132
OpenRTM_aist.RTObject.RTObject_impl.get_context
def get_context(self, ec_id)
[CORBA interface] Get ExecutionContextList.
Definition: RTObject.py:764
OpenRTM_aist.RTObject.RTObject_impl.finalizeContexts
def finalizeContexts(self)
Definition: RTObject.py:3501
OpenRTM_aist.RTObject.RTObject_impl.setProperties
def setProperties(self, prop)
[local interface] Set RTC property
Definition: RTObject.py:2525
OpenRTM_aist.RTObject.RTObject_impl.addPreComponentActionListener
def addPreComponentActionListener(self, listener_type, memfunc, autoclean=True)
Adding PreComponentAction type listener.
Definition: RTObject.py:3595
OpenRTM_aist.PortConnectListener.PortConnectListeners
PortConnectListeners class.
Definition: PortConnectListener.py:593
OpenRTM_aist.RTObject.RTObject_impl.detach_context
def detach_context(self, ec_id)
[CORBA interface] Attach ExecutionContext.
Definition: RTObject.py:1090
OpenRTM_aist.RTObject.RTObject_impl.deactivate_comps
Definition: RTObject.py:4689
OpenRTM_aist.RTObject.RTObject_impl.svc_name
Definition: RTObject.py:4616
OpenRTM_aist.RTObject.RTObject_impl._exiting
_exiting
Definition: RTObject.py:125
OpenRTM_aist.RTObject.RTObject_impl.on_finalize
def on_finalize(self)
[ComponentAction CORBA interface] Finalize RTC
Definition: RTObject.py:1184
OpenRTM_aist.RTObject.RTObject_impl.get_ports
def get_ports(self)
[RTObject CORBA interface] Get Ports
Definition: RTObject.py:949
OpenRTM_aist.RTObject.RTObject_impl.deletePortByName
def deletePortByName(self, port_name)
Definition: RTObject.py:2908
OpenRTM_aist.RTObject.RTObject_impl.addConfigurationSetListener
def addConfigurationSetListener(self, listener_type, memfunc, autoclean=True)
Adding ConfigurationSetListener.
Definition: RTObject.py:4289
OpenRTM_aist.RTObject.RTObject_impl.addExecutionContextActionListener
def addExecutionContextActionListener(self, listener_type, memfunc, autoclean=True)
Adding ExecutionContextAction type listener.
Definition: RTObject.py:3915
OpenRTM_aist.RTObject.RTObject_impl.get_status_list
def get_status_list(self)
[SDO interface] Get SDO Status
Definition: RTObject.py:2233
OpenRTM_aist.RTObject.RTObject_impl.onAttachExecutionContext
def onAttachExecutionContext(self, ec_id)
Definition: RTObject.py:4597
OpenRTM_aist.RTObject.RTObject_impl.on_startup
def on_startup(self, ec_id)
[ComponentAction CORBA interface] StartUp RTC
Definition: RTObject.py:1224
OpenRTM_aist.RTObject.RTObject_impl.postOnError
def postOnError(self, ec_id, ret)
Definition: RTObject.py:4555
OpenRTM_aist.RTObject.RTObject_impl.get_owned_contexts
def get_owned_contexts(self)
[CORBA interface] Get ExecutionContextList.
Definition: RTObject.py:803
OpenRTM_aist.RTObject.RTObject_impl.get_organizations
def get_organizations(self)
[SDO interface] Getting Organizations
Definition: RTObject.py:2189
OpenRTM_aist.CORBA_SeqUtil.for_each
def for_each(seq, f)
Apply the functor to all CORBA sequence elements.
Definition: CORBA_SeqUtil.py:47
OpenRTM_aist.RTObject.RTObject_impl.getTypeName
def getTypeName(self)
const char* getTypeName()
Definition: RTObject.py:2354
OpenRTM_aist.RTObject.RTObject_impl.finalize
def finalize(self)
Finalize the RTC for preparing it for destruction.
Definition: RTObject.py:570
OpenRTM_aist.RTObject.RTObject_impl.onDeactivated
def onDeactivated(self, ec_id)
Definition: RTObject.py:294
OpenRTM_aist.RTObject.RTObject_impl._ecOther
_ecOther
Definition: RTObject.py:123
OpenRTM_aist.RTObject.RTObject_impl.get_status
def get_status(self, name)
[SDO interface] Get SDO Status
Definition: RTObject.py:2280
OpenRTM_aist.RTObject.RTObject_impl._SdoConfig
_SdoConfig
Definition: RTObject.py:115
OpenRTM_aist.RTObject.RTObject_impl.ec_find
Definition: RTObject.py:4650
OpenRTM_aist.RTObject.RTObject_impl.preOnReset
def preOnReset(self, ec_id)
Definition: RTObject.py:4491
OpenRTM_aist.RTObject.RTObject_impl._configsets
_configsets
Definition: RTObject.py:110
OpenRTM_aist.RTObject.RTObject_impl.addConfigurationSetNameListener
def addConfigurationSetNameListener(self, type, memfunc, autoclean=True)
Adding ConfigurationSetNameListener.
Definition: RTObject.py:4372
OpenRTM_aist.RTObject.RTObject_impl._execContexts
_execContexts
Definition: RTObject.py:116
OpenRTM_aist.RTObject.RTObject_impl._writeAllCompletion
_writeAllCompletion
Definition: RTObject.py:129
OpenRTM_aist.RTObject.RTObject_impl.getProperties
def getProperties(self)
[local interface] Get RTC property
Definition: RTObject.py:2559
OpenRTM_aist.RTObject.RTObject_impl.attach_context
def attach_context(self, exec_context)
[CORBA interface] Attach ExecutionContext.
Definition: RTObject.py:994
OpenRTM_aist.RTObject.RTObject_impl.preOnRateChanged
def preOnRateChanged(self, ec_id)
Definition: RTObject.py:4507
OpenRTM_aist.RTObject.RTObject_impl._sdoservice
_sdoservice
Definition: RTObject.py:113
OpenRTM_aist.RTObject.RTObject_impl.ec_copy.__call__
def __call__(self, ecs)
Definition: RTObject.py:4677
OpenRTM_aist.RTObject.RTObject_impl.deactivate_comps.__call__
def __call__(self, ec)
Definition: RTObject.py:4693
OpenRTM_aist.RTObject.RTObject_impl.on_aborting
def on_aborting(self, ec_id)
[ComponentAction CORBA interface] Transition Error State
Definition: RTObject.py:1387
OpenRTM_aist.RTObject.RTObject_impl.addPortConnectListener
def addPortConnectListener(self, listener_type, memfunc, autoclean=True)
Adding PortConnect type listener.
Definition: RTObject.py:4018
OpenRTM_aist.RTObject.RTObject_impl._properties
_properties
Definition: RTObject.py:109
OpenRTM_aist.RTObject.RTObject_impl._sdoStatus
_sdoStatus
Definition: RTObject.py:121
OpenRTM_aist.ConfigurationListener.ConfigurationSetNameListener
ConfigurationSetNameListener class.
Definition: ConfigurationListener.py:307
OpenRTM_aist.RTObject.RTObject_impl.setObjRef
def setObjRef(self, rtobj)
void setObjRef(const RTObject_ptr rtobj);
Definition: RTObject.py:2473
OpenRTM_aist.RTObject.RTObject_impl.get_sdo_id
def get_sdo_id(self)
[SDO interface] Getting SDO ID
Definition: RTObject.py:1757
OpenRTM_aist.RTObject.RTObject_impl.postOnAborting
def postOnAborting(self, ec_id, ret)
Definition: RTObject.py:4549
OpenRTM_aist.RTObject.RTObject_impl.reset
def reset(self, ec_id)
[local interface] Resetting and go to Inactive state
Definition: RTObject.py:3276
OpenRTM_aist.RTObject.RTObject_impl.removeConfigurationParamListener
def removeConfigurationParamListener(self, type, listener)
Removing ConfigurationParamListener.
Definition: RTObject.py:4248
OpenRTM_aist.RTObject.RTObject_impl.postOnStateUpdate
def postOnStateUpdate(self, ec_id, ret)
Definition: RTObject.py:4573
OpenRTM_aist.RTObject.RTObject_impl.deactivate_comps._comp
_comp
Definition: RTObject.py:4691
OpenRTM_aist.RTObject.RTObject_impl.getDescription
def getDescription(self)
const char* getDescription()
Definition: RTObject.py:2374
OpenRTM_aist.RTObject.RTObject_impl.bindContext
def bindContext(self, exec_context)
Definition: RTObject.py:1021
OpenRTM_aist.RTObject.RTObject_impl._readAll
_readAll
Definition: RTObject.py:126
OpenRTM_aist.RTObject.RTObject_impl._rtcout
_rtcout
Definition: RTObject.py:104
OpenRTM_aist.RTObject.RTObject_impl.activate
def activate(self, ec_id)
[local interface] Make transition to Active state
Definition: RTObject.py:3234
OpenRTM_aist.StringUtil.split
def split(input, delimiter)
Split string by delimiter.
Definition: StringUtil.py:323
OpenRTM_aist.RTObject.RTObject_impl.on_state_update
def on_state_update(self, ec_id)
[DataFlowComponentAction CORBA interface] Secondary Periodic Operation of RTC
Definition: RTObject.py:1601
OpenRTM_aist.NVUtil.copyFromProperties
def copyFromProperties(nv, prop)
Copy to NVList from Proeprties.
Definition: NVUtil.py:85
OpenRTM_aist.RTObject.RTObject_impl.get_sdo_service
def get_sdo_service(self, _id)
[SDO interface] Getting specified SDO Service's reference
Definition: RTObject.py:2023
OpenRTM_aist.RTObject.RTObject_impl.get_owned_organizations
def get_owned_organizations(self)
[SDO interface] Getting Organizations
Definition: RTObject.py:1706
OpenRTM_aist.RTObject.RTObject_impl.postOnExecute
def postOnExecute(self, ec_id, ret)
Definition: RTObject.py:4567
OpenRTM_aist.RTObject.RTObject_impl._inports
_inports
Definition: RTObject.py:130
OpenRTM_aist.RTObject.RTObject_impl.removeSdoServiceConsumer
def removeSdoServiceConsumer(self, id)
[local interface] Remove a SDO service consumerbool removeSdoServiceConsumer(const char* id);
Definition: RTObject.py:3328
OpenRTM_aist.RTObject.RTObject_impl.postOnInitialize
def postOnInitialize(self, ec_id, ret)
Definition: RTObject.py:4513
OpenRTM_aist.RTObject.RTObject_impl._SdoConfigImpl
_SdoConfigImpl
Definition: RTObject.py:114
OpenRTM_aist.RTObject.RTObject_impl.get_sdo_type
def get_sdo_type(self)
[SDO interface] Getting SDO type
Definition: RTObject.py:1802
OpenRTM_aist.RTObject.RTObject_impl.preOnError
def preOnError(self, ec_id)
Definition: RTObject.py:4486
OpenRTM_aist.RTObject.RTObject_impl.bindParameter
def bindParameter(self, param_name, var, def_val, trans=None)
template <typename VarType> bool bindParameter(const char* param_name, VarType& var,...
Definition: RTObject.py:2587
OpenRTM_aist.RTObject.RTObject_impl.registerOutPort
def registerOutPort(self, name, outport)
void registerOutPort(const char* name, OutPortBase& outport);
Definition: RTObject.py:2757
OpenRTM_aist.CORBA_SeqUtil.find
def find(seq, f)
Return the index of CORBA sequence element that functor matches.
Definition: CORBA_SeqUtil.py:84
OpenRTM_aist.RTObject.RTObject_impl.writeAll
def writeAll(self)
The write() method of all OutPort is called.
Definition: RTObject.py:3387
OpenRTM_aist.ComponentActionListener.ComponentActionListeners
ComponentActionListeners class.
Definition: ComponentActionListener.py:1087
OpenRTM_aist.RTObject.RTObject_impl.onFinalize
def onFinalize(self)
Definition: RTObject.py:198
OpenRTM_aist.RTObject.RTObject_impl.onExecute
def onExecute(self, ec_id)
Definition: RTObject.py:320
OpenRTM_aist.RTObject.RTObject_impl.svc_name.__call__
def __call__(self, prof)
Definition: RTObject.py:4620
OpenRTM_aist.RTObject.RTObject_impl.finalizePorts
def finalizePorts(self)
Unregister the All Portse.
Definition: RTObject.py:3493
OpenRTM_aist.RTObject.RTObject_impl.getInstanceName
def getInstanceName(self)
const char* getInstanceName()
Definition: RTObject.py:2313
OpenRTM_aist.RTObject.RTObject_impl.on_activated
def on_activated(self, ec_id)
[ComponentAction CORBA interface] Activate RTC
Definition: RTObject.py:1302
OpenRTM_aist.RTObject.RTObject_impl._ecMine
_ecMine
Definition: RTObject.py:122
OpenRTM_aist.RTObject.RTObject_impl.setReadAll
def setReadAll(self, read=True, completion=False)
Set whether to execute the readAll() method.
Definition: RTObject.py:3434
OpenRTM_aist.RTObject.RTObject_impl.getExecutionRate
def getExecutionRate(self, ec_id)
[local interface] Getting current context' execution rate
Definition: RTObject.py:3021
OpenRTM_aist.RTObject.RTObject_impl.is_alive
def is_alive(self, exec_context)
Confirm whether RTC is an Alive state or NOT.
Definition: RTObject.py:698
OpenRTM_aist.RTObject.RTObject_impl.getVendor
def getVendor(self)
const char* getVendor()
Definition: RTObject.py:2414
OpenRTM_aist.PortAdmin.PortAdmin
PortAdmin class.
Definition: PortAdmin.py:41
OpenRTM_aist.RTObject.RTObject_impl.removePortConnectListener
def removePortConnectListener(self, listener_type, listener)
Removing PortConnect type listener.
Definition: RTObject.py:4056
OpenRTM_aist.PortConnectListener.PortConnectRetListener
PortConnectRetListener class.
Definition: PortConnectListener.py:252
OpenRTM_aist.RTObject.RTObject_impl.exit
def exit(self)
Stop the RTC's execution context(s) and finalize it along with its contents.
Definition: RTObject.py:633
OpenRTM_aist.RTObject.RTObject_impl.on_shutdown
def on_shutdown(self, ec_id)
[ComponentAction CORBA interface] ShutDown RTC
Definition: RTObject.py:1264
OpenRTM_aist.RTObject.RTObject_impl.nv_name.__init__
def __init__(self, _name)
Definition: RTObject.py:4636
OpenRTM_aist.RTObject.RTObject_impl.onInitialize
def onInitialize(self)
Definition: RTObject.py:175
OpenRTM_aist.ComponentActionListener.PostComponentActionListener
PostComponentActionListener class.
Definition: ComponentActionListener.py:275
OpenRTM_aist.RTObject.RTObject_impl.onError
def onError(self, ec_id)
Definition: RTObject.py:367
OpenRTM_aist.PortBase.PortBase
Port base class.
Definition: PortBase.py:115
OpenRTM_aist.ConfigurationListener.ConfigurationParamListener
ConfigurationParamListener class.
Definition: ConfigurationListener.py:64
OpenRTM_aist.ComponentActionListener.PortActionListener
PortActionListener class.
Definition: ComponentActionListener.py:399
OpenRTM_aist.RTObject.RTObject_impl.postOnDeactivated
def postOnDeactivated(self, ec_id, ret)
Definition: RTObject.py:4543
OpenRTM_aist.ConfigAdmin.ConfigAdmin
ConfigAdmin class.
Definition: ConfigAdmin.py:318
OpenRTM_aist.Properties.Properties
Definition: Properties.py:83
OpenRTM_aist.RTObject.RTObject_impl.addPortActionListener
def addPortActionListener(self, listener_type, memfunc, autoclean=True)
Adding PortAction type listener.
Definition: RTObject.py:3815
OpenRTM_aist.RTObject.RTObject_impl._created
_created
Definition: RTObject.py:108
OpenRTM_aist.RTObject.RTObject_impl.ec_find._ec
_ec
Definition: RTObject.py:4652
OpenRTM_aist.RTObject.RTObject_impl.postOnRateChanged
def postOnRateChanged(self, ec_id, ret)
Definition: RTObject.py:4579
OpenRTM_aist.RTObject.RTObject_impl.get_service_profile
def get_service_profile(self, _id)
[SDO interface] Getting Organizations
Definition: RTObject.py:1956
OpenRTM_aist.RTObject.RTObject_impl.removePort
def removePort(self, port)
Definition: RTObject.py:2888
OpenRTM_aist.RTObject.RTObject_impl._manager
_manager
Definition: RTObject.py:93
OpenRTM_aist.RTObject.RTObject_impl.onRateChanged
def onRateChanged(self, ec_id)
Definition: RTObject.py:442
OpenRTM_aist.RTObject.RTObject_impl.addPortConnectRetListener
def addPortConnectRetListener(self, listener_type, memfunc, autoclean=True)
Adding PortConnectRet type listener.
Definition: RTObject.py:4125
OpenRTM_aist.RTObject.RTObject_impl.removePreComponentActionListener
def removePreComponentActionListener(self, listener_type, listener)
Removing PreComponentAction type listener.
Definition: RTObject.py:3632
OpenRTM_aist.RTObject.RTObject_impl.on_error
def on_error(self, ec_id)
[ComponentAction CORBA interface] Error Processing of RTC
Definition: RTObject.py:1442
OpenRTM_aist.RTObject.RTObject_impl._poa
_poa
Definition: RTObject.py:95
OpenRTM_aist.RTObject.RTObject_impl.on_reset
def on_reset(self, ec_id)
[ComponentAction CORBA interface] Resetting RTC
Definition: RTObject.py:1488
OpenRTM_aist.RTObject.RTObject_impl.deactivate
def deactivate(self, ec_id)
[local interface] Make transition to Inactive state
Definition: RTObject.py:3190
OpenRTM_aist.ConfigurationListener.ConfigurationSetListener
ConfigurationSetListener class.
Definition: ConfigurationListener.py:187
OpenRTM_aist.RTObject.RTObject_impl.removeSdoServiceProvider
def removeSdoServiceProvider(self, id)
[local interface] Remove a SDO service providerbool removeSdoServiceProvider(const char* id);
Definition: RTObject.py:3304
OpenRTM_aist.RTObject.RTObject_impl._memfunc
_memfunc
Definition: RTObject.py:3598
OpenRTM_aist.RTObject.RTObject_impl.preOnStartup
def preOnStartup(self, ec_id)
Definition: RTObject.py:4461
OpenRTM_aist.RTObject.RTObject_impl._readAllCompletion
_readAllCompletion
Definition: RTObject.py:128
OpenRTM_aist.RTObject.RTObject_impl.postOnReset
def postOnReset(self, ec_id, ret)
Definition: RTObject.py:4561
OpenRTM_aist.RTObject.RTObject_impl.removeOutPort
def removeOutPort(self, port)
[local interface] Unregister OutPort
Definition: RTObject.py:2844
OpenRTM_aist.RTObject.RTObject_impl.preOnFinalize
def preOnFinalize(self, ec_id)
Definition: RTObject.py:4456
OpenRTM_aist.RTObject.RTObject_impl.getVersion
def getVersion(self)
const char* getVersion()
Definition: RTObject.py:2394
OpenRTM_aist.SdoServiceAdmin.SdoServiceAdmin
Definition: SdoServiceAdmin.py:90
OpenRTM_aist.RTObject.RTObject_impl.onStartup
def onStartup(self, ec_id)
Definition: RTObject.py:222
OpenRTM_aist.RTObject.RTObject_impl.onActivated
def onActivated(self, ec_id)
Definition: RTObject.py:270
OpenRTM_aist.RTObject.RTObject_impl.nv_name.__call__
def __call__(self, nv)
Definition: RTObject.py:4639
OpenRTM_aist.RTObject.RTObject_impl
Definition: RTObject.py:68
OpenRTM_aist.RTObject.RTObject_impl.removeInPort
def removeInPort(self, port)
[local interface] Unregister InPort
Definition: RTObject.py:2805
OpenRTM_aist.RTObject.RTObject_impl.onStateUpdate
def onStateUpdate(self, ec_id)
Definition: RTObject.py:416
OpenRTM_aist.RTObject.RTObject_impl.deletePort
def deletePort(self, port)
[local interface] Unregister Port
Definition: RTObject.py:2881
OpenRTM_aist.RTObject.RTObject_impl._portconnListeners
_portconnListeners
Definition: RTObject.py:133
OpenRTM_aist.RTObject.RTObject_impl.isOwnExecutionContext
def isOwnExecutionContext(self, ec_id)
[local interface] Checking if the current context is own context
Definition: RTObject.py:3144
OpenRTM_aist.RTObject.RTObject_impl.ec_copy._eclist
_eclist
Definition: RTObject.py:4675
OpenRTM_aist.RTObject.RTObject_impl.onAddPort
def onAddPort(self, pprof)
Definition: RTObject.py:4585
OpenRTM_aist.RTObject.RTObject_impl.deactivate_comps.__init__
def __init__(self, comp)
Definition: RTObject.py:4690
OpenRTM_aist.RTObject.RTObject_impl.addOutPort
def addOutPort(self, name, outport)
Definition: RTObject.py:2765
OpenRTM_aist.RTObject.RTObject_impl.ec_copy
Definition: RTObject.py:4673
OpenRTM_aist.RTObject.RTObject_impl.getNamingNames
def getNamingNames(self)
std::vector<std::string> getNamingNames();
Definition: RTObject.py:2454
OpenRTM_aist.RTObject.RTObject_impl.addConfigurationParamListener
def addConfigurationParamListener(self, type, memfunc, autoclean=True)
Adding ConfigurationParamListener.
Definition: RTObject.py:4206
OpenRTM_aist.RTObject.RTObject_impl.preOnAborting
def preOnAborting(self, ec_id)
Definition: RTObject.py:4481
OpenRTM_aist.RTObject.RTObject_impl.getCategory
def getCategory(self)
const char* getCategory()
Definition: RTObject.py:2434
OpenRTM_aist.RTObject.RTObject_impl.preOnActivated
def preOnActivated(self, ec_id)
Definition: RTObject.py:4471
OpenRTM_aist.RTObject.RTObject_impl.addInPort
def addInPort(self, name, inport)
Definition: RTObject.py:2721
OpenRTM_aist.RTObject.RTObject_impl._sdoSvcProfiles
_sdoSvcProfiles
Definition: RTObject.py:119
OpenRTM_aist.PortConnectListener.PortConnectListener
PortConnectListener class.
Definition: PortConnectListener.py:109
OpenRTM_aist.RTObject.RTObject_impl.readAll
def readAll(self)
Readout the value from All InPorts.
Definition: RTObject.py:3353
OpenRTM_aist.RTObject.RTObject_impl.onAborting
def onAborting(self, ec_id)
Definition: RTObject.py:344
OpenRTM_aist.RTObject.RTObject_impl.get_device_profile
def get_device_profile(self)
[SDO interface] Getting SDO DeviceProfile
Definition: RTObject.py:1851
OpenRTM_aist.RTObject.RTObject_impl.postOnStartup
def postOnStartup(self, ec_id, ret)
Definition: RTObject.py:4525
OpenRTM_aist.RTObject.RTObject_impl.removeConfigurationSetNameListener
def removeConfigurationSetNameListener(self, type, listener)
Removing ConfigurationSetNameListener.
Definition: RTObject.py:4415
OpenRTM_aist.RTObject.RTObject_impl.removePortActionListener
def removePortActionListener(self, listener_type, listener)
Removing PortAction type listener.
Definition: RTObject.py:3852
OpenRTM_aist.CorbaPort.CorbaPort
RT Conponent CORBA service/consumer Port.
Definition: CorbaPort.py:604
OpenRTM_aist.NVUtil.append
def append(dest, src)
Definition: NVUtil.py:386


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Apr 21 2025 02:45:06