From 27562b04a5480b8dc703703711f179e4d139ab15 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 17 Jan 2013 09:00:20 -0500 Subject: [PATCH] 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. --- pycomedi/channel.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.26.2