diff --git a/frappy_psi/parmod.py b/frappy_psi/parmod.py index 0070026..31d60e0 100644 --- a/frappy_psi/parmod.py +++ b/frappy_psi/parmod.py @@ -149,7 +149,7 @@ class SwitchDriv(HasConvergence, Drivable): # disable_other = Parameter('whether to disable unused channel', BoolType(), readonly=False) selected = Parameter('selected module', EnumType(low=LOW, high=HIGH), readonly=False, default=0) autoswitch = Parameter('switch sensor automatically', BoolType(), readonly=False, default=True) - _switch_target = None # if not None, switch to selection mhen mid range is reached + _switch_target = None # if not None, switch to selection when mid range is reached # TODO: copy units from attached module # TODO: callbacks for updates @@ -167,7 +167,7 @@ class SwitchDriv(HasConvergence, Drivable): return else: high = get_value(self.high, mid) # return mid when high is invalid - if high < mid: + if high < mid: # change to self.max_low self.value = self.high.value self._switch_target = None self.write_target(self.target) @@ -221,6 +221,7 @@ class SwitchDriv(HasConvergence, Drivable): this, other = other, this selected = HIGH elif target < self.min_high * 0.75 + self.max_low * 0.25: + # reinstall this with higher threshold (e.g. 4 K)? #if self.value > self.max_low: # target1 = max(self.min_high, target) # self._switch_target = LOW