Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: BR549 on May 07, 2014, 04:11:18 PM

Title: Image Buttons and images on screen
Post by: BR549 on May 07, 2014, 04:11:18 PM
I do not see a way to bring in your OWN images only the prepackaged ones can you access.

Where are the Images stored ??

(;-) TP
Title: Re: Image Buttons and images on screen
Post by: Ya-Nvr-No on May 07, 2014, 05:24:00 PM
After going in to screen edit
Choose Screen menu option then manage Images
Title: Re: Image Buttons and images on screen
Post by: Overloaded on May 07, 2014, 05:34:25 PM
THANKS for that tid-bit Craig !

Looks like you're on a roll now, TP !
Russ
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 07, 2014, 06:20:37 PM
NAW making it look pretty is easy peasy Making it WORK now that is difficult.

(;-) TP
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 07, 2014, 06:35:05 PM
Thanks Craig, Now that makes a nice looking  "Mach4 Manuals "   Page having the manual cover pages  as the Button image to open.

I have loading PDF s working as well so I can load either *.TXT or *.PDF and STILL run Mach4 at the same time.

NOW IF it could only make coffee (;-)

NOW I did just hang a sign on the PUTOR it says DO NOT JUMP DOWN THE MACH4 RABBIT HOLE. IT WILL CONSUME YOU like mach3 did.

(;-0 TP
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 07, 2014, 06:38:05 PM
NOW IF we only had Hotkeys / {Fkeys}   for the screens.

(;-) TP
Title: Re: Image Buttons and images on screen
Post by: Brian Barker on May 08, 2014, 08:33:31 AM
You can have all the hot keys you would like.. BUT you have to map them as inputs.. We are not making the KB part of the GUI, that was a Mach3 thing. We want an input device like pokeys and or PLC to be able to do input as well as the KB.
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 08, 2014, 04:42:12 PM
OK SO HOW do you do that ??. I have 24 {f} keys I use for Functions in lue of the MOUSE. I need to assign them to screen buttons and /or functions.

ALSO a horror story with the screen editor. Working on a screen set and it started acting funny. It would NOT align a set of buttons. OK so I had better save and stop. DID THAT and it scrambled the screen set on save. When I open it in mach4 the buttons I was working with showed up on the main program screen behind other stuf and on the page I was working on half the buttons would NOT show up until I clicked on the page.

Lost that screen set,  (;-) TP
Title: Re: Image Buttons and images on screen
Post by: smurph on May 09, 2014, 12:11:14 AM
I think Brian put up a post on how to configure the keyboard plugin. 

For the screen editor, you cannot align controls that are in separate containers.  A container is a page, group box, or notebook page.  A control on page 0 (Default) will always show up and it may appear that it occupies the same container.  But appearances are just that, appearances.  It is hard to catch things like that (read impossible) in the screen editor because we can't tell that you didn't mean to do that!!!  Because it is perfectly acceptable in some circumstances.  Look at the tree on the left to tell where a control is actually placed.  It will have a parent.  That is a good way to figure out if an accident happened.

Making a copy of the screen set before you edit it is a good idea. 

Steve
Title: Re: Image Buttons and images on screen
Post by: ger21 on May 09, 2014, 06:37:18 AM
I think Brian put up a post on how to configure the keyboard plugin. 


According to this thread, there are severe issues with the keyboard plugin.
http://www.machsupport.com/forum/index.php/topic,27129.0.html
Title: Re: Image Buttons and images on screen
Post by: RICH on May 09, 2014, 08:13:33 AM
May want to consider adding a Tab like this and populate whatever you want for help.
It can be images or whatever. You'll need to play with the images some....been a while since I played with the screen editor.

RICH
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 09, 2014, 03:38:23 PM
OK I have a screen button with custom code and it DOES exactly what I want it to do . HOW do I assign a hotkey to THAT button so that when I press {F11} it does the Function.

I only need one complete example of how it works, );-) TP
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 09, 2014, 03:53:41 PM
HIYA RICH THat is what I do to create things I create a seperate TAB(page) then use that page to base everything on. It was to keep me from messing OTHER pages UP until I found the the screen editor can do that FOR me (mess up other screens) automaticaly (;-)

(;-) TP
Title: Re: Image Buttons and images on screen
Post by: smurph on May 09, 2014, 04:01:05 PM
In Mach 4, it is better not to think of buttons that do things.  To implement something that a button AND a key press does, it is better to define the action in the screen script and have both the button and key press call that script function.  That way, you are not duplicating code and when you make changes, you make them in one place.

So in the PLC script:

function mySuperFunc
   -- A script function that does what I want.
   ...
end

Then, in the button Left Up scritp:

mySuperFunc();

Then, using the keyboard plugin, you map a key to an named input.  At this point, you have two options:

1.  Look at that input in the PLC script directly using mcIoGetHandle() and mcIoGetState() directly.  However, it is hard to catch a momentary push this way.

or
2.  Map the I/O to and input signal and catch the state change in the screen signals script.


I prefer method 2.

So map the keypord input to say Mach Input signal Input#1.  Then in the screen signal script do:

local inst = mc.mcGetInstance();

if (sig == mc.ISIG_INPUT1) then
    if (state == 1) then
        mySuperFunc();
    end
end


Steve
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 09, 2014, 04:08:24 PM
(;-) so I can't check a box and push a hotkey ?? HUM ??? I think the average JOE chip slinger is in trouble, Houston we have a problem.(;-)

I have NO idea what and where those things are BUT I will work on it for a while and see what becomes of it. WHAT is a PLC script in mach4? where is it located?

Thanks Steve(;-) TP
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 09, 2014, 05:18:26 PM
OK I have looked at this.

I only find 1 file that mentioned PLC it is MACHPLC it is in the profile dir. It only has 1 line in it. IS THIS IT???

To keep it simple I want to "Load A gcode file"   so I add

function mysuperscript
???? to do load gcode. I have no clue here what to add.
end

Screen signal Script ?? I have no idea what or where this is. I see mention of it in the LUA script window IS this where it is and where is it located so that I can edit it.


Config the KEYBOARD function THAT I can do.


(;-) TP
Title: Re: Image Buttons and images on screen
Post by: Ya-Nvr-No on May 09, 2014, 05:24:23 PM
Under screen edits

That's a great Idea Rich
Title: Re: Image Buttons and images on screen
Post by: BR549 on May 10, 2014, 10:37:54 AM
OK THIS aint happening (;-) The best I can do it end up with a hand full of error messages AND lock up mach4.

QUESTION in the keyboard config it asks all the important question to set up a hotkey(very Simple) To the far right side there is a FUNCTION box BUT it only has jog functions. Could not the REST of mach4 function be added to the list. Things like cycle start,load Gcode,edit gcode,etc.

AND add a CustomFunction selection where you just drop your SuperFunction() code into the window and be done with it.

Easy Peasy, Yous guys are programmers right ? PLEASE throw some magic monkey dust at it and make it happen.  Something as important as Hotkeys for NON MOUSE control panels should be an automatic and easy thing to assign for a CNC controller (;-).

Just a thought, (;-) TP