def __init__(self):
super(SignalKScope, self).__init__(None)
self.plot = SignalKPlot()
self.glContext = wx.glcanvas.GLContext(self.glArea)
self.client = SignalKClientFromArgs(sys.argv[:2], True, self.on_con)
self.host_port = self.client.host_port
self.client.autoreconnect = False
self.value_list = self.client.list_values()
self.plot.init(self.value_list)
self.watches = {}
watches = sys.argv[2:]
for name in sorted(self.value_list):
if self.value_list[name]['type'] != 'SensorValue':
continue
i = self.clValues.Append(name)
self.watches[name] = False
for arg in watches:
if arg == name:
self.clValues.Check(i, True)
self.watches[name] = True
watches.remove(name)
for arg in watches:
print 'value not found:', arg
self.on_con(self.client)
self.timer = wx.Timer(self, wx.ID_ANY)
self.Bind(wx.EVT_TIMER, self.receive_messages, id=wx.ID_ANY)
self.timer.Start(100)
self.sTime.SetValue(self.plot.disptime)
self.plot_reshape = False
评论列表
文章目录