From: W. Trevor King Date: Thu, 17 Jan 2013 14:00:20 +0000 (-0500) Subject: channel: Fix to-physical setup in AnalogChannel._get_converter X-Git-Tag: 0.7~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=27562b04a5480b8dc703703711f179e4d139ab15;p=pycomedi.git channel: Fix to-physical setup in AnalogChannel._get_converter This fixes a bug introduced by commit ac38a7987800c3982ac363af5b7780885c88d3a1 Author: W. Trevor King Date: Fri Oct 19 09:53:22 2012 -0400 calibration: support to-physical-only softcal boards. where the converter's _from_physical was only initialized if there was an error trying to determine its value. Obviously, we should only be initializing it if there *wasn't* an error. --- diff --git a/pycomedi/channel.pyx b/pycomedi/channel.pyx index 68520f3..b111da9 100644 --- a/pycomedi/channel.pyx +++ b/pycomedi/channel.pyx @@ -441,7 +441,7 @@ cdef class AnalogChannel (Channel): _constant.CONVERSION_DIRECTION.from_physical) ret = _CalibratedConverter(from_physical_error=from_physical_error) ret._to_physical = to_physical - if from_physical_error is not None: + if from_physical_error is None: ret._from_physical = from_physical return ret