flamesample: improve comments to parmod.SwitchDriv
This commit is contained in:
parent
5b0da3ba98
commit
2b42e3fa0a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user