fixes on 2023-11-27

- ls372 autorange: wait one sec. more for switching
- keep only one channel, even after target is reached
- intermediate target only when T is raise, but not when lowered
This commit is contained in:
l_samenv
2023-11-28 10:12:27 +01:00
parent c80b4ac5fb
commit 5b0da3ba98
3 changed files with 27 additions and 17 deletions

View File

@ -231,7 +231,7 @@ class ResChannel(Channel):
def _read_value(self):
"""read value, without update"""
now = time.monotonic()
if now + 0.5 < max(self._last_range_change, self.switcher._start_switch) + self.pause:
if now - 0.5 < max(self._last_range_change, self.switcher._start_switch) + self.pause:
return None
result = float(self.communicate('RDGR?%d' % self.channel))
if result == 0:
@ -241,7 +241,7 @@ class ResChannel(Channel):
return None
if self.autorange:
self.fix_autorange()
if now + 0.5 > self._last_range_change + self.pause:
if now - 0.5 > self._last_range_change + self.pause:
rng = int(max(self.minrange, self.range)) # convert from enum to int
if self.status[0] < self.Status.ERROR:
if abs(result) > self.RES_SCALE[rng]:
@ -386,6 +386,10 @@ class TemperatureLoop(HasConvergence, TemperatureChannel, Drivable):
htrrng = Parameter('', EnumType(HTRRNG), readonly=False)
_control_active = False
def doPoll(self):
super().doPoll()
self.set_htrrng()
@Command
def control_off(self):
"""switch control off"""