Hello Guest it is March 28, 2024, 02:42:11 PM

Author Topic: Mach4 screen GRAPHICS -- makin' it Purdy  (Read 38413 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #40 on: March 12, 2015, 08:09:00 AM »
What I meant was have the images change state based on the state of the LED's. I don't need to manipulate the LED's, just read their state and swap the images accordingly. So the image would be (or mimic)  the LED.

I'm trying to imagine the task that would be best done with this method, but to your question, yes, it is doable. There may be a number of ways to do what you want, but only one comes to mind, and I can describe that;

LEDs do not have associated scripts, but they do have an input and an output. The output has a pulldown with a bunch of choices, none of which would do what you want. I do not know if you can just type in some other option nor what those options might be if you could .

That leaves you needing to continuously monitor either the LED itself or something that the LED can output to. The only mechanism for monitoring something, to my knowledge at this point, is the screen script (I don't recall its actual name at the moment) that is accessed in screen edit mode by clicking the very topmost item in the upper left window (wxMach01).

This script runs continuously and you can add whatever code you want and it will loop indefinitely. In this script, you can look at the LED using scr.GetProperty or look at whatever the LED is outputting to, say output#7 or something like that.

When the state changes, the script will catch it and do whatever you told it to do in response, in your case swap an image. I don't know what image you want to swap, so can't help there.
[/quote]


I don't have Mach4 in fornt of me, but is there a border style option of "none"?

On some types, yes. But not on the image toggle
 

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #41 on: March 12, 2015, 08:20:15 AM »
Quote
That leaves you needing to continuously monitor either the LED itself or something that the LED can output to. The only mechanism for monitoring something, to my knowledge at this point, is the screen script (I don't recall its actual name at the moment) that is accessed in screen edit mode by clicking the very topmost item in the upper left window (wxMach01).

This script runs continuously and you can add whatever code you want and it will loop indefinitely. In this script, you can look at the LED using scr.GetProperty or look at whatever the LED is outputting to, say output#7 or something like that.

When the state changes, the script will catch it and do whatever you told it to do in response, in your case swap an image. I don't know what image you want to swap, so can't help there.

This is what I would want to do.

I just want to use images instead of the built in LED's, which as you've noticed, look like crap.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #42 on: March 12, 2015, 09:21:52 AM »
Ger,

Use the Lua Script Panel, as you custom background (and you CAN edit its boarder, color etc., see wxTemplate in the tool box).
At any rate, drop your LED pics (states) onto that panel as a change-able bitmap.
For that matter you ENTIRE Screen could be one GIANT luaPanel that is really a wxdialog or whatever that is filled
with all kinds of high end GUI stuff.
Yes, it is more work, but, you would have control over what and how things show.

Scott

fun times

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #43 on: March 12, 2015, 11:04:22 AM »
Ironically, I found this with a google search and it happens to be here on the forum.

Main documentation overview can be viewed here: http://wxlua.sourceforge.net/documentation.php

1. Lua
Replacing Basic, this is the new scripting language used in UI callbacks, scripts and wizards. API documentation: http://www.lua.org/manual/5.2/

2. wxLua
This UI library was originally built on C++. It makes you able to build windows, frames, input fields, buttons and has been ported to Lua (not all of it, but most). You can either refer to wxWidget original API documentation (starting at http://docs.wxwidgets.org/2.8/) or to the sparse wxLua doc (http://wxlua.sourceforge.net/docs/wxluaref.html, please scroll down for partial API).



There are tons of docs and examples on SourceForge and after a few nights of reading, I should be up to speed.
 
« Last Edit: March 12, 2015, 11:11:01 AM by simpson36 »

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #44 on: March 13, 2015, 09:15:44 AM »

(and you CAN edit [Lua Panel's] boarder, color etc., see wxTemplate in the tool box).


Do you know how to turn off the border on image toggle buttons?

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #45 on: March 13, 2015, 05:03:03 PM »
Attached is a quick video of the 'cascading buttons' idea I described a few posts back.

Also note that the larger 'master' button setting off the cascade is not an image toggle, but just an image button. I discovered that the single 'enabled' image can be changed 'on the fly' which opens up some interesting possibilities.

There are some other goodies as well, but I have now managed to make MACH4 unusable by not commenting out a wx.messagebox in the PLC script, so not it just continuously puts the box up in a split second after dismissing it and the net effect is that I can't do anything else.  :'(

I have tried a number of things to escape this loop, but so far no joy. Anybody know how to recover from this?

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #46 on: March 13, 2015, 05:59:17 PM »
I like my buttons FIRMLY attatched to an exact spot on the screen. That way I KNOW where they are when I need them.

(;-) TP

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #47 on: March 14, 2015, 06:19:00 AM »
I like my buttons FIRMLY attatched to an exact spot on the screen. That way I KNOW where they are when I need them.

You would need to go back in time to DOS for that.  The windowing environment had had things popping on and off the screen as needed since Xerox invented it many moons ago. That is more or less the whole point. Mach is a windows program and already has, in addition to the normal windows pull-downs, tabbed 'pages' as well as a separate set of tabbed windows within those pages.

Widgets pop on and off the screen, are resizable and can be moved anywhere, not to mention dialogue boxes for everything from alarms to user input.

If you click on a tab, a new set of 'buttons' appears. If instead, you click on a button and a new set of buttons appears, there is no operational difference, except that you have more control over placement and how much space is consumed.  All I will do is make the process more ergonomic and context sensitive.

The great thing about MACH is that you CAN have all of your buttons 'glued' to one spot if that is your preference.
« Last Edit: March 14, 2015, 06:20:53 AM by simpson36 »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #48 on: March 14, 2015, 12:11:35 PM »
The thing to remember with machine tools IS the operator HAS to maintain focus on the job. THE more GAMEBOY like you make the screen the harder it is for the OP to concentrate on  his job.  That is WHY you NEVER see Gamboy type screens on real CNC machines.

Stop and take a look at HAAS screens. State of the art for controllers and very DOS like in nature. AND there is the reason for that.

Also keep in mind that new flashy things are NOT always best for Machine controllers. Kinda like the saying that not all things FANUC are a good idea to duplicate when building a new controller(;-)

This is just my experience YOUR mileage may vary.

Just a thought, (;-)

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Mach4 screen GRAPHICS -- makin' it Purdy
« Reply #49 on: March 14, 2015, 02:48:42 PM »
The thing to remember with machine tools IS the operator HAS to maintain focus on the job.

Well, that explains why so little ergonomic research goes into heads-up displays and control systems for fighter aircraft.  ::)


THE more GAMEBOY like you make the screen the harder it is for the OP to concentrate on  his job.



You should have said so before all those millions were spent on those 'GAMEBOY like' HMI control systems.   :)


This is just my experience YOUR mileage may vary.


My mileage varies a lot from CNC machine tools. HAAS and Fanuc may or may not be 'state-of-the-art' for CNC machine tools, but that is not representative of true 'state- of- the- art' in HMI. Nobody dies if a CNC operator pushes the wrong button at the wrong time.

You may have noticed that MACH4 out-of-the-box has some of this 'fancy' stuff and even some context sensitive controls. Apparently they also did not get the memo where it was explained that you don't need to disable buttons so that they will not function when they SHOULD not function. It is not a big leap to go from disabled to disappeared. Functionally, these methods are the same, but one makes the screen less cluttered and uses the real estate more efficiently.

In any case, the purpose of this thread is to figure out how to make the screen pretty, not to debate whether it should be pretty or not. If ugly is your preference, you don't need to learn anything. Ugly is included for free.
    
Incidentally, from what little I saw of the wizard you are working on, it looked pretty jazzy to me. There were big photos in the middle of the screen, provided by yours truly. Which HAAS or Fanuc control was that idea copied from?  ;)

Incidentally, didn't you get a script stuck in a continuous loop? How did you get out of that?
« Last Edit: March 14, 2015, 02:53:38 PM by simpson36 »