GScreen and some understanding gap of hal-widgets

More
20 Jun 2019 06:25 #137346 by cmorley
Nice consistent button theme!

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

More
20 Jun 2019 08:47 #137352 by Reinhard
Thank you :)

I found this hint for replacing widgets, but it does not work for me.
I probabely did some mistake, but I'm unable to find it.
I use a togglebutton to replace the dro with a textfield and on retoggle replace the textfield with the dro.
Visual effect is: the dro disappears from screen and all other dros slide topwards. On retoggle the dro fills the original place and all looks like expected.

This is the code:
def on_sk03_toggled(self, button):
        if (button.get_active()):
            self.droX = self.w.dro_x_rel
            container = self.droX.parent
            # moved to __init__
#            self.xTF = gtk.Entry()
            self.xTF.set_text(self.droX.get_label())
            props = {}
            for pspec in gtk.container_class_list_child_properties(container):
                props[pspec.name] = container.child_get_property(self.droX, pspec.name)
            gtk.Container.remove(container, self.droX)
            container.add(self.xTF)
            for name, value in props.items():
                container.child_set_property(self.xTF, name, value)
            print('current x value: ')
            print(self.droX.get_label())
        else:
            print('user entered: ')
            print(self.xTF.get_text())
            print('droXrel value: ')
            print(self.droX.get_label())
            container = self.xTF.parent
            props = {}
            for pspec in gtk.container_class_list_child_properties(container):
                props[pspec.name] = container.child_get_property(self.xTF, pspec.name)
            gtk.Container.remove(container, self.xTF)
            container.add(self.droX)
            for name, value in props.items():
                container.child_set_property(self.droX, name, value)
Terminal output is as expected, so the textfield is created and operable
current x value: 
     0.000
user entered: 
     0.000
droXrel value: 
     0.000

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

More
20 Jun 2019 12:34 #137372 by cmorley
Just a guess, try changing code to:
            container.add(self.xTF)
            self.xTF.show()
            for name, value in props.items():

Chris M

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

More
20 Jun 2019 15:42 #137394 by Reinhard
Thank you! That did the trick :)
didn't know, that each widget needs its own show() call.

Actually I have another problem. Homing does not work any more.
I added some print statements to hal_action to verify, that the action gets called and the print statements raised their output to terminal (function entry and mode was checked).

I can't see any other errors, so what could go wrong, that linuxcnc does not home?
I'm stil working with simulation ...

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

More
21 Jun 2019 04:03 #137447 by cmorley
If you built the widgets outside of GLADE then you must call show() or show_all()
gscreen calls show_all() after the GLADE widgets are loaded.

homing can fail you are not in the right mode - the details of which I can't remember at the moment. Did you add any code that might have changed the mode?
If you have an MDI widget and type STATUS in it, it will pop a window that displays linuxcnc status so you can we whats going on.

Chris M

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

More
21 Jun 2019 04:24 #137450 by Reinhard
Hi Chris,

i changed hal_action (on_activate of EMC_Action_Home) like this:
def on_activate(self, w):
        #if not manual_ok(): return
        if ensure_mode(self.stat, self.linuxcnc, linuxcnc.MODE_MANUAL):
            print('Action-Home: mode is manual')
        else:
            print('Action-Home: mode is NOT manual')
and Terminal says:
Action-Home: mode is manual

Therefore I'm confused

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

More
21 Jun 2019 05:54 #137454 by cmorley
If you are willing to post your GLADE and handler files - I could look into it for you.

Chris M

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

More
21 Jun 2019 06:12 #137456 by Reinhard
Hi,

I enabled Debug output and examined the output.
I did not find the reason, why homing won't work, but found some strange looking things. Don't know, which of them might be important ...
I wanted to put the logs in a code-box, but that box has no line-numbers ... :(
... so I attach the log

linuxcnc has no path (line 3, 6 and 8)
linuxcnc looses version information (line 17 and 28 / 35)
emcTrajSetAccel looks very strange (line 47 and 48)

line 216 home button was pressed
... and line 288 is the print output from Home-Action (hal_action)
.

- I could look into it for you

What a great offer! Thank you very much!
Attachments:

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

More
22 Jun 2019 01:29 #137536 by cmorley
You said you were using a sim config but sent a pncconf config. The pncconf config has no homing sequence info so using home-all (in your GLADE file) won't do anything.

Using your GLADE and handler file with Gscreen's tester sim config, the machine homes xy and z

Chris M

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

More
22 Jun 2019 08:25 #137568 by Reinhard
Hi Chris,

thank you for that info. That helped my find the missing config lines.

I beg your pardon - there's so much, I don't know.
I wanted to finish screen work before I start with hw-dedication ...
I created configurations for both machine types I'm interested in (Gantry XYYZA and vertical mill with XYZWA).
pncconf does not support any of them, so I created a xyyza and changed the rest manually.

adding core_sim9.hal I thought, I have support for 9 axis.
But when I start gui and press home, the z-axis homes and than I get the error
11 motion stop at referencestatus 7
... and I have no idea, what that means.

When I start gui with my pncconf-created config I get the error:
hm2_pci: rtapi_app_main: No such device (-19)

So what's the best way to get a simulation setup for the configurations I want to test?

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

Time to create page: 0.087 seconds
Powered by Kunena Forum