Adding a button to Gmoccapy

  • LearningLinuxCNC
  • LearningLinuxCNC's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 Jul 2015 00:25 #60546 by LearningLinuxCNC
Adding a button to Gmoccapy was created by LearningLinuxCNC
I need to add a button that will release the spindle brake if I want to change to the back gear on my spindle head. There is a check box for this in Axis but I don't see any means of doing this with the stock Gmoccapy screen.

I am curious about the best way to add a button to Gmoccapy. Do I need to make a new glade panel that will be located to the right of the main Gmoccapy screen or can I add the button directly on the Gmoccapy screen?

I am running 2.6.8.

Also I installed from the ISO on the webpage. Where are the locations of the source code for LinuxCNC on the install? Do I have to download them separate?

Is the glade editor installed with the ISO image the proper one for making a side panel? It say it is version 3.8.0. From what I can tell on the Glade wepbage this appears to be right for GTK+2.

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

More
11 Jul 2015 21:57 #60566 by newbynobi
Replied by newbynobi on topic Adding a button to Gmoccapy
Hallo Nitro,

both is possible.

You do find the gmoccapy.glade file at
/usr/share/gmoccapy

You may use the glade esitor to modify that file. Please backup it before any change, do not delete or rename objects. Just find a place for your convinient to add the checkbox.

Or you just make your own panel with the glade editor and add that one as an embedded tab, what would be the recomendet way, as otherwise every update will undo your changes to the origin glade file. You will find the doku to add a user panel and the possible locations within the documentation or at the WIKI.

Norbert

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

  • LearningLinuxCNC
  • LearningLinuxCNC's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
11 Jul 2015 22:54 #60568 by LearningLinuxCNC
Replied by LearningLinuxCNC on topic Adding a button to Gmoccapy
Thanks Norbert,

I already started on the right side panel. This is what I have so far.



What I would like to know now is if there is a way to turn off the button when the spindle starts? Is there or can I make an input pin to the HALtogglebutton that I can set based on an output in HAL in such as motin.spindle-on?

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

More
12 Jul 2015 01:02 #60570 by newbynobi
Replied by newbynobi on topic Adding a button to Gmoccapy
Hallo,

I would recommend not to use right panel, but better the custom box 3 or custom box 4, as you will save space.

See: Side Panels

and to make the widgets sensitive or not, just use a hal_sensitive container:

see: Hal Tables

Norbert
The following user(s) said Thank You: LearningLinuxCNC

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

  • LearningLinuxCNC
  • LearningLinuxCNC's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
12 Jul 2015 04:21 - 12 Jul 2015 04:22 #60573 by LearningLinuxCNC
Replied by LearningLinuxCNC on topic Adding a button to Gmoccapy

I would recommend not to use right panel, but better the custom box 3 or custom box 4, as you will save space.


I will definitely give that a try.

and to make the widgets sensitive or not, just use a hal_sensitive container:


I will also use this. But what I was wanting to do is to actually toggle the button if the spindle is started. So if I have the spindle brake override button pressed it will unpress it when the spindle starts. This will mimic the behavior of the check box in Axis. If the check box is manually unchecked and the spindle is started and stopped then the spindle brake will come on again. With my button if I have the button pressed it will override the spindle brake until the button is unpressed.

I hope this makes sense. From what it appears I will have to write some python code somewhere to do this. I am drawing this from the following statement in the glade vcp manual section.

As a general rule, if you need to set a HAL output widget’s value from Python code, do so by calling the underlying Gtk setter (e.g. set_active(), set_value()) - do not try to set the associated pin’s value by halcomp[pinname] = value directly because the widget will not take notice of the change!.


Is this correct? I don't quite understand where to put this Python code.

Sorry for all the questions but I am learning as I go.
Last edit: 12 Jul 2015 04:22 by LearningLinuxCNC.

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

More
13 Jul 2015 04:37 #60600 by newbynobi
Replied by newbynobi on topic Adding a button to Gmoccapy
Did you read This ?

Norbert

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

  • LearningLinuxCNC
  • LearningLinuxCNC's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
13 Jul 2015 05:30 #60602 by LearningLinuxCNC
Replied by LearningLinuxCNC on topic Adding a button to Gmoccapy
I am reading more and more. Sometimes it is difficult to put the pieces together. But I think I am getting the gist of it. I will ask more questions as I run into roadblocks.

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

  • LearningLinuxCNC
  • LearningLinuxCNC's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
13 Jul 2015 09:45 #60608 by LearningLinuxCNC
Replied by LearningLinuxCNC on topic Adding a button to Gmoccapy
So here is the latest version using the custom_box_4 panel location. It looks pretty good. I was wondering what is the best way to change the background color of my glade window so that it matches the rest of the panels in the gmoccapy interface?

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

Moderators: newbynobiHansU
Time to create page: 0.065 seconds
Powered by Kunena Forum