How to format the g-code displayed in QTPlasmaC

More
5 years 1 week ago #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 to join the conversation.

More
5 years 1 week ago #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 to join the conversation.

More
5 years 1 week ago #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.

Please Log in to join the conversation.

More
5 years 1 week ago #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 to join the conversation.

More
5 years 1 week ago #223634 by Daddio
Awesome, thanks guys, that did the trick.

Please Log in to join the conversation.

More
5 years 1 week ago #223707 by snowgoer540
I think that commented lines ( ; ) should be ignored:

 

Attachment not found



I think that must be what Phill was talking about here:  github.com/LinuxCNC/linuxcnc/commit/7c67...mmitcomment-58331334

Please Log in to join the conversation.

More
5 years 1 week ago #223728 by cmorley
I didn't know ; was legal comment code.
Fixed thanks!

Please Log in to join the conversation.

More
5 years 1 week ago #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 to join the conversation.

More
5 years 1 week ago #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 :)

Please Log in to join the conversation.

Time to create page: 0.184 seconds
Powered by Kunena Forum