Gmoccapy - A new screen for linuxcnc

More
9 years 1 month ago - 9 years 1 month ago #98666 by newbynobi
Plesse post the changes you did, i will rewiew them and check if it can be integraler as standard code

Norbert
Last edit: 9 years 1 month ago by newbynobi.

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

More
9 years 1 month ago #98715 by Patrik T
Thanks, but you do not have to do that. It is just adding a few pins that clear and zoom the Gremlin view.

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

More
9 years 1 month ago #98717 by andypugh

Patrik T wrote: Thanks, but you do not have to do that. It is just adding a few pins that clear and zoom the Gremlin view.


If you wanted them, then why do you assume that nobody else wants them?

This is Open Source, and Active open source. If one user wants it, we tend to assume that two or more users want it.

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

More
9 years 1 month ago - 9 years 1 month ago #98718 by Patrik T
Point taken.

On line 450
Code:
#My edit ################################################################### cnc_ini = linuxcnc.ini(os.environ['INI_FILE_NAME']) self.gx = 0 self.gy = 0 self.d_zoom = self.widgets.gremlin.get_zoom_distance() self.pan_speed = float(cnc_ini.find('GREMLIN_JOY', 'PAN_SPEED') or 50) self.zoom_speed = float(cnc_ini.find('GREMLIN_JOY', 'ZOOM_SPEED') or 0.5) ###################################################################

On line 4148
Code:
################################################################# # Gremlin, zoom, pan, clear. ################################################################# def _on_gremlin_io(self, hal_pin, data=None): halpin = hal_pin.get() # print("gremlin_io pin changed to %d." % halpin) if halpin == 0: return elif halpin == 1: self.gx = self.gx + self.gremlin_joyz_pos.get() * self.pan_speed self.gy = self.gy + self.gremlin_joyx_pos.get() * self.pan_speed self.widgets.gremlin.pan(self.gx, self.gy) elif halpin == 2: self.d_zoom = self.widgets.gremlin.get_zoom_distance() * (1 + self.gremlin_joyx_pos.get() * self.zoom_speed) if self.d_zoom < 0.1: self.d_zoom = 0.1 self.widgets.gremlin.set_zoom_distance(self.d_zoom) elif halpin == 3: self.widgets.gremlin.clear_live_plotter() self.widgets.gremlin.set_zoom_distance(self.d_zoom) self.widgets.gremlin.pan(self.gx, self.gy) elif halpin == 4: self.d_zoom = self.widgets.gremlin.get_zoom_distance() self.widgets.gremlin.pan(0, 0) hal_pin.set(0) # We need extra HAL pins here is where we do it. # we make pins for the hardware buttons witch can be placed around the # screen to activate the coresponding buttons on the GUI def _init_hal_pins( self ): ################################################################# # My pins. ################################################################# self.gremlin_joyx_pos = hal_glib.GPin(self.halcomp.newpin('gremlin-joyx-pos', hal.HAL_FLOAT, hal.HAL_IN)) self.gremlin_joyz_pos = hal_glib.GPin(self.halcomp.newpin('gremlin-joyz-pos', hal.HAL_FLOAT, hal.HAL_IN)) self.gremlin_io = hal_glib.GPin(self.halcomp.newpin('gremlin-io', hal.HAL_S32, hal.HAL_IO)) self.gremlin_io.connect('value-changed', self._on_gremlin_io) #################################################################
Last edit: 9 years 1 month ago by Patrik T. Reason: Added a code line.
The following user(s) said Thank You: KCJ

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

More
9 years 1 month ago #98931 by andypugh
Thanks, and sorry for the slow reply. I am currently working 5000 miles from home, and don't have as much spare time as normal.

Are you interested in making further contributions to LinuxCNC, or do you see this as a one-off? In the latter case I can incorporate it as a patch on your behalf, and send it through the normal approval channel.
If you feel you might want to continue to contribute then you could consider setting up a local git repository and pushing directly to GitHub in your own right.

Which do you prefer?

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

More
9 years 1 month ago - 9 years 1 month ago #98976 by Patrik T
I do like my name on creations I am proud of.
But for these lines, I have no attachment and am happy to postpone the github thing until another time.

Thanks for asking.
Last edit: 9 years 1 month ago by Patrik T. Reason: Spelling

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

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