Gmoccapy - A new screen for linuxcnc

More
9 years 2 months ago #97812 by remrendes
Thanks!

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

More
9 years 1 month ago #98374 by Patrik T
I have tried some more to gain control over the Gremlin preview from a custom panel.
I can import your widgets method.
Code:
from gmoccapy import widgets
But this does not work:
Code:
class HandlerClass: def __init__(self, halcomp, builder, useropts): print("%s\n" % widgets.Widgets.__getattr__(self, 'gremlin'))
Not surprising it gives the warning:
TypeError: unbound method __getattr__() must be called with Widgets instance as first argument (got HandlerClass instance instead)

I am only importing the class, I need an instance. I have tried, but not been able to get a reference to any instance outside of the custom panel's top level window.
I feels like the reference has to me sent to my HandlerClass when it is created.

Is there any way to pass an instance reference to Gmoccapy when the custom panel is added into Gmoccapy?

Patrik

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

More
9 years 1 month ago #98380 by newbynobi
Hallo Patrik,

you may change the gmoccapy.py file to expose the Node-ID from gremlin, or you try the way to get first the parrent window like may be so:

toplevel = mywidget.get_toplevel()

and then search in that window for the node ID of gremlin.

All that is only an idea, as I have not tested anythink like that.


Please keep us informed, if you do find a solution.

Norbert

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

More
9 years 1 month ago #98383 by Patrik T
I tried get_toplevel() but it seems I cannot get outside of the custom panel's window,
What is the path to Gmoccapy.py?
Is it read only?

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

More
9 years 1 month ago #98384 by andypugh

newbynobi wrote: toplevel = mywidget.get_toplevel()

and then search in that window for the node ID of gremlin.


This sounds a bit like the problem I had with embedded tabs in Touchy. In that case the containing GUI needed to send signals to the embedded GUI, there is no way that an embedded tab can "climb up the tree" to the containing GUI.

github.com/LinuxCNC/linuxcnc/commit/1bcd...b3ae236486cb45cd0e9e

(Did that system get added to Gmoccapy?)

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

More
9 years 1 month ago #98645 by Patrik T
I got the Gremlin instance id from Gmoccapy to the subprocess. In Gmoccapy I could get the instance back from the id, but in the subprocess the same code did not run. It crashed so hard a try: except: statement could not catch the error :)
Gave up on that and solved it by adding the desired features in Gmoccapy directly.

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

Moderators: newbynobi, HansU
Time to create page: 0.373 seconds
Powered by Kunena Forum