From: W. Trevor King Date: Sat, 12 Nov 2011 21:32:41 +0000 (-0500) Subject: Update slow_bend.py to version 0.4. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cebf7f2ca8bc90da9f1977a1b4454da951314d44;p=mw2txt.git Update slow_bend.py to version 0.4. --- diff --git a/posts/slow_bend/slow_bend.py b/posts/slow_bend/slow_bend.py index 0b6963c..19b314d 100755 --- a/posts/slow_bend/slow_bend.py +++ b/posts/slow_bend/slow_bend.py @@ -1,155 +1,263 @@ #!/usr/bin/python # -# W. Trevor King, Jan. 29th, 2008 +# Copyright (C) 2008-2011 W. Trevor King # -# Version 0.2, WT King, Feb. 20th, 2008 +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program. If not, see +# . + +# Version 0.2, W. Trevor King, Feb. 20th, 2008 # (added OptionParser code and stripchart debug parameters) -# Version 0.3, WT King, Mar. 25th, 2010 +# Version 0.3, W. Trevor King, Mar. 25th, 2010 # (added multiple channels option) +# Version 0.4, W. Trevor King, Nov. 12th, 2011 +# Transition from optparse -> argparse and update to pycomedi 0.3. -""" -Simple single analog channel polling software. -Spends most of its time sleeping, -waking up every dt seconds to record the current voltage. -Designed for Liming's cellulase activity measurements. +"""Simple analog channel polling script. + +Spends most of its time sleeping, waking up every `dt` seconds to +record the current voltage. """ -import pycomedi.single_aio as single_aio -import time -import curses_check_for_keypress -import stripchart -import data_logger +import logging as _logging +import os.path as _os_path +import sys as _sys +import time as _time -DEFAULT_STRIPVERBOSE = False -TEXT_VERBOSE = False -LOG_DIR = '~/rsrch/data/slow_bend' # set LOG_DIR = None to disable logging +import pycomedi.device as _pycomedi_device +import pycomedi.subdevice as _pycomedi_subdevice +import pycomedi.channel as _pycomedi_channel +import pycomedi.constant as _pycomedi_constant +try: + from pypid.backend.melcor import MelcorBackend as _TemperatureBackend +except ImportError, pypid_import_error: + _TemperatureBackend = None + + +__version__ = '0.4' + + +class Monitor (object): + """Take measurements on a single channel every dt seconds. -class slow_bend : - """ - Take measurements on a single channel every dt seconds. Save '