Qudi
Public Member Functions | Public Attributes | List of all members
core.threadmanager.ThreadManager Class Reference

This class keeps track of all the QThreads that are needed somewhere. More...

Inheritance diagram for core.threadmanager.ThreadManager:
Inheritance graph
[legend]
Collaboration diagram for core.threadmanager.ThreadManager:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self)
 
def newThread (self, name)
 Create a new thread with a name, return its object. More...
 
def quitThread (self, name)
 Stop event loop of QThread. More...
 
def joinThread (self, name, time=None)
 Stop event loop of QThread. More...
 
def cleanupThread (self, name)
 Remove thread from thread list. More...
 
def quitAllThreads (self)
 Stop event loop of all QThreads.
 
def getItemByNumber (self, n)
 Get thread by number ins list. More...
 
def getItemNumberByKey (self, key)
 Get number in list from thread name. More...
 
def rowCount (self, parent=QtCore.QModelIndex())
 Gives the number of threads registered. More...
 
def columnCount (self, parent=QtCore.QModelIndex())
 Gives the number of data fields of a thread. More...
 
def flags (self, index)
 Determines what can be done with entry cells in the table view. More...
 
def data (self, index, role)
 Get data from model for a given cell. More...
 
def headerData (self, section, orientation, role=QtCore.Qt.DisplayRole)
 Data for the table view headers. More...
 

Public Attributes

 lock
 
 headers
 
 thread
 

Detailed Description

This class keeps track of all the QThreads that are needed somewhere.

Member Function Documentation

◆ cleanupThread()

def core.threadmanager.ThreadManager.cleanupThread (   self,
  name 
)

Remove thread from thread list.

Parameters
strname: unique thread name

◆ columnCount()

def core.threadmanager.ThreadManager.columnCount (   self,
  parent = QtCore.QModelIndex() 
)

Gives the number of data fields of a thread.

Returns
int: number of thread data fields

◆ data()

def core.threadmanager.ThreadManager.data (   self,
  index,
  role 
)

Get data from model for a given cell.

Data can have a role that affects display.

     @param QModelIndex index: cell for which data is requested
     @param ItemDataRole role: role for which data is requested

     @return QVariant: data for given cell and role

◆ flags()

def core.threadmanager.ThreadManager.flags (   self,
  index 
)

Determines what can be done with entry cells in the table view.

Parameters
QModelIndexindex: cell fo which the flags are requested
Returns
Qt.ItemFlags: actins allowed fotr this cell

◆ getItemByNumber()

def core.threadmanager.ThreadManager.getItemByNumber (   self,
  n 
)

Get thread by number ins list.

Parameters
intn: number in list
Returns
(threadname, thread): thread name and thread

◆ getItemNumberByKey()

def core.threadmanager.ThreadManager.getItemNumberByKey (   self,
  key 
)

Get number in list from thread name.

Parameters
strkey: thread name
Returns
int: thread number in list

◆ headerData()

def core.threadmanager.ThreadManager.headerData (   self,
  section,
  orientation,
  role = QtCore.Qt.DisplayRole 
)

Data for the table view headers.

Parameters
intsection: number of the column to get header data for
Qt.Orientationorientation of header (horizontal or vertical)
ItemDataRolerole for which to get data
Returns
QVariant: header data for given column and role

◆ joinThread()

def core.threadmanager.ThreadManager.joinThread (   self,
  name,
  time = None 
)

Stop event loop of QThread.

Parameters
strname: unique thread name
inttime: timeout for waiting in msec

◆ newThread()

def core.threadmanager.ThreadManager.newThread (   self,
  name 
)

Create a new thread with a name, return its object.

Parameters
strname: unique name of thread
Returns
QThread: new thred, none if failed

◆ quitThread()

def core.threadmanager.ThreadManager.quitThread (   self,
  name 
)

Stop event loop of QThread.

Parameters
strname: unique thread name

◆ rowCount()

def core.threadmanager.ThreadManager.rowCount (   self,
  parent = QtCore.QModelIndex() 
)

Gives the number of threads registered.

Returns
int: number of threads

The documentation for this class was generated from the following file: