From: W. Trevor King Date: Wed, 14 Mar 2012 21:54:08 +0000 (-0400) Subject: Add analog reference to ChannelConfig (forgotten earlier?). X-Git-Tag: 0.6~18 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=54b00e2a92e463aac316fff3d61b8c954dd61ce9;p=pypiezo.git Add analog reference to ChannelConfig (forgotten earlier?). --- diff --git a/pypiezo/base.py b/pypiezo/base.py index 8594646..dcb07d2 100644 --- a/pypiezo/base.py +++ b/pypiezo/base.py @@ -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() diff --git a/pypiezo/config.py b/pypiezo/config.py index 14d0ca9..520ba13 100644 --- a/pypiezo/config.py +++ b/pypiezo/config.py @@ -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 '