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()
def main(): """ Main function """ tempreader = TemperatureReader() tempreader.daemon = True tempreader.start() temp_logger = ValueLogger(tempreader, comp_val=1) temp_logger.start() db_logger = ContinuousDataSaver( continuous_data_table='dateplots_chemlab307', username=credentials.user, password=credentials.passwd, measurement_codenames=['chemlab307_muffle_furnace']) socket = DateDataPullSocket('muffle_furnace', ['chemlab307_muffle_furnace'], timeouts=[1.0]) socket.start() livesocket = LiveSocket('muffle_furnace', ['chemlab307_muffle_furnace']) livesocket.start() db_logger.start() time.sleep(5) while True: time.sleep(0.25) value = temp_logger.read_value() socket.set_point_now('chemlab307_muffle_furnace', value) livesocket.set_point_now('chemlab307_muffle_furnace', value) if temp_logger.read_trigged(): print(value) db_logger.save_point_now('chemlab307_muffle_furnace', value) temp_logger.clear_trigged()
def main(): """ Main function """ emission_control = EmissionControl() emission_control.set_bias(28) emission_control.start() logger = ValueLogger(emission_control, comp_val=0.01, comp_type='log') logger.start() codenames = ['tof_emission_value'] db_logger = ContinuousDataSaver(continuous_data_table='dateplots_tof', username=credentials.user, password=credentials.passwd, measurement_codenames=codenames) db_logger.start() tui = emission_tui.CursesTui(emission_control) tui.daemon = True tui.start() time.sleep(10) while emission_control.running is True: time.sleep(1) value = logger.read_value() if logger.read_trigged(): LOGGER.debug('Logged value: %s', value) db_logger.save_point_now('tof_emission_value', value) logger.clear_trigged()
def main(): """ Main function """ emission_control = EmissionControl() emission_control.set_bias(38) emission_control.start() logger = ValueLogger(emission_control, comp_val=0.01, comp_type='log') logger.start() codenames = ['tof_emission_value'] db_logger = ContinuousDataSaver(continuous_data_table='dateplots_tof', username=credentials.user, password=credentials.passwd, measurement_codenames=codenames) db_logger.start() tui = emission_tui.CursesTui(emission_control) tui.daemon = True tui.start() time.sleep(10) while emission_control.running is True: time.sleep(1) value = logger.read_value() if logger.read_trigged(): LOGGER.debug('Logged value: ' + str(value)) db_logger.save_point_now('tof_emission_value', value) logger.clear_trigged()
def main(): """ Main function """ devices = ['M13201551A', 'M11200362F', 'M8203814A', 'M8203814B', 'M11200362B', 'M11213502A'] ranges = {} ranges['M13201551A'] = 5 # Microreactor, pressure controller ranges['M11200362F'] = 1 # Microreactor, flow 2 ranges['M8203814A'] = 10 # Microreactor, flow 5 (argon calibrated) ranges['M8203814B'] = 3 # Microreactor, flow 1 (argon calibrated) flow_control = FlowControl(devices=devices, ranges=ranges, name='microreactor_mfc_control') flow_control.start() logger = ValueLogger(flow_control, comp_val=1, comp_type='log', low_comp=0.0001) logger.start() db_logger = ContinuousDataSaver(continuous_data_table='dateplots_microreactor', username=credentials.user, password=credentials.passwd, measurement_codenames=['mr_reactor_pressure']) db_logger.start() time.sleep(5) while True: time.sleep(0.25) value = logger.read_value() if logger.read_trigged(): print(value) db_logger.save_point_now('mr_reactor_pressure', value) logger.clear_trigged()
def main(): """ Main function """ tempreader = TemperatureReader() tempreader.daemon = True tempreader.start() temp_logger = ValueLogger(tempreader, comp_val=1) temp_logger.start() db_logger = ContinuousDataSaver(continuous_data_table='dateplots_chemlab307', username=credentials.user, password=credentials.passwd, measurement_codenames=['chemlab307_muffle_furnace']) socket = DateDataPullSocket('muffle_furnace', ['chemlab307_muffle_furnace'], timeouts=[1.0]) socket.start() livesocket = LiveSocket('muffle_furnace', ['chemlab307_muffle_furnace']) livesocket.start() db_logger.start() time.sleep(5) while True: time.sleep(0.25) value = temp_logger.read_value() socket.set_point_now('chemlab307_muffle_furnace', value) livesocket.set_point_now('chemlab307_muffle_furnace', value) if temp_logger.read_trigged(): print(value) db_logger.save_point_now('chemlab307_muffle_furnace', value) temp_logger.clear_trigged()
def main(): """ Main function """ devices = ['M11200362H', 'M11200362C', 'M11200362A', 'M11200362E', 'M11200362D', 'M11210022B', 'M11200362G'] ranges = {} ranges['M11200362H'] = 2.5 # Pressure controller ranges['M11200362C'] = 10 # Flow1 ranges['M11200362A'] = 10 # Flow2 ranges['M11200362E'] = 5 # Flow3 ranges['M11200362D'] = 5 # Flow4 ranges['M11210022B'] = 10 # Flow5 (NH3 compatible) ranges['M11200362G'] = 1 # Flow6 flow_control = FlowControl(devices=devices, ranges=ranges, socket_name='microreactorNG_mfc_control') flow_control.start() logger = ValueLogger(flow_control, comp_val=1, comp_type='log', low_comp=0.0001) logger.start() db_logger = ContinuousDataSaver(continuous_data_table='dateplots_microreactorNG', username=credentials.user, password=credentials.passwd, measurement_codenames=['microreactorng_pressure_reactor']) db_logger.start() time.sleep(5) while True: time.sleep(0.25) value = logger.read_value() if logger.read_trigged(): print(value) db_logger.save_point_now('microreactorng_pressure_reactor', value) logger.clear_trigged()
def main(): """ Main function """ logging.basicConfig(filename="logger.txt", level=logging.ERROR) logging.basicConfig(level=logging.ERROR) i2c_helper = ABEHelpers() bus = i2c_helper.get_smbus() adc_instance = ADCPi(bus, 0x68, 0x69, 18) pressurereader = PressureReader(adc_instance) pressurereader.daemon = True pressurereader.start() logger = ValueLogger(pressurereader, comp_val=0.5) logger.start() socket = DateDataPullSocket('hall_n5_argon_pressure', ['n5_argon_pressure'], timeouts=[1.0]) socket.start() live_socket = LiveSocket('hall_n5_argon_pressure', ['n5_argon_pressure'], 2) live_socket.start() db_logger = ContinuousDataSaver( continuous_data_table='dateplots_hall', username=credentials.user, password=credentials.passwd, measurement_codenames=['n5_argon_pressure']) db_logger.start() time.sleep(2) while True: time.sleep(0.25) value = logger.read_value() socket.set_point_now('n5_argon_pressure', value) live_socket.set_point_now('n5_argon_pressure', value) if logger.read_trigged(): print(value) db_logger.save_point_now('n5_argon_pressure', value) logger.clear_trigged()
def main(): """ Main function """ logging.basicConfig(filename="logger.txt", level=logging.ERROR) logging.basicConfig(level=logging.ERROR) i2c_helper = ABEHelpers() bus = i2c_helper.get_smbus() adc_instance = DeltaSigma(bus, 0x68, 0x69, 18) pressurereader = PressureReader(adc_instance) pressurereader.daemon = True pressurereader.start() codenames = ['mr_iongauge_pressure'] logger = ValueLogger(pressurereader, comp_val=0.5) logger.start() socket = DateDataPullSocket('Microreactor Ion Gauge', codenames, timeouts=[1.0]) socket.start() live_socket = LiveSocket('Microreactor Ion Gauge', codenames) live_socket.start() db_logger = ContinuousDataSaver(continuous_data_table='dateplots_microreactor', username=credentials.user, password=credentials.passwd, measurement_codenames=codenames) db_logger.start() time.sleep(2) while True: time.sleep(0.25) value = logger.read_value() socket.set_point_now(codenames[0], value) live_socket.set_point_now(codenames[0], value) if logger.read_trigged(): print(value) db_logger.save_point_now(codenames[0], value) logger.clear_trigged()
def main(): """ Main function """ devices = [ 'M11200362H', 'M11200362C', 'M11200362A', 'M11200362E', 'M11200362D', 'M11210022B', 'M11200362G' ] ranges = {} ranges['M11200362H'] = 2.5 # Pressure controller ranges['M11200362C'] = 10 # Flow1 ranges['M11200362A'] = 10 # Flow2 ranges['M11200362E'] = 5 # Flow3 ranges['M11200362D'] = 5 # Flow4 ranges['M11210022B'] = 10 # Flow5 (NH3 compatible) ranges['M11200362G'] = 1 # Flow6 flow_control = FlowControl(devices=devices, ranges=ranges, name='microreactorNG_mfc_control') flow_control.start() logger = ValueLogger(flow_control, comp_val=1, comp_type='log', low_comp=0.0001) logger.start() db_logger = ContinuousDataSaver( continuous_data_table='dateplots_microreactorNG', username=credentials.user, password=credentials.passwd, measurement_codenames=['microreactorng_pressure_reactor']) db_logger.start() time.sleep(5) while True: time.sleep(0.25) value = logger.read_value() if logger.read_trigged(): print(value) db_logger.save_point_now('microreactorng_pressure_reactor', value) logger.clear_trigged()
def main(): """ Main function """ devices = [ 'M13201551A', 'M11200362F', 'M8203814A', 'M8203814B', 'M11200362B', 'M11213502A' ] ranges = {} ranges['M13201551A'] = 5 # Microreactor, pressure controller ranges['M11200362F'] = 1 # Microreactor, flow 2 ranges['M8203814A'] = 10 # Microreactor, flow 5 (argon calibrated) ranges['M8203814B'] = 3 # Microreactor, flow 1 (argon calibrated) flow_control = FlowControl(devices=devices, ranges=ranges, name='microreactor_mfc_control') flow_control.start() logger = ValueLogger(flow_control, comp_val=1, comp_type='log', low_comp=0.0001) logger.start() db_logger = ContinuousDataSaver( continuous_data_table='dateplots_microreactor', username=credentials.user, password=credentials.passwd, measurement_codenames=['mr_reactor_pressure']) db_logger.start() time.sleep(5) while True: time.sleep(0.25) value = logger.read_value() if logger.read_trigged(): print(value) db_logger.save_point_now('mr_reactor_pressure', value) logger.clear_trigged()
Pushsocket = DataPushSocket(unichr(0x03BC) + '-reactor_mfc_control', action='enqueue') Pushsocket.start() Livesocket = LiveSocket(unichr(0x03BC) + '-reactor_mfc_control', devices) Livesocket.start() fc = FlowControl(MFCs, Datasocket, Pushsocket, Livesocket) fc.start() Logger = ValueLogger(fc, comp_val=1, comp_type='log', low_comp=0.0001) Logger.start() codename = 'microreactorng_pressure_reactor' db_logger = ContinuousLogger(table='dateplots_microreactorNG', username=credentials.user, password=credentials.passwd, measurement_codenames=[codename]) db_logger.start() time.sleep(10) while True: time.sleep(0.25) v = Logger.read_value() if Logger.read_trigged(): print v db_logger.enqueue_point_now(codename, v) Logger.clear_trigged()
tempreader.start() temp_logger = ValueLogger(tempreader, comp_val=1) #temp_logger = TemperatureLogger(tempreader) temp_logger.start() db_logger = ContinuousLogger(table='dateplots_chemlab307', username=credentials.user, password=credentials.passwd, measurement_codenames=['chemlab307_muffle_furnace']) socket = DateDataPullSocket('muffle_furnace', ['chemlab307_muffle_furnace'], timeouts=[1.0]) socket.start() livesocket = LiveSocket('muffle_furnace', ['chemlab307_muffle_furnace'], 2) livesocket.start() db_logger.start() time.sleep(5) while True: time.sleep(0.25) t = temp_logger.read_value() socket.set_point_now('chemlab307_muffle_furnace', t) livesocket.set_point_now('chemlab307_muffle_furnace', t) if temp_logger.read_trigged(): print t db_logger.enqueue_point_now('chemlab307_muffle_furnace', t) temp_logger.clear_trigged()
low_comp=0.0001, channel=2) Sniffer_Logger.start() db_logger = ContinuousLogger(table='dateplots_microreactor', username=credentials.user, password=credentials.passwd, measurement_codenames=['mr_reactor_pressure']) db_logger.start() db_logger_sniffer = ContinuousLogger( table='dateplots_sniffer', username=credentials_sniffer.user, password=credentials_sniffer.passwd, measurement_codenames=['sniffer_chip_pressure']) db_logger_sniffer.start() time.sleep(5) while True: time.sleep(0.25) v = Logger.read_value() if Logger.read_trigged(): print v db_logger.enqueue_point_now('mr_reactor_pressure', v) Logger.clear_trigged() s = Sniffer_Logger.read_value() if Sniffer_Logger.read_trigged(): print s db_logger_sniffer.enqueue_point_now('sniffer_chip_pressure', s) Sniffer_Logger.clear_trigged()
port=9000) Datasocket.start() Pushsocket = DataPushSocket('sniffer_mfc_control', action='enqueue') Pushsocket.start() Livesocket = LiveSocket('sniffer_mfc_control', devices) Livesocket.start() fc = FlowControl(MFCs, Datasocket, Pushsocket, Livesocket) fc.start() Logger = ValueLogger(fc, comp_val=1, comp_type='log', low_comp=0.0001, channel=1) Logger.start() db_logger = ContinuousLogger(table='dateplots_sniffer', username=credentials.user, password=credentials.passwd, measurement_codenames=['sniffer_chip_pressure']) db_logger.start() time.sleep(5) while True: time.sleep(0.25) v = Logger.read_value() if Logger.read_trigged(): print v db_logger.enqueue_point_now('sniffer_chip_pressure', v) Logger.clear_trigged()
Sniffer_Logger = ValueLogger(fc, comp_val=1, comp_type='log', low_comp=0.0001, channel=2) Sniffer_Logger.start() db_logger = ContinuousLogger(table='dateplots_microreactor', username=credentials.user, password=credentials.passwd, measurement_codenames=['mr_reactor_pressure']) db_logger.start() db_logger_sniffer = ContinuousLogger(table='dateplots_sniffer', username=credentials_sniffer.user, password=credentials_sniffer.passwd, measurement_codenames=['sniffer_chip_pressure']) db_logger_sniffer.start() time.sleep(5) while True: time.sleep(0.25) v = Logger.read_value() if Logger.read_trigged(): print v db_logger.enqueue_point_now('mr_reactor_pressure', v) Logger.clear_trigged() s = Sniffer_Logger.read_value() if Sniffer_Logger.read_trigged(): print s db_logger_sniffer.enqueue_point_now('sniffer_chip_pressure', s) Sniffer_Logger.clear_trigged()
measurement_codenames=['mgw_pressure_chamber', 'mgw_pressure_buffer', 'mgw_reactor_pressure']) db_logger.start() time.sleep(5) while True: time.sleep(0.2) c = chamber_logger.read_value() b = buffer_logger.read_value() r = reactor_logger.read_value() socket.set_point_now('chamber_pressure', c) socket.set_point_now('buffer_pressure', b) livesocket.set_point_now('chamber_pressure', c) livesocket.set_point_now('buffer_pressure', b) if reactor_logger.read_trigged(): print(r) db_logger.enqueue_point_now('mgw_reactor_pressure', r) reactor_logger.clear_trigged() if chamber_logger.read_trigged(): print(c) db_logger.enqueue_point_now('mgw_pressure_chamber', c) chamber_logger.clear_trigged() if buffer_logger.read_trigged(): print(b) db_logger.enqueue_point_now('mgw_pressure_buffer', b) buffer_logger.clear_trigged()
socket.start() live_socket = LiveSocket('hall_waterpressure', ['hall_coolingwater_pressure']) live_socket.start() #db_logger = ContinuousLogger(table='dateplots_hall', # username=credentials.user, # password=credentials.passwd, # measurement_codenames=['hall_coolingwater_pressure']) db_logger = ContinuousDataSaver(continuous_data_table='dateplots_hall', username=credentials.user, password=credentials.passwd, measurement_codenames=['hall_coolingwater_pressure']) db_logger.start() time.sleep(2) while True: time.sleep(0.25) p = logger.read_value() socket.set_point_now('hall_coolingwater_pressure', p) live_socket.set_point_now('hall_coolingwater_pressure', p) if logger.read_trigged(): print(p) #db_logger.enqueue_point_now('hall_coolingwater_pressure', p) db_logger.save_point_now('hall_coolingwater_pressure', p) logger.clear_trigged()
flowreader.start() logger = ValueLogger(flowreader, comp_val=0.1) logger.start() name = 'stm312_xray_waterflow' codenames = ['stm312_xray_waterflow'] socket = DateDataPullSocket(name, codenames, timeouts=[1.0]) socket.start() live_socket = LiveSocket(name, codenames, 2) live_socket.start() db_logger = ContinuousLogger(table='dateplots_stm312', username=credentials.user, password=credentials.passwd, measurement_codenames=codenames) db_logger.start() time.sleep(2) while True: time.sleep(0.25) flow = logger.read_value() socket.set_point_now(name, flow) live_socket.set_point_now(name, flow) if logger.read_trigged(): print flow db_logger.enqueue_point_now(name, flow) logger.clear_trigged()