AEM
master.Master Class Reference

Public Member Functions

def __init__ (self, ports=['/dev/ttyUSB0'], nbThreads=4, dataDir='./DATA')
 
def getSyncTime (self)
 
def sendMsg (self, msg)
 
def createReaderThreads (self, portLis)
 
def createWriterThreads (self, num)
 
def diskSpaceLimitReached (self)
 
def run (self)
 

Data Fields

 fileLockDict
 file lock dire for writer threads keys: full filename values: threading.lock object used to guarranty exclusive access to the file for writing More...
 
 dataDir
 Directory for data files. More...
 
 q
 Synchronized work queue. More...
 
 lock
 Semaphore object to be passed to consumer threads for their use. More...
 
 stopEvent
 
 mailQ
 
 mailer
 
 startTime
 
 readerThreads
 
 writerThreads
 

Constructor & Destructor Documentation

def master.Master.__init__ (   self,
  ports = ['/dev/ttyUSB0'],
  nbThreads = 4,
  dataDir = './DATA' 
)
Constructor for class Master, implements the start and Producer part of
the Producer/Consumer paradigm for parallel processing. 
At instanciation, 
a FIFO, thread-safe queue is created which will be where the producer puts
his production and where the consumers get it.
A semaphore (threading.Lock) object is created to ensure unicity of access
the the fileLockDict used by all the consumer threads.
An insnce of the spiCommsMgr it created.
Finally the conusmer threads are created.
@param self,
@param nbThreads defaults to the initializer
@param dataDir default value provided, the directory where the conusmers
will write the csv files.

Member Function Documentation

def master.Master.createReaderThreads (   self,
  portLis 
)
These run the serial server but need to have a helper to take the data coming in and put
it on the q for the writers...
def master.Master.createWriterThreads (   self,
  num 
)
Creates the number of consumer threads according to the argument.
@param num the number of threads to create
def master.Master.diskSpaceLimitReached (   self)
def master.Master.getSyncTime (   self)
def master.Master.run (   self)
called to start a data run, after the consumer threads have been started.
will display the elapsed time on exit.
To exit, ctrl-c will be handled properly.
def master.Master.sendMsg (   self,
  msg 
)

Field Documentation

master.Master.dataDir

Directory for data files.

master.Master.fileLockDict

file lock dire for writer threads keys: full filename values: threading.lock object used to guarranty exclusive access to the file for writing

master.Master.lock

Semaphore object to be passed to consumer threads for their use.

master.Master.mailer
master.Master.mailQ
master.Master.q

Synchronized work queue.

master.Master.readerThreads
master.Master.startTime
master.Master.stopEvent
master.Master.writerThreads

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