- Posts: 596
- Thank you received: 0
Gcode preview and remap
Attachment not found
It dont work. Probably I need modification for Python 3 from Python.
Attachment not found
I would like ask you for help.
Please Log in to join the conversation.
Please Log in to join the conversation.
Try using the #<_task> parameter in your subroutine so it is only executed when you are actually running the gcode program.
#<_task> - 1.0 if the executing interpreter instance is part of milltask, 0.0 otherwise. Sometimes it is necessary to treat this case specially to retain proper preview, for instance when testing the success of a probe (G38.n) by inspecting #5070, which will always fail in the preview interpreter (e.g. Axis).
Please Log in to join the conversation.
It no longer gives the error message, but it didn't solve the problem. Still showing path of ATC. Still, thanks for the help.it says right there at the end of the error message. In python, indentation is part of the syntax. It needs to say
Code:if fn == None: fn = self.ilename if fn.split.... notice same indentation level, you have additional indentation on the line with "if fn.split...". rule of thumb, if the previous line is a complete statement (no open parenthesis, ...) and doesn't end with a colon (":") then next line must be on same level.
Please Log in to join the conversation.
The same advice give me rene-dev.The preview interpreter doesn't know if you want a subroutine displayed or not.
Try using the #<_task> parameter in your subroutine so it is only executed when you are actually running the gcode program.#<_task> - 1.0 if the executing interpreter instance is part of milltask, 0.0 otherwise. Sometimes it is necessary to treat this case specially to retain proper preview, for instance when testing the success of a probe (G38.n) by inspecting #5070, which will always fail in the preview interpreter (e.g. Axis).
github.com/LinuxCNC/linuxcnc/issues/2651...uecomment-1729335327
But I dont know how use #<_task>.
Please Log in to join the conversation.
But #<_task> is only readonly parameter.
Attachment not found
Please Log in to join the conversation.
Please Log in to join the conversation.
I tried this:
(PREVIEW,hide)
<G-code to be hidden>
(PREVIEW, show)
linuxcnc.org/docs/2.9/html/gui/gmoccapy.html#_preview_control
But it didn't help on physical machine.
I'm stupid today.
Please Log in to join the conversation.
Please Log in to join the conversation.
need the ATC exchange to happen every time, not just depending on some parameter. I just need Preview to ignore it.
The point is this:
gcode is run in a separate interpreter for the preview and for this the parameter #<_task> is = 0.
If the code is executed 'on the hardware' (by clicking on the 'Run' button) then the parameter #<_task> = 1.
So you check that parameter #<_task> == 1 to make the code in the if-endif subroutine invisible for the preview but execute it when you actually click on the 'Run' button.
Please Log in to join the conversation.
