Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: thespindoctor on May 06, 2017, 09:03:25 PM

Title: how to conect a loaded gcode file to a gcode window on a screen
Post by: thespindoctor on May 06, 2017, 09:03:25 PM
Figured out how to load a gcode file with wx.widgets and it shows up in the other gcode windows on the stock tabs in Mach4-Mill.  However, when I add a gcode window to the tab I have created, the window is loaded with the code from the file but when I either hit the cycle start button or try to program a cycle start, it says nothing to run.  When I switch to another tab, the gcode is properly listed and will run with cycle start.  How do I link the new gcode window to the loaded code?  I cannot see any difference on the lua scripts or the properties of the other gcode windows.  Seems odd that is would not work.  I see the Lua code necessary to make an MDI window run code, but is there something not stated that I have not done?

Thanks
Keith
Title: Re: how to conect a loaded gcode file to a gcode window on a screen
Post by: django013 on May 06, 2017, 11:46:23 PM
Take a look at your screen load script and there at the function CycleStart()
The point is, that mach works with the name of screen-elements (which is a good thing), but when you change the screen and copy/delete several objects their name will change and so functionality is broken. I did not find a possibility to move elements across their panel-borders. So you have to copy/delete the elements. But its vital to rename the new object after deleting the old one ;)

There are plenty scripts that refer to exisiting screen elements. If lua reaches a line, which refers to a non-exisiting element, the script-processing silently stops and failed.
So I startet to debug my changes, before I continue work :)

cheers Reinhard
Title: Re: how to conect a loaded gcode file to a gcode window on a screen
Post by: thespindoctor on May 07, 2017, 01:35:08 PM
Danke, Heinhard

I am still working on it but had to delete another tab and rob everything from that tab to make it work.  Still don't understand it completely but I could not seem to effectively modify the screen load script to add another MDI to the CycleStart function.

Keith