示例#1
0
 def test04_canPutDataInQueue(self):
         getter = BioDataGetter(self.dataSource, self.queue)
         input = getter._getData()
         data = getter._transformData(input)
         getter._putData(data)
         out = getter.dst.get(True, 3)
         self.assertEquals(PORT_NUMBER, out[0])
         self.assertEquals(P3_OUTPUT, out[1])
示例#2
0
 def test03_canParseP38channelFast(self):
         getter = BioDataGetter(self.dataSource, self.queue)
         input = getter._getData()
         start = time.time()
         for i in range(1000):
             output = getter._transformData(input)
         end = time.time()
         dur = (end - start)/1000.0
         self.assertTrue(dur < 0.0002)     
示例#3
0
class Dsu(object):
    
    def __init__(self, dst, serial, noise=None):
        self.serial = serial
        self.getter = BioDataGetter(self.serial, dst, noise=noise)
        
    def pump(self):
        self.serial.open()
        self.getter.pump()
        self.serial.close()
        
    def start(self):
        self.serial.open()
        self.getter.start()
        
    def stop(self):
        self.getter.stop()  
        self.serial.close()
示例#4
0
 def test02_canParseP38channel(self):
         getter = BioDataGetter(self.dataSource, self.queue)
         input = getter._getData()
         output = getter._transformData(input)
         self.assertEquals(P3_OUTPUT, output[2])
示例#5
0
 def test01_canGetData(self):
         getter = BioDataGetter(self.dataSource, self.queue)
         inputArray = getter._getData()
         for a, b in zip(inputArray, P3_INPUT):
             self.assertEquals(a, b)
示例#6
0
 def __init__(self, dst, serial, noise=None):
     self.serial = serial
     self.getter = BioDataGetter(self.serial, dst, noise=noise)