Adding a button to Gmoccapy
- LearningLinuxCNC
- Topic Author
- Offline
- Platinum Member
- Posts: 320
- Thank you received: 48
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.
- newbynobi
- Offline
- Moderator
- Posts: 2075
- Thank you received: 406
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
- Topic Author
- Offline
- Platinum Member
- Posts: 320
- Thank you received: 48
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.
- newbynobi
- Offline
- Moderator
- Posts: 2075
- Thank you received: 406
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
Please Log in or Create an account to join the conversation.
- LearningLinuxCNC
- Topic Author
- Offline
- Platinum Member
- Posts: 320
- Thank you received: 48
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.
Please Log in or Create an account to join the conversation.
- newbynobi
- Offline
- Moderator
- Posts: 2075
- Thank you received: 406
Please Log in or Create an account to join the conversation.
- LearningLinuxCNC
- Topic Author
- Offline
- Platinum Member
- Posts: 320
- Thank you received: 48
Please Log in or Create an account to join the conversation.
- LearningLinuxCNC
- Topic Author
- Offline
- Platinum Member
- Posts: 320
- Thank you received: 48
Please Log in or Create an account to join the conversation.