Duet3D / PanelDueFirmware

Firmware for the PanelDue touch screen for 3D printers
Other
165 stars 84 forks source link

feat: add a popup showing "Updating firmware" #329

Closed wilriker closed 10 months ago

wilriker commented 10 months ago

Closes #251

mfs12 commented 10 months ago

Hey @wilriker, if I understand @dc42 correctly

When PanelDue receives the erase-and-reset command from RRF, the screen freezes. It would be better if it cleared the screen and displayed "Updating firmware" before executing the erase-and-reset command.

The idea is not to have a popup, but a full main page covering everything.

Also I think if it should be "just" a popup RRF could just send a message which then will displayed as well. This would mean no change PanelDue side.

@dc42 can comment on this idea.

wilriker commented 10 months ago

The idea is not to have a popup, but a full main page covering everything.

That's exactly what this PR achieves. The popup covers the full screen in black and positions the text in white at the center. Doing this as a logical popup instead of low-level overwriting the even in black and then painting the text simply reuses the existing UI framework making all the required code much shorter. But it's the exact same approach that is used by the screensaver.

Also I think if it should be "just" a popup RRF could just send a message which then will displayed as well. This would mean no change PanelDue side.

I'm not certain if that would work over a static popup. Reason is that for flashing from Duet we are on a tight time budget to have the Duet recognize that the PanelDue in fact did erase and reset. In my first code I preventatively added a 100ms delay to have the screen repaint but that broke flashing completely (and it turned out it was not necessary anyways).

dc42 commented 10 months ago

I don't mind how this is implemented, and I can quite understand that clearing the screen and then using the existing popup code may be the simplest way to achieve this. I would rather not have to add code to RRF to do this because we are already running out of flash memory space on Duet 2.

@wilriker, please address the comments from @mfs12 if you have not already done so.