Skip to content

Commit 3c0482d

Browse files
authored
Merge pull request #3792 from zz912/gm-tbl-exit
Gmoccapy: make Tool Table exit more verbose
2 parents c0b0448 + 9494c17 commit 3c0482d

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
@@ -4745,11 +4745,20 @@ def on_btn_back_clicked(self, widget, data=None):
47454745
new_offset = (tt.xoffset, tt.yoffset, tt.zoffset,
47464746
tt.aoffset, tt.boffset, tt.coffset,
47474747
tt.uoffset, tt.voffset, tt.woffset)
4748+
message = None
4749+
new_offset_is_nonzero = any(v != 0.0 for v in new_offset)
4750+
old_offset_is_zero = all(v == 0.0 for v in self.stat.tool_offset)
47484751
if (new_offset != self.stat.tool_offset) and ("G43" in self.active_gcodes):
47494752
message = _("Offset values for the tool in the spindle\n" \
47504753
"have been changed with tool compensation (G43) active.\n\n" \
47514754
"Do you want the new values to be applied as the currently\n" \
47524755
"active tool offset?")
4756+
elif new_offset_is_nonzero and old_offset_is_zero and ("G49" in self.active_gcodes):
4757+
message = _("Offset values for the tool in the spindle\n" \
4758+
"have been changed from zero to non-zero.\n\n" \
4759+
"Do you want to activate tool compensation (G43)\n" \
4760+
"using the currently active tool offset?")
4761+
if message:
47534762
result = self.dialogs.yesno_dialog(self, message, _("Attention!"))
47544763
if result: # user says YES
47554764
self.command.mode(linuxcnc.MODE_MDI)

0 commit comments

Comments
 (0)