geting line number from extending gcode.

More
28 Aug 2019 01:43 #143384 by thang
Base on:
www.vdwalle.com/Norte/Structure.html#_in...r_by_remapping_codes
I tried create new gcode and it worked. there is only 1 problem that i cant find the line number of new gcode. lineno() function just return line number in python script file not gcode file. Is there any way to get line number of my new gcode command?

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

More
28 Aug 2019 04:55 #143395 by cmorley
You might need to give us a little more to go on.
What are you trying to do?

Chris

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

More
28 Aug 2019 06:33 #143398 by thang
i create a gcode command name "g0.1". This command use G1 command to move machine in a paterm(like square, triangle). In command "self.excuse(G1 x y z,linenumber)" there is an argument that allow me set line number,i want to use it to highlight command "g0.1" when program reach this command.

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

More
28 Aug 2019 06:48 - 28 Aug 2019 06:49 #143400 by cmorley
So you created a remap program to feed linuxcnc a gcode program but you need to know what line on the gcode program it is running?

That's my guess anyways.
Remap is one of the most cutting-edge things an integrator can use.
We would need much more detail to help, like to see the remap code.

Chris M
Last edit: 28 Aug 2019 06:49 by cmorley.

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

More
28 Aug 2019 06:53 #143401 by cmorley
oh wait - do you mean when running linuxcnc normally, you want your new gcode to be highlighted?

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

More
28 Aug 2019 07:01 - 28 Aug 2019 07:10 #143403 by thang
yes, i want to this command is highlighted. Currently it highlight previous gcode command if i dont give line_number in command self.excuse(). So i need to find a function in module emccanon or interpreter or what ever that give me the line_number
Last edit: 28 Aug 2019 07:10 by thang.

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

More
28 Aug 2019 07:10 #143404 by cmorley
There is no universal way to do this. Any highlighting is done by the display screen being used, not by linuxcnc.
You could surely program gladevcp's sourceview widget to search for and highlight whatever you want but it would require custom coding - AXIS would be more difficult.

but gladevcp sourcview does use color coding for gcode and possible you could use that to at least color the gcode differently. I'm sorry I don't have a reference for that - but you might check linuxcnc's wiki or google.

Chris M

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

More
28 Aug 2019 07:26 #143407 by thang
As i know, gladevcp sourceview use "motion_line" in module linuxcnc python interface to get executing line of gcode. And this stat is created somewhere

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

More
28 Aug 2019 07:39 #143409 by cmorley
yes linuxcnc's status messages are used in gladevcp, but I don't actually know where it originates from, but possibly motion.

Chris M

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

Time to create page: 0.236 seconds
Powered by Kunena Forum