[Yes. YES.] Is there a way to display the current UCS [G5n setting] in AXIS?

More
14 Apr 2020 21:37 - 14 Apr 2020 21:43 #163984 by cmorley

Qtvcp? different than PyVCP? than GladeVCP?

I sense a pattern, but can't put my finger on it, because I don't recognize Qt and Glade as programming languages. Are they?


Display Toolkits is a good description. Qtvcp uses python/Qt,, pyvcp uses python and tkinter and gladevcp uses python/gtk2 with the GLADE editor.

vcp is virtual control panel.

Chrsi
Last edit: 14 Apr 2020 21:43 by cmorley.

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

More
14 Apr 2020 21:43 #163985 by cmorley
The python module has the info you need.
linuxcnc.org/docs/2.7/html/config/python...ding_linuxcnc_status

specifically the attribute: g5x_index

You then use gladevcp's handler file option to poll the linuxcnc python module to get the UCS and display it with a gladevcp widget.

Gstat does the same thing in possibly a neater fashion but is not available (for that attribute) in 2.7

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

More
15 Apr 2020 01:43 #164000 by phillc54
Entering the following in ~/.axisrc or a USER_COMMAND_FILE will give you a label on the F3 tab with the current UCS.
W = root_window.tk.call
W('label','.pane.top.tabs.fmanual.jogf.zerohome.ucs','-text','G5x')
W('grid','.pane.top.tabs.fmanual.jogf.zerohome.ucs','-column','0','-row','2','-sticky','w')

def user_live_update():
    W('.pane.top.tabs.fmanual.jogf.zerohome.ucs','configure','-text','UCS: ' + all_systems[o.last_g5x_index].split()[1])
The following user(s) said Thank You: MaHa

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

More
15 Apr 2020 02:52 #164004 by cmorley
yaay - Phill swoops in with AXIS code again! :)

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

More
15 Apr 2020 04:36 - 15 Apr 2020 04:39 #164018 by clunc
In. Deed! I been swooped sure enough. I just appended it to what I found already in .axisrc (a single line, which was already a root_window.tk.call) and it worked! (This would be the TCL/TK approach, right?)

I couldn't see it at first, because I was looking for it in the "graphic" model-Preview window, but lo, there it is! nestled under the "Home All" button. Byoo tee full. [See attachment. Shameless plug of one of my cool topo maps.]

Thank you Phil.

(Persons-in-charge, Chris?, LinuxCNC really ought to come with this improvement as the default.)

Happy Easter all! (I know I'm happy.)

(My gut told me it just had to be trivial, and after my gut scoured Phil's codette, it freely admits it was stark-raving wrong. Trivial never looked sooo comblicated.)
Attachments:
Last edit: 15 Apr 2020 04:39 by clunc. Reason: change title

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

More
15 Apr 2020 04:43 #164019 by phillc54
Actually you could change:
W('label','.pane.top.tabs.fmanual.jogf.zerohome.ucs','-text','G5x')
to:
W('label','.pane.top.tabs.fmanual.jogf.zerohome.ucs')
The text was just for testing...

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

More
15 Apr 2020 05:05 #164020 by clunc
Not me. I'm using it as it was presented to me by my bff. :^D

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

More
15 Apr 2020 13:14 - 15 Apr 2020 22:16 #164059 by MaHa
Thanks a lot for this code. I tried it in my sim, 2.7.15. The dispayed Gn was always 1 ahead, eg. G57 in effect, G58 displayed. So i changed this line

W('.pane.top.tabs.fmanual.jogf.zerohome.ucs','configure','-text','UCS: ' + all_systems[o.last_g5x_index].split()[1])
to
W('.pane.top.tabs.fmanual.jogf.zerohome.ucs','configure','-text','UCS: ' + all_systems[o.last_g5x_index-1].split()[1])

and it is displaying the active UCS now.
Last edit: 15 Apr 2020 22:16 by MaHa.

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

More
15 Apr 2020 22:34 #164092 by phillc54
Interesting, I didn't try it with running gcode, just MDI commands.

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

More
27 Dec 2020 11:41 #193289 by nau
Dear Phil

Thank you. Wonder where all_systems[o.last_g5x_index].split()[1]) comes from? I mean can't find that in docs.
Or maybe would you be so kind help me to print spindle speed in same style?

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

Time to create page: 1.061 seconds
Powered by Kunena Forum