101
Mach4 General Discussion / Re: Load GCode from fixed directory - for TP
« on: May 07, 2014, 11:42:28 AM »
What do you mean, "does not like this"?
Jeff
Jeff
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
local inst = mc.mcGetInstance();
local myGCodePath = "C:/Mach3/GCode";
local fileDialog = wx.wxFileDialog(wx.NULL, "Open file", myGCodePath,
"", "NC files (*.nc)|*.nc|TAP files (*.tap)|*.tap",
wx.wxFD_DEFAULT_STYLE);
if fileDialog:ShowModal() == wx.wxID_OK then
local fileName = string.reverse(fileDialog:GetFilename());
local pos = string.find(fileName, "%.");
local fileExt = string.reverse(string.sub(fileName, 1, pos-1));
if fileExt == "tap" or fileExt == "nc" then
local filePath = fileDialog:GetPath();
local result = mc.mcCntlLoadGcodeFile(inst, filePath);
if not result then
wx.wxMessageBox("Sorry, I could not open file.");
end
else
local message = string.format("%s is wrong file type",
fileExt);
wx.wxMessageBox(message);
end
end
local inst = mc.mcGetInstance();
local myGCodePath = "C:/Mach3/GCode";
local fileDialog = wx.wxFileDialog(wx.NULL, "Open file", myGCodePath,
"", "NC files (*.nc)|*.nc|TAP files (*.tap)|*.tap", wx.wxFD_DEFAULT_STYLE);
local result = false;
if fileDialog:ShowModal() == wx.wxID_OK then
local fileName = fileDialog:GetPath();
result = mc.mcCntlLoadGcodeFile(inst, fileName);
if not result then
wx.wxMessageBox("Sorry, I could not open file.");
end
end
local inst = mc.mcGetInstance();
local myGCodePath = "C:/Mach3/GCode";
local fileDialog = wx.wxFileDialog(wx.NULL, "Open file", myGCodePath,
"", "All files(*)|*", wx.wxFD_DEFAULT_STYLE);
local result = false;
if fileDialog:ShowModal() == wx.wxID_OK then
local fileName = fileDialog:GetPath();
result = mc.mcCntlLoadGcodeFile(inst, fileName);
if not result then
wx.wxMessageBox("Sorry, I could not open file.");
end
end
M4-1754 Much better Guys !
File Ops. buttons are "hot" while G-code file is running. Should they be disabled and maybe warn "Stop file before ......" like M3 ?
Go to Zero sends all axis' except Z. Is there a Safe Z setting ? Don't understand the "Z Order" entry.
Russ