本文整理汇总了Python中frame.Frame.get方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.get方法的具体用法?Python Frame.get怎么用?Python Frame.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frame.Frame
的用法示例。
在下文中一共展示了Frame.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: work
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import get [as 别名]
def work(self, input_items, output_items):
inp = input_items[0]
for i in range(len(inp)):
data = []
for x in inp[i]:
data.append(x&0xFF)
data.append(x>>8)
frame = Frame(data, self.frame_prev)
if not frame:
print "no frame" + str(frame)
continue
if not frame.is_broken():
self.frame_prev = frame
self.conf = frame.get(SF_TYPE_CONFIG)
if self.conf is not None:
frame_num = self.conf.frame_num
node_id = self.conf.id
calibration_num = self.conf.calibration_num
de = DataEvent([EVENT_CONFIG, frame_num, node_id, calibration_num])
wx.PostEvent(self.panel, de)
del de
else:
frame_num = 'N/A'
self.meas = frame.get(SF_TYPE_MEASUREMENTS)
if self.meas is not None and self.conf is not None:
temp = self.meas.temp
hum = self.meas.hum_down
pres = self.meas.pressure
de = DataEvent([EVENT_MEASSURE, self.conf.frame_num, temp, hum, pres])
wx.PostEvent(self.panel, de)
del de
#self._dump_frame(frame, frame_num)
#self._dump_eval(frame)
if not self.calibrated and self.conf is not None:
self.calibrated = self.calib.addFragment(self.conf.calibration_num, self.conf.calibration_data)
if self.calibrated:
print("calibration complete at frame %s" % frame_num)
calib_data = self.calib.data()
self.calib = Calibration(calib_data)
de = DataEvent([EVENT_CALIBRATED])
wx.PostEvent(self.panel, de)
del de
print("frame: %s %s" % (frame_num, not frame.is_broken(), ))
return len(inp)
示例2: work
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import get [as 别名]
def work(self, input_items, output_items):
inp = input_items[0]
for i in range(len(inp)):
data = []
for x in inp[i]:
data.append(x&0xFF)
data.append(x>>8)
frame = Frame(data, self.frame_prev)
if not frame:
print "no frame" + str(frame)
continue
if not frame.is_broken():
self.frame_prev = frame
self.conf = frame.get(SF_TYPE_CONFIG)
if self.conf is not None:
frame_num = self.conf.frame_num
node_id = self.conf.id
calibration_num = self.conf.calibration_num
self.node_id.setText(str(node_id))
self.frame_num.setText(str(frame_num))
else:
frame_num = 0
self.meas = frame.get(SF_TYPE_MEASUREMENTS)
if self.meas is not None and self.conf is not None:
temp = self.meas.temp
hum = self.meas.hum_down
pres = self.meas.pressure
self.plot.update_figure(frame_num, temp, hum, pres)
if not self.calibrated and self.conf is not None:
self.calibrated = self.calib.addFragment(self.conf.calibration_num, self.conf.calibration_data)
if self.calibrated:
print("calibration complete at frame %s" % frame_num)
calib_data = self.calib.data()
self.calib = Calibration(calib_data)
self.calibrated_label.setText("calibrated")
self.calibrated_label.setStyleSheet("color: green")
print("frame: %s %s" % (frame_num, not frame.is_broken(), ))
return len(inp)
示例3: loop
# 需要导入模块: from frame import Frame [as 别名]
# 或者: from frame.Frame import get [as 别名]
def loop(self):
self._test_write_header()
calib = CalibrationCollector()
frame_prev = None
while True:
data = self._src.get_frame()
if not data:
return
frame = Frame(data, frame_prev)
if not frame:
continue
if not frame.is_broken():
frame_prev = frame
conf = frame.get(SF_TYPE_CONFIG)
if conf is not None:
frame_num = conf.frame_num
else:
frame_num = 'N/A'
self._dump_frame(frame, frame_num)
self._dump_eval(frame)
if conf is not None:
if calib.addFragment(conf.callibration_num, conf.callibration_data):
break
print("frame: %s %s" % (frame_num, not frame.is_broken(), ))
print("calibration complete at frame %s" % frame_num)
calib_data = calib.data()
calib = Calibration(calib_data)
self._dump_calibration(calib, calib_data)
while True:
data = self._src.get_frame()
if not data:
break
frame = Frame(data, frame_prev)
if not frame:
continue
if not frame.is_broken():
frame_prev = frame
conf = frame.get(SF_TYPE_CONFIG)
if conf is not None:
frame_num = conf.frame_num
else:
frame_num = 'N/A'
self._dump_frame(frame, frame_num)
self._dump_eval(frame, calib)
print("frame: %s %s" % (frame_num, not frame.is_broken(), ))