From: W. Trevor King Date: Mon, 19 Mar 2012 15:43:34 +0000 (-0400) Subject: Add 'external' unit for RF_EXTERNAL (see previous commit for reasoning). X-Git-Tag: 0.5~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6e52484d44f0984424ddc618596d46e0cfee8b96;p=pycomedi.git Add 'external' unit for RF_EXTERNAL (see previous commit for reasoning). --- diff --git a/pycomedi/constant.pyx b/pycomedi/constant.pyx index ae981d7..719075d 100644 --- a/pycomedi/constant.pyx +++ b/pycomedi/constant.pyx @@ -95,6 +95,13 @@ True >>> TRIG_SRC.now > None True +The ``UNIT`` constant treats ``RF_EXTERNAL`` as a full-fledged unit: + +>>> UNIT.index_by_name('external') +<_NamedInt external> +>>> UNIT.index_by_value(_comedi.RF_EXTERNAL) +<_NamedInt external> + .. [#ops] See `emulating numeric types`_ and `NotImplementedError` in `the standard type hierarchy`_. @@ -442,6 +449,11 @@ SUPPORT_LEVEL = _Enum('support_level', 'COMEDI_', whitelist=[ UNIT = _Enum('unit', 'UNIT_', translation={'mA':'mA'}) # The mA translation avoids lowercasing to 'ma'. +UNIT.append(_NamedInt( + name='external', + value=_comedi.RF_EXTERNAL, + doc=('RF_EXTERNAL (value unit is defined by an external reference ' + 'channel)'))) CALLBACK = _Enum('callback_flags', 'COMEDI_CB_', blacklist=['block', 'eobuf']) CALLBACK.eos.doc += ' (end of scan)'