Commit df9b217a authored by David Cussans's avatar David Cussans

Edited import statements to make it easier to more to multiprocess rather than Theading interface

git-svn-id: https://svn2.phy.bris.ac.uk/svn/uob-hep-pc049a/trunk@41 e1591323-3689-4d5a-aa31-d1a7cbdc5706
parent a4ada180
...@@ -5,20 +5,22 @@ import logging ...@@ -5,20 +5,22 @@ import logging
from PyChipsUser import * from PyChipsUser import *
import threading #import threading
from threading import Thread
import time import time
import Queue #import Queue
from Queue import Queue
import MarocHistograms import MarocHistograms
from marocLogging import marocLogging from marocLogging import marocLogging
class MarocHistogrammingThread(threading.Thread): class MarocHistogrammingThread(Thread):
"""Class with functions that can read unpacked MAROC3 ADC data histogramme the results. Inherits from threading class, so has a 'start' method""" """Class with functions that can read unpacked MAROC3 ADC data histogramme the results. Inherits from threading class, so has a 'start' method"""
def __init__(self, threadID, name , unpackedDataQueue , debugLevel=logging.DEBUG ): def __init__(self, threadID, name , unpackedDataQueue , debugLevel=logging.DEBUG ):
threading.Thread.__init__(self) Thread.__init__(self)
self.threadID = threadID self.threadID = threadID
self.name = name self.name = name
self.unpackedDataQueue = unpackedDataQueue self.unpackedDataQueue = unpackedDataQueue
......
...@@ -5,20 +5,22 @@ import logging ...@@ -5,20 +5,22 @@ import logging
from PyChipsUser import * from PyChipsUser import *
import threading #import threading
from threading import Thread
import time import time
import Queue #import Queue
from Queue import Queue
import MarocDAQ import MarocDAQ
from marocLogging import marocLogging from marocLogging import marocLogging
class MarocReadoutThread(threading.Thread): class MarocReadoutThread(Thread):
"""Class with functions that can read out MAROC3 using IPBus. Inherits from threading class, so has a 'start' method""" """Class with functions that can read out MAROC3 using IPBus. Inherits from threading class, so has a 'start' method"""
def __init__(self, threadID, name, board , rawDataQueue , numTriggers, debugLevel=logging.DEBUG ): def __init__(self, threadID, name, board , rawDataQueue , numTriggers, debugLevel=logging.DEBUG ):
threading.Thread.__init__(self) Thread.__init__(self)
self.threadID = threadID self.threadID = threadID
self.board = board self.board = board
self.name = name self.name = name
......
...@@ -5,20 +5,22 @@ import logging ...@@ -5,20 +5,22 @@ import logging
from PyChipsUser import * from PyChipsUser import *
import threading #import threading
from threading import Thread
import time import time
import Queue #import Queue
from Queue import Queue
import MarocRecording import MarocRecording
from marocLogging import marocLogging from marocLogging import marocLogging
class MarocRecordingThread(threading.Thread): class MarocRecordingThread(Thread):
"""Class with functions that can store data from MAROC3 into a ROOT file as a TTree. Inherits from threading class, so has a 'start' method""" """Class with functions that can store data from MAROC3 into a ROOT file as a TTree. Inherits from threading class, so has a 'start' method"""
def __init__(self, threadID, name , unpackedDataQueue , fileName="marocData.root" , debugLevel=logging.DEBUG ): def __init__(self, threadID, name , unpackedDataQueue , fileName="marocData.root" , debugLevel=logging.DEBUG ):
threading.Thread.__init__(self) Thread.__init__(self)
self.threadID = threadID self.threadID = threadID
self.name = name self.name = name
self.unpackedDataQueue = unpackedDataQueue self.unpackedDataQueue = unpackedDataQueue
......
...@@ -10,18 +10,20 @@ import binstr ...@@ -10,18 +10,20 @@ import binstr
from PyChipsUser import * from PyChipsUser import *
import threading #import threading
from threading import Thread
import time import time
import Queue #import Queue
from Queue import Queue
import array import array
class MarocUnpackingThread(threading.Thread): class MarocUnpackingThread(Thread):
"""Class with functions that can read unpack raw MAROC3 ADC data and pack into an array of integers. Inherits from threading class, so has a 'start' method""" """Class with functions that can read unpack raw MAROC3 ADC data and pack into an array of integers. Inherits from threading class, so has a 'start' method"""
def __init__(self, threadID, name , rawDataQueue , recordingDataQueue, histogramDataQueue , debugLevel=logging.DEBUG ): def __init__(self, threadID, name , rawDataQueue , recordingDataQueue, histogramDataQueue , debugLevel=logging.DEBUG ):
threading.Thread.__init__(self) Thread.__init__(self)
self.threadID = threadID self.threadID = threadID
self.name = name self.name = name
self.rawDataQueue = rawDataQueue self.rawDataQueue = rawDataQueue
......
...@@ -20,7 +20,8 @@ import MarocConfiguration ...@@ -20,7 +20,8 @@ import MarocConfiguration
from PyChipsUser import * from PyChipsUser import *
import Queue #import Queue
from Queue import Queue
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
marocLogging(logger,logging.DEBUG) marocLogging(logger,logging.DEBUG)
...@@ -57,11 +58,11 @@ logger.info("Firmware ID = %s" % (hex(firmwareID))) ...@@ -57,11 +58,11 @@ logger.info("Firmware ID = %s" % (hex(firmwareID)))
marocConfiguration = MarocConfiguration.MarocConfiguration(board,configurationFile = options.configFile , debugLevel=logging.DEBUG) marocConfiguration = MarocConfiguration.MarocConfiguration(board,configurationFile = options.configFile , debugLevel=logging.DEBUG)
rawDataQueue = Queue.Queue() rawDataQueue = Queue()
recordingDataQueue = Queue.Queue() recordingDataQueue = Queue()
histogramQueueSize = 100 histogramQueueSize = 100
histogramDataQueue = Queue.Queue(histogramQueueSize) histogramDataQueue = Queue(histogramQueueSize)
# Create a readout thread. Pass down an event limit. When the event limit is reached the readout thread will pass a message along chain and threads will terminate. # Create a readout thread. Pass down an event limit. When the event limit is reached the readout thread will pass a message along chain and threads will terminate.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment