Re: Notepad++ Gcode Lexer
That's really nice. I've wanted gcode language support in notepad++ for some time.
Finding this was a very pleasant surprise - THANK YOU!
Dave
Re: Notepad++ Gcode Lexer
I was searching for a plugin as well.
Listing this on the notepad++ website would make this easier for others to find. Of course it's your choice.
Thanks for your efforts :)
Re: Notepad++ Gcode Lexer
I have been using this with notepad ++ for years. https://github.com/robEllenberg/gcode-syntax
It is the first link whe you search google for " Gcode notepad++"
Re: Notepad++ Gcode Lexer
Quote:
Originally Posted by
109jb
It is the first link whe you search google for " Gcode notepad++"
I found that and chose not to download it for some reason. Possibly appeared too Mach3 specific ?
Modifying the xml file looks not difficult so will customize this one for my machine,
In hindsight the same was possible with the earlier plugin. Oh well..
Re: Notepad++ Gcode Lexer
Thanks you guys for trying the plugin. This is my first attempt to write a Notepad++ plugin and I started this project to also learn object oriented programming.
It does something more than setting colors to different Gcode commands. It does a scanning of the file, setting the color of rapid motions to red, feed motions to green, circular interpolations to other colors and so on. I admit my sense of colour need to be improved. I choose these colours to mimic the behaviour of other cgode editors. It should be a visual help to immediately see what a gcode file does. I tried it with basic GCODE files without advanced commands or variables. It seems to work fine even if it could be improved.
PS: If someone find a good colors combination, please share your gcodelexer.xml file so others can find it useful.
thanks again for testing.
(please ignore my english errors, my italian is better)
Sandro
Re: Notepad++ Gcode Lexer
Thank's for nice plugin Sandro,
I wanted to highlight z-axis + - movements somehow but found out that I cant edit yours as "user defined language".
How can I make changes other than style?
Re: Notepad++ Gcode Lexer
To change lexer colours click on Settings --> Style Configurator. then choose "Gcode Lexer" from the language list on the left but
you can't change the colout of just the Z axis (or any other Axis). Only FEED, RAPID and other command categories can be changed. As i wrote in previous message, the lexer do not set colours based on gcode recognition. It does a scanning of all the tokens and set colour accordingly to motion status.
What I mean is that if, for example, a block contains let' say X100 Y 100 and the the last G motion command was G0, the block will be marked by the lexer as RAPID and drawn with the colour assigned to "RAPID MOTIONS" in the style configurator (red by default).
The same line would be marked as FEED if the last previous motion command was G1 and drawn in "FEED MOTIONS" style. The same is true for circular motions and canned cycles.
Sandro
Re: Notepad++ Gcode Lexer
Quote:
Modifying the xml file looks not difficult
Hmm... taking a closer look at things this lexer isn't editable in xml in any useful way.
Tracking the active gcode mode is a very nice feature. A another nice feature would be to highlight the
minimum/maximum ranges of movement. I'm not sure if this is practical or even possible. Consider it a feature
request to be safely ignored :)
Re: Notepad++ Gcode Lexer
Hi. you request sounds interesting. Do you mean the lexer should highlight the max/min XYX motion ?. Why is this useful ? I'm always interested in learning from people tha make chips. I wrote postprocessors for living but I do not have many contacts with people in the shopfloor.
May be I didn't understood you quote about XML editing. Configuration of the lexer colours doesn't not require manual XML file editing. All the configuration stuff is done via Notepad++ user interface.
Re: Notepad++ Gcode Lexer
Quote:
Do you mean the lexer should highlight the max/min XYX motion ?. Why is this useful ?
Yes, max/min motion. Most of my gcode files are created/stored in my office. The computer in the office is not a cnc machine control and does not have a machine simulator.
It would be helpful to scan the files for unreasonable motion, especially in the -Z direction. This feature is found in back-plotters and editors like Cimco Edit.
My comment should be filed under 'thinking out loud' and thanks for the plug-in.
Sorry for the late reply.
Re: Notepad++ Gcode Lexer
@cyclestart : it not so easy to highlight XYZ min/max values in the editor. The problem is not to compute the values rather than to highlight the correct value in the correct input line.
In my spare time I'm writing another program that read and analyze Gcode files and create a report trying to predict machining time. Among other things it also save XYZ min max values (in the current workpiece origin). I do not have any date for it because I only work on it on weekends (and bike season is approaching so I will have less time to code and more time to have fun I hope...). anyway I will release it here when ready.
Re: Notepad++ Gcode Lexer
Thank you Sandro for sharing this nice plugin!
It would be wonderful, if possible, to be able to assign different colors to X&I, Y&J, Z&K, A, B, R movements. Something like FEED_X_I, FEED_Y_J, FEED_Z_J, FEED_A..., RAPID_X_I, RAPID_Y_J...