def __init__(self, parent, label_name, topic_name, topic_type, topic_field, buffer_size): self.label_name = label_name self.topic_type = topic_type self.topic_name = topic_name self.topic_field = topic_field self.buffer_size = buffer_size self.timer = QTimer() self.timer.setInterval(100) self.timer.timeout.connect(self.update_figure) fig = Figure(figsize=(5, 4), dpi=100) self.axes = fig.add_subplot(111) # We want the axes cleared every time plot() is called self.axes.hold(False) self.compute_initial_figure() self.buffer = collections.deque(maxlen=self.buffer_size) FigureCanvas.__init__(self, fig) self.setParent(parent) FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) FigureCanvas.updateGeometry(self) self.subscriber = RosHelper.create_subscriber_from_type( self.topic_name, self.topic_type, self.on_message) self.timer.start()
def __init__(self, parent, label_name,topic_name,topic_type,topic_field,buffer_size): self.label_name= label_name self.topic_type = topic_type self.topic_name = topic_name self.topic_field = topic_field self.buffer_size = buffer_size self.timer = QTimer() self.timer.setInterval(100) self.timer.timeout.connect(self.update_figure) fig = Figure(figsize=(5, 4), dpi=100) self.axes = fig.add_subplot(111) # We want the axes cleared every time plot() is called self.axes.hold(False) self.compute_initial_figure() self.buffer = collections.deque(maxlen=self.buffer_size) FigureCanvas.__init__(self, fig) self.setParent(parent) FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) FigureCanvas.updateGeometry(self) self.subscriber = RosHelper.create_subscriber_from_type(self.topic_name,self.topic_type,self.on_message) self.timer.start()
def __init__(self,parent,label_name,topic_name,topic_type,topic_field): super(RosLabel,self).__init__(label_name,parent) self.label_name = label_name self.topic_name = topic_name self.topic_type = topic_type self.topic_field = topic_field self.subscriber = RosHelper.create_subscriber_from_type(self.topic_name,self.topic_type,self.onmsg) self.setText("N/A")
def __init__(self,parent,name,topic_name,topic_type,topic_fields): super(RosMsgView,self).__init__(name,parent) self.topic_name = topic_name self.topic_type = topic_type self.topic_fields = topic_fields self.ref_dict = {} self.layout = QGridLayout() self.__populate_self() self.subscriber = RosHelper.create_subscriber_from_type(self.topic_name,self.topic_type,self.onmsg)