From a06b576a042fb416631495b0fa4624d76228b974 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 20 Dec 2019 23:28:15 +0200 Subject: [PATCH] - in Geometry Object UI (selected tab) when a tool type is changed from no matter what to V-shape, the cut_z value is saved and when the tool type is changed back to something different than V-shape, this saved cut-z value is restored --- FlatCAMObj.py | 10 ++++++++++ README.md | 1 + 2 files changed, 11 insertions(+) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index 6029ca31..ee1dbed6 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -3612,6 +3612,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): # this variable can be updated by the Object that generates the geometry self.tool_type = 'C1' + # save here the old value for the Cut Z before it is changed by selecting a V-shape type tool in the tool table + self.old_cutz = self.app.defaults["geometry_cutz"] + # Attributes to be included in serialization # Always append to it because it carries contents # from predecessors. @@ -3949,6 +3952,10 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): self.ui.addtool_from_db_btn.clicked.connect(self.on_tool_add_from_db_clicked) self.ui.apply_param_to_all.clicked.connect(self.on_apply_param_to_all_clicked) + self.ui.cutz_entry.returnPressed.connect(self.on_cut_z_changed) + + def on_cut_z_changed(self): + self.old_cutz = self.ui.cutz_entry.get_value() def set_tool_offset_visibility(self, current_row): if current_row is None: @@ -4589,6 +4596,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry): if cb_txt == 'V': idx = self.ui.geo_tools_table.cellWidget(cw_row, 3).findText(_('Iso')) self.ui.geo_tools_table.cellWidget(cw_row, 3).setCurrentIndex(idx) + else: + self.ui.cutz_entry.set_value(self.old_cutz) + self.ui_update_v_shape(tool_type_txt=self.ui.geo_tools_table.cellWidget(cw_row, 4).currentText()) def update_form(self, dict_storage): diff --git a/README.md b/README.md index c9c5da8f..25a39c1b 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ CAD program, and create G-Code for Isolation routing. - fixed a rare issue in the generation of non-copper-region geometry started from the Gerber Object UI (selected tab) - Print function is now printing a PDF file for a selection of objects in the colors from canvas - added an icon in the infobar that will show more clearly the status of the grid snapping +- in Geometry Object UI (selected tab) when a tool type is changed from no matter what to V-shape, the cut_z value is saved and when the tool type is changed back to something different than V-shape, this saved cut-z value is restored 19.12.2019