Python PySide.QtCore.QThread() Examples

The following are 14 code examples of PySide.QtCore.QThread(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PySide.QtCore , or try the search function .
Example #1
Source File: _debugger_case_qthread4.py    From PyDev.Debugger with Eclipse Public License 1.0 5 votes vote down vote up
def run(self):
        QtCore.QThread.sleep(4)
        print('Done sleeping') 
Example #2
Source File: fileloading.py    From TimeMachine with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, session, parent=None):
        QtCore.QThread.__init__(self, parent)
        self.session = session

        self.file_path = None
        self.incoming_file = () 
Example #3
Source File: fileloading.py    From TimeMachine with GNU Lesser General Public License v3.0 5 votes vote down vote up
def load(self, file_path):
        self.file_path = file_path
        if file_path.endswith(".ag"):
            self.incoming_file = (file_path, 'SESSION')
        else:
            file_type = androconf.is_android(file_path)
            self.incoming_file = (file_path, file_type)
        self.start(QtCore.QThread.LowestPriority) 
Example #4
Source File: fileloading.py    From AndroBugs_Framework with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, session, parent=None):
        QtCore.QThread.__init__(self, parent)
        self.session = session

        self.file_path = None
        self.incoming_file = () 
Example #5
Source File: fileloading.py    From AndroBugs_Framework with GNU General Public License v3.0 5 votes vote down vote up
def load(self, file_path):
        self.file_path = file_path
        if file_path.endswith(".ag"):
            self.incoming_file = (file_path, 'SESSION')
        else:
            file_type = androconf.is_android(file_path)
            self.incoming_file = (file_path, file_type)
        self.start(QtCore.QThread.LowestPriority) 
Example #6
Source File: fileloading.py    From MARA_Framework with GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, session, parent=None):
        QtCore.QThread.__init__(self, parent)
        self.session = session

        self.file_path = None
        self.incoming_file = () 
Example #7
Source File: fileloading.py    From MARA_Framework with GNU Lesser General Public License v3.0 5 votes vote down vote up
def load(self, file_path):
        self.file_path = file_path
        if file_path.endswith(".ag"):
            self.incoming_file = (file_path, 'SESSION')
        else:
            file_type = androconf.is_android(file_path)
            self.incoming_file = (file_path, file_type)
        self.start(QtCore.QThread.LowestPriority) 
Example #8
Source File: ItemAdderThread.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, receivePipe, tableModel, rawData, useTimestamp=True):
        # Call the superclass constructor
        QtCore.QThread.__init__(self)
        # Attributes to manage the sniffer process
        self.receivePipe = receivePipe
        self.tableModel = tableModel
        self.useTimestamp = useTimestamp
        self.rawData = rawData
        self.enabled = True 
Example #9
Source File: SenderThread.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, packets, sleepTime, CANData, threadName):
        QtCore.QThread.__init__(self)
        self.packets = packets
        self.sleepTime = sleepTime
        self.CANData = CANData
        self.threadName = threadName
        self.enabled = True

        self.logger = Logger(Strings.senderThreadLoggerName + " (" +
                             self.threadName + ")").getLogger() 
Example #10
Source File: SenderThread.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, sleepTime, fuzzerSendPipe, CANData, threadName):
        QtCore.QThread.__init__(self)
        self.sleepTime = sleepTime
        self.fuzzerSendPipe = fuzzerSendPipe
        self.CANData = CANData
        self.threadName = threadName
        self.enabled = True

        self.logger = Logger(Strings.fuzzSenderThreadLoggerName + " (" +
                             self.threadName + ")").getLogger() 
Example #11
Source File: SenderThread.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, UDSTab, sleepTime, UDSSendPipe, CANData, threadName):
        QtCore.QThread.__init__(self)
        self.UDSTab = UDSTab
        self.sleepTime = sleepTime
        self.UDSSendPipe = UDSSendPipe
        self.CANData = CANData
        self.threadName = threadName
        self.enabled = True

        self.logger = Logger(Strings.UDSSenderThreadLoggerName + " (" +
                             self.threadName + ")").getLogger() 
Example #12
Source File: FilterTab.py    From CANalyzat0r with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, snifferReceivePipe, sharedEnabledFlag, curSampleIndex):
        # Call the superclass constructor
        QtCore.QThread.__init__(self)
        self.curSampleIndex = curSampleIndex
        # Attributes to manage the sniffer process
        self.sharedEnabledFlag = sharedEnabledFlag
        self.snifferReceivePipe = snifferReceivePipe 
Example #13
Source File: ui.py    From CSGO-Market-Float-Finder with MIT License 5 votes vote down vote up
def __init__(self):
        QtCore.QObject.__init__(self)
        self.WorkerThread = WorkerThread(self)
        self.t = QtCore.QThread(self, objectName='workerThread')
        self.WorkerThread.moveToThread(self.t)
        self.t.start()
        self.PassedHere = False
        self.currency = None
        self.soldcount = 0
        self.start = 0
        self.logging = 0

        self.WorkerThread.progresscount = 0
        self.WorkerThread.SetStatus.connect(lambda x: self.StatusLabel.setText(x))
        self.WorkerThread.progressSignal.connect(lambda x: self.progressBar_2.setProperty("value", x))
        self.WorkerThread.StartEn.connect(lambda x: self.StartButton.setEnabled(x))
        self.WorkerThread.StartDis.connect(lambda x: self.StartButton.setDisabled(x))
        self.WorkerThread.PauseEn.connect(lambda x: self.PauseButton.setEnabled(x))
        self.WorkerThread.PauseDis.connect(lambda x: self.PauseButton.setDisabled(x))
        self.WorkerThread.RetrieveEn.connect(lambda x: self.RetrieveButton.setEnabled(x))
        self.WorkerThread.RetrieveDis.connect(lambda x: self.RetrieveButton.setDisabled(x))
        self.WorkerThread.TableSorting.connect(lambda x: self.tableWidget.setSortingEnabled(x))
        self.WorkerThread.NewRow.connect(lambda x: self.tableWidget.insertRow(x))
        self.WorkerThread.SetTableItem.connect(self.SetTable)

        self.WorkerThread.ShowError.connect(self.showError)
        self.WorkerThread.ShowInfo.connect(self.showInfo)
        self.WorkerThread.SetCurrHeader.connect(self.setCurrHeader)

        self.WorkerThread.display_error.connect(lambda x: self.display_error(x))
        self.WorkerThread.log_event.connect(lambda x: self.logEvent(x))
        self.WorkerThread.MainLogin.connect(self.login)

        self.init_login.emit(True) 
Example #14
Source File: IntegratorControl.py    From PySimulator with GNU Lesser General Public License v3.0 4 votes vote down vote up
def _simulate(self):
        ''' Starts the simulation of the current model with the current settings in the GUI '''
        self.models[self.currentNumberedModelName].integrationStatistics.finished = False
        self.run.setEnabled(False)
        self.closebutton.setEnabled(False)
        # Delete pluginData because new simulation will start
        self.models[self.currentNumberedModelName].pluginData.clear()
        self._setSettingsFromIntegratorControlGUI(self.currentNumberedModelName)
        # Close the corresponding result file to have write access
        self.models[self.currentNumberedModelName].integrationResults.close()
        try:
            os.remove(self.models[self.currentNumberedModelName].integrationResults.fileName)
        except:
            pass

        self.models[self.currentNumberedModelName].integrationResultFileSemaphore = threading.Semaphore()
        if hasattr(self.models[self.currentNumberedModelName], 'integrationResults'):
            self.models[self.currentNumberedModelName].integrationResults.fileName = ''

        # Define some variables before simulation can start
        self.models[self.currentNumberedModelName].integrationStatistics.cpuTime = None
        self.models[self.currentNumberedModelName].integrationStatistics.nTimeEvents = 0
        self.models[self.currentNumberedModelName].integrationStatistics.nStateEvents = 0
        self.models[self.currentNumberedModelName].integrationStatistics.nGridPoints = 0
        self.models[self.currentNumberedModelName].integrationStatistics.reachedTime = self.models[self.currentNumberedModelName].integrationSettings.startTime

        # Define Timers for result updates and simulation info updates
        self.updateData = QtCore.QTimer()
        self.updateData.timeout.connect(self.triggerdResultUpdate)

        self.updateSimulationInfo = QtCore.QTimer()
        self.updateSimulationInfo.timeout.connect(self.showSimulationInfo)

        # Define a new thread for the simulation task
        self._simThread = simulationThread(self)

        self._simThread.model = self.models[self.currentNumberedModelName]
        self._simThread.model.simulationStopRequest = False

        self.lastCurrentTime = self._simThread.model.integrationStatistics.reachedTime
        self.showSimulationInfo()

        # Start the timers and the simulation thread
        self._simThread.SimulationFinished = self.SimulationFinished
        self.updateData.start(1000)
        self.updateSimulationInfo.start(500)
        self._cpuStartTime = time.clock()
        self.stop.setEnabled(True)
        self._simThread.start(QtCore.QThread.LowPriority)