Closed EvanKirshenbaum closed 8 months ago
This issue was referenced by the following commit before migration:
Okay, it was a little more complicated than that, but not much. The System.prompt_and_wait()
now pops up a dialog box if there's a BoardMonitor
. Confirmed with manual pipettor.
While doing this, noticed that in combinatorial synthesis code, this necessitates guarding the transfers into the extraction point with a trigger so that the second one isn't prompted until the first one has moved away.
I also took this opportunity to add a rounding
config param for the manual pipettor, so that with the new weird drop size it isn't asking for overly precise amounts.
Currently, when the user needs to do something manually, the code calls:
where
terminal_interaction
is anAsyncFunctionSerializer
. This is currently used byManualPipettor
to prompt the user to add or remove reagent, but we're also going to want to use it to get the user to aim the ESELog laser (#264) and probably for other things.This works, but all of the interaction happens on the terminal window, and this can be hard to notice when the user is focused on the GUI. What we'd like, when we have a display, is to have it pop up a dialog box and wait for the user to hit
Continue
.I was chatting with ChatGPT, and we came up with the following non-blocking dialog box class (Tkinter's dialog boxes all block):
This would be created in the GUI thread using
monitor.in_display_thread(fn)
, which would, I presume, result in all of the other interaction (including thedestroy()
) happening there.For our purposes, rather than caching an
answer
there, we'd want either a callback function or aPostable[T]
where thebuttons
are aSequence[str|tuple[str,T]]
, with the second item being the thing that is posted or passed to the function, defaulting to the string itself. (Although thinking about it, that may be more complicated than is warranted. Let's just start with the values always being the strings and count on the caller to know what to do with them.)Migrated from internal repository. Originally created by @EvanKirshenbaum on May 16, 2023 at 2:59 PM PDT. Closed on May 17, 2023 at 11:37 AM PDT.