Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/emc/usr_intf/gmoccapy/gmoccapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4744,11 +4744,20 @@ def on_btn_back_clicked(self, widget, data=None):
new_offset = (tt.xoffset, tt.yoffset, tt.zoffset,
tt.aoffset, tt.boffset, tt.coffset,
tt.uoffset, tt.voffset, tt.woffset)
message = None
new_offset_is_nonzero = any(v != 0.0 for v in new_offset)
old_offset_is_zero = all(v == 0.0 for v in self.stat.tool_offset)
if (new_offset != self.stat.tool_offset) and ("G43" in self.active_gcodes):
message = _("Offset values for the tool in the spindle\n" \
"have been changed with tool compensation (G43) active.\n\n" \
"Do you want the new values to be applied as the currently\n" \
"active tool offset?")
elif new_offset_is_nonzero and old_offset_is_zero and ("G49" in self.active_gcodes):
message = _("Offset values for the tool in the spindle\n" \
"have been changed from zero to non-zero.\n\n" \
"Do you want to activate tool compensation (G43)\n" \
"using the currently active tool offset?")
if message:
result = self.dialogs.yesno_dialog(self, message, _("Attention!"))
if result: # user says YES
self.command.mode(linuxcnc.MODE_MDI)
Expand Down
Loading