Hi. This is dhanger's son, Caleb. Last March he posted (page 130 of this thread) about trying to get a button into gmoccapy to control his spindle brake. I am trying to help him with this endeavor as I am pretty expert with Linux (which he doesn't use at all beyond LinuxCNC) and also have a much deeper background in programming.
Mostly hoping that newbynobi can chime in on this; your help would be most appreciated!
I have created a glade file called spindle_brake_button.glade which contains "window1" (I read that GladeVCP expects the exact name "window1") and within that window I made a single HAL toggle button, named spindle_brake_button and labeled "Spindle Brake". His main config files for his machine are dm4400.ini and dm4400.hal. After backing these up, I added the EMBED lines into dm4400.ini as follows:
Code:
EMBED_TAB_NAME = spindle_brake_button
EMBED_TAB_LOCATION = custom_box_4
EMBED_TAB_COMMAND = gladevcp -x {XID} -H spindle_brake_button.hal spindle_brake_button.glade
When I start LinuxCNC using the dm4400 configuration, the button loads and displays to the right of the other spindle controls, so that much is working perfectly. What I'm not sure how to do is correctly connect the new button to the spindle brake itself in the spindle_brake_button.hal file. I see in dm4400.hal the following lines relevant to the spindle brake:
Code:
net spindle-brake <= motion.spindle-brake
...
Code:
net spindle-brake => parport.0.pin-08-out
I have tried numerous different contents for spindle_brake_button.hal. At first, I had put the button into the window with no "container" since all we needed was the one button. So it was just window1 containing spindle_brake_button. In that setup, I tried all of the following for spindle_brake_button.hal:
Code:
net spindle_brake_button spindle_brake_button => gmoccapy.spindle_brake
Code:
net spindle_brake_button spindle_brake_button => spindle_brake
Code:
net spindle_brake_button => gmoccapy.spindle_brake
All of these attempts result in the button *not* being displayed in the interface when loaded. I thought, "Well, maybe it *needs* the button to be inside another container within the window." So I added a vertical box with only one slot, called vbox1, and placed the button inside of *that*. Then I tried all the following for spindle_brake_button.hal:
Code:
net spindle_brake_button vbox1.spindle_brake_button => gmoccapy.spindle_brake
Code:
net spindle_brake_button vbox1.spindle_brake_button => spindle_brake
Code:
net vbox1.spindle_brake_button => gmoccapy.spindle_brake
All of these attempts resulted in the same thing -- the button no longer displays at all in the interface. If spindle_brake_button.hal is empty, or has a commented line, the button loads fine, but of course does nothing.
Can anyone (especially newbynobi) give me any pointers? Many thanks to any/all!
Cheers,
Caleb