Basic Glade/GladeVCP questions

More
24 Feb 2013 16:51 #30517 by DaBit
I have a few Glade/GladeVCP questions. I am pretty sure they are stupid user/beginner level, but I cannot find the answer through the search.

OK, so I made my first GladeVCP panel:



Purpose: a bit what ngcgui does for those 'I want to make simple parts behind the machine without going through CAD/CAM' jobs and a few buttons and sliders for often used functions, and all those in one easily accessible panel.

So far I have only used Glade, no HAL-file or python code yet. Spinners are of type HAL_SpinButton and the buttons execute an EMC MDI action which calls an NGC o-word subroutine like this: 'o<circularpocket> call [${hal_DepthSpin-f}] [${hal_DiameterSpin-f}] [${hal_CutterDiameter-f}]'

It works, but not flawless.

Questions:
- In Glade I can see the default values I set in the GtkAdjustment for the spinner. In GladeVCP (either integrated in axis or separate) the values start at 0.0. How do I set default values?
- I must use the spin up or down buttons next to the spinner at least once, otherwise the value passed to the o-word subroutine is 0.0. I think this is related to the problem above, how do I correct it?
- How would I make the panel useable without using the mouse? I cannot seem to get the focus on the panel in axis unless I click on it.

I have seen BigJohn's tutorial, but it doesn't cover these basic things.

LinuxCNC 2.5.1, glade3 3.6.7 BTW.

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

More
24 Feb 2013 19:49 - 24 Feb 2013 19:56 #30523 by BigJohnT
Axis is a combination that includes Tcl and it doesn't play nice with Gtk all the time. There seem to be some limitations when trying to combine the two.

You mention you want to make the panel mouse free, is this for a touch screen? Would you be interested in testing Touchy + Gremlin (backplot) + pyngcgui?









John
Attachments:
Last edit: 24 Feb 2013 19:56 by BigJohnT.

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

More
25 Feb 2013 03:47 #30534 by DaBit

Axis is a combination that includes Tcl and it doesn't play nice with Gtk all the time. There seem to be some limitations when trying to combine the two.


Hmm. That might be the root cause why I cannot 'tab' into the GladeVCP panel, but I suppose that has not much to do with the default spinner values and the 'must move them before they pass another value than 0.0 to the o-word sub'?

You mention you want to make the panel mouse free, is this for a touch screen?


No, I just prefer to hit a few keys instead of clicking everything with a mouse. While milling it doesn't matter how well you try to evacuate the chips; part of it ends beside the machine anyway. While milling freehand using the NC-control as an advanced power feed even more so.

The (Logitech) washable keyboard stands up to that abuse nicely. The mouse doesn't like chips and is generally a slow method of doing things. Shortcut keys are much faster, and easier to do blindly.

Would you be interested in testing Touchy + Gremlin (backplot) + pyngcgui?


Looks good!
But until I have a touchscreen (I will have one in the future) I think I prefer the regular axis interface with a panel next to it for some often used tasks.

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

More
25 Feb 2013 21:18 #30558 by andypugh

- I must use the spin up or down buttons next to the spinner at least once, otherwise the value passed to the o-word subroutine is 0.0. I think this is related to the problem above, how do I correct it?.

This is also a feature of PyVCP. it is related to a problem of keyboard focus.
Axis uses keyboard shortcuts for jogging, setting modes, setting the feed override etc.
Clicking in a spinbox and entering numbers takes the keyboard focus into the spinbox, and no keypresses can then be seen by Axis. (this includes "ESC" for stopping the machine).
There is an argument that it is a bad idea to be able to type directly into the boxes. This sort-of explains why the problem has not been fixed in a released version, even though there is a fix out there for PyVCP.
There is some discussion here, including a suggestion that it isn't a problem in GladeVCP
en.usenet.digipedia.org/thread/18399/5200/
There is a version of pyvcp_widgets.py here: www.bodgesoc.org/lathe/pyvcp_widgets.py that allows you to use "enter" to set the value, rather than click-up / click-down.
This isn't directly relevant to GladeVCP, but the same change might help (or, perhaps, enter already works in GadeVCP?)

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

More
26 Feb 2013 09:51 #30592 by cmorley

Questions:
- In Glade I can see the default values I set in the GtkAdjustment for the spinner. In GladeVCP (either integrated in axis or separate) the values start at 0.0. How do I set default values?
- I must use the spin up or down buttons next to the spinner at least once, otherwise the value passed to the o-word subroutine is 0.0. I think this is related to the problem above, how do I correct it?
- How would I make the panel useable without using the mouse? I cannot seem to get the focus on the panel in axis unless I click on it.

I have seen BigJohn's tutorial, but it doesn't cover these basic things.

LinuxCNC 2.5.1, glade3 3.6.7 BTW.


www.linuxcnc.org/docs/2.5/html/gui/glade...ies_programmatically

Maybe this would help.

Chris M

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

More
26 Feb 2013 23:11 - 26 Feb 2013 23:11 #30618 by DaBit

Clicking in a spinbox and entering numbers takes the keyboard focus into the spinbox, and no keypresses can then be seen by Axis. (this includes "ESC" for stopping the machine).
There is an argument that it is a bad idea to be able to type directly into the boxes. This sort-of explains why the problem has not been fixed in a released version


Well, I think that decision should be at the user/integrator level and not at development level.
If I really want the machine to stop, I use the external Estop button. Other than that, 'typing a number, tab, typing a number, tab, typing a number, tab, hit enter' is a very convenient way to execute a 'wizard'

There is some discussion here, including a suggestion that it isn't a problem in GladeVCP


I can enter a number in the boxes, no problem there. But without using the spin buttons, ${SpinnerName-f} returns 0.0

Now that I think about it: do I have to hit 'enter' before Glade accepts it? Normally I 'tab' or mouseclick into the box, enter the number, and tab/mouseclick away again to the next box. Might be a 'stupid user error' after all...

Maybe this would help.


Yes, maybe it does. I liked the fact that I could just throw some UI elements together in Glade designer and use an EMC MDI action to call an o-word sub with the parameters in the input boxes. It doesn't get simpler than that.
But maybe adding a bit of python is not a bad idea after all. I haven't written a single line of pyhon in my life, but once you know one programming language the rest is usually just a variation.
Last edit: 26 Feb 2013 23:11 by DaBit.

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

More
26 Feb 2013 23:27 #30625 by mhaberler
re user/integrator decisions - yes you can:

please read section 11 here: www.linuxcnc.org/docs/2.5/html/gui/glade...key_handling_in_axis

and have a look at git.linuxcnc.org/gitweb?p=linuxcnc.git;a...05d2d6eb0b7751cd07e3

There is limited leeway to adapt things though - the GUI toolkit in Axis is outdated, and I do not expect a working Xembed solution for Tkinter to become available.

Your best option would be to consider all-GTK GUIs like Screen or Touchy.

- Michael

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

More
26 Feb 2013 23:51 - 26 Feb 2013 23:51 #30626 by DaBit
OK, at least I read an answer to one of my questions, so thanks! Missed that somehow.

6. I defined a hal_spinbutton widget in glade, and set a default value property in the corresponding adjustment. It comes up with zero?

this is due to a bug in the old Gtk version distributed with Ubuntu 8.04 and 10.04, and is likely to be the case for all widgets using adjustment. The workaround mentione for instance in osdir.com/ml/gtk-app-devel-list/2010-04/msg00129.html does not reliably set the HAL pin value, it is better to set it explicitly in an on_realize signal handler during widget creation. See the example in configs/gladevcp/by-widget/spinbutton.


A bit of Python is needed, I suppose. Never done Python before, but I will learn.

Might be that the 'have to hit a spin button otherwise it reports 0.0'-issue is linked to having to press enter or something like that. Will try that at home. If that is the case, I suppose that a bit of Python can fix it too.
Last edit: 26 Feb 2013 23:51 by DaBit.

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

Moderators: HansU
Time to create page: 0.416 seconds
Powered by Kunena Forum