def __init__(self, *args, **kwargs): MyMplCanvas.__init__(self, *args, **kwargs) timer = QtCore.QTimer(self) timer.timeout.connect(self.on_timer) timer.start(100) self.livefeed = LiveDataFeed() self.xydata = []
def __init__(self, parent = None): super(ProdGui, self).__init__(parent) # counters self.face_count = 0 self.device_count = 1 self.current_device_no = 1 # Create the queues for data transfer from serial self.q_Data = None self.q_Error = None # Create (serial) event monitor flag self.event_monitor = False self.com_monitor = None # Create a data class self.livefeed = LiveDataFeed() self.value_samples = [] # Create a Timer Class self.timer = QTimer() #Init the UI self.create_main_frame() self.create_menu() #text file we will be saving in # ACC | GSM | GSM_SNR | RTC | SD | NRF_SPI | STN | V_BAT | GPS | GPS_ANT | NRF-ACC | NRF_SD | NRF_OTA self.failed_checks = {"acc":0,"gsm":0,"gsm_snr":0,"rtc":0,"sd":0,"nrf_spi":0,"stn":0,"v_bat":0, "gps":0,"gps_ant":0,"nrf_acc":0,"nrf_sd":0,"nrf_ota":0} self.setWindowTitle("Carnot Production") #advanced stuff self.advanced_set = False self.timer_counter = 0 self.small_string_flag = 0
def __init__(self, parent=None): #def __init__(self, text, parent=None): super(CellCount_Qt_Mpl, self).__init__(parent) self.setupUi(self) # create live data feed object self.livefeed = LiveDataFeed() # add title & legends for plots self.setLegends()
def __init__(self, parent=None): super(DataMonitor, self).__init__(parent) self.monitor_active = False self.livefeed = LiveDataFeed() self.timer = QTimer() self.create_menu() self.create_main_frame() self.create_status_bar()
def __init__(self, parent=None): super(PlottingDataMonitor, self).__init__(parent) self.monitor_active = False self.com_monitor = None self.com_data_q = None self.com_error_q = None self.livefeed = LiveDataFeed() self.temperature_samples = [] self.timer = QTimer() self.create_menu() self.create_main_frame() self.create_status_bar()
def __init__(self, parent=None): super(PlottingDataMonitor, self).__init__(parent) self.monitor_active = False self.com_monitor = None self.livefeed = LiveDataFeed() self.temperature_samples = [] self.timer = QTimer() # menu # self.file_menu = self.menuBar().addMenu("&File") selectport_action = QAction('Select TTY &Port...', self) selectport_action.triggered.connect(self.on_select_port) self.file_menu.addAction(selectport_action) self.start_action = QAction('&Start monitor') self.start_action.triggered.connect(self.on_start) self.start_action.setEnabled(False) self.file_menu.addAction(self.start_action) self.stop_action = QAction('&Stop monitor') self.stop_action.triggered.connect(self.on_stop) # main widget # # port portname_label = QLabel('tty port:') self.portname = QLineEdit() self.portname.setEnabled(False) self.portname.setFrame(False) portname_layout = QHBoxLayout() portname_layout.addWidget(portname_label) portname_layout.addWidget(self.portname, 0) portname_layout.addStretch(1) portname_groupbox = QGroupBox('Port') portname_groupbox.setLayout(portname_layout) # plot widget self.plot = qwt.QwtPlot(self) self.plot.setCanvasBackground(Qt.black) self.plot.setAxisTitle(qwt.QwtPlot.xBottom, 'Time') self.plot.setAxisScale(qwt.QwtPlot.xBottom, 0, 10, 1) self.plot.setAxisTitle(qwt.QwtPlot.yLeft, 'Temperature') self.plot.setAxisScale(qwt.QwtPlot.yLeft, 0, 250, 40) self.plot.replot() # curve widget self.curve = qwt.QwtPlotCurve('') self.curve.setRenderHint(qwt.QwtPlotItem.RenderAntialiased) pen = QPen(QColor('limegreen')) pen.setWidth(2) self.curve.setPen(pen) self.curve.attach(self.plot) # dial # self.dial = QDial() self.dial.setNotchesVisible(True) self.dial.setRange(0, 20) self.dial.setValue(10) self.dial.valueChanged.connect(self.on_dial_change) self.dial_label = QLabel('Update speed = %s (Hz)' % self.dial.value()) self.dial_label.setAlignment(Qt.AlignTop | Qt.AlignHCenter) dial_layout = QVBoxLayout() dial_layout.addWidget(self.dial) dial_layout.addWidget(self.dial_label) # plot layout plot_layout = QVBoxLayout() plot_layout.addWidget(self.plot) plot_layout.addLayout(dial_layout) plot_groupbox = QGroupBox('Temperature') plot_groupbox.setLayout(plot_layout) # main self.main_frame = QWidget() main_layout = QVBoxLayout() main_layout.addWidget(portname_groupbox) main_layout.addWidget(plot_groupbox) main_layout.addStretch(1) self.main_frame.setLayout(main_layout) self.setCentralWidget(self.main_frame) # status # self.status_text = QLabel('Monitor idle') self.statusBar().addWidget(self.status_text, 1)