11 consolein_spec = [
"implementation_id",
"ConsoleIn",
12 "type_name",
"ConsoleIn",
13 "description",
"Console input component",
15 "vendor",
"Shinji Kurihara",
16 "category",
"example",
17 "activity_type",
"DataFlowComponent",
20 "lang_type",
"script",
29 print "dtor of ", self.
_name 32 data = OpenRTM_aist.ConnectorDataListenerT.__call__(self, info, cdrdata, RTC.TimedLong(RTC.Time(0,0),0))
33 print "------------------------------" 34 print "Listener: ", self.
_name 35 print "Profile::name: ", info.name
36 print "Profile::id: ", info.id
37 print "Data: ", data.data
38 print "------------------------------" 45 print "dtor of ", self.
_name 48 print "------------------------------" 49 print "Listener: ", self.
_name 50 print "Profile::name: ", info.name
51 print "Profile::id: ", info.id
52 print "------------------------------" 57 OpenRTM_aist.DataFlowComponentBase.__init__(self, manager)
68 print "preOnInitializeFunc" 72 print "preOnFinalizeFunc" 76 print "preOnStartupFunc" 80 print "preOnShutdownFunc" 84 print "preOnActivatedFunc" 88 print "preOnDeactivatedFunc" 92 print "preOnAbortingFunc" 96 print "preOnErrorFunc" 100 print "preOnResetFunc" 104 print "preOnExecuteFunc" 108 print "preOnStateUpdateFunc" 112 print "preOnRateChangedFunc" 116 print "postOnInitializeFunc, ret: ", ret
120 print "postOnFinalizeFunc, ret: ", ret
124 print "postOnStartupFunc, ret: ", ret
128 print "postOnShutdownFunc, ret: ", ret
132 print "postOnActivatedFunc, ret: ", ret
136 print "postOnDeactivatedFunc, ret: ", ret
140 print "postOnAbortingFunc, ret: ", ret
144 print "postOnErrorFunc, ret: ", ret
148 print "postOnResetFunc, ret: ", ret
152 print "postOnExecuteFunc, ret: ", ret
156 print "postOnStateUpdateFunc, ret: ", ret
160 print "postOnRateChangedFunc, ret: ", ret
164 print "onAddPortFunc" 168 print "onRemovePortFunc" 172 print "onAttachExecutionContextFunc" 176 print "onDetachExecutionContextFunc" 181 print "onNotifyConnectFunc pname: ",pname
185 print "onNotifyDisconnectFunc pname: ",pname
189 print "onUnsubscribeInterfacesFunc pname: ", pname
193 print "onPublishInterfacesFunc pname: ", portname,
" ret: ", ret
197 print "onConnectNextportFunc pname: ", portname,
" ret: ", ret
201 print "onSubscribeInterfacesFunc pname: ", portname,
" ret: ", ret
205 print "onConnectedFunc pname: ", portname,
" ret: ", ret
209 print "onDisconnectNextportFunc pname: ", portname,
" ret: ", ret
213 print "onDisconnectedFunc pname: ", portname,
" ret: ", ret
293 self.
_data = RTC.TimedLong(RTC.Time(0,0),0)
297 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE,
299 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_FULL,
301 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE_TIMEOUT,
303 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_OVERWRITE,
305 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_READ,
307 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_SEND,
309 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVED,
311 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVER_FULL,
313 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVER_TIMEOUT,
315 self._outport.addConnectorDataListener(OpenRTM_aist.ConnectorDataListenerType.ON_RECEIVER_ERROR,
318 self._outport.addConnectorListener(OpenRTM_aist.ConnectorListenerType.ON_CONNECT,
320 self._outport.addConnectorListener(OpenRTM_aist.ConnectorListenerType.ON_DISCONNECT,
327 print "Please input number: ",
328 self._data.data = long(sys.stdin.readline())
329 if self._data.data == 9:
331 OpenRTM_aist.setTimestamp(self.
_data)
332 print "Sending to subscriber: ", self._data.data
333 self._outport.write()
339 manager.registerFactory(profile,
348 comp = manager.createComponent(
"ConsoleIn")
352 mgr = OpenRTM_aist.Manager.init(sys.argv)
356 mgr.setModuleInitProc(MyModuleInit)
359 mgr.activateManager()
368 if __name__ ==
"__main__":
def onDisconnectedFunc(self, portname, profile, ret)
def onConnectedFunc(self, portname, profile, ret)
def preOnResetFunc(self, ec_id)
def preOnExecuteFunc(self, ec_id)
def onUnsubscribeInterfacesFunc(self, pname, profile)
def __call__(self, info, cdrdata)
def addPortConnectRetListener(self, listener_type, memfunc, autoclean=True)
Adding PortConnectRet type listener.
def preOnStateUpdateFunc(self, ec_id)
def onConnectNextportFunc(self, portname, profile, ret)
The Properties class represents a persistent set of properties.
def postOnRateChangedFunc(self, ec_id, ret)
This class is abstract base class for listener classes that provides callbacks for various events in ...
def onAttachExecutionContextFunc(self, ec_id)
def addPortActionListener(self, listener_type, memfunc, autoclean=True)
Adding PortAction type listener.
def onSubscribeInterfacesFunc(self, portname, profile, ret)
def onPublishInterfacesFunc(self, portname, profile, ret)
def addExecutionContextActionListener(self, listener_type, memfunc, autoclean=True)
Adding ExecutionContextAction type listener.
def preOnErrorFunc(self, ec_id)
def preOnRateChangedFunc(self, ec_id)
def postOnStateUpdateFunc(self, ec_id, ret)
def postOnErrorFunc(self, ec_id, ret)
def onDisconnectNextportFunc(self, portname, profile, ret)
def addOutPort(self, name, outport)
def postOnFinalizeFunc(self, ec_id, ret)
def preOnActivatedFunc(self, ec_id)
def preOnDeactivatedFunc(self, ec_id)
def __init__(self, manager)
def preOnAbortingFunc(self, ec_id)
def preOnInitializeFunc(self, ec_id)
def postOnStartupFunc(self, ec_id, ret)
def ConsoleInInit(manager)
def onRemovePortFunc(self, pprof)
def postOnInitializeFunc(self, ec_id, ret)
def MyModuleInit(manager)
def postOnShutdownFunc(self, ec_id, ret)
def onNotifyDisconnectFunc(self, pname, prof)
def preOnStartupFunc(self, ec_id)
def addPreComponentActionListener(self, listener_type, memfunc, autoclean=True)
Adding PreComponentAction type listener.
def addPostComponentActionListener(self, listener_type, memfunc, autoclean=True)
Adding PostComponentAction type listener.
def onNotifyConnectFunc(self, pname, prof)
def preOnFinalizeFunc(self, ec_id)
def onExecute(self, ec_id)
def onAddPortFunc(self, pprof)
def postOnExecuteFunc(self, ec_id, ret)
def postOnActivatedFunc(self, ec_id, ret)
DataFlowComponentBase class.
def postOnResetFunc(self, ec_id, ret)
def preOnShutdownFunc(self, ec_id)
def postOnDeactivatedFunc(self, ec_id, ret)
def onDetachExecutionContextFunc(self, ec_id)
def addPortConnectListener(self, listener_type, memfunc, autoclean=True)
Adding PortConnect type listener.
This class is abstract base class for listener classes that provides callbacks for various events in ...
def postOnAbortingFunc(self, ec_id, ret)