예제 #1
0
def main():
    """ Main function """
    logging.basicConfig(filename="logger.txt", level=logging.ERROR)
    logging.basicConfig(level=logging.ERROR)

    ports = '/dev/serial/by-id/'
    ports += 'usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0'
    xgs_instance = xgs600.XGS600Driver(ports)
    print(xgs_instance.read_all_pressures())

    pressure = PressureReader(xgs_instance)
    pressure.start()

    time.sleep(2.5)

    codenames = ['ps_qms_pressure', 'ps_chamber_pressure']
    loggers = {}
    loggers[codenames[0]] = ValueLogger(pressure,
                                        comp_val=0.1,
                                        low_comp=1e-11,
                                        comp_type='log',
                                        channel=0)
    loggers[codenames[0]].start()
    loggers[codenames[1]] = ValueLogger(pressure,
                                        comp_val=0.1,
                                        low_comp=1e-11,
                                        comp_type='log',
                                        channel=1)
    loggers[codenames[1]].start()

    #livesocket = LiveSocket('PS', codenames, 2)
    #livesocket.start()

    socket = DateDataPullSocket('PS pressure logger',
                                codenames,
                                timeouts=2 * [1.0],
                                port=9001)
    socket.start()

    db_logger = ContinuousDataSaver(continuous_data_table='dateplots_ps',
                                    username=credentials.user,
                                    password=credentials.passwd,
                                    measurement_codenames=codenames)
    db_logger.start()

    while pressure.isAlive():
        time.sleep(0.5)
        for name in codenames:
            value = loggers[name].read_value()
            #livesocket.set_point_now(name, value)
            socket.set_point_now(name, value)
            if loggers[name].read_trigged():
                print(value)
                db_logger.save_point_now(name, value)
                loggers[name].clear_trigged()
예제 #2
0
def main():
    """ Main function """
    logging.basicConfig(filename="logger.txt", level=logging.ERROR)
    logging.basicConfig(level=logging.ERROR)
    port = 'serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0'
    xgs = xgs600.XGS600Driver('/dev/' + port)
    print(xgs.read_all_pressures())

    reader = PressureReader(xgs)
    reader.daemon = True
    reader.start()

    buffer_logger = ValueLogger(reader, comp_val=0.1, comp_type='log',
                                channel=0, low_comp=1e-3)
    containment_logger = ValueLogger(reader, comp_val=0.1, comp_type='log',
                                     channel=1, low_comp=1e-3)
    buffer_logger.start()
    containment_logger.start()

    socket = DateDataPullSocket('mgw',
                                ['containment_pressure', 'buffer_pressure'],
                                timeouts=[1.0, 1.0])
    socket.start()

    livesocket = LiveSocket('mgw', ['containment_pressure', 'buffer_pressure'])
    livesocket.start()

    codenames = ['mgw_pressure_containment', 'mgw_pressure_buffer']
    db_logger = ContinuousDataSaver(continuous_data_table='dateplots_mgw',
                                    username=credentials.user,
                                    password=credentials.passwd,
                                    measurement_codenames=codenames)
    db_logger.start()
    time.sleep(5)

    while reader.isAlive():
        time.sleep(0.2)
        p_containment = containment_logger.read_value()
        p_buffer = buffer_logger.read_value()
        socket.set_point_now('containment_pressure', p_containment)
        socket.set_point_now('buffer_pressure', p_buffer)
        livesocket.set_point_now('containment_pressure', p_containment)
        livesocket.set_point_now('buffer_pressure', p_buffer)

        if containment_logger.read_trigged():
            print(p_containment)
            db_logger.save_point_now('mgw_pressure_containment', p_containment)
            containment_logger.clear_trigged()

        if buffer_logger.read_trigged():
            print(p_buffer)
            db_logger.save_point_now('mgw_pressure_buffer', p_buffer)
            buffer_logger.clear_trigged()
예제 #3
0
def main():
    """ Main code """
    mux_instance = agilent_34972A.Agilent34972ADriver(
        interface='lan', hostname='volvo-agilent-34972a')
    port = '/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0'
    xgs_instance = xgs600.XGS600Driver(port)

    analog_measurement = MuxReader(mux_instance)
    analog_measurement.start()

    pressure = PressureReader(xgs_instance)
    print('-')
    pressure.start()

    time.sleep(2.5)

    codenames = ['volvo_pressure', 'volvo_temperature']
    loggers = {}
    loggers[codenames[0]] = ValueLogger(pressure,
                                        comp_val=0.1,
                                        comp_type='log')
    loggers[codenames[0]].start()
    loggers[codenames[1]] = ValueLogger(analog_measurement,
                                        comp_val=0.5,
                                        comp_type='lin')
    loggers[codenames[1]].start()

    socket = DateDataPullSocket('Volvo data logger',
                                codenames,
                                timeouts=[1.0, 1.0])
    socket.start()

    livesocket = LiveSocket('Volvo data logger', codenames)
    livesocket.start()

    db_logger = ContinuousDataSaver(continuous_data_table='dateplots_volvo',
                                    username=credentials.user,
                                    password=credentials.passwd,
                                    measurement_codenames=codenames)
    db_logger.start()

    #while pressure.isAlive() and analog_measurement.isAlive():
    while True:
        time.sleep(0.25)
        for name in codenames:
            value = loggers[name].read_value()
            socket.set_point_now(name, value)
            livesocket.set_point_now(name, value)
            if loggers[name].read_trigged():
                print(value)
                db_logger.save_point_now(name, value)
                loggers[name].clear_trigged()
예제 #4
0
def main():
    """ Main function """
    logging.basicConfig(filename="logger.txt", level=logging.ERROR)
    logging.basicConfig(level=logging.ERROR)
    ports = '/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0'
    xgs_instance = xgs600.XGS600Driver(ports)
    print(xgs_instance.read_all_pressures())

    pressure = PressureReader(xgs_instance)
    pressure.start()

    time.sleep(2.5)

    codenames = ['tof_iongauge_ft', 'tof_iongauge_main', 'tof_pirani_roughing']
    loggers = {}
    loggers[codenames[0]] = ValueLogger(pressure,
                                        comp_val=0.1,
                                        low_comp=1e-11,
                                        comp_type='log',
                                        channel=0)
    loggers[codenames[0]].start()
    loggers[codenames[1]] = ValueLogger(pressure,
                                        low_comp=1e-11,
                                        comp_val=0.1,
                                        comp_type='log',
                                        channel=1)
    loggers[codenames[1]].start()
    loggers[codenames[2]] = ValueLogger(pressure,
                                        comp_val=0.1,
                                        comp_type='log',
                                        channel=2)
    loggers[codenames[2]].start()

    livesocket = LiveSocket('TOF data logger', codenames)
    livesocket.start()

    db_logger = ContinuousDataSaver(continuous_data_table='dateplots_tof',
                                    username=credentials.user,
                                    password=credentials.passwd,
                                    measurement_codenames=codenames)
    db_logger.start()

    while pressure.isAlive():
        time.sleep(0.5)
        for name in codenames:
            value = loggers[name].read_value()
            livesocket.set_point_now(name, value)
            if loggers[name].read_trigged():
                print(value)
                db_logger.save_point_now(name, value)
                loggers[name].clear_trigged()
예제 #5
0
            time.sleep(0.5)
            press = self.xgs.read_all_pressures()
            try:
                self.pressure = press[0]
            except IndexError:
                print("av")
                self.pressure = 0


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

mux_instance = agilent_34972A.Agilent34972ADriver('volvo-agilent-34972a')
#mux_instance = agilent_34972A.Agilent34972ADriver('10.54.6.144')
xgs_instance = xgs600.XGS600Driver(
    '/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0'
)

analog_measurement = MuxReader(mux_instance)
analog_measurement.start()

pressure = PressureReader(xgs_instance)
pressure.start()

time.sleep(2.5)

codenames = ['volvo_pressure', 'volvo_temperature']
loggers = {}
loggers[codenames[0]] = ValueLogger(pressure, comp_val=0.1, comp_type='log')
loggers[codenames[0]].start()
loggers[codenames[1]] = ValueLogger(analog_measurement,
예제 #6
0
def main():
    """ Main function """
    logging.basicConfig(filename="logger.txt", level=logging.ERROR)
    logging.basicConfig(level=logging.ERROR)

    xgs_port = '/dev/serial/by-id/'
    xgs_port += 'usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0'
    xgs_instance = xgs600.XGS600Driver(xgs_port)
    print(xgs_instance.read_all_pressures())

    xgs_pressure = XgsReader(xgs_instance)
    xgs_pressure.start()

    time.sleep(2.5)

    codenames = [
        'pvd309_load_lock_ig', 'pvd309_load_lock_turbo_roughing',
        'pvd309_load_lock_pirani', 'pvd309_main_chamber_ig',
        'pvd309_cryo_roughing', 'pvd309_main_chamber_pirani'
    ]

    loggers = {}
    loggers[codenames[0]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-9,
                                        comp_type='log',
                                        channel=0)
    loggers[codenames[0]].start()
    loggers[codenames[1]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-3,
                                        comp_type='log',
                                        channel=1)
    loggers[codenames[1]].start()
    loggers[codenames[2]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-3,
                                        comp_type='log',
                                        channel=2)
    loggers[codenames[2]].start()
    loggers[codenames[3]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-9,
                                        comp_type='log',
                                        channel=3)
    loggers[codenames[3]].start()
    loggers[codenames[4]] = ValueLogger(xgs_pressure,
                                        comp_val=0.3,
                                        low_comp=1e-2,
                                        comp_type='log',
                                        channel=4)
    loggers[codenames[4]].start()
    loggers[codenames[5]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-3,
                                        comp_type='log',
                                        channel=5)
    loggers[codenames[5]].start()

    livesocket = LiveSocket('pvd309 pressure logger', codenames, 2)
    livesocket.start()

    socket = DateDataPullSocket('pvd309 pressure',
                                codenames,
                                timeouts=[1.0] * 6)
    socket.start()

    db_logger = ContinuousDataSaver(continuous_data_table='dateplots_pvd309',
                                    username=credentials.user,
                                    password=credentials.passwd,
                                    measurement_codenames=codenames)
    db_logger.start()

    while xgs_pressure.isAlive():
        time.sleep(0.25)
        for name in codenames:
            value = loggers[name].read_value()
            livesocket.set_point_now(name, value)
            socket.set_point_now(name, value)
            if loggers[name].read_trigged():
                print(name + ': ' + str(value))
                db_logger.save_point_now(name, value)
                loggers[name].clear_trigged()
예제 #7
0
def main():
    """ Main function """
    logging.basicConfig(filename="logger.txt", level=logging.ERROR)
    logging.basicConfig(level=logging.ERROR)

    omega = D6400.OmegaD6400(
        1,
        '/dev/serial/by-id/' + 'usb-FTDI_USB-RS485_Cable_FTWECCJP-if00-port0')
    omega.update_range_and_function(1, action='tc', fullrange='K')
    omega.update_range_and_function(2, action='tc', fullrange='K')
    omega.update_range_and_function(3, action='tc', fullrange='K')
    omega.update_range_and_function(4, action='tc', fullrange='K')
    omega.update_range_and_function(5, action='tc', fullrange='K')
    omega.update_range_and_function(6, action='tc', fullrange='K')
    omega.update_range_and_function(7, action='tc', fullrange='K')

    xgs = xgs600.XGS600Driver(
        '/dev/serial/by-id/usb-Prolific_Technology_Inc.' +
        '_USB-Serial_Controller_D-if00-port0')
    print(xgs.read_all_pressures())

    pressurereader = PressureReader(xgs)
    pressurereader.daemon = True
    pressurereader.start()

    tempreader = TemperatureReader(omega)
    tempreader.daemon = True
    tempreader.start()

    loggers = {}
    loggers['vhp_mass_spec_pressure'] = ValueLogger(pressurereader,
                                                    comp_val=0.1,
                                                    low_comp=1e-11,
                                                    comp_type='log',
                                                    channel=0)
    loggers['vhp_mass_spec_pressure'].start()

    loggers['vhp_pressure_pc_backside'] = ValueLogger(pressurereader,
                                                      comp_val=0.1,
                                                      low_comp=1e-3,
                                                      comp_type='log',
                                                      channel=1)
    loggers['vhp_pressure_pc_backside'].start()

    temp_codenames = [
        'vhp_T_reactor_inlet', 'vhp_T_reactor_outlet', 'vhp_T_reactor_top',
        'vhp_T_mass_spec', 'vhp_T_gas_lines', 'vhp_T_purifying_reactor',
        'vhp_T_furnace'
    ]

    for i in range(0, 7):
        loggers[temp_codenames[i]] = ValueLogger(tempreader,
                                                 comp_val=0.2,
                                                 comp_type='lin',
                                                 channel=i + 1)
        loggers[temp_codenames[i]].start()

    all_codenames = ['vhp_mass_spec_pressure', 'vhp_pressure_pc_backside'
                     ] + temp_codenames
    socket = DateDataPullSocket('vhp', all_codenames, timeouts=1.0)
    socket.start()

    db_logger = ContinuousDataSaver(
        continuous_data_table='dateplots_vhp_setup',
        username=credentials.user,
        password=credentials.passwd,
        measurement_codenames=all_codenames)
    db_logger.start()
    time.sleep(5)

    while tempreader.isAlive():
        time.sleep(0.5)
        for name in all_codenames:
            value = loggers[name].read_value()
            if loggers[name].read_trigged():
                print(value)
                db_logger.save_point_now(name, value)
                loggers[name].clear_trigged()
예제 #8
0
def main():
    """ Main function """
    logging.basicConfig(filename="logger.txt", level=logging.ERROR)
    logging.basicConfig(level=logging.ERROR)

    xgs_port = '/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0'
    xgs_instance = xgs600.XGS600Driver(xgs_port)
    print(xgs_instance.read_all_pressures())

    kjlc_port = '/dev/serial/by-id/usb-Prolific_Technology_Inc._'
    kjlc_port += 'USB-Serial_Controller-if00-port0'
    kjlc_instance = kjlc.KJLC300(kjlc_port)

    xgs_pressure = XgsReader(xgs_instance)
    xgs_pressure.start()

    kjlc_pressure = PressureReader(kjlc_instance)
    kjlc_pressure.start()

    time.sleep(2.5)

    codenames = [
        'sniffer_qms_ion_gauge', 'sniffer_qms_roughing',
        'sniffer_buffer_roughing', 'sniffer_buffer_pressure'
    ]

    loggers = {}
    loggers[codenames[0]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-8,
                                        comp_type='log',
                                        channel=0)
    loggers[codenames[0]].start()
    loggers[codenames[1]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-3,
                                        comp_type='log',
                                        channel=1)
    loggers[codenames[1]].start()
    loggers[codenames[2]] = ValueLogger(xgs_pressure,
                                        comp_val=0.1,
                                        low_comp=1e-3,
                                        comp_type='log',
                                        channel=2)
    loggers[codenames[2]].start()

    loggers[codenames[3]] = ValueLogger(kjlc_pressure,
                                        comp_val=0.1,
                                        comp_type='lin')
    loggers[codenames[3]].start()

    livesocket = LiveSocket('sniffer pressure logger', codenames, 2)
    livesocket.start()

    socket = DateDataPullSocket('sniffer pressure',
                                codenames,
                                timeouts=[1.0] * len(codenames))
    socket.start()

    db_logger = ContinuousDataSaver(continuous_data_table='dateplots_sniffer',
                                    username=credentials.user,
                                    password=credentials.passwd,
                                    measurement_codenames=codenames)
    db_logger.start()

    while xgs_pressure.isAlive():
        time.sleep(0.25)
        for name in codenames:
            value = loggers[name].read_value()
            livesocket.set_point_now(name, value)
            socket.set_point_now(name, value)
            if loggers[name].read_trigged():
                print(name, value)
                db_logger.save_point_now(name, value)
                loggers[name].clear_trigged()
예제 #9
0
def main():
    """ Main function """
    logging.basicConfig(filename="logger.txt", level=logging.ERROR)
    logging.basicConfig(level=logging.ERROR)

    omega = D6400.OmegaD6400(1, '/dev/serial/by-id/' +
                             'usb-FTDI_USB-RS485_Cable_FTWECCJP-if00-port0')
    omega.update_range_and_function(1, action='tc', fullrange='K')
    omega.update_range_and_function(2, action='tc', fullrange='K')
    omega.update_range_and_function(3, action='tc', fullrange='K')
    omega.update_range_and_function(4, action='tc', fullrange='K')
    omega.update_range_and_function(5, action='tc', fullrange='K')
    omega.update_range_and_function(6, action='tc', fullrange='K')
    omega.update_range_and_function(7, action='tc', fullrange='K')

    xgs = xgs600.XGS600Driver('/dev/serial/by-id/usb-Prolific_Technology_Inc.' +
                              '_USB-Serial_Controller_D-if00-port0')
    print(xgs.read_all_pressures())

    pressurereader = PressureReader(xgs)
    pressurereader.daemon = True
    pressurereader.start()

    chamber_logger = PressureLogger(pressurereader, 0)
    chamber_logger.start()

    tempreader = TemperatureReader(omega)
    tempreader.daemon = True
    tempreader.start()

    temp_loggers = {}
    for i in range(0, 7):
        temp_loggers[i] = TemperatureLogger(tempreader, i + 1)
        temp_loggers[i].start()

    temp_codenames = ['vhp_T_reactor_inlet',
                      'vhp_T_reactor_outlet',
                      'vhp_T_reactor_top',
                      'vhp_T_mass_spec',
                      'vhp_T_gas_lines',
                      'vhp_T_purifying_reactor',
                      'vhp_T_furnace']

    socket = DateDataPullSocket('vhp', ['vhp_mass_spec_pressure'] + temp_codenames,
                                timeouts=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
    socket.start()

    db_logger = ContinuousDataSaver(continuous_data_table='dateplots_vhp_setup',
                                    username=credentials.user,
                                    password=credentials.passwd,
                                    measurement_codenames=['vhp_mass_spec_pressure'] +
                                    temp_codenames)
    db_logger.start()
    time.sleep(5)
    while True:
        time.sleep(0.25)
        for i in range(0, 7):
            value = temp_loggers[i].read_value()
            socket.set_point_now(temp_codenames[i], value)
            if temp_loggers[i].trigged:
                print(value)
                db_logger.save_point_now(temp_codenames[i], value)
                temp_loggers[i].trigged = False

        value = chamber_logger.read_pressure()
        socket.set_point_now('vhp_mass_spec_pressure', value)
        if chamber_logger.trigged:
            print(value)
            db_logger.save_point_now('vhp_mass_spec_pressure', value)
            chamber_logger.trigged = False