コード例 #1
0
ファイル: mass_spec.py プロジェクト: PenelopeJones/batteries
    def __init__(self):
        sql_queue = queue.Queue()
        self.data_saver = database_saver.SqlSaver(settings.username,
                                                  settings.username, sql_queue)
        self.data_saver.start()
        if settings.qmg == '420':
            self.qmg = qmg420.qmg_420(settings.port)
        if settings.qmg == '422':
            print(settings.port)
            self.qmg = qmg422.qmg_422(port=settings.port, speed=settings.speed)

        try:
            livesocket = LiveSocket(settings.name + '-mass-spec',
                                    ['qms-value'])
            livesocket.start()
        except:
            livesocket = None

        pullsocket = DateDataPullSocket(settings.name + '-mass-spec',
                                        ['qms-value'])
        pullsocket.start()

        self.qms = ms.QMS(self.qmg,
                          sql_queue,
                          chamber=settings.chamber,
                          credentials=settings.username,
                          livesocket=livesocket,
                          pullsocket=pullsocket)
        self.qmg.reverse_range = settings.reverse_range
        self.printer = qmg_status_output.QmsStatusOutput(
            self.qms, sql_saver_instance=self.data_saver)
        self.printer.start()
コード例 #2
0
ファイル: mass_spec.py プロジェクト: CINF/PyExpLabSys
    def __init__(self):
        sql_queue = queue.Queue()
        self.data_saver = database_saver.SqlSaver(settings.username,
                                                  settings.username, sql_queue)
        self.data_saver.start()
        if settings.qmg == '420':
            self.qmg = qmg420.qmg_420(settings.port)
        if settings.qmg == '422':
            print(settings.port)
            self.qmg = qmg422.qmg_422(port=settings.port, speed=settings.speed)

        try:
            livesocket = LiveSocket(settings.name + '-mass-spec', ['qms-value'])
            livesocket.start()
        except:
            livesocket = None

        pullsocket = DateDataPullSocket(settings.name + '-mass-spec', ['qms-value'])
        pullsocket.start()

        self.qms = ms.QMS(self.qmg, sql_queue, chamber=settings.chamber,
                          credentials=settings.username, livesocket=livesocket,
                          pullsocket=pullsocket)
        self.qmg.reverse_range = settings.reverse_range
        self.printer = qmg_status_output.QmsStatusOutput(self.qms,
                                                         sql_saver_instance=self.data_saver)
        self.printer.start()
コード例 #3
0
import PyExpLabSys.common.sql_saver as sql_saver
import PyExpLabSys.drivers.pfeiffer_qmg422 as qmg422
import PyExpLabSys.apps.qms.qms as ms
import PyExpLabSys.apps.qms.qmg_status_output as qmg_status_output
import PyExpLabSys.apps.qms.qmg_meta_channels as qmg_meta_channels
import sql_credentials

logging.basicConfig(filename="qms.txt", level=logging.ERROR)
logging.basicConfig(level=logging.DEBUG)

timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
sql_queue = Queue.Queue()
sql_saver = sql_saver.SqlSaver(sql_queue, sql_credentials.username)
sql_saver.start()

qmg = qmg422.qmg_422()
chamber = 'dummy'
#chamber = 'stm312'
qms = ms.qms(qmg, sql_queue, chamber=chamber, credentials=sql_credentials.username)

printer = qmg_status_output.qms_status_output(qms, sql_saver_instance=sql_saver)
printer.start()

if True:
    channel_list = qms.read_ms_channel_list('channel_list.txt')
    meta_udp = qmg_meta_channels.udp_meta_channel(qms, timestamp, channel_list, 5)
    meta_udp.daemon = True
    meta_udp.start()
    print qms.mass_time(channel_list['ms'], timestamp)

if False:
コード例 #4
0
ファイル: mass_spec.py プロジェクト: neilanderson/PyExpLabSys
import PyExpLabSys.common.sql_saver as sql_saver
import PyExpLabSys.drivers.pfeiffer_qmg422 as qmg422
import PyExpLabSys.apps.qms.qms as ms
import PyExpLabSys.apps.qms.qmg_status_output as qmg_status_output
import PyExpLabSys.apps.qms.qmg_meta_channels as qmg_meta_channels
import sql_credentials

logging.basicConfig(filename="qms.txt", level=logging.ERROR)
logging.basicConfig(level=logging.DEBUG)

timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
sql_queue = Queue.Queue()
sql_saver = sql_saver.SqlSaver(sql_queue, sql_credentials.username)
sql_saver.start()

qmg = qmg422.qmg_422(port="/dev/ttyS0", speed=9600)
chamber = "dummy"
# chamber = 'volvo'

qms = ms.qms(qmg, sql_queue, chamber=chamber, credentials=sql_credentials.username)
qmg.reverse_range = False
printer = qmg_status_output.qms_status_output(qms, sql_saver_instance=sql_saver)
printer.start()

if False:
    channel_list = qms.read_ms_channel_list("channel_list.txt")
    meta_udp = qmg_meta_channels.udp_meta_channel(qms, timestamp, channel_list, 5)
    meta_udp.daemon = True
    meta_udp.start()
    print qms.mass_time(channel_list["ms"], timestamp)