def __init__(self, pth): """ obj = datafile.__init__(self,pth) Initialize DATAFILE object INPUT: pth: directory path where datafiles are stored (string) OUTPUT: obj: dafafile object """ # remove trailing whitespace (just in case): pth = pth.strip() # check for tilde in pth (as shortcut for home directory), and replace with full path if pth[0] == '~': pth = pth.replace("~", expanduser("~")) # check if path exists and is accessible for writing: if not os.access(pth, os.W_OK): misc.warnmessage( 'DATAFILE', 'path \'' + pth + '\' is not accessible for writing!') # remember base path: self._basepath = pth # init empty file ID: self._fid = -1
def warning(self,msg): ''' temperaturesensor_MAXIM.warning(msg) Issue warning about issues related to operation of pressure sensor. INPUT: msg: warning message (string) OUTPUT: (none) ''' misc.warnmessage (self.label(),msg)
def warning(self, msg): """ datafile.warning(msg) Warn about issues related to DATAFILE object INPUT: msg: warning message (string) OUTPUT: (none) """ misc.warnmessage(msg)
def warning(self,msg): """ datafile.warning(msg) Warn about issues related to DATAFILE object INPUT: msg: warning message (string) OUTPUT: (none) """ misc.warnmessage ('DATAFILE',msg)
def warning(self,msg): ''' temperaturesensor_VIRTUAL.warning(msg) Issue warning about issues related to operation of pressure sensor. INPUT: msg: warning message (string) OUTPUT: (none) ''' misc.warnmessage ('[' + self.label() + '] ' + msg)
def warning(self, msg): ''' pressuresensor_OMEGA.warning(msg) Issue warning about issues related to operation of pressure sensor. INPUT: msg: warning message (string) OUTPUT: (none) ''' misc.warnmessage(self.label(), msg)
def warning(self,msg): ''' selectorvalve_VICI.warning(msg) Issue warning about issues related to operation of the valve. INPUT: msg: warning message (string) OUTPUT: (none) ''' misc.warnmessage ('[' + self.label() + '] ' + msg)
warnings.warn("ruediPy / temperaturesensor_MAXIM class is running on Python version < 3. Version 3.0 or newer is recommended!") havedisplay = "DISPLAY" in os.environ if havedisplay: # prepare plotting environment try: import matplotlib matplotlib.rcParams['legend.numpoints'] = 1 matplotlib.rcParams['axes.formatter.useoffset'] = False # suppress mplDeprecation warning: import warnings import matplotlib.cbook warnings.filterwarnings("ignore",category=matplotlib.cbook.mplDeprecation) matplotlib.use('TkAgg') import matplotlib.pyplot as plt except: misc.warnmessage ('MAXIM-TEMPERATURE init','Could not set up display environment.') havedisplay = False class temperaturesensor_MAXIM: """ ruediPy class for MAXIM DS1820 type temperature sensors (wrapper class for pydigitemp package). """ ######################################################################################################## def __init__( self , serialport , romcode = '', label = 'TEMPERATURESENSOR' , plot_title = None , max_buffer_points = 500 , fig_w = 6.5 , fig_h = 5): ''' temperaturesensor_MAXIM.__init__( serialport , romcode, label = 'TEMPERATURESENSOR' , plot_title = None , max_buffer_points = 500 , fig_w = 6.5 , fig_h = 5 )
def warning(self,msg): # warn about issues related to operation of the valve # msg: warning message misc.warnmessage ('VICI VALVE',msg)
from classes.misc import misc havedisplay = "DISPLAY" in os.environ if havedisplay: # prepare plotting environment try: import matplotlib matplotlib.rcParams['legend.numpoints'] = 1 matplotlib.rcParams['axes.formatter.useoffset'] = False # suppress mplDeprecation warning: import warnings import matplotlib.cbook warnings.filterwarnings("ignore",category=matplotlib.cbook.mplDeprecation) matplotlib.use('TkAgg') import matplotlib.pyplot as plt except: misc.warnmessage ('WIKA-PRESSURE init','Could not set up display environment.') havedisplay = False class pressuresensor_WIKA: """ ruediPy class for WIKA pressure sensor control. """ ######################################################################################################## def __init__( self , serialport , label = 'PRESSURESENSOR' , plot_title = None , max_buffer_points = 500 , fig_w = 6.5 , fig_h = 5): '''
def warning(self, msg): # warn about issues related to operation of the valve # msg: warning message misc.warnmessage('VICI VALVE', msg)
havedisplay = "DISPLAY" in os.environ if havedisplay: # prepare plotting environment try: import matplotlib matplotlib.rcParams['legend.numpoints'] = 1 matplotlib.rcParams['axes.formatter.useoffset'] = False # suppress mplDeprecation warning: import warnings import matplotlib.cbook warnings.filterwarnings("ignore", category=matplotlib.cbook.mplDeprecation) matplotlib.use('TkAgg') import matplotlib.pyplot as plt except: misc.warnmessage('OMEGA-PRESSURE init', 'Could not set up display environment.') havedisplay = False class pressuresensor_OMEGA: """ ruediPy class for OMEGA pressure sensor control. """ ######################################################################################################## def __init__(self, serialport, label='PRESSURESENSOR', plot_title=None, max_buffer_points=500,
def warning(self, msg): # warn about issues related to operation of the valve # msg: warning message misc.warnmessage('[' + self.label() + '] ' + msg)
havedisplay = "DISPLAY" in os.environ if havedisplay: # prepare plotting environment try: import matplotlib matplotlib.rcParams['legend.numpoints'] = 1 matplotlib.rcParams['axes.formatter.useoffset'] = False # suppress mplDeprecation warning: import warnings import matplotlib.cbook warnings.filterwarnings("ignore", category=matplotlib.cbook.mplDeprecation) matplotlib.use('TkAgg') import matplotlib.pyplot as plt except: misc.warnmessage('MAXIM-TEMPERATURE init', 'Could not set up display environment.') havedisplay = False class temperaturesensor_MAXIM: """ ruediPy class for MAXIM DS1820 type temperature sensors (wrapper class for pydigitemp package). """ ######################################################################################################## def __init__(self, serialport, romcode='', label='TEMPERATURESENSOR', plot_title=None,