Add analog reference to ChannelConfig (forgotten earlier?).
authorW. Trevor King <wking@drexel.edu>
Wed, 14 Mar 2012 21:54:08 +0000 (17:54 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 14 Mar 2012 21:54:08 +0000 (17:54 -0400)
pypiezo/base.py
pypiezo/config.py

index 8594646b0b1de149ea79f82552c40a993b12c37b..dcb07d22167d851c943d2e93cfeb6052d3f3a179 100644 (file)
@@ -179,6 +179,7 @@ def _setup_channel_config(config, channel):
     config['channel'] = channel.index
     config['maxdata'] = channel.get_maxdata()
     config['range'] = channel.range.value
+    config['analog-reference'] = channel.aref.value
     converter = channel.get_converter()
     config['conversion-origin'
            ] = converter.get_to_physical_expansion_origin()
index 14d0ca9e1c316d979a4e7f0527c4bf8dec424048..520ba13fc38f8e8ae95e92f519b7fcebdf7926a7 100644 (file)
@@ -19,6 +19,8 @@
 import h5config.config as _config
 import h5config.tools as _h5config_tools
 
+import pycomedi.constant as _constant
+
 
 class PackageConfig (_h5config_tools.PackageConfig):
     "Configure `pypiezo` module operation"
@@ -55,6 +57,10 @@ class ChannelConfig (_config.Config):
         _config.IntegerSetting(
             name='range',
             help="Channel's selected range index."),
+        _config.ChoiceSetting(
+            name='analog-reference',
+            help="Channel's selected analog reference index.",
+            choices=[(x.name, x) for x in _constant.AREF]),
         _config.FloatListSetting(
             name='conversion-coefficients',
             help=('Bit to physical unit conversion coefficients starting with '