Switch between AXIS tabs with GladeVCP button?
31 Jan 2019 03:09 #125369
by pferrick
Replied by pferrick on topic Switch between AXIS tabs with GladeVCP button?
That works just fine, Phill...thank you very much! Now to see about getting everything ON the tabs to work correctly! (that's mostly a solved problem, fortunately)
Patrick
Patrick
The following user(s) said Thank You: phillc54
Please Log in or Create an account to join the conversation.
01 Feb 2019 03:51 #125448
by phillc54
Chris,
I have put some odds and ends together, how/where would you like me to send them?
Cheers, Phill.
Replied by phillc54 on topic Switch between AXIS tabs with GladeVCP button?
cmorley wrote:
We should collect your code snippets and add it to the official docs.
they are very useful
Chris,
I have put some odds and ends together, how/where would you like me to send them?
Cheers, Phill.
Please Log in or Create an account to join the conversation.
01 Feb 2019 06:29 #125451
by cmorley
Replied by cmorley on topic Switch between AXIS tabs with GladeVCP button?
If you are a member of the linuxcnc maillist you could email me there or for convenience you could compress them and post them here.
Chris M
Chris M
Please Log in or Create an account to join the conversation.
08 Feb 2019 02:03 #125969
by pferrick
Replied by pferrick on topic Switch between AXIS tabs with GladeVCP button?
Hi Phill-
Since you so generously provided the modifications to .axisrc that enabled me to switch AXIS tabs via HAL buttons, I have been busy whipping up a very nice GladeVCP panel.
I've just noticed something, though, that has me stumped and I am hoping that you'd be willing to shed just a bit more light on it.
When I open a g-code file, I see the blue progress bar go all the way across the bottom of the screen as well as the correct preview (the backplot)...but then I see a floating hourglass and things stay that way indefinitely! Interestingly, everything on my GladeVCP panel seems to still work. Through a fairly laborious process of commenting out one thing at a time, I have determined that the code added to .axisrc is somehow directly related to this behavior.
If, when you have a spare moment you could take a look at my .axisrc (and hopefully suggest a modification) I would be extremely grateful.
Thanks again,
Patrick
ps - had a bunch of difficulty trying to add .axisrc, or even axisrc (it seems as though you MUST include an acceptable extension....!) Didn't want you to think I actually called it axisrc.h
Since you so generously provided the modifications to .axisrc that enabled me to switch AXIS tabs via HAL buttons, I have been busy whipping up a very nice GladeVCP panel.
I've just noticed something, though, that has me stumped and I am hoping that you'd be willing to shed just a bit more light on it.
When I open a g-code file, I see the blue progress bar go all the way across the bottom of the screen as well as the correct preview (the backplot)...but then I see a floating hourglass and things stay that way indefinitely! Interestingly, everything on my GladeVCP panel seems to still work. Through a fairly laborious process of commenting out one thing at a time, I have determined that the code added to .axisrc is somehow directly related to this behavior.
If, when you have a spare moment you could take a look at my .axisrc (and hopefully suggest a modification) I would be extremely grateful.
Thanks again,
Patrick
ps - had a bunch of difficulty trying to add .axisrc, or even axisrc (it seems as though you MUST include an acceptable extension....!) Didn't want you to think I actually called it axisrc.h
Attachments:
Please Log in or Create an account to join the conversation.
08 Feb 2019 02:38 #125971
by pferrick
Replied by pferrick on topic Switch between AXIS tabs with GladeVCP button?
Here is the relevant part of my .ini file, which might be helpful. (But as I mentioned before, I tried running AXIS without any of these tabs etc. and still had the problem, so perhaps it isn't so necessary.)
[DISPLAY]
DISPLAY = axis
# add GladeVCP panels...
GLADEVCP = -d -u pkf.py geometry_test.glade
EMBED_TAB_NAME = Probe
EMBED_TAB_COMMAND = halcmd loadusr -Wn ppp gladevcp -c ppp -x {XID} -u probe.py pkf_probe2.glade
EMBED_TAB_NAME = Toolchanger
EMBED_TAB_COMMAND = halcmd loadusr -Wn ttt gladevcp -c ttt -x {XID} toolchange.glade
EMBED_TAB_NAME = Camera
EMBED_TAB_COMMAND = halcmd loadusr -Wn ccc gladevcp -c ccc -x {XID} camera.glade
EMBED_TAB_NAME = File Open
EMBED_TAB_COMMAND = halcmd loadusr -Wn fff gladevcp -c fff -x {XID} -u file.py file.glade
EMBED_TAB_NAME = Calculator
EMBED_TAB_COMMAND = halcmd loadusr -Wn rrr gladevcp -c rrr -x {XID} calculator.glade
Please Log in or Create an account to join the conversation.
08 Feb 2019 02:39 #125972
by phillc54
Replied by phillc54 on topic Switch between AXIS tabs with GladeVCP button?
I created a seven button GladeVCP panel and ran it with an Axis sim but could not find a problem.
Could you post your complete config.
Cheers, Phill.
Could you post your complete config.
Cheers, Phill.
Please Log in or Create an account to join the conversation.
08 Feb 2019 03:30 #125973
by pferrick
Replied by pferrick on topic Switch between AXIS tabs with GladeVCP button?
Hi-
Thanks very much for taking a look. I'll try to get the whole config put together tonight, but if I don't quite get to it (I have a bunch of somewhat (!) more important "real" work to attend to) I will put it up tomorrow.
regards,
Patrick
Thanks very much for taking a look. I'll try to get the whole config put together tonight, but if I don't quite get to it (I have a bunch of somewhat (!) more important "real" work to attend to) I will put it up tomorrow.
regards,
Patrick
Please Log in or Create an account to join the conversation.
08 Feb 2019 03:58 #125975
by phillc54
Replied by phillc54 on topic Switch between AXIS tabs with GladeVCP button?
I forgot to ask, does this problem occur with every gcode file or one specific file.
Please Log in or Create an account to join the conversation.
08 Feb 2019 22:58 #126022
by pferrick
Replied by pferrick on topic Switch between AXIS tabs with GladeVCP button?
Hi again Phill-
The problem occurs with any g-code file. And I've narrowed the problem down (possibly!) to the number of TAB entries in the .axisrc file. I've zipped the whole config with a 'working' and a 'not working' version of .axisrc.
I've tried many combinations of 'if happy' entries. It seems as though things are OK with two (either the non-user preview and DRO tabs OR any two user tabs). Adding a third entry (either one user tab along with preview + DRO -or- three user tabs) seems to trigger the problem. Hopefully that's a clue that will mean more to you than it does to me!!!!
Let's hope that you can re-create the problem, anyway.
Thanks again,
Patrick
The problem occurs with any g-code file. And I've narrowed the problem down (possibly!) to the number of TAB entries in the .axisrc file. I've zipped the whole config with a 'working' and a 'not working' version of .axisrc.
I've tried many combinations of 'if happy' entries. It seems as though things are OK with two (either the non-user preview and DRO tabs OR any two user tabs). Adding a third entry (either one user tab along with preview + DRO -or- three user tabs) seems to trigger the problem. Hopefully that's a clue that will mean more to you than it does to me!!!!
Let's hope that you can re-create the problem, anyway.
Thanks again,
Patrick
Attachments:
Please Log in or Create an account to join the conversation.
09 Feb 2019 03:32 - 09 Feb 2019 03:41 #126030
by phillc54
Replied by phillc54 on topic Switch between AXIS tabs with GladeVCP button?
This seems to be caused by using Popen as a workaround to read HAL pins for LinuxCNC 2.7.
I guess it is some sort of timing issue.
If we scan four or less buttons per cycle time we can get it to work consistently.
Note that you have a couple less buttons than tabs.
The following workaround for the workaround seems to behave (for 2.7):
LinuxCNC Master branch does not exhibit this problem using the hal module to read pins.
The following code seems to work ok (for master branch):
Cheers, Phill.
I guess it is some sort of timing issue.
If we scan four or less buttons per cycle time we can get it to work consistently.
Note that you have a couple less buttons than tabs.
The following workaround for the workaround seems to behave (for 2.7):
Warning: Spoiler!
# for switching tabs via HAL buttons in GladeVCP panel
from subprocess import Popen, PIPE
scanNumber = 0
def user_live_update():
global scanNumber
try:
happy = hal.component_exists('gladevcp')
if happy:
if scanNumber == 0:
if Popen('halcmd getp gladevcp.backplot',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE':
root_window.tk.call('.pane.top.right','raise','preview')
# there is no gladevcp button for this...
#if Popen('halcmd getp gladevcp.dro',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE':
# root_window.tk.call('.pane.top.right','raise','numbers')
if Popen('halcmd getp gladevcp.probe',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE':
root_window.tk.call('.pane.top.right','raise','user_0')
if Popen('halcmd getp gladevcp.toolchange',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE':
root_window.tk.call('.pane.top.right','raise','user_1')
scanNumber = 1
else:
# there is no gladevcp button for this...
#if Popen('halcmd getp gladevcp.camera',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE':
# root_window.tk.call('.pane.top.right','raise','user_2')
if Popen('halcmd getp gladevcp.file',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE':
root_window.tk.call('.pane.top.right','raise','user_3')
if Popen('halcmd getp gladevcp.calculator',stdout=PIPE,shell=True).communicate()[0].strip() == 'TRUE':
root_window.tk.call('.pane.top.right','raise','user_4')
scanNumber = 0
except Exception:
traceback.print_exc()
# remove "do you really want to exit?"
root_window.tk.call("wm","protocol",".","WM_DELETE_WINDOW","destroy .")
# start fullscreen
root_window.tk.call("wm","geometry",".","1920x1000")
# root_window.attributes("-fullscreen",1)
LinuxCNC Master branch does not exhibit this problem using the hal module to read pins.
The following code seems to work ok (for master branch):
Warning: Spoiler!
# for switching tabs via HAL buttons in GladeVCP panel
def user_live_update():
try:
if hal.get_value('gladevcp.backplot'):
root_window.tk.call('.pane.top.right','raise','preview')
# there is no gladevcp button for this...
#if hal.get_value('gladevcp.dro'):
# root_window.tk.call('.pane.top.right','raise','numbers')
if hal.get_value('gladevcp.probe'):
root_window.tk.call('.pane.top.right','raise','user_0')
if hal.get_value('gladevcp.toolchange'):
root_window.tk.call('.pane.top.right','raise','user_1')
scanNumber = 1
# there is no gladevcp button for this...
#if hal.get_value('gladevcp.camera'):
# root_window.tk.call('.pane.top.right','raise','user_2')
if hal.get_value('gladevcp.file'):
root_window.tk.call('.pane.top.right','raise','user_3')
if hal.get_value('gladevcp.calculator'):
root_window.tk.call('.pane.top.right','raise','user_4')
scanNumber = 0
except:
pass
#remove "do you really want to exit?"
root_window.tk.call("wm","protocol",".","WM_DELETE_WINDOW","destroy .")
#start fullscreen
root_window.tk.call("wm","geometry",".","1920x1000")
#root_window.attributes("-fullscreen",1)
Cheers, Phill.
Last edit: 09 Feb 2019 03:41 by phillc54.
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds