Custom GUI - how to launch Hal Meter, Hal Scope, etc.
08 May 2018 15:34 #110386
by tripwire
Custom GUI - how to launch Hal Meter, Hal Scope, etc. was created by tripwire
I'm using LCNC 2.8-pre and Glade 3.8.6.
I've gotten pretty far along with my stand-alone Glade VCP gui app but can't seem to figure out how to launch Hal Meter, Hal Scope, Status, Config, etc. like Axis does from the "Machine" menu. I've discovered MDI commands such as HALMETER and STATUS that do work as MDI input, but I've tried to add these commands to a vcp mdi action, attached to a menu item, but these fail with messages such as, "interp_error: Unknown word starting with a". ("Normal commands such as G0 X0Y0 *do* work.)
Is there a proper way to do this with a vcp mdi action? Or is there something I can do programmatically in python? (I've tried issuing a self.c.mdi('HALMETER') but get the same error as stated above.)
Thanks as always for any help provided!
Dave L.
I've gotten pretty far along with my stand-alone Glade VCP gui app but can't seem to figure out how to launch Hal Meter, Hal Scope, Status, Config, etc. like Axis does from the "Machine" menu. I've discovered MDI commands such as HALMETER and STATUS that do work as MDI input, but I've tried to add these commands to a vcp mdi action, attached to a menu item, but these fail with messages such as, "interp_error: Unknown word starting with a". ("Normal commands such as G0 X0Y0 *do* work.)
Is there a proper way to do this with a vcp mdi action? Or is there something I can do programmatically in python? (I've tried issuing a self.c.mdi('HALMETER') but get the same error as stated above.)
Thanks as always for any help provided!
Dave L.
Please Log in or Create an account to join the conversation.
08 May 2018 17:56 #110393
by cmorley
Replied by cmorley on topic Custom GUI - how to launch Hal Meter, Hal Scope, etc.
I might suggest looking at gscreen's source code - it was made for producing custom screens.
I'll agree its hard to digest and not well documented.
for instance to load halmeter while using gscreens system would be:
self.gscreen.on_halmeter()
but to answer your question; in python:
p = os.popen("halmeter &")
halscope:
p = os.popen("halscope > /dev/null &","w")
linuxcnc status:
p = os.popen("linuxcnctop > /dev/null &","w")
halshow:
TCLPATH = os.environ
p = os.popen("tclsh %s/bin/halshow.tcl &" % (TCLPATH))
Chris M
I'll agree its hard to digest and not well documented.
for instance to load halmeter while using gscreens system would be:
self.gscreen.on_halmeter()
but to answer your question; in python:
p = os.popen("halmeter &")
halscope:
p = os.popen("halscope > /dev/null &","w")
linuxcnc status:
p = os.popen("linuxcnctop > /dev/null &","w")
halshow:
TCLPATH = os.environ
p = os.popen("tclsh %s/bin/halshow.tcl &" % (TCLPATH))
Chris M
The following user(s) said Thank You: tripwire
Please Log in or Create an account to join the conversation.
08 May 2018 18:04 - 08 May 2018 19:40 #110394
by tripwire
Replied by tripwire on topic Custom GUI - how to launch Hal Meter, Hal Scope, etc.
Thanks for the info, Chris! I'll check those out.
(edit)
checked it out. All the os functions worked great except I had trouble with "halshow". I found an executable file named "halshow" in /usr/bin and called it from python with a simple p = os.popen("/usr/bin/halshow","w"). This worked.
Thanks again!
(edit)
checked it out. All the os functions worked great except I had trouble with "halshow". I found an executable file named "halshow" in /usr/bin and called it from python with a simple p = os.popen("/usr/bin/halshow","w"). This worked.
Thanks again!
Last edit: 08 May 2018 19:40 by tripwire.
Please Log in or Create an account to join the conversation.
09 May 2018 22:00 #110463
by andypugh
Replied by andypugh on topic Custom GUI - how to launch Hal Meter, Hal Scope, etc.
If you don't need them from the GUI you can get them from the terminal.
halcmd loadusr halmeter
I do this a lot, as I tend to use Touchy which doesn't have built-in ways to launch the tools.
halcmd loadusr halmeter
I do this a lot, as I tend to use Touchy which doesn't have built-in ways to launch the tools.
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.065 seconds