Przeglądaj źródła

- 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

Marius Stanciu 6 lat temu
rodzic
commit
a06b576a04
2 zmienionych plików z 11 dodań i 0 usunięć
  1. 10 0
      FlatCAMObj.py
  2. 1 0
      README.md

+ 10 - 0
FlatCAMObj.py

@@ -3612,6 +3612,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
         # this variable can be updated by the Object that generates the geometry
         # this variable can be updated by the Object that generates the geometry
         self.tool_type = 'C1'
         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
         # Attributes to be included in serialization
         # Always append to it because it carries contents
         # Always append to it because it carries contents
         # from predecessors.
         # 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.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.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):
     def set_tool_offset_visibility(self, current_row):
         if current_row is None:
         if current_row is None:
@@ -4589,6 +4596,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
                     if cb_txt == 'V':
                     if cb_txt == 'V':
                         idx = self.ui.geo_tools_table.cellWidget(cw_row, 3).findText(_('Iso'))
                         idx = self.ui.geo_tools_table.cellWidget(cw_row, 3).findText(_('Iso'))
                         self.ui.geo_tools_table.cellWidget(cw_row, 3).setCurrentIndex(idx)
                         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())
                 self.ui_update_v_shape(tool_type_txt=self.ui.geo_tools_table.cellWidget(cw_row, 4).currentText())
 
 
     def update_form(self, dict_storage):
     def update_form(self, dict_storage):

+ 1 - 0
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)
 - 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 
 - 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
 - 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
 19.12.2019