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.
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 |
|
) |
| |
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
Semaphore object to be passed to consumer threads for their use.
master.Master.readerThreads |
master.Master.writerThreads |
The documentation for this class was generated from the following file:
- /home/bob/Desktop/temp/Yannick/PhD_Support/temp/SPI/RPI/Python/serialApp/master.py