# HG changeset patch # User Alexis Jeandet # Date 2019-05-17 09:57:21 # Node ID 7b43cd98469d99ca0182a0c019c629fdffd9539a # Parent 669810a4267cc1d79292e51e596d4584ef20c372 Fixed regression, disco/analog read didn't enable and set range as expected diff --git a/lppinstru/discovery.py b/lppinstru/discovery.py --- a/lppinstru/discovery.py +++ b/lppinstru/discovery.py @@ -288,9 +288,11 @@ class Discovery(object): self.__libdwf.FDwfAnalogInFrequencyGet(self.__hdwf, byref(f)) frequency=f.value self.__libdwf.FDwfAnalogInBufferSizeSet(self.__hdwf, c_int(cnt)) + range,enabled = [ch1range,ch2range],[ch1,ch2] + for ch in (0,1): - self.__libdwf.FDwfAnalogInChannelEnableSet(self.__hdwf, c_int(ch), c_bool(ch2)) - self.__libdwf.FDwfAnalogInChannelRangeSet(self.__hdwf, c_int(ch), c_double(ch2range)) + self.__libdwf.FDwfAnalogInChannelEnableSet(self.__hdwf, c_int(ch), c_bool(enabled[ch])) + self.__libdwf.FDwfAnalogInChannelRangeSet(self.__hdwf, c_int(ch), c_double(range[ch])) self.__libdwf.FDwfAnalogInChannelFilterSet(self.__hdwf,c_int(ch),filterAverage) self.set_analog_in_trigger(trigger) self.__libdwf.FDwfAnalogInConfigure(self.__hdwf, c_bool(False), c_bool(True))