Skip to content

Commit 9494c17

Browse files
committed
Gmoccapy - exit ToolTable - more verbose
1 parent 0673e3f commit 9494c17

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4744,11 +4744,20 @@ def on_btn_back_clicked(self, widget, data=None):
47444744
new_offset = (tt.xoffset, tt.yoffset, tt.zoffset,
47454745
tt.aoffset, tt.boffset, tt.coffset,
47464746
tt.uoffset, tt.voffset, tt.woffset)
4747+
message = None
4748+
new_offset_is_nonzero = any(v != 0.0 for v in new_offset)
4749+
old_offset_is_zero = all(v == 0.0 for v in self.stat.tool_offset)
47474750
if (new_offset != self.stat.tool_offset) and ("G43" in self.active_gcodes):
47484751
message = _("Offset values for the tool in the spindle\n" \
47494752
"have been changed with tool compensation (G43) active.\n\n" \
47504753
"Do you want the new values to be applied as the currently\n" \
47514754
"active tool offset?")
4755+
elif new_offset_is_nonzero and old_offset_is_zero and ("G49" in self.active_gcodes):
4756+
message = _("Offset values for the tool in the spindle\n" \
4757+
"have been changed from zero to non-zero.\n\n" \
4758+
"Do you want to activate tool compensation (G43)\n" \
4759+
"using the currently active tool offset?")
4760+
if message:
47524761
result = self.dialogs.yesno_dialog(self, message, _("Attention!"))
47534762
if result: # user says YES
47544763
self.command.mode(linuxcnc.MODE_MDI)

0 commit comments

Comments
 (0)