Add button to Gscreen "AUTO" page.

More
07 Jul 2015 01:50 #60482 by LAIR82
Hello Guys,

What is the best way to add a button on the row near the bottom of the screen that contains the "BLOCK DELETE, OPTIONAL STOP, FULL GRAPHICS, NEXT TAB" buttons. I want to add a button to work with Dewey Garret's Moveoff component, that will toggle the "moveoff.N.move-enable" on and off.

I know I need to use the Glade editor, but not sure after that.


Thanks

Rick

Please Log in or Create an account to join the conversation.

More
07 Jul 2015 03:13 - 07 Jul 2015 03:14 #60491 by cmorley
I believe you are using the default gscreen skin, any other skin is changed the same.

load the screen's glade file in the GLADE editor ( make sure you use the gtk2 glade editor if using wheezy )
I bet you are using a run-in-place version of linuxcnc..
The default glade file is found in src/emc/usr_intf/gsreen
If using a different skin, they are found in share/gscreen/skins/

now look to the left of the 'next tab' button, it is actually a blank label, used as a place holder.
delete it (right click, delete)
now I'm not sure what kind of button you need but i'm sure you need one with a hal pin.
let go with a momentary HAl button... on the left (hal python) find the hal_button widget and click it.
now go click the space where you deleted the blank label.
a hal button should appear with a label 'button'

To change the buttons text / hal name:
with the button still highlighted, you will see on the right, a properties selection area.
look under 'general'
find 'name'
- this is the name of the halpin change to what you like eg moveoff-select
scroll down find 'label'
- this sets the visible text of the button change to what you like.

ok so now you need to save this BUT you need to save it in your config folder.
If gscreen finds the glade file in the config folder it will use that one rather then the default one.
In this way your changes won't disappear if you upgrade linuxcnc and you will always have the original glade file if you need it.

If you can't get this to work - I can supply you a modified version - just let me know what type of button you need.

Chris M
Last edit: 07 Jul 2015 03:14 by cmorley.

Please Log in or Create an account to join the conversation.

More
07 Jul 2015 21:47 #60497 by LAIR82
Excellent,

I got it on the first shot,

This just opened up a whole world of possibilities for us.


Thanks Chris,

Rick

Please Log in or Create an account to join the conversation.

More
07 Jul 2015 22:54 #60498 by cncbasher
Rick
can you keep us updated , i'm probably going to look at the move off and adding to gmacoppy
but i'm about a week away before i can , so any updates Rick it's appreciated

Dave

Please Log in or Create an account to join the conversation.

More
07 Jul 2015 23:42 #60500 by LAIR82
Will do,

I have to get the component integrated into my hal and INI files, then see how it works on the machine, it's the last piece of the puzzle on the programming side of things on our mill.

I just wanted to integrate the button into the screen, instead of trying to mount another push button on our front end, that is already pretty tight on space. The hal_togglebutton worked perfect.

Isn't Gmoccapy programmed in Python?

Rick

Please Log in or Create an account to join the conversation.

More
08 Jul 2015 00:38 #60502 by cncbasher
yes it is Rick , your correct !

Please Log in or Create an account to join the conversation.

More
08 Jul 2015 01:53 #60503 by LAIR82
What format does an image need to be to insert it into the control?

I want to put our shop logo on the front end, where the old linuxcnc logo used to be.

I am going to take a guess and say that I use the image function under the "Control and Display" section.

Rick

Please Log in or Create an account to join the conversation.

More
08 Jul 2015 07:34 #60508 by cmorley
Glade you're have success and fun - it's what I hoped Gscreen based screens would be used for.

I think you are talking of the image of chips that is displayed on Gscreen all the time...
In the glade editor look for 'image6'
It's the funny looking small box under all the axes DROs
click the image widget, look at the properties selections on the right.
under 'general' tab look for 'edit image' and then 'File name'
set this file name to the path/filename of your image.
I would put the image in your config folder.
Most types of image files should load such as JPEG, PNG etc
The image may not show in the editor when you select the new filename.
then save the glade file.

If you want to set an image somewhere were there isn't an image now you would do all the same things but would have to
add an image widget to the spot first.

Chris M

Ps these techniques should work fine in Gmoccapy too.

Please Log in or Create an account to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum