Feature Req:Show current layer,total layers and total height
-
It would be nice to be able to see on the PanelDue which layer is currently printing, as well as the total number of layers, and the total z-height of the print.
-
I figured I'd take a stab at implementing this. Looks like the PanelDue is sending a "M408 S0" to get the current info. I was thinking of changing this to a "M408 S4" to get some additional info, and if the status is currently printing, send a "M36" to get stats of the current file.
-
M408 S0 and S1 return a flat JSON object. M408 S2 to S5 return a nested JSON object. The parser in PanelDue didn't originally work with nested JSON objects, but I extended it a few versions ago. There were bugs in the original implementation, but I fixed those when I used the same parser in another project, and I back-ported the fixes to PanelDue in the latest revision. So it should be possible to use S2 instead of S0 now, and also to use S4; but you will need to change the variable names in table ReceiveDataTableEntry in PanelDue.cpp to match the names used in the S2 response.
There is already code to process a M36 response, but currently it is only used in to display file info after selecting a print file.