def main(distress_queue, message_queue, audio_queue_out, audio_queue_in):

    QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)

    print('Begin server gui')

    device_db, message_db, audio_sent_db, audio_recv_db = helper.init_db()

    app = QApplication(sys.argv)

    window = MainWindow(device_db, message_db, audio_sent_db, audio_recv_db,
                        audio_queue_out, audio_queue_in, message_queue)

    distress_reciever = window.ui.insert_distress_message
    distress_worker = Distress_Object(distress_queue)
    distress_worker.aSignal.connect(distress_reciever)
    distress_thread = QThread()
    distress_worker.moveToThread(distress_thread)
    distress_thread.started.connect(distress_worker.run)
    distress_thread.start()

    audio_reciever = window.ui.insert_audio_recieved
    audio_worker = Audio_Object(audio_queue_in)
    audio_worker.bSignal.connect(audio_reciever)
    audio_thread = QThread()
    audio_worker.moveToThread(audio_thread)
    audio_thread.started.connect(audio_worker.run)
    audio_thread.start()

    window.show()

    sys.exit(app.exec_())

    print('End server gui')
Beispiel #2
0
 def __init__(self, device: hs100.HS100, deviceID: str, deviceName: str):
     # -Variables-
     self._device = device
     self.state = 0
     self.deviceID = deviceID
     self.deviceName = deviceName
     # Set threads
     self._turn_on = QThread()
     self._turn_off = QThread()
     self._turn_on.run = self._device.power_on
     self._turn_off.run = self._device.power_off
     self.refresh()
Beispiel #3
0
 def __init__(self, jsdev):
     super().__init__()
     self.jsdev = jsdev
     self.thread = QThread()
     self.moveToThread(self.thread)
     self.thread.started.connect(self.create)
     self.thread.start()
Beispiel #4
0
 def __init__(self, portName):
     super().__init__()
     self.portName = portName
     self.thread = QThread()
     self.moveToThread(self.thread)
     self.thread.started.connect(self.create)
     self.thread.start()
Beispiel #5
0
    def on_tcp_server_start_stop_button_clicked(self):
        if self.ui.button_TcpServer.text() == 'Start':
            self.ui.button_TcpServer.setEnabled(False)
            self.ui.lineEdit_TcpServerListenPort.setEnabled(False)
            self.tcp_server_thread = QThread()
            self.tcp_server = TCPServer(
                self.ui.label_LocalIP.text(),
                int(self.ui.lineEdit_TcpServerListenPort.text()))

            self.tcp_server_thread.started.connect(self.tcp_server.start)
            self.tcp_server.status.connect(self.on_tcp_server_status_update)
            self.tcp_server.message.connect(self.on_tcp_server_message_ready)

            self.tcp_server.moveToThread(self.tcp_server_thread)

            self.tcp_server_thread.start()

            self.config[
                'TCP_Server_Port'] = self.ui.lineEdit_TcpServerListenPort.text(
                )
            self.save_config()

        elif self.ui.button_TcpServer.text() == 'Stop':
            self.ui.button_TcpServer.setEnabled(False)
            self.tcp_server.close()

        elif self.ui.button_TcpServer.text() == 'Disconnect':
            self.ui.button_TcpServer.setEnabled(False)
            self.tcp_server.disconnect()
Beispiel #6
0
    def on_tcp_client_connect_button_clicked(self):
        if self.ui.button_TcpClient.text() == 'Connect':
            self.ui.button_TcpClient.setEnabled(False)
            self.ui.lineEdit_TcpClientTargetIP.setEnabled(False)
            self.ui.lineEdit_TcpClientTargetPort.setEnabled(False)

            self.tcp_client_thread = QThread()
            self.tcp_client = TCPClient(
                self.ui.lineEdit_TcpClientTargetIP.text(),
                int(self.ui.lineEdit_TcpClientTargetPort.text()))

            self.tcp_client_thread.started.connect(self.tcp_client.start)
            self.tcp_client.status.connect(self.on_tcp_client_status_update)
            self.tcp_client.message.connect(self.on_tcp_client_message_ready)

            self.tcp_client.moveToThread(self.tcp_client_thread)

            self.tcp_client_thread.start()

            self.config[
                'TCP_Client_IP'] = self.ui.lineEdit_TcpClientTargetIP.text()
            self.config[
                'TCP_Client_Port'] = self.ui.lineEdit_TcpClientTargetPort.text(
                )
            self.save_config()

        elif self.ui.button_TcpClient.text() == 'Disconnect':
            self.ui.button_TcpClient.setEnabled(False)
            self.tcp_client.close()
Beispiel #7
0
 def setupThread(self):
     self.worker = TimeDisplayer()
     self.thread = QThread()
     self.worker.moveToThread(self.thread)
     self.worker.timeUpdated.connect(self.lblTime.setText)
     self.thread.started.connect(self.worker.run)
     self.thread.finished.connect(self.worker.stop)
    def _init_connectivity(self):
        self._connectivity_service = ConnectivityService(
            self._ss_client, self._network_speed_calculator)
        self._connectivity_service_thread = QThread()
        self._connectivity_service.moveToThread(
            self._connectivity_service_thread)
        self._connectivity_service_thread.started.connect(
            self._connectivity_service.init.emit)
        self._connectivity_service.connected_nodes_outgoing_changed.connect(
            self._on_connected_nodes_changed, Qt.QueuedConnection)
        self._download_manager = DownloadManager(
            connectivity_service=self._connectivity_service,
            ss_client=self._ss_client,
            upload_enabled=False,
            tracker=self._tracker)
        self._download_manager.moveToThread(self._connectivity_service_thread)
        data_dir = self._cfg.sync_directory if self._cfg else get_data_dir()
        downloads_dir = get_downloads_dir(data_dir=data_dir, create=True)
        self._connectivity_service_thread.started.connect(
            lambda: self._download_manager.prepare_cleanup([downloads_dir]))
        self._connectivity_service_thread.start()

        self._download_manager.idle.connect(self._sync.on_share_idle)
        self._download_manager.working.connect(self._sync.on_share_downloading)
        self._download_manager.error.connect(
            self._sync.on_share_downloading_error)
        self._download_manager.progress.connect(
            self._sync.send_download_progress)
        self._download_manager.downloads_status.connect(
            self._sync.send_downloads_status)
        self._download_manager.signal_info_tx.connect(self._on_info_tx)
        self._download_manager.signal_info_rx.connect(self._on_info_rx)
    def __init__(self):
        super().__init__()
        self.label = QLabel("0")

        # 1 - create Worker and Thread inside the Form
        self.obj = worker.Worker()  # no parent!
        self.thread = QThread()  # no parent!

        # 2 - Connect Worker`s Signals to Form method slots to post data.
        self.obj.intReady.connect(self.onIntReady)

        # 3 - Move the Worker object to the Thread object
        self.obj.moveToThread(self.thread)

        # 4 - Connect Worker Signals to the Thread slots
        self.obj.finished.connect(self.thread.quit)

        # 5 - Connect Thread started signal to Worker operational slot method
        self.thread.started.connect(self.obj.procCounter)

        # * - Thread finished signal will close the app if you want!
        #self.thread.finished.connect(app.exit)

        # 6 - Start the thread
        self.thread.start()

        # 7 - Start the form
        self.initUI()
    def init_connection(self):
        """Creates a Worker and a new thread to read source data.
        If there is an existing thread close that one.
        """
        # close existing thread
        self.close_connection()
        # create new thread and worker
        self._thread = QThread()
        self._worker = ConnectionWorker(self._source, self._connection)
        self._worker.moveToThread(self._thread)
        # connect worker signals
        self._worker.connectionReady.connect(self._handle_connection_ready)
        self._worker.tablesReady.connect(self._handle_tables_ready)
        self._worker.dataReady.connect(self.dataReady.emit)
        self._worker.mappedDataReady.connect(self.mappedDataReady.emit)
        self._worker.error.connect(self.error.emit)
        self._worker.connectionFailed.connect(self.connectionFailed.emit)
        # connect start working signals
        self.startTableGet.connect(self._worker.tables)
        self.startDataGet.connect(self._worker.data)
        self.startMappedDataGet.connect(self._worker.mapped_data)
        self.closeConnection.connect(self._worker.disconnect)

        # when thread is started, connect worker to source
        self._thread.started.connect(self._worker.init_connection)
        self._thread.start()
Beispiel #11
0
    def __init__(self, xtitle=None, ytitle=None, width=5, height=4, dpi=100):
        fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = fig.add_subplot(111)
        self.axes.autoscale(enable=True)
        super().__init__(fig)
        self._createDialog()

        self._needsUpdating = False

        self.updateTimer = QTimer()
        self.updateTimer.setSingleShot(False)
        self.updateTimer.setInterval(UPDATE_INTERVAL)
        self.updateTimer.timeout.connect(self._updateFigure)
        self.updateThread = QThread()
        self.updateThread.started.connect(self._refreshFigure)

        self.xdata = list(range(MAXIMUM_POINTS))
        self.ydata = [0] * MAXIMUM_POINTS

        #The following lines may not be correct
        self.xtitle = xtitle
        self.ytitle = ytitle
        self.xtitle("SAMPLE X")

        # self._plot_ref = None
        self._showDialog()
        self.updateTimer.start()
Beispiel #12
0
 def __init__(self) -> None:
     super().__init__()
     self._worker = ImageStreamWorker()
     self._thread = QThread(self)
     self._worker.image_received.connect(self.image_received_slot)
     self._worker.moveToThread(self._thread)
     self._thread.started.connect(self._worker.do_work)
 def start_muxing(self):
     self.start_muxing_thread = QThread()
     self.start_muxing_worker = StartMuxingWorker(self.data)
     self.start_muxing_worker.moveToThread(self.start_muxing_thread)
     self.start_muxing_thread.started.connect(self.start_muxing_worker.run)
     self.start_muxing_worker.finished_paused_signal.connect(
         self.start_muxing_thread.quit)
     self.start_muxing_worker.finished_all_jobs_signal.connect(
         self.start_muxing_thread.quit)
     self.start_muxing_worker.finished_all_jobs_signal.connect(
         self.start_muxing_worker.deleteLater)
     self.start_muxing_worker.finished_all_jobs_signal.connect(
         self.finished_all_jobs)
     self.start_muxing_worker.finished_paused_signal.connect(
         self.start_muxing_worker.deleteLater)
     self.start_muxing_worker.finished_paused_signal.connect(
         self.paused_done)
     self.start_muxing_worker.cancel_signal.connect(
         self.start_muxing_thread.quit)
     self.start_muxing_worker.cancel_signal.connect(
         self.start_muxing_worker.deleteLater)
     self.start_muxing_thread.finished.connect(
         self.start_muxing_thread.deleteLater)
     self.start_muxing_worker.mkvpropedit_good_signal.connect(
         self.show_confirm_using_mkvpropedit)
     self.start_muxing_worker.progress_signal.connect(self.update_progress)
     self.start_muxing_worker.job_started_signal.connect(
         self.new_job_started)
     self.start_muxing_worker.job_succeeded_signal.connect(
         self.job_done_successfully)
     self.start_muxing_worker.job_failed_signal.connect(
         self.job_error_occurred)
     self.start_muxing_worker.pause_from_error_occurred_signal.connect(
         self.pause_from_error_occurred)
     self.start_muxing_thread.start()
Beispiel #14
0
 def __init__(self,
              vertex_count,
              src_inds,
              dst_inds,
              spread,
              heavy_positions=None,
              iterations=10,
              weight_exp=-2):
     super().__init__()
     if vertex_count == 0:
         vertex_count = 1
     if heavy_positions is None:
         heavy_positions = dict()
     self.vertex_count = vertex_count
     self.src_inds = src_inds
     self.dst_inds = dst_inds
     self.spread = spread
     self.heavy_positions = heavy_positions
     self.iterations = max(
         3,
         round(iterations * (1 - len(heavy_positions) / self.vertex_count)))
     self.weight_exp = weight_exp
     self.initial_diameter = (self.vertex_count**(0.5)) * self.spread
     self._state = _State.ACTIVE
     self._thread = QThread()
     self.moveToThread(self._thread)
     self._thread.start()
     qApp.aboutToQuit.connect(self._thread.quit)  # pylint: disable=undefined-variable
     self.started.connect(self.get_coordinates)
     self.finished.connect(self.clean_up)
Beispiel #15
0
    def startLaserWatcher(self):
        Logger().debug("Start laser watcher thread")

        self.__ftpWatcherThread = QThread()
        self.__ftpWatcherThread.setObjectName("CSVWatcherThread")
        self.__ftpWatcher = FTPWatcher(
            remotePath=self.__settingsBean.getLaserRemotePath(),
            ftpAddress=self.__settingsBean.getLaserIp(),
            intervalMs=self.__settingsBean.getLaserPollingTimeMs(),
            ftpPort=self.__settingsBean.getLaserPort())
        self.__ftpWatcher.moveToThread(self.__ftpWatcherThread)

        self.__ftpWatcherThread.started.connect(self.__ftpWatcher.startProcess)
        self.__ftpWatcher.itemsPathUpdatedSignal.connect(
            lambda items: (self.__processBean.setLaserFolderItems(items),
                           self.analizeFolderItems()))
        # self.__csvWatcher.isConnectedSignal.connect(self.laserFolderWatcherConnectedSignal)
        self.__ftpWatcher.isConnectedSignal.connect(
            lambda isConnected: self.__processBean.setLaserConnectionUp(
                isConnected))

        self.__ftpWatcher.startedSignal.connect(
            lambda: self.__processBean.setLaserWatcherRunning(True))
        self.__ftpWatcher.stoppedSignal.connect(
            lambda: self.__processBean.setLaserWatcherRunning(False))

        self.__ftpWatcher.stoppedSignal.connect(self.__ftpWatcherThread.quit)
        self.__ftpWatcherThread.finished.connect(
            self.__ftpWatcherThread.deleteLater)
        self.__ftpWatcherThread.finished.connect(self.__ftpWatcher.deleteLater)

        Logger().debug("Laser watcher thread avviato")

        self.__ftpWatcherThread.start()
Beispiel #16
0
 def __init__(self):
     super().__init__()
     self._thread = QThread()
     self.moveToThread(self._thread)
     self._function = None
     self._args = None
     self._kwargs = None
Beispiel #17
0
    def testQThreadReceiversExtern(self):
        #QThread.receivers() - Inherited protected method

        obj = QThread()
        self.assertEqual(obj.receivers(SIGNAL('destroyed()')), 0)
        QObject.connect(obj, SIGNAL("destroyed()"), self.cb)
        self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 1)
Beispiel #18
0
    def __init__(self, **kwargs):
        super().__init__(*kwargs)
        self._instances = {}
        self._atom = {}
        self._shm = []

        self.logger = logging.getLogger(__name__ + "." + self.__class__.__name__)
        self.connection = xcffib.Connection()
        self.screen = self.connection.get_screen_pointers()[self.connection.pref_screen]
        self.xcomposite = self.connection(xcffib.composite.key)
        self.xshm = self.connection(xcffib.shm.key)
        self.xinput = self.connection(xcffib.xinput.key)
        self._setup_composite()
        self._setup_overlay()

        self.event_thread = QThread(self)

        self.event_worker = X11EventWorker(self)
        self.event_worker.moveToThread(self.event_thread)
        self.event_thread.started.connect(self.event_worker.run)
        self.event_thread.finished.connect(self.event_worker.deleteLater)
        self.event_worker.create_signal.connect(self.on_game_opened)
        self.event_worker.destroy_signal.connect(self.on_game_closed)

        self.event_thread.start()

        self.get_instances()
Beispiel #19
0
    def run_testing(self):
        if not self.file_names:
            self.selected_files.setText(
                "No files were selected. Go to menu and "
                "select files to test.")
            return
        # Create new queues every run
        self.queues = [
            multiprocessing.Queue(maxsize=self.PROCESS_NUMBER),
            multiprocessing.Queue(maxsize=self.PROCESS_NUMBER)
        ]
        self.STOP_THREADS = False
        progress = QProgressDialog("Starting Docker and VMs", "Abort start", 0,
                                   len(self.file_names) * 2, self)
        progress.canceled.connect(self.cancel)
        progress.setWindowModality(Qt.WindowModal)

        # Create Qthread to show progress
        self.thread = QThread()
        self.worker = Worker(self, self.file_names, self.queues)
        self.worker.moveToThread(self.thread)
        # Custom signals connected to own functions for progress dialog
        self.show_steps_thread = threading.Thread(target=self.show_steps,
                                                  args=(progress, ))
        self.show_steps_thread.start()
        # Thread start and stop signals connected with slots
        self.thread.started.connect(self.worker.run)
        self.thread.finished.connect(self.remove_processes)
        # Start thread and force to show progress dialog
        self.thread.start()
        progress.forceShow()
 def __init__(self, toolbox, engine_data, dag, dag_identifier,
              project_items):
     """
     Args:
         toolbox (ToolboxUI)
         engine_data (dict): engine data
         dag (DirectedGraphHandler)
         dag_identifier (str)
         project_items (dict): mapping from project item name to :class:`ProjectItem`
     """
     super().__init__()
     self._toolbox = toolbox
     self._engine_mngr = self._make_engine_manager(engine_data)
     self.dag = dag
     self.dag_identifier = dag_identifier
     self._engine_final_state = "UNKNOWN"
     self._executing_items = []
     self._project_items = project_items
     self.sucessful_executions = []
     self._thread = QThread()
     self.moveToThread(self._thread)
     self._thread.started.connect(self.do_work)
     self._dag_execution_started.connect(_handle_dag_execution_started)
     self._node_execution_started.connect(_handle_node_execution_started)
     self._node_execution_finished.connect(_handle_node_execution_finished)
     self._event_message_arrived.connect(_handle_event_message_arrived)
     self._process_message_arrived.connect(_handle_process_message_arrived)
Beispiel #21
0
    def __init__(self, parent = None):
        super(MainWindow, self).__init__(parent)
        self.mainWindow = getUiFromFile(os.path.join(ROOT_DIR,"UI/mainwindow.ui"))
        self.setCentralWidget(self.mainWindow)


        # Visualization Part
        # accessing Motivo

        self.fileDialog = QFileDialog()

        self.userPreferencesDialog = UserPreferencesDialog()
        self.svgCache = ImageProvider(100)

        self.errorMessage = QMessageBox()

        self.csvFilePath = None

        self.writeToPDFThread = QThread(self)
        self.writeToPDF = ResultsExporter(self.svgCache)
        self.writeToPDF.moveToThread(self.writeToPDFThread)
        # TO DO: Creating a queue for motivo sessions

        # hide Layout

        self.mainWindow.writeToPdfProgressBar.hide()
        self.mainWindow.cancelWritingToPDFButton.hide()
        self.mainWindow.writeToPdfLabel.hide()

        # Creating the dialogs for menu bar actions

        self.basicDialog = BasicDialog()
        self.advancedDialog = AdvancedDialog()

        # Creating connections between menu bar actions and dialogs

        # File

        self.mainWindow.actionExit.triggered.connect(self.exit)

        # Motivo

        self.mainWindow.actionBasic.triggered.connect(self.openBasicDialog)
        self.mainWindow.actionAdvanced.triggered.connect(self.openAdvancedDialog)
        self.mainWindow.actionSaveAsPDF.triggered.connect(self.startWriteToPDFThread)
        self.mainWindow.actionOpenCSV.triggered.connect(self.openSelectCsv)

        self.writeToPDFSignal.connect(self.writeToPDF.setData)

        # Options
        self.mainWindow.actionUserPreferences.triggered.connect(self.openUserPreferencesDialog)

        # visualization

        self.basicDialog.outputReady.connect(self.visualizeFromBasicDialog)
        self.advancedDialog.outputReady.connect(self.visualizeFromAdvancedDialog)

        self.writeToPDF.progress.connect(self.updateWriteToPDFProgress)
        self.writeToPDF.finished.connect(self.writeToPdfComplete)
        self.mainWindow.cancelWritingToPDFButton.clicked.connect(self.cancelWritingToPDF)
Beispiel #22
0
    def startCameraWatcher(self):
        Logger().debug("Start camera watcher thread")

        self.__fsWatcherThread = QThread()
        self.__fsWatcherThread.setObjectName("FSWatcherThread")
        self.__fsWatcher = FSWatcher(
            path=self.__settingsBean.getCameraRemotePath(),
            intervalMs=self.__settingsBean.getCameraPollingTimeMs())
        self.__fsWatcher.moveToThread(self.__fsWatcherThread)

        self.__fsWatcherThread.started.connect(self.__fsWatcher.startProcess)
        self.__fsWatcher.itemsPathUpdatedSignal.connect(
            lambda items: self.__processBean.setCameraFolderItems(items))
        self.__fsWatcher.isConnectedSignal.connect(
            lambda isConnected: self.__processBean.setCameraConnectionUp(
                isConnected))
        self.__fsWatcher.startedSignal.connect(
            lambda: self.__processBean.setCameraWatcherRunning(True))
        self.__fsWatcher.stoppedSignal.connect(
            lambda: self.__processBean.setCameraWatcherRunning(False))

        self.__fsWatcher.stoppedSignal.connect(self.__fsWatcherThread.quit)
        self.__fsWatcherThread.finished.connect(
            self.__fsWatcherThread.deleteLater)
        self.__fsWatcherThread.finished.connect(self.__fsWatcher.deleteLater)

        Logger().debug("Camera watcher thread avviato")

        self.__fsWatcherThread.start()
Beispiel #23
0
    def start_threads(self):
        self.log.append('starting {} threads'.format(self.NUM_THREADS))
        self.button_start_threads.setDisabled(True)
        self.button_stop_threads.setEnabled(True)

        self.__workers_done = 0
        self.__threads = []
        for idx in range(self.NUM_THREADS):
            worker = Worker(idx)
            thread = QThread()
            thread.setObjectName('thread_' + str(idx))
            self.__threads.append((thread, worker))  # need to store worker too otherwise will be gc'd
            worker.moveToThread(thread)

            # get progress messages from worker:
            worker.sig_step.connect(self.on_worker_step)
            worker.sig_done.connect(self.on_worker_done)
            worker.sig_msg.connect(self.log.append)

            # control worker:
            self.sig_abort_workers.connect(worker.abort)

            # get read to start worker:
            # self.sig_start.connect(worker.work)  # needed due to PyCharm debugger bug (!); comment out next line
            thread.started.connect(worker.work)
            thread.start()  # this will emit 'started' and start thread's event loop
Beispiel #24
0
    def init_worker(self, fetch_config, options):
        """
        Create and initialize the worker.

        Should be subclassed to configure the worker, and should return the
        worker method that should start the work.
        """
        self.options = options

        # global preferences
        global_prefs = get_prefs()
        self.global_prefs = global_prefs
        # apply the global prefs now
        apply_prefs(global_prefs)

        fetch_config.set_base_url(global_prefs["archive_base_url"])

        download_dir = global_prefs["persist"]
        if not download_dir:
            download_dir = self.mainwindow.persist
        persist_limit = PersistLimit(abs(global_prefs["persist_size_limit"]) * 1073741824)
        self.download_manager = GuiBuildDownloadManager(download_dir, persist_limit)
        self.test_runner = GuiTestRunner()
        self.thread = QThread()

        # options for the app launcher
        launcher_kwargs = {}
        for name in ("profile", "preferences"):
            if name in options:
                value = options[name]
                if value:
                    launcher_kwargs[name] = value

        # add add-ons paths to the app launcher
        launcher_kwargs["addons"] = options["addons"]
        self.test_runner.launcher_kwargs = launcher_kwargs

        launcher_kwargs["cmdargs"] = []

        if options["profile_persistence"] in ("clone-first", "reuse") or options["profile"]:
            launcher_kwargs["cmdargs"] += ["--allow-downgrade"]

        # Thunderbird will fail to start if passed an URL arg
        if options.get("url") and fetch_config.app_name != "thunderbird":
            launcher_kwargs["cmdargs"] += [options["url"]]

        # Lang only works for firefox-l10n
        if options.get("lang"):
            if options["application"] == "firefox-l10n":
                fetch_config.set_lang(options["lang"])
            else:
                raise MozRegressionError("Invalid lang argument")

        self.worker = self.worker_class(fetch_config, self.test_runner, self.download_manager)
        # Move self.bisector in the thread. This will
        # allow to the self.bisector slots (connected after the move)
        # to be automatically called in the thread.
        self.worker.moveToThread(self.thread)
        self.worker_created.emit(self.worker)
Beispiel #25
0
 def __init__(self):
     super(MainWindow, self).__init__()
     self.ui = Ui_MainWindow()
     self.ui.setupUi(self)
     self.signals = MainWindowSignals()
     self.save_data_dir = None
     self.current_measurement = 0
     self.max_measurements = 0
     self.collecting = False
     self.time_axis = None
     self.mutex = QMutex()
     self.comp_thread = QThread()
     self.exp_thread = QThread()
     self._connect_components()
     self._set_initial_widget_states()
     self._store_line_objects()
     self._set_plot_mouse_mode()
 def setup_start_muxing_process_thread(self):
     self.start_muxing_process_worker = StartMuxingProcessWorker()
     self.start_muxing_process_thread = QThread()
     self.start_muxing_process_worker.moveToThread(self.start_muxing_process_thread)
     self.start_muxing_process_thread.started.connect(self.start_muxing_process_worker.run)
     self.start_muxing_process_worker.all_finished.connect(self.start_muxing_process_thread.quit)
     self.start_muxing_process_worker.all_finished.connect(self.start_muxing_process_worker.deleteLater)
     self.start_muxing_process_worker.finished_job_signal.connect(self.finished_muxing_process)
Beispiel #27
0
 def skip_ahead(self, n):
     self._worker_thread = QThread(self)
     self._worker = self._SkipAheadWorker(deepcopy(self.board), n - 1)
     self._worker_thread.started.connect(self._worker.run)
     self._worker.progressed.connect(self.skipaheadProgress.emit)
     self._worker.completed.connect(self._on_worker_complete)
     self._worker.moveToThread(self._worker_thread)
     self._worker_thread.start(QThread.LowPriority)
Beispiel #28
0
 def iniciar(self):
     self.thread = QThread()
     self.controlador = Controlador()
     self.controlador.requestPrime.connect(self.recebe) #Sinal do Robo para VIEW
     self.request.connect(self.controlador.request)     #Sinal da VIEW para o ROBO
     self.controlador.moveToThread(self.thread)
     self.thread.started.connect(self.controlador.run)
     self.thread.start()
 def startthread(self, text):
     self.WorkerThread = QThread()
     self.worker = Worker1(self._serie)
     self.WorkerThread.started.connect(self.worker.run)
     self.worker.finished.connect(self.end)
     self.worker.set_val.connect(self.setval)
     self.worker.moveToThread(self.WorkerThread)  # Move the Worker object to the Thread object
     self.WorkerThread.start()
Beispiel #30
0
 def __init__(self):
     super().__init__()
     self.background_worker = BackgroundWorker()
     self.working_thread = QThread()
     self.background_worker.moveToThread(self.working_thread)
     self.task_started.connect(self.background_worker.on_task_started)
     self.background_worker.task_failed.connect(self.on_task_failed)
     self.background_worker.task_succeeded.connect(self.on_task_succeeded)
     self.working_thread.start()