13 seqout_spec = [
"implementation_id",
"SeqOut",
14 "type_name",
"SequenceOutComponent",
15 "description",
"Sequence OutPort component",
17 "vendor",
"Shinji Kurihara",
18 "category",
"example",
19 "activity_type",
"DataFlowComponent",
22 "lang_type",
"script",
29 OpenRTM_aist.DataFlowComponentBase.__init__(self, manager)
33 self.
_octet = RTC.TimedOctet(RTC.Time(0,0),0)
34 self.
_short = RTC.TimedShort(RTC.Time(0,0),0)
35 self.
_long = RTC.TimedLong(RTC.Time(0,0),0)
36 self.
_float = RTC.TimedFloat(RTC.Time(0,0),0)
37 self.
_double = RTC.TimedDouble(RTC.Time(0,0),0)
38 self.
_octetSeq = RTC.TimedOctetSeq(RTC.Time(0,0),[])
39 self.
_shortSeq = RTC.TimedShortSeq(RTC.Time(0,0),[])
40 self.
_longSeq = RTC.TimedLongSeq(RTC.Time(0,0),[])
41 self.
_floatSeq = RTC.TimedFloatSeq(RTC.Time(0,0),[])
78 self._octet.data = int(random.uniform(0x41, 0x4a))
79 self._short.data = int(random.uniform(0, 10))
80 self._long.data = long(random.uniform(0, 10))
81 self._float.data = float(random.uniform(0.0, 10.0))
82 self._double.data = float(random.uniform(0.0, 10.0))
84 print '%3.2s %10.8s %10.8s %10.8s %10.8s %10.8s' \
85 % (
' ',
'octet',
'short',
'long',
'float',
'double')
86 print '%3.2s %7s[%s] %10.8s %10.8s %10.8s %10.8s' \
87 % (
' ', self._octet.data, chr(self._octet.data), self._short.data, self._long.data, self._float.data, self._double.data)
88 print "-------------------------------------------------------------" 89 print " Sequence Data " 90 print "-------------------------------------------------------------" 92 octetSeq = octetSeq + chr(int(random.uniform(0x41, 0x4a)))
93 shortSeq.append(int(random.uniform(0, 10)))
94 longSeq.append(long(random.uniform(0, 10)))
95 floatSeq.append(float(random.uniform(0.0, 10.0)))
96 doubleSeq.append(float(random.uniform(0.0, 10.0)))
97 print '%3.2s : %7s[%s] %10.8s %10.8s %10.8s %10.8s' \
98 % (str(i), ord(octetSeq[i]), octetSeq[i], shortSeq[i], longSeq[i], floatSeq[i], doubleSeq[i])
101 print "[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r[A\r" 103 self._octetSeq.data = octetSeq
104 self._shortSeq.data = shortSeq
105 self._longSeq.data = longSeq
106 self._floatSeq.data = floatSeq
107 self._doubleSeq.data = doubleSeq
109 self._octetOut.write()
110 self._shortOut.write()
111 self._longOut.write()
112 self._floatOut.write()
113 self._doubleOut.write()
114 self._octetSeqOut.write()
115 self._shortSeqOut.write()
116 self._longSeqOut.write()
117 self._floatSeqOut.write()
118 self._doubleSeqOut.write()
127 manager.registerFactory(profile,
137 comp = manager.createComponent(
"SeqOut")
139 print "Component created" 144 mgr = OpenRTM_aist.Manager.init(sys.argv)
148 mgr.setModuleInitProc(MyModuleInit)
151 mgr.activateManager()
160 if __name__ ==
"__main__":
The Properties class represents a persistent set of properties.
def addOutPort(self, name, outport)
def __init__(self, manager)
def onExecute(self, ec_id)
DataFlowComponentBase class.
def MyModuleInit(manager)