11 seqin_spec = [
"implementation_id",
"SeqIn",
12 "type_name",
"SequenceInComponent",
13 "description",
"Sequence InPort component",
15 "vendor",
"Shinji Kurihara",
16 "category",
"example",
17 "activity_type",
"DataFlowComponent",
20 "lang_type",
"script",
26 OpenRTM_aist.DataFlowComponentBase.__init__(self, manager)
31 self.
_octet = RTC.TimedOctet(RTC.Time(0,0),0)
32 self.
_short = RTC.TimedShort(RTC.Time(0,0),0)
33 self.
_long = RTC.TimedLong(RTC.Time(0,0),0)
34 self.
_float = RTC.TimedFloat(RTC.Time(0,0),0)
35 self.
_double = RTC.TimedDouble(RTC.Time(0,0),0)
36 self.
_octetSeq = RTC.TimedOctetSeq(RTC.Time(0,0),[])
37 self.
_shortSeq = RTC.TimedShortSeq(RTC.Time(0,0),[])
38 self.
_longSeq = RTC.TimedLongSeq(RTC.Time(0,0),[])
39 self.
_floatSeq = RTC.TimedFloatSeq(RTC.Time(0,0),[])
70 octet_ = self._octetIn.read()
71 short_ = self._shortIn.read()
72 long_ = self._longIn.read()
73 float_ = self._floatIn.read()
74 double_ = self._doubleIn.read()
76 octetSeq_ = self._octetSeqIn.read()
77 shortSeq_ = self._shortSeqIn.read()
78 longSeq_ = self._longSeqIn.read()
79 floatSeq_ = self._floatSeqIn.read()
80 doubleSeq_ = self._doubleSeqIn.read()
82 octetSize_ = len(octetSeq_.data)
83 shortSize_ = len(shortSeq_.data)
84 longSize_ = len(longSeq_.data)
85 floatSize_ = len(floatSeq_.data)
86 doubleSize_ = len(doubleSeq_.data)
89 for i
in range(octetSize_):
90 octetSeqDisp_.append(ord(octetSeq_.data[i]))
92 maxsize = max(octetSize_, shortSize_, longSize_, floatSize_, doubleSize_)
93 octetSeqDisp_ = octetSeqDisp_ + [
'-'] * (maxsize - octetSize_)
94 shortSeq_.data = shortSeq_.data + [
'-'] * (maxsize - shortSize_)
95 longSeq_.data = longSeq_.data + [
'-'] * (maxsize - longSize_)
96 floatSeq_.data = floatSeq_.data + [
'-'] * (maxsize - floatSize_)
97 doubleSeq_.data = doubleSeq_.data + [
'-'] * (maxsize - doubleSize_)
99 if 0x20 <= octet_.data < 0x7e :
100 octetDisp_ = chr(octet_.data)
103 print '%3.2s %10.8s %10.8s %10.8s %10.8s %10.8s' \
104 % (
' ',
'octet',
'short',
'long',
'float',
'double')
105 print '%3.2s %7s[%s] %10.8s %10.8s %10.8s %10.8s' \
106 % (
' ', octet_.data, octetDisp_, short_.data, long_.data, float_.data, double_.data)
107 print "-----------------------------------------------------------" 108 print " Sequence Data " 109 print "-----------------------------------------------------------" 110 for i
in range(maxsize):
111 if 0x20 <= octetSeqDisp_[i] < 0x7e :
112 octetDisp_ = chr(octetSeqDisp_[i])
115 print '%3.2s %7s[%s] %10.8s %10.8s %10.8s %10.8s' \
116 % (i, octetSeqDisp_[i], octetDisp_, shortSeq_.data[i], longSeq_.data[i], floatSeq_.data[i], doubleSeq_.data[i])
119 print "\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r" 127 manager.registerFactory(profile,
136 comp = manager.createComponent(
"SeqIn")
141 mgr = OpenRTM_aist.Manager.init(sys.argv)
145 mgr.setModuleInitProc(MyModuleInit)
148 mgr.activateManager()
157 if __name__ ==
"__main__":
def onExecute(self, ec_id)
The Properties class represents a persistent set of properties.
def __init__(self, manager)
def addInPort(self, name, inport)
def MyModuleInit(manager)
DataFlowComponentBase class.