コード例 #1
0
ファイル: cdcLogger.py プロジェクト: ednspace/cdcLogger
    def on_startMon(self):
        if self.com_monitor is not None or self.portname.text() == '':
           return

        # First define a couple of variables that will be used to calculate the period
        #self.startTime = 1.1
        self.mark = 'False'
        self.periodAvg = []
        self.periodCount = 0


        self.data_q = Queue.Queue()
        self.error_q = Queue.Queue()
        self.com_monitor = ComMonitorThread(
            self.data_q,
            self.error_q,
            full_port_name(str(self.portname.text())),
            57600)
        self.com_monitor.start()

        com_error = get_item_from_queue(self.error_q)
        if com_error is not None:
            QMessageBox.critical(self, 'ComMonitorThread error', com_error)
            self.com_monitor = None

        self.monitor_active = True
        self.set_actions_enable_state()

        self.timer = QTimer()
        self.connect(self.timer, SIGNAL('timeout()'), self.on_timer)

        self.timer.start(.005)
        self.status_text.setText('Monitor running')
コード例 #2
0
    def on_start(self):
        """ Start the monitor: com_monitor thread and the update
            timer
        """
        if self.com_monitor is not None or self.portname.text() == "":
            return

        self.data_q = Queue.Queue()
        self.error_q = Queue.Queue()
        self.com_monitor = ComMonitorThread(self.data_q, self.error_q, full_port_name(str(self.portname.text())), 9600)
        self.com_monitor.start()

        com_error = get_item_from_queue(self.error_q)
        if com_error is not None:
            QMessageBox.critical(self, "ComMonitorThread error", com_error)
            self.com_monitor = None

        self.monitor_active = True
        self.set_actions_enable_state()

        self.timer = QTimer()
        self.connect(self.timer, SIGNAL("timeout()"), self.on_timer)

        update_freq = 20
        self.timer.start(1000.0 / update_freq)

        self.status_text.setText("Monitor running")
コード例 #3
0
ファイル: pyqtplot.py プロジェクト: mehrdadzarei/pyqt-nirs
    def on_start(self):
        """ Start the monitor: com_monitor thread and the update
            timer
        """
        if self.com_monitor is not None or self.portname.text() == '':
            return
        
        self.data_q = queue.Queue()
        self.error_q = queue.Queue()
        self.com_monitor = ComMonitorThread(
            self.data_q,
            self.error_q,
            full_port_name(str(self.portname.text())),
            38400)
        self.com_monitor.start()
        
        com_error = get_item_from_queue(self.error_q)
        if com_error is not None:
            QMessageBox.critical(self, 'ComMonitorThread error',
                com_error)
            self.com_monitor = None

        self.monitor_active = True
        self.set_actions_enable_state()
        
        self.timer = QTimer()
        self.connect(self.timer, SIGNAL('timeout()'), self.on_timer)
        
        update_freq = self.updatespeed_knob.value()
        if update_freq > 0:
            self.timer.start(1000.0 / update_freq)
        
        self.status_text.setText('Monitor running')
コード例 #4
0
ファイル: monitor.py プロジェクト: CrearAyT/proyecto-anahi
    def on_start(self):
        """ Start the monitor: com_monitor thread and the update
            timer
        """


        if self.com_monitor is not None or self.portname.text() == '':
            return False
        
        self.data_q = Queue.Queue()
        self.error_q = Queue.Queue()
        self.com_monitor = ComMonitorThread(
            self.data_q,
            self.error_q,
            full_port_name(str(self.portname.text())),
            115200)
        self.com_monitor.start()
#        self.com_monitor.invert = True 
        com_error = get_item_from_queue(self.error_q)
        if com_error is not None:
            QMessageBox.critical(self, 'ComMonitorThread error',
                com_error)
            self.com_monitor = None

        self.monitor_active = True
        
        self.timer = QTimer()
        self.connect(self.timer, SIGNAL('timeout()'), self.on_timer)
        
        update_freq = 10
        if update_freq > 0:
            self.timer.start(1000.0 / update_freq)
        
        return True
コード例 #5
0
ファイル: main.py プロジェクト: CrearAyT/proyecto-anahi
    def open_port(self):
        self.data_q = Queue.Queue()
        self.error_q = Queue.Queue()
        self.com_monitor = ComMonitorThread(self.data_q, self.error_q,
                                            '/dev/ttyACM0', 115200)
        self.com_monitor.start()
        com_error = get_item_from_queue(self.error_q)
        if com_error is not None:
            QtGui.QMessageBox.critical(self, 'ComMonitorThread error',
                                       com_error)
            self.com_monitor = None

        self.monitor_active = True

        self.connect(self.timer, QtCore.SIGNAL('timeout()'), self.on_timer)

        self.timer.start(1000.0 / 10)
コード例 #6
0
ファイル: CAN_sniffer.py プロジェクト: boyps/CAN_sniffer
    def on_start(self):
        """ Start the monitor: com_monitor thread and the update
            timer
        """
        if self.com_monitor is not None or self.ui.serialPortLbl.text() == '':
            return
        
        self.data_q = Queue.Queue()
        self.error_q = Queue.Queue()
        self.com_monitor = ComMonitorThread(
            self.data_q,
            self.error_q,
            full_port_name(str(self.ui.serialPortLbl.text())),
            38400)
        self.com_monitor.start()
        
        com_error = get_item_from_queue(self.error_q)
        if com_error is not None:
            QMessageBox.critical(self, 'ComMonitorThread error',
                com_error)
            self.com_monitor = None

        self.monitor_active = True
        # self.set_actions_enable_state()
        
        # self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.on_timer)
        # self.connect(self.timer, SIGNAL('timeout()'), self.on_timer)
        
        update_freq = 100
        if update_freq > 0:
            self.timer.start(1000.0 / update_freq)
        
        self.ui.statusbar.showMessage('Monitor running')
        self.ui.serialConnectPb.hide()
        self.ui.serialDisconnectPb.show()