Open EvanKirshenbaum opened 7 months ago
Interesting. I had never tested the code with a single temperature because, well, "thermocycle" implies cycling between temperatures. Since there's no drop in temperature those_heaters
are never used and, importantly, those_heaters.change_to()
(which sets ready
) is never called. It does make sense, though, as it allows the same code to be used for cooking drops at a single temperature.
The easiest (and probably cleanest) way to fix this is to simply initialize ready
to True
by default. Then if change_to()
isn't called, the loop will terminate as soon as these_heaters
get back to ambient temperature. So, just say
class HeaterState:
...
ready: bool = True
An alternative would be to change
if len(downs) > 0:
those_heaters.change_to(downs.popleft())
to
if len(downs) > 0:
those_heaters.change_to(downs.popleft())
else
those_heaters.change_to(None)
before the
for phase in phases:
...
loop. I don't think I'd do that, though, because on a board like Joey, with the middle heater shared, it would be perfectly reasonable to do a normal thermocycle on one side of the board and a simple cook on the other, so the cooking "thermocycle" shouldn't mess with the middle (shared) heater.
If it is not intended to be used with a single temperature we can add a check when parsing the parameters and refuse to run.
Nah. I meant to add that as an alternative in my last comment, but as I mentioned, simple heating at a single temperature is something people want to do, and the logic for moving into a zone, moving around within the zone, and moving out of the zone is identical, so we might as well do it in one place. (Perhaps the name should be changed at some point.)
I was running
joey.py
and ran into this. It might be a bug:Migrated from internal repository. Originally created by Rares Vernica on Mar 31, 2022 at 11:16 AM PDT.