How to format the g-code displayed in QTPlasmaC

More
19 Oct 2021 04:11 #223518 by Daddio
Hello all,
What is the best way to format the g-code display in qtplasmac?  I am running 2.9.0-pre0 and have been playing with the screens in qt designer.  The g-code display is all a single color driven by "Foreground" color in GUI settings.  In the g-code, I am trying to highlight the M codes (yellow), make "X" and "Y" a different color (dark green) and in text comments another color (light blue).  Being able to format the g-code display makes it a lot easier to ready.  Any ideas?
Thanks

Please Log in or Create an account to join the conversation.

More
19 Oct 2021 07:48 #223528 by cmorley
While in master branch you can select some of the colors:
linuxcnc.org/docs/devel/html/gui/qtvcp_w...s.html#_gcodedisplay
There are currently only 4 colors available.

To change the formatting further requires some coding changes.
The gcode formatting lexer is just something I quickly fumbled with a few years ago and never went back to.
I'm not a pro but if someone wrote up a requirement, I could hack on it.
Or better yet someone else hack it and I can commit it.

(The GcodeLexer class can be found in qtvcp's gcode_editor file)

Please Log in or Create an account to join the conversation.

More
19 Oct 2021 09:03 #223537 by cmorley
Looks like Phill is a little bit restrictive on Gcode highlighting.
I'm sure he will chime in to tell you how to utilize the existing 4 colors if you want.

I did a bit of hacking and have code that can give individual colors to M, F and Axes as well.
The following user(s) said Thank You: phillc54

Please Log in or Create an account to join the conversation.

More
19 Oct 2021 22:39 #223598 by phillc54
You can set up some custom styling:
linuxcnc.org/docs/devel/html/plasma/qtpl...mizing_qtplasmac_gui

So you should be able to use any available styles for the gcode text:
linuxcnc.org/docs/devel/html/gui/qtvcp_w...s.html#_gcodedisplay

Please Log in or Create an account to join the conversation.

More
20 Oct 2021 06:21 #223634 by Daddio
Awesome, thanks guys, that did the trick.

Please Log in or Create an account to join the conversation.

More
20 Oct 2021 21:13 - 20 Oct 2021 21:13 #223707 by snowgoer540
I think that commented lines ( ; ) should be ignored:

 

I think that must be what Phill was talking about here: github.com/LinuxCNC/linuxcnc/commit/7c67...mmitcomment-58331334
Attachments:
Last edit: 20 Oct 2021 21:13 by snowgoer540.

Please Log in or Create an account to join the conversation.

More
21 Oct 2021 00:54 #223728 by cmorley
I didn't know ; was legal comment code.
Fixed thanks!

Please Log in or Create an account to join the conversation.

More
21 Oct 2021 01:53 #223743 by rodw

I didn't know ; was legal comment code.
Fixed thanks!


That is documented :)
linuxcnc.org/docs/html/gcode/overview.html#gcode:comments

Please Log in or Create an account to join the conversation.

More
21 Oct 2021 02:00 - 21 Oct 2021 02:01 #223747 by cmorley
Yes i found it when I looked for it (though harder then I thought - an overview was not what I thought I was looking for)

Just not any of my usual test code uses it. It looks weird to me :)
Last edit: 21 Oct 2021 02:01 by cmorley.

Please Log in or Create an account to join the conversation.

Time to create page: 0.164 seconds
Powered by Kunena Forum