Hello Guest it is March 28, 2024, 10:29:27 AM

Show Posts

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.


Messages - Jeff_Birt

101
What do you mean, "does not like this"?

Jeff

102
Mach4 General Discussion / Re: Screen Set Ideas
« on: May 07, 2014, 11:13:44 AM »
For the love of God don't manually edit screen sets!!!!!

That is a sure way to cause endless problems, seriously.

103
Look in the lower right of the file open dialog, there is a drop down box that lets you select the file type :) I'm not sure if it can show all allowed types at once or not.

I have spent way too much time on this, mainly trying to figure out Lua's string manipulation functions, but did manage to add a secondary file type check.

TP - You can add a secondary dialog to the bottom of the standard File Open dialog. This would be a good way to show an image association to the file. Another way to do this is to write an extension to the OS that tells the OS how to create/show a thumbnail of the file but that is much more effort.

Code: [Select]
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

104
If you want to restrict the file types that someone can see you just need to set the file filter string as shown below. Note that the first type in the filter string gets shown as default. This stops someone from browsing all but the file extensions you include in the filter, it does not prevent them from typing in a different filenale.ext though. If you wanted to be double sure that only files of a certain type are opened, say if you had some sort of custom machine, then you could use something like 'string.gmatch' to find the extension type and compare it to your allowed types.

I build a controller for a specialized machine that currently runs with a custom screen set on Mach3. For a machine like this being able to lock down what could be loaded and where it can be loaded from would be a good thing.

Code: [Select]
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

105
The directory path inset it to was just an example, i.e. someplace that was not in the Mach4 directory. It would be set to what ever is the 'standard' gcode folder on your controllers. Terry wanted to make it simple so it always opened the same directory each time to lessen the likelihood of operator error.

106
Mach4 General Discussion / Load GCode from fixed directory - for TP
« on: May 07, 2014, 07:55:30 AM »
TP wanted to be able to have a fixed directory that is opened when you click the 'Load GCode' button. Well with Mach4 you can do that and it is not too hard. Open the screen editor and click on the 'Open GCode' button and set the 'Left Down Action' to blank and then paste this script in for the 'Clicked Script'.

Code: [Select]
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

107
Mach4 General Discussion / Re: Mach 4 Feature Request
« on: May 06, 2014, 03:46:02 PM »
Terry, the way I do it I am never more than two directory changes form any GCode I'm going to run. Since all product families are in their own subfolder it is very, very easy to find what you want. No lost time. Like I said unless you send Mach off into the wild blue it will always stay where you last told it to look. It is up to you to screw things up, or not...

108
Mach4 General Discussion / Re: Mach 4 Feature Request
« on: May 06, 2014, 03:11:02 PM »
I have one folder where I keep all my GCode. In that folder are sub folders for different product families. It is never that difficult to find the right file unless I go wild and try to load a file from the desktop then that is where it will go next time. The point being if you don't screw it up it won't be broken :)

109
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 06, 2014, 11:52:07 AM »
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


'Z-order' is a GUI setting, not a Z axis setting. If you think of each object on your screen as being drawn on a separate piece of clear plastic then the sheets of plastic are overlaid so you have the items on top covering up the items below them. The Z-order determines the layering of the objects. (I can never remember if zero is on top or bottom though :) )

110
Yes, the G540 has its own BOB built in. Trying to feed it with another BOB is a recipe for disaster. Just run Port 1 from ESS to G540 and use Port 2 and Port 3 for the PMDX-126.