Created on 25 Oct 2013 @author: richardm ''' from DarwinVets.Bloods.SpotChem import SpotChem from DarwinVets.Bloods.Mythic import Mythic import signal import sys import logging import time if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) mythic = Mythic("/dev/ttyUSB0", 9600) spotchem = SpotChem("/dev/ttyUSB1", 9600) mythic.start() spotchem.start() # def sigint_handler(sig, frame): # print 'You pressed Ctrl+C - exiting' # mythic.exit() # spotchem.exit() # # signal.signal(signal.SIGINT, sigint_handler) try: while True: raw_input("Press Ctrl-C to exit")
import re def rhandler(res): print res res.save() if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) bdb = BloodsDB() fname = sys.argv[1] if re.match('mythic-', fname): print "Mythic" analyser = Mythic("TEST", 115200) elif re.match('scEZ', fname): analyser = SpotChemEZ("TEST", 9600) elif re.match('scEL', fname): analyser = SpotChemEL("TEST") else: print "Unknown analyser for '%s'"%fname sys.exit(1) analyser.registerResultHandler(rhandler) analyser.start() print "Reading %s"%fname dfile = open(fname, "rb")
import logging from DarwinVets.Bloods.Mythic import Mythic datafiles = [ "data/mythic-2013-11-04T15:27.raw" ] #, "data/mythic-2013-11-02T18:01.raw" ] def rhandler(res): print res cnlist = res.createCNs() for cn in cnlist: print "->%s<-"%cn if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) mythic = Mythic("TEST", 115200) mythic.registerResultHandler(rhandler) mythic.start() for dfname in datafiles: dfile = open(dfname, "rb") while True: d=dfile.read(16) if len(d) == 0: break mythic.testWrite(d) dfile.close()
import sys import logging import time from datetime import datetime def rhandler(res): print res res.save() if __name__ == '__main__': logging.basicConfig(filename=datetime.now().isoformat()[0:16]+'.log',level=logging.DEBUG) bdb = BloodsDB() mythic = Mythic("/dev/ttyUSB0", 115200) spotchemez = SpotChemEZ("/dev/ttyUSB1", 9600) spotchemel = SpotChemEL("/dev/ttyUSB2") mythic.registerResultHandler(rhandler) spotchemez.registerResultHandler(rhandler) spotchemel.registerResultHandler(rhandler) mythic.saveRaw() spotchemez.saveRaw() spotchemel.saveRaw() mythic.start() spotchemez.start() spotchemel.start()
Created on 25 Oct 2013 @author: richardm ''' from DarwinVets.Bloods.SpotChemEZ import SpotChemEZ from DarwinVets.Bloods.SpotChemEL import SpotChemEL from DarwinVets.Bloods.Mythic import Mythic import sys import logging import time if __name__ == '__main__': logging.basicConfig(level=logging.DEBUG) mythic = Mythic("/dev/ttyUSB0", 115200) spotchem1 = SpotChemEZ("/dev/ttyUSB1", 9600) spotchem2 = SpotChemEL("/dev/ttyUSB2") mythic.saveRaw() spotchem1.saveRaw() spotchem2.saveRaw() mythic.start() spotchem1.start() spotchem2.start() # def sigint_handler(sig, frame): # print 'You pressed Ctrl+C - exiting' # mythic.exit() # spotchem.exit()