Conversation
Still figuring out whether to use this or emulating it through the GCodes above. In this case dynamic text (through GCodes) might be difficult.
lcd_progressbar awaits values between 0 and 124 (the pixel width)
Borrow some code from M23 (e.g.): |
…eptable way to do this.
…use I instead of S for inverted text, e.g. M10008 X10 Y10 S48656c6c6f2c20776f726c6421 displays "Hello, world!"
Fixes the text feature to display text without appending checksum (e.g. "*127"!) Also, allows inverted strings with M10001 Istring.
…uilt up with existing UI functions.
Terminate with a null byte to prevent characters from earlier strings to be displayed.
|
@TinkerGnome Thanks, managed to fix the checksum problem! (and more). See also the newest commits if you're interested! |
| case 10008://M10008 - Display string at X,Y based on hex encoded chars (S), use I instead of S for inverted text, | ||
| // e.g. M10008 X10 Y10 S48656c6c6f2c20776f726c6421 displays "Hello, world!" | ||
| { | ||
| uint8_t x = 0, y = 0; |
There was a problem hiding this comment.
This code should also clear out the '*' character, to prevent the hex2bin function trying to convert that.
|
you're actualy drawing on the screen trough gcode, this seems odd to me wouldn't it make more sense to generate the UI in marlin and send statistics? |
|
@robinmdh yes, I have a specific need for it but it's really a generic capability that different people can use for their own use case. They can integrate a third party product much more nicely. E.g. Doodle3D can use this very well as well. I'd love to see this merged but I'm not capable (yet) of implementing the feedback |
This should fix the biggest objections to this branch/pull reqest. If this was not marlin code for instance: all the magic values such as the 22 and 125 should be derived/defined or explained, etc. Signed-off-by: Robin den Hertog <r.denhertog@ultimaker.com>
|
@ErikDeBruijn made a very much untested fix of the items mentioned by @ckielstra also grabbed the updated hex2bin function from after testing and review. |
Feel free to comment. I've done some initial test and it seems to work, however don't consider this battle tested firmware! :) My testing was of the progress bar was before I multiplied the percentage (integer) by 1.2. While it doesn't give a compilation error I'm not sure whether the scaling to the progress bar size actually works but I have no UM2 here to test this with currently.
As you can see in the picture, I'm still dealing with the annoying checksums also being displayed if I display text through M10001 X[x] Y[y] S[text]. If anyone knows how to not display these, that's great.