Hello Guest it is November 16, 2019, 04:02:28 PM

Author Topic: Mach4 LED's  (Read 767 times)

0 Members and 1 Guest are viewing this topic.

Offline HL

*
  •  10 10
    • View Profile
Mach4 LED's
« on: January 22, 2019, 04:25:05 PM »
Hello all, I'm new here. First post.
I'm using Mach4 screen editor and have stumbled upon a seemingly not doable problem. It's those damn ugly LED's. Is there a way to replace LED's with a label that turns ON instead. Something like " Coolant ON" or "Spindle CCW"?
I could do this easily in Mach3, but LUA is not even close to C++. I'm getting old and don't want to learn yet another programming language just to get over this ugly LED B.S. I've included a screen shot of what I'm working on(not finished), and if it can't be done then I guess I won't be buying Mach4.
Thank you,
P.S. Any help will be greatly appreciated.
Re: Mach4 LED's
« Reply #1 on: January 22, 2019, 05:14:11 PM »
What you want can be accomplished because LUA is quite powerful.
I would name each Text Box something easy to remember because the name will be used in the code.
You will also have to edit the code to get the handle of the Coolant, Spindle, and whatever else you want to have a notification of.
I put this code straight into the PLC script that way if the state changes, IE coolant turns on or off, the Text Box will update.

--Code Placed in the PLC Script.
--Coolant State Text Box
local hSig = mc.mcSignalGetHandle(inst, mc.OSIG_COOLANTON)
local State = mc.mcSignalGetState(hSig)
if State == 1 then
    scr.SetProperty("txtCoolantState", "Value", "Coolant On") --The text box name is "txtCoolantState"   Whatever you want it to say, replace where it says "Coolant On"
else
     scr.SetProperty("txtCoolantState", "Value", "Coolant Off")
end   

Kind of harsh wanting to ditch Mach4 because of some LEDs IMHO; but hey, that's one great thing about Mach4, you can change it and make it whatever you like.

Mach4 is very powerful and very flexible, and this forum is a great place to learn and share your experiences.  There are some very knowledgeable people that get on the forum to help everyone out as well.

Welcome to the forum!!   
« Last Edit: January 22, 2019, 05:20:51 PM by Cbyrdtopper »
Chad Byrd

Offline HL

*
  •  10 10
    • View Profile
Re: Mach4 LED's
« Reply #2 on: January 22, 2019, 07:34:32 PM »
Thanks Cbyrdtopper. I will give it a try. Now as for the "Kind of harsh wanting to ditch Mach4 because of some LEDs IMHO;" comment, I disagree. We're both entilled to our differing opinions, but I do have a good reason for saying that.
 I build Machine tools and retrofit some with Mach software. All of my customers have asked for a clean, non hobby looking GUI. So Yes, those goofy looking LED's that look like candy are a non starter.
Newfangled should of thought of that especially when the competition is getting better and better every year that goes by.
Like I said, I'm new at Mach4 and I just started playing with it, less than a day, and there are many things I like about it.
So I'll give it a try and if successful I'll let you know.

Again, thank you.
Re: Mach4 LED's
« Reply #3 on: February 05, 2019, 11:17:05 AM »
Wow. I honestly really like that screen layout.  Never thought I'd like the "old school" machine controller view, but it is simple and fast to find information. Nice Job.  I'm sure you're keeping the design proprietary as you said it is your business, but if you'd ever consider sharing the screen set I would love to try out that setup.

Offline HL

*
  •  10 10
    • View Profile
Re: Mach4 LED's
« Reply #4 on: February 05, 2019, 06:05:25 PM »
Thank you mcardoso. Like I said, this is not completed yet. The screen set will be shared with any one interested when completed. Still having issues implementing Cbyrdtopper's suggestion. I wonder if it's because I'm using the hobby/trial version. I haven't worked on this for couple of weeks now, but will try again tomorrow to see how far I can go. My only other complaint of Mach4 is the raised buttons/frame. That I imagine is a whole other problem.
I'll post if any positive results come out of this.
Re: Mach4 LED's
« Reply #5 on: February 05, 2019, 06:25:56 PM »
Hi,

Quote
I wonder if it's because I'm using the hobby/trial version

To my knowledge the only restriction of the Demo version is the length of time  (six minutes) that it will run
before it requires a restart. Absolutely no changes in how the GUI works.

Craig
My wife left with my best friend...
     and I miss him!

Offline HL

*
  •  10 10
    • View Profile
Re: Mach4 LED's
« Reply #6 on: February 05, 2019, 07:02:09 PM »
Hi,

Quote
I wonder if it's because I'm using the hobby/trial version

To my knowledge the only restriction of the Demo version is the length of time  (six minutes) that it will run
before it requires a restart. Absolutely no changes in how the GUI works.

Craig

Thanks for confirmation.
Re: Mach4 LED's
« Reply #7 on: February 05, 2019, 08:31:15 PM »
Hi,

Quote
My only other complaint of Mach4 is the raised buttons/frame. That I imagine is a whole other problem.

I think that all the buttons, panels, tabs, frames in fact all of the graphical elements in Machs screen are wxWidgets
elements. Thus Machs screen is no more than a large collection of wxLua code.

If you are at all familiar with wxWidgets then you will also be aware that there is a wide range of graphical styles from which
you can chose, including things like raised borders. When in Machs screen edit mode a number of parameters of the
button, say, are available for user update, colors, font, blink rate etc. The structure of the underlying button is not
accessible through the edit screen, things like raised borders etc.

I think that your guess 'That I imagine is a whole other problem' is probably correct. A worthwhile selection of wxWidgets
parameters are made available for user manipulation others are not, including the nature and size of the boundaries.
If you had the GUI source code then ALL the wxWidgets parameters would be available to you.

NFS does have a policy of allowing interested developers access to the inner workings of Mach and presumably the source
code. In order to secure their intellectual property you would have to enter a N(on) D(isclosure) A(greement) with NFS.

To make the case to NFS you would want to demonstrate the need and/or demand for the project you were undertaking
and your ability and stickability to achieve a result.

I have recent come across a quote that is appropriate here 'Better a diamond with a flaw than a pebble without'.
The question I pose is that 'does the visual style that Machs screen is constructed with preclude you from using it?'
I suspect from your preceeding posts that your sense of 'offended visual style' is a weak argument in face of the demonstrated
usefulness as a CNC program. Remember we are talking CNC here.....not some high end desktop publishing software.

Craig
My wife left with my best friend...
     and I miss him!

Offline HL

*
  •  10 10
    • View Profile
Re: Mach4 LED's
« Reply #8 on: February 05, 2019, 09:27:19 PM »
joeaverage,
 I agree with everything you said, including commenting that my sense of style is not NFS's priority. That's perfectly fine. I can work with what they've put together.
I was only seeking help to create a clear and bare bones GUI that has little in the form of distractions. As an engineer I try my best to cut out all the fat. My GUI looks like a throw back of an antiquitated CNC panel, but it is done that way purposely.
I'm just an old fart that can't let go of the past, where flashy framed anything or 3D buttons or bubble gum LED's etc... weren't the norm, but that's just me.
I know many, like all that stuff and I think more power to them.

Thanks for all the help.
Re: Mach4 LED's
« Reply #9 on: February 05, 2019, 10:13:56 PM »
Hi,
I think that with the suggestions that Chad has made, ie using those functions that NFS has left exposed for our use
you will get close to the visual style that you want.

Some other visual styles are not left exposed. I rather think you could get stuck in and do something about it but might
involve some effort and NFS's cooperation.

I too am an engineer by training and inclination and I have come to the conclusion that certain things about Mach I would
do slightly differently but faced with the scale of the challenge you are talking about I decline to go there. I could spend many
tens or hundreds of hours getting some small feature to my satisfaction but not alter, materially, how the machine behaves.
For instance I would ideally build Through Spindle Coolant into my machine or even a much better filtration system for my
existing flood coolant setup and constitutes a better use of my time and resources.

Craig
My wife left with my best friend...
     and I miss him!