コード例 #1
0
PyExpLabSys.common.utilities.ERROR_EMAIL = '*****@*****.**'
python2_and_3(__file__)

try:
    MICRO = chr(0x03BC)  # Python 2
except ValueError:
    MICRO = unichr(0x03BC)  # Python 2

LOGGER = get_logger(MICRO + '-reactor Temperature control',
                    level='WARN',
                    file_log=True,
                    file_name='temp_control.log',
                    terminal_log=False,
                    email_on_warnings=False)

activate_library_logging('PyExpLabSys.common.microreactor_temperature_control',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.auxiliary.pid',
                         logger_to_inherit_from=LOGGER)

LOGGER.warn('Program started')


class RtdReader(threading.Thread):
    """ Read resistance of RTD and calculate temperature """
    def __init__(self, calib_temp):
        visa_string = 'usb0::2391::1543::MY47002726::INSTR'
        self.rtd_reader = dmm.Agilent34410ADriver(
            interface='usbtmc', connection_string=visa_string)
        self.rtd_reader.select_measurement_function('FRESISTANCE')
        self.calib_temp = calib_temp
        time.sleep(0.2)
コード例 #2
0
from PyExpLabSys.common.microreactor_temperature_control import HeaterClass
from PyExpLabSys.common.microreactor_temperature_control import CursesTui
import PyExpLabSys.common.utilities
from PyExpLabSys.common.supported_versions import python2_and_3
PyExpLabSys.common.utilities.ERROR_EMAIL = '*****@*****.**'
python2_and_3(__file__)

try:
    MICRO = chr(0x03BC) # Python 2
except ValueError:
    MICRO = unichr(0x03BC) # Python 2

LOGGER = get_logger(MICRO + '-reactor Temperature control', level='WARN', file_log=True,
                    file_name='temp_control.log', terminal_log=False, email_on_warnings=False)

activate_library_logging('PyExpLabSys.common.microreactor_temperature_control',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.auxiliary.pid', logger_to_inherit_from=LOGGER)

LOGGER.warn('Program started')

class RtdReader(threading.Thread):
    """ Read resistance of RTD and calculate temperature """
    def __init__(self, calib_temp):
        visa_string = 'usb0::2391::1543::MY47002726::INSTR'
        self.rtd_reader = dmm.Agilent34410ADriver(interface='usbtmc',
                                                  connection_string=visa_string)
        self.rtd_reader.select_measurement_function('FRESISTANCE')
        self.calib_temp = calib_temp
        time.sleep(0.2)
        self.calib_value = self.rtd_reader.read()
        self.rtd_calc = rtd_calculator.RtdCalculator(calib_temp,
コード例 #3
0
ファイル: monitor.py プロジェクト: PenelopeJones/batteries
"""

import time
import json

import credentials
from PyExpLabSys.drivers.crowcon import Vortex
from PyExpLabSys.common.loggers import ContinuousLogger
from PyExpLabSys.common.sockets import LiveSocket
from PyExpLabSys.common.utilities import get_logger, activate_library_logging
# Set log filesize to 10 MB
LOGGER = get_logger('b307gasalarm', level='debug')
import MySQLdb

activate_library_logging('PyExpLabSys.drivers.crowcon',
                         logger_to_inherit_from=LOGGER,
                         level='warn')


# pylint: disable=R0902
class GasAlarmMonitor(object):
    """Class that monitors the gas alarm the building 307"""
    def __init__(self):
        # Start logger
        codenames = [
            'B307_gasalarm_CO_051', 'B307_gasalarm_H2_051',
            'B307_gasalarm_CO_055', 'B307_gasalarm_H2_055',
            'B307_gasalarm_CO_059', 'B307_gasalarm_H2_059',
            'B307_gasalarm_CO_061', 'B307_gasalarm_H2_061',
            'B307_gasalarm_CO_42-43', 'B307_gasalarm_H2_2sal',
            'B307_gasalarm_CO_932', 'B307_gasalarm_H2_932'
コード例 #4
0
ファイル: mass_spec.py プロジェクト: CINF/PyExpLabSys
import PyExpLabSys.apps.qms.qmg_meta_channels as qmg_meta_channels
from PyExpLabSys.common.sockets import LiveSocket, DateDataPullSocket
from PyExpLabSys.common.utilities import get_logger
from PyExpLabSys.common.utilities import activate_library_logging
from PyExpLabSys.common.supported_versions import python2_and_3
BASEPATH = os.path.abspath(__file__)[:os.path.abspath(__file__).find('PyExpLabSys')]
sys.path.append(BASEPATH + '/PyExpLabSys/machines/' + sys.argv[1])
import settings # pylint: disable=wrong-import-position
python2_and_3(__file__)

LOGGER = get_logger('Mass Spec', level='warning', file_log=True,
                    file_name='qms.txt', terminal_log=False,
                    email_on_warnings=False, email_on_errors=False,
                    file_max_bytes=104857600, file_backup_count=5)

activate_library_logging('PyExpLabSys.drivers.pfeiffer_qmg422',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.apps.qms.qmg_status_output',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.apps.qms.qmg_meta_channels',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.apps.qms.qms',
                         logger_to_inherit_from=LOGGER)

try:
    from local_channels import Local
    LOCAL_READER = Local()
    LOCAL_READER.daemon = True
    LOCAL_READER.start()
except ImportError:
    pass
コード例 #5
0
sys.path.append(BASEPATH + '/PyExpLabSys/machines/' + sys.argv[1])
import settings  # pylint: disable=wrong-import-position

python2_and_3(__file__)

LOGGER = get_logger('Mass Spec',
                    level='warning',
                    file_log=True,
                    file_name='qms.txt',
                    terminal_log=False,
                    email_on_warnings=False,
                    email_on_errors=False,
                    file_max_bytes=104857600,
                    file_backup_count=5)

activate_library_logging('PyExpLabSys.drivers.pfeiffer_qmg422',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.apps.qms.qmg_status_output',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.apps.qms.qmg_meta_channels',
                         logger_to_inherit_from=LOGGER)
activate_library_logging('PyExpLabSys.apps.qms.qms',
                         logger_to_inherit_from=LOGGER)

try:
    from local_channels import Local
    LOCAL_READER = Local()
    LOCAL_READER.daemon = True
    LOCAL_READER.start()
except ImportError:
    pass
コード例 #6
0
""" Local channels for instruments directly connected """
import time
import threading
from PyExpLabSys.common.sockets import DateDataPullSocket
from PyExpLabSys.drivers.omega_D6400 import OmegaD6400
from PyExpLabSys.common.utilities import get_logger
from PyExpLabSys.common.utilities import activate_library_logging
from PyExpLabSys.common.supported_versions import python2_and_3
python2_and_3(__file__)

LOGGER = get_logger('Local Mass Spec Channels', level='warning', file_log=True,
                    file_name='locals.txt', terminal_log=False,
                    email_on_warnings=False, email_on_errors=False,
                    file_max_bytes=104857600, file_backup_count=5)

activate_library_logging('PyExpLabSys.drivers.omega_D6400', logger_to_inherit_from=LOGGER)


class Local(threading.Thread):
    """ This class will be automatically started by the mass-spec program
    it can be arbritrarily simply or complex and will provide a local udp-socket
    to be included in a meta-channel in the mass-spec, thus allowing integraion
    of local instruments """
    def __init__(self):
        threading.Thread.__init__(self)
        #self.daemon = True
        self.pullsocket = DateDataPullSocket('local MS socket',
                                             ['analog_in'], timeouts=2, port=9250)
        self.pullsocket.start()
        port = '/dev/serial/by-id/usb-FTDI_USB-RS485_Cable_FTWBEDQ3-if00-port0'
        self.omega = OmegaD6400(1, port=port)