GLADE Signals IN and OUT - Buttons won't work.

More
23 Dec 2017 07:36 - 24 Dec 2017 07:05 #103478 by Askjerry
I have written a BUNCH of pyVCP panels... and they work great.
Now i am trying to write a GLADE VCP panel so that I can lean how it works and share this information on my YouTube channel.

I created some input devices... labels for example... and I have a spiffy job timer and spindle cmd speed indicator working perfectly. I even figured out how to get the text to display nicely.

BUTTONS... they are killing me... I can go to the "Show HAL Configuration" from within AXIS and select my gladevcp buttons...
  • x-minus / x-plus
  • y-minus / y-plus
  • z-minus / z-plus

I can see that they are indeed correctly changing as I press and release the buttons... the watch status LED changes exactly the same as in a pyVCP panel. But for some reason... the JOG does nothing... pretty much the same code... but doesn't work. I know I'm missing something very minor... but I can't seem to figure it out. And even after reading the tutorials... I'm so close.

custom_postgui.hal for the working pyVCP
# Connect the X PyVCP buttons
net panel-jog-x-minus 		<= halui.jog.0.minus 		<= pyvcp.x-minus
net panel-jog-x-plus 		<= halui.jog.0.plus 		<= pyvcp.x-plus

custom_postgui.hal for the failing gladevcp
# Connect the X gladevcp buttons
net panel-jog-x-minus 		<= halui.jog.0.minus 		<= gladevcp.x-minus
net panel-jog-x-plus 		<= halui.jog.0.plus 		<= gladevcp.x-plus

What am I missing?
File attached.

File Attachment:

File Name: GLADEPanel.tar.gz
File Size:9 KB


Thanks!
Jerry
Attachments:
Last edit: 24 Dec 2017 07:05 by Askjerry.

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

More
23 Dec 2017 08:46 #103479 by raglanlittlejohn
Jerry.
I'm interested in this, as I've only used pyVCP panels up to now, and would like to try gladevcp. If you look in Show Hal Configuration, and do a watch on the signal panel-jog-x-minus, does it change when you press the jog minus button?.
John.

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

More
23 Dec 2017 10:50 #103481 by cmorley
looks like you forgot to set the jog speed.
linuxcnc.org/docs/2.7/html/gui/halui.html#_halui_pin_reference

halui.jog-speed [SOMETHING]

In linuxcnc each GUI keeps it's own jog speed setting - linuxcnc has no concept or global jog speed.
In master GSTAT is expanded to help with this.

It was very useful to post your config thank you.
It would be even better if you can use the simulated hardware option to create a sample that can run on any hardware - my laptop didn't have a parport :)
Hopefuly the option should make it easy to make a simulated parport config.

Hope that helps
Chris
The following user(s) said Thank You: Askjerry

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

More
23 Dec 2017 17:36 - 23 Dec 2017 21:05 #103489 by Askjerry
raglanlittlejohn - Yes, the signals went through.

Ok... I was telling it to move forward at 0.0 ipm so it was doing exactly what I told it to do. :blink:

I added a Jog Slider... and should have known better... EVERY pyVCP panel I have ever written had that feature. :blush:

I will make this note for others following in my footsteps... unlike a pyVCP slider... there are a couple of differences.
  1. In the pyVCP if you named it "jog-speed" in the panel... you had to reference it as "pyvcp.jog-speed-f" to indicate it was a floating point number. But in GLADE, if you do that, it fails to find the device. If you name it as "jog-speed" in the panel, then you reference it as "gladevcp.jog-speed" as it already knows it's floating point.
  2. In the pyVCP just putting in a slider with a HAL pin is enough. In GLADE, it will show up but be absolutely stupid... just a paperweight. You need to add more values to it by including an "adjustment".

Here is the code added to the custom_postgui.hal file:
# connect the gladevcp jog speed slider
net panel-jogspeed 		halui.jog-speed 		<= gladevcp.jog-speed

To make the addition of the adjustment, from within GLADE do the following...
  1. Click on the slider.
  2. In the GENERAL tab of the slider, click on the "..." next to ADJUSTMENT.
  3. A dialog box will open up, click NEW to add the adjustment.
  4. In the box at the top with all the stuff... click this new adjustment to get to it's values.
  5. Make some changes to this adjustment...
    Rename it something that makes sense, I used "jog-adjustment" for example.
  6. Fill out the following information at a minimum...
    • VALUE = The starting value for the slider
    • MINIMUM VALUE = The slowest allowable speed
    • MAXIMUM VALUE = The fastest allowable speed
    • STEP INCREMENT = Step size for the allowable movement.

Attached is Version GLADE (1.1)

File Attachment:

File Name: GLADE1.1.tar.gz
File Size:6 KB


cmorley -
-- First, thanks for the pointer... spot on!
-- Second... If I take my CONFIG "GLADE (1.1)" and put a copy into "GLADE (1.1) SIM"
-- what do I need to do with that to make it a simulation? (Never done that process before.)

Thanks,
Jerry
Attachments:
Last edit: 23 Dec 2017 21:05 by Askjerry. Reason: Add data / Clean up.

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

More
24 Dec 2017 01:10 #103509 by cmorley

cmorley -
-- First, thanks for the pointer... spot on!
-- Second... If I take my CONFIG "GLADE (1.1)" and put a copy into "GLADE (1.1) SIM"
-- what do I need to do with that to make it a simulation? (Never done that process before.)

Thanks,
Jerry


Hey Jerry.
I saw that it was a stepconf generated config. Stepconf has an option on the start page to produce a 'simulated hardware' config.
It adds a component to substitute for the parport component :
loadrt sim_parport names=parport.0
and adds a HAL file to connect signals for this component and add a sim hardware component for homing and limits:
source sim_hardware.hal
besides that is should be exactly the same.
i'm sure you could hand add it in,if your config is highly modified (which I'm sure it is)
It just makes it easier to test ( i don't have too much linuxcnc running hardware handy with a parport)

It's certainly not the end of the world if you don't do this.
In this case i was familiar enough with the requirements (read that: I've done the same thing) to guess the problem.

Chris M
The following user(s) said Thank You: Askjerry

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

More
24 Dec 2017 01:43 #103512 by Askjerry
Chris -

I went into STEPCONFIG presuming that I could create a simple mill using a parallel port, then do exactly the same steps to create a simulated one... and view the differences. Unfortunately, STEPCONFIG does NOT have this feature. It has the ability to create a new configuration, or modify an existing one... with ONE parallel port or TWO parallel ports... but no mutton that has any kind of "create simulation" option.

I went looking in the SIM folder of LinuxCNC and unfortunately... all sorts of configurations are in there... hard to tell what is needed for which particular INI file. It would be nice to have two folders... one with a simple PARAPORT machine, and one with SIM... exactly the same machine in simulation... so I could see the differences. (I have a program I use for work called ULTRACOMPARE... it would instantly mark any and all differences between them.)

Anyway... rather than tie up this conversation with that topic... I'll start a new one... hopefully someone can tell me exactly what lines to hand-code and/or what to search/replace to make the changes.

I'll also start a new topic about button decoration... colors, possibly tiled images... any ways to make it look better. But for now... the button issue is resolved and I can make a YouTube video to compare the two so users can decide which way to go.

Thanks,
Jerry

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

More
24 Dec 2017 07:09 - 24 Dec 2017 07:11 #103525 by Askjerry
After a bit of trial and error... I was able to create the same machine with a GLADE and with pyVCP. There are a couple of subtle differences... color on the pyVCP buttons for example... but I'll address artistic stuff for GLADE in another post.

Anyway... here is the final result.

pyVCP Original Panel


GLADE Duplicated Panel


Now to learn the artistic side of the GLADE method... whoo!

Jerry
Attachments:
Last edit: 24 Dec 2017 07:11 by Askjerry.

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

More
24 Dec 2017 08:02 #103529 by cmorley
Looks good!

There are about four ways to change the color of the button - it's more painful then it should be.

- upgrade to 2.7 - there are fancy light buttons widgets that can be colored (and rounded and text changed on state)

-place an image file in the button using the GLADE editor.
You would need the text in the image

-try a technique something like this in a python handler file:
stackoverflow.com/questions/1241020/gtk-...lored-regular-button
python files of course allow you to do almost anything but takes more work.

-use custom themes - probably not worth the effort for just a small panel.

Chris M

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

More
24 Dec 2017 13:59 #103548 by Askjerry
CHRIS -

You said...

-place an image file in the button using the GLADE editor.
You would need the text in the image


The only indication to place an image is what I see below... and that only places a small image next to the text.


I guess I'll have to learn Python now... from what you are saying... and the referenced web page... it sounds like you rewrite the handler.py file into the folder... and do the changes there. The custom_postgui.hal would modify the AXIS signals... and the handler.py would modify the panel.glade appearance after loading.

If I read that correctly... the WYSIWYG of the GLADE program would not look right until you actually ran it in AXIS.

Sort of what I am doing with pyVCP... write it, look at it, change it... repeat.

Yeah?
Jerry
Attachments:

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

More
24 Dec 2017 19:52 #103571 by cmorley
Jerry:
try selecting 'add custom content', then add an image widget to the button.

Yes WYSIWYG is not quite true... I generally run an editor and a linuxcnc session side by side to see the changes.
Chris M

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

Moderators: mhaberlerHansU
Time to create page: 0.137 seconds
Powered by Kunena Forum