Gremlin widget following the current tool location

More
29 Nov 2018 00:14 - 11 Dec 2018 04:28 #121567 by Nico2017
Hi,
I would like to be able to have the preview of a gremlin widget part of a glade project that follows at any time the tool position.
In other word the preview should be centered on the current tool location. Is that possible?

Before doing it on a continuous way, I have set up a button for development and maybe final use, which runs the command once clicked, so it "recenter" the preview.. I have been trying some commands in the associated python file related to the gremlin:

def on_hal_Center_clicked(self, widget, data=None):
self.gremlin.set_mouse_start(0,0)
self.gremlin.pan(-self.status.actual_position[0],-self.status.actual_position[1])
but this does not actually work as I would expect. The view is moving, but in an expected location and cannot work the pattern to find out how the coordinates should be entered.

Anyone would be able to explain a bit more the coordinates system used for the set_mouse_start and pan command. Can those coordinates be actually based on the physical coordinates of the tool?

I have also been looking at the pydoc gremlin without finding anything obvious method that could be used appart from
self.gremlin.set_centerpoint(1000,1000,100)
self.gremlin.set_eyepoint(0)
But again this does not give me an expected results.

Thank you for your help,

Nicolas
Last edit: 11 Dec 2018 04:28 by Nico2017. Reason: More specific question

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

More
29 Jan 2019 04:29 #125128 by Nico2017
Hi,
would anyone have more information about how to use:
[widget name].set_mouse_start(0,0)
[widget name].rotate_view(x,y)
[widget name].pan(x,y)

Thank you,
Nicolas

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

More
29 Jan 2019 07:09 #125136 by cmorley
These function are found in src/emc/usr_intf/gremlin.py

They call functions found in lib/python/glnav

I don't know how to translate mouse/screen position to linuxcnc coordinate system
Do I understand right - you want the tool to stay in center and the program 'body' move around it?

Chris M

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

More
29 Jan 2019 07:45 #125139 by Nico2017
Yeah, that is the idea, the tool would remain at any time in the center of the gremlin display and the program 'body' move around it.

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

Moderators: HansU
Time to create page: 0.074 seconds
Powered by Kunena Forum