Sfoglia il codice sorgente

- In Excellon Object UI fixed the enable/disable for the Milling section according to the Tools Table row that is selected
- In Excellon Object UI fixed the miiling geometry generation
- updated th translations strings to the changes in the source code

Marius Stanciu 5 anni fa
parent
commit
35328c2a81

+ 3 - 0
CHANGELOG.md

@@ -11,6 +11,9 @@ CHANGELOG for FlatCAM beta
 
 - in Geometry Object fixed the issue with not using the End X-Y value and also made some other updates here
 - in NCC and Paint Tool fixed some issues with missing keys in the tool data dictionary
+- In Excellon Object UI fixed the enable/disable for the Milling section according to the Tools Table row that is selected
+- In Excellon Object UI fixed the miiling geometry generation
+- updated th translations strings to the changes in the source code
 
 20.10.2020
 

+ 3 - 1
appGUI/ObjectUI.py

@@ -701,7 +701,7 @@ class ExcellonObjectUI(ObjectUI):
         self.milling_button = QtWidgets.QPushButton(_('Milling Tool'))
         self.milling_button.setIcon(QtGui.QIcon(self.app.resource_location + '/milling_tool32.png'))
         self.milling_button.setToolTip(
-            _("Generate GCode out of slot holes in an Excellon object.")
+            _("Generate a Geometry for milling drills or slots in an Excellon object.")
         )
         self.milling_button.setStyleSheet("""
                         QPushButton
@@ -710,6 +710,8 @@ class ExcellonObjectUI(ObjectUI):
                         }
                         """)
         grid2.addWidget(self.milling_button, 6, 0, 1, 2)
+        # TODO until the Milling Tool is finished this stays disabled
+        self.milling_button.setDisabled(True)
 
         separator_line = QtWidgets.QFrame()
         separator_line.setFrameShape(QtWidgets.QFrame.HLine)

+ 21 - 14
appObjects/FlatCAMExcellon.py

@@ -442,6 +442,9 @@ class ExcellonObject(FlatCAMObj, Excellon):
             self.ui.slot_tooldia_entry.setDisabled(False)
             self.ui.generate_milling_slots_button.setDisabled(False)
 
+        # update the milling section
+        self.on_row_selection_change()
+
         self.ui_connect()
 
     def ui_connect(self):
@@ -514,12 +517,22 @@ class ExcellonObject(FlatCAMObj, Excellon):
             self.ui.slot_tooldia_entry.setDisabled(False)
             self.ui.generate_milling_slots_button.setDisabled(False)
 
-            # find if we have drills:
-            has_drills = None
-            for tt in self.tools:
-                if 'drills' in self.tools[tt] and self.tools[tt]['drills']:
-                    has_drills = True
-                    break
+            has_drills = True
+            has_slots = True
+            for row in sel_rows:
+                row_dia = self.app.dec_format(float(self.ui.tools_table.item(row, 1).text()), self.decimals)
+
+                for tt in self.tools:
+                    tool_dia = self.app.dec_format(float(self.tools[tt]['tooldia']), self.decimals)
+                    if tool_dia == row_dia:
+                        # find if we have drills:
+                        if 'drills' not in self.tools[tt] or not self.tools[tt]['drills']:
+                            has_drills = None
+
+                        # find if we have slots
+                        if 'slots' not in self.tools[tt] or not self.tools[tt]['slots']:
+                            has_slots = None
+
             if has_drills is None:
                 self.ui.tooldia_entry.setDisabled(True)
                 self.ui.generate_milling_button.setDisabled(True)
@@ -527,12 +540,6 @@ class ExcellonObject(FlatCAMObj, Excellon):
                 self.ui.tooldia_entry.setDisabled(False)
                 self.ui.generate_milling_button.setDisabled(False)
 
-            # find if we have slots
-            has_slots = None
-            for tt in self.tools:
-                if 'slots' in self.tools[tt] and self.tools[tt]['slots']:
-                    has_slots = True
-                    break
             if has_slots is None:
                 self.ui.slot_tooldia_entry.setDisabled(True)
                 self.ui.generate_milling_slots_button.setDisabled(True)
@@ -895,7 +902,7 @@ class ExcellonObject(FlatCAMObj, Excellon):
             geo_obj.options['Tools_in_use'] = tool_table_items
             geo_obj.options['type'] = 'Excellon Geometry'
             geo_obj.options["cnctooldia"] = str(tooldia)
-            geo_obj.options["multidepth"] = self.options["multidepth"]
+            geo_obj.options["multidepth"] = self.app.defaults["geometry_multidepth"]
             geo_obj.solid_geometry = []
 
             # in case that the tool used has the same diameter with the hole, and since the maximum resolution
@@ -995,7 +1002,7 @@ class ExcellonObject(FlatCAMObj, Excellon):
             geo_obj.options['Tools_in_use'] = tool_table_items
             geo_obj.options['type'] = 'Excellon Geometry'
             geo_obj.options["cnctooldia"] = str(tooldia)
-            geo_obj.options["multidepth"] = self.options["multidepth"]
+            geo_obj.options["multidepth"] = self.app.defaults["geometry_multidepth"]
             geo_obj.solid_geometry = []
 
             # in case that the tool used has the same diameter with the hole, and since the maximum resolution

BIN
locale/de/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 182 - 178
locale/de/LC_MESSAGES/strings.po


BIN
locale/en/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 174 - 177
locale/en/LC_MESSAGES/strings.po


BIN
locale/es/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 182 - 178
locale/es/LC_MESSAGES/strings.po


BIN
locale/fr/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 182 - 178
locale/fr/LC_MESSAGES/strings.po


BIN
locale/hu/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 182 - 178
locale/hu/LC_MESSAGES/strings.po


BIN
locale/it/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 182 - 178
locale/it/LC_MESSAGES/strings.po


BIN
locale/pt_BR/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 182 - 178
locale/pt_BR/LC_MESSAGES/strings.po


BIN
locale/ro/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 180 - 176
locale/ro/LC_MESSAGES/strings.po


BIN
locale/ru/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 181 - 177
locale/ru/LC_MESSAGES/strings.po


BIN
locale/tr/LC_MESSAGES/strings.mo


File diff suppressed because it is too large
+ 158 - 180
locale/tr/LC_MESSAGES/strings.po


File diff suppressed because it is too large
+ 193 - 192
locale_template/strings.pot


Some files were not shown because too many files changed in this diff