2
« on: April 16, 2020, 10:45:14 AM »
Hi, am trying to show a dialog during the Toolchange, to gin ethe user some option amd a status feedback. I Already tested the Macro in Debugger, and everthing works fine ...
The Problem nu is if GCode Contains an T1 M6 (for example) the Macro is called, but the dialog ist not shown Modal. If i Run the eyaple in Debugger it Shows first MessageBox, opens the dialog and after closing the dialog it shows up MessageBox 2.
During a Toolchange caused by a GCODE T1 M6 it shows First Messagebox, Dialog and Second Messagebox as soon i cloed the first one ....
I also tryed to open the dialog moda by using dialog:ShowModal(true) which works also fine in debugger but causes an error in GCODE ...
function m6()
dialog = wx.wxDialog(wx.NULL, wx.wxID_ANY, "Mach4 Auto Caculate Motor Counts Per Units", wx.wxDefaultPosition, wx.wxDefaultSize)
panel = wx.wxPanel(dialog, wx.wxID_ANY)
dialog:Connect(wx.wxEVT_CLOSE_WINDOW,
function (event)
dialog:Destroy()
event:Skip()
end)
inst = mc.mcGetInstance()
wx.wxMessageBox("before Toolchange Dialog")
dialog:Centre()
-- Show the dialog
dialog:Show(true)
wx.wxGetApp():MainLoop()
wx.wxMessageBox("after ToolChange Dialog")
end
if (mc.mcInEditor() == 1) then
m6()
end