10 coctestrtc_spec = [
"implementation_id",
"COCTestRTC",
11 "type_name",
"COCTestRTC",
12 "description",
"Console input component",
14 "vendor",
"Shinji Kurihara",
15 "category",
"example",
16 "activity_type",
"DataFlowComponent",
19 "lang_type",
"script",
28 print "dtor of ", self.
_name 31 data = OpenRTM_aist.ConnectorDataListenerT.__call__(self, info, cdrdata, RTC.TimedLong(RTC.Time(0,0),0))
32 print "------------------------------" 33 print "Listener: ", self.
_name 34 print "Profile::name: ", info.name
35 print "Profile::id: ", info.id
36 print "Data: ", data.data
37 print "------------------------------" 44 print "dtor of ", self.
_name 47 print "------------------------------" 48 print "Listener: ", self.
_name 49 print "Profile::name: ", info.name
50 print "Profile::id: ", info.id
51 print "------------------------------" 56 OpenRTM_aist.DataFlowComponentBase.__init__(self, manager)
60 self.
_data = RTC.TimedLong(RTC.Time(0,0),0)
64 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE,
66 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_FULL,
68 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE_TIMEOUT,
70 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_OVERWRITE,
72 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_READ,
74 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_SEND,
76 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVED,
78 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVER_FULL,
80 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVER_TIMEOUT,
82 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVER_ERROR,
85 self._outport.addConnectorListener(OpenRTM_aist.ConnectorListenerType.ON_CONNECT,
87 self._outport.addConnectorListener(OpenRTM_aist.ConnectorListenerType.ON_DISCONNECT,
94 print "Please input number: ",
95 self._data.data = long(sys.stdin.readline())
96 OpenRTM_aist.setTimestamp(self.
_data)
97 print "Sending to subscriber: ", self._data.data
104 manager.registerFactory(profile,
113 comp = manager.createComponent(
"COCTestRTC")
117 mgr = OpenRTM_aist.Manager.init(sys.argv)
121 mgr.setModuleInitProc(MyModuleInit)
124 mgr.activateManager()
133 if __name__ ==
"__main__":
def COCTestRTCInit(manager)
The Properties class represents a persistent set of properties.
This class is abstract base class for listener classes that provides callbacks for various events in ...
def addOutPort(self, name, outport)
def onExecute(self, ec_id)
def __init__(self, manager)
def MyModuleInit(manager)
def __call__(self, info, cdrdata)
DataFlowComponentBase class.
This class is abstract base class for listener classes that provides callbacks for various events in ...