Просмотр исходного кода

- some GUI layout optimizations in Edit -> Preferences
- added the possibility for multiple tool diameters in the Edit -> Preferences -> Geometry -> Geometry General -> Tool dia separated by comma
- fixed scaling for the multiple tool diameters in Edit -> Preferences -> Geometry -> Geometry General -> Tool dia, for NCC tools more than 2 and for Solderpaste nozzles more than 2
- fixed bug in CNCJob where the CNC Tools table will show always only 2 decimals for Tool diameters regardless of the current measuring units
- made the tools diameters decimals in case of INCH FlatCAM units to be 4 instead of 3
- fixed bug in updating Grid values whenever toggling the FlatCAM units and the X, Y Grid values are linked, bugs which caused the Y value to be scaled incorrectly
- set the decimals for Grid values to be set to 6 if the units of FlatCAM is INCH and to set to 4 if FlatCAM units are METRIC
- updated translations
- updated the Russian translate from 51% complete to 69% complete using the Yandex translation engine

Marius Stanciu 6 лет назад
Родитель
Сommit
68bdfaf062

+ 39 - 18
FlatCAMApp.py

@@ -95,7 +95,7 @@ class App(QtCore.QObject):
 
     # Version
     version = 8.919
-    version_date = "2019/06/21"
+    version_date = "2019/06/22"
     beta = True
 
     # current date now
@@ -3618,9 +3618,10 @@ class App(QtCore.QObject):
         if self.toggle_units_ignore:
             return
 
+        new_units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
+
         # If option is the same, then ignore
-        if self.ui.general_defaults_form.general_app_group.units_radio.get_value().upper() == \
-                self.defaults["units"].upper():
+        if new_units == self.defaults["units"].upper():
             self.log.debug("on_toggle_units(): Same as defaults, so ignoring.")
             return
 
@@ -3667,16 +3668,24 @@ class App(QtCore.QObject):
                     coords_xy[0] *= sfactor
                     coords_xy[1] *= sfactor
                     self.options['geometry_toolchangexy'] = "%f, %f" % (coords_xy[0], coords_xy[1])
+                elif dim == 'geometry_cnctooldia':
+                    self.options['geometry_cnctooldia'] = ''
+                    tools_diameters = [float(eval(a)) for a in self.defaults["geometry_cnctooldia"].split(",")]
+                    for t in range(len(tools_diameters)):
+                        tools_diameters[t] *= sfactor
+                        self.options['geometry_cnctooldia'] += "%f, " % tools_diameters[t]
                 elif dim == 'tools_ncctools':
+                    self.options['tools_ncctools'] = ''
                     ncctols = [float(eval(a)) for a in self.defaults["tools_ncctools"].split(",")]
-                    ncctols[0] *= sfactor
-                    ncctols[1] *= sfactor
-                    self.options['tools_ncctools'] = "%f, %f" % (ncctols[0], ncctols[1])
+                    for t in range(len(ncctols)):
+                        ncctols[t] *= sfactor
+                        self.options['tools_ncctools'] += "%f, " % ncctols[t]
                 elif dim == 'tools_solderpaste_tools':
+                    self.options['tools_solderpaste_tools'] = ""
                     sp_tools = [float(eval(a)) for a in self.defaults["tools_solderpaste_tools"].split(",")]
-                    sp_tools[0] *= sfactor
-                    sp_tools[1] *= sfactor
-                    self.options['tools_solderpaste_tools'] = "%f, %f" % (sp_tools[0], sp_tools[1])
+                    for t in range(len(sp_tools)):
+                        sp_tools[t] *= sfactor
+                        self.options['tools_solderpaste_tools'] = "%f, " % sp_tools[t]
                 elif dim == 'tools_solderpaste_xy_toolchange':
                     sp_coords = [float(eval(a)) for a in self.defaults["tools_solderpaste_xy_toolchange"].split(",")]
                     sp_coords[0] *= sfactor
@@ -3700,16 +3709,24 @@ class App(QtCore.QObject):
                     coords_xy[0] *= sfactor
                     coords_xy[1] *= sfactor
                     self.defaults['geometry_toolchangexy'] = "%.4f, %.4f" % (coords_xy[0], coords_xy[1])
+                elif dim == 'geometry_cnctooldia':
+                    self.defaults['geometry_cnctooldia'] = ''
+                    tools_diameters = [float(eval(a)) for a in self.defaults["geometry_cnctooldia"].split(",")]
+                    for t in range(len(tools_diameters)):
+                        tools_diameters[t] *= sfactor
+                        self.defaults['geometry_cnctooldia'] += "%.4f, " % tools_diameters[t]
                 elif dim == 'tools_ncctools':
+                    self.defaults['tools_ncctools'] = ''
                     ncctols = [float(eval(a)) for a in self.defaults["tools_ncctools"].split(",")]
-                    ncctols[0] *= sfactor
-                    ncctols[1] *= sfactor
-                    self.defaults['tools_ncctools'] = "%.4f, %.4f" % (ncctols[0], ncctols[1])
+                    for t in range(len(ncctols)):
+                        ncctols[t] *= sfactor
+                        self.defaults['tools_ncctools'] += "%.4f, " % ncctols[t]
                 elif dim == 'tools_solderpaste_tools':
+                    self.defaults['tools_solderpaste_tools'] = ""
                     sp_tools = [float(eval(a)) for a in self.defaults["tools_solderpaste_tools"].split(",")]
-                    sp_tools[0] *= sfactor
-                    sp_tools[1] *= sfactor
-                    self.defaults['tools_solderpaste_tools'] = "%.4f, %.4f" % (sp_tools[0], sp_tools[1])
+                    for t in range(len(sp_tools)):
+                        sp_tools[t] *= sfactor
+                        self.defaults['tools_solderpaste_tools'] = "%.4f, " % sp_tools[t]
                 elif dim == 'tools_solderpaste_xy_toolchange':
                     sp_coords = [float(eval(a)) for a in self.defaults["tools_solderpaste_xy_toolchange"].split(",")]
                     sp_coords[0] *= sfactor
@@ -3723,7 +3740,7 @@ class App(QtCore.QObject):
 
         # The scaling factor depending on choice of units.
         factor = 1/25.4
-        if self.ui.general_defaults_form.general_app_group.units_radio.get_value().upper() == 'MM':
+        if new_units == 'MM':
             factor = 25.4
 
         # Changing project units. Warn user.
@@ -3757,8 +3774,12 @@ class App(QtCore.QObject):
                 self.plotcanvas.draw_workspace()
 
             # adjust the grid values on the main toolbar
-            self.ui.grid_gap_x_entry.set_value(float(self.ui.grid_gap_x_entry.get_value()) * factor)
-            self.ui.grid_gap_y_entry.set_value(float(self.ui.grid_gap_y_entry.get_value()) * factor)
+            dec = 6 if new_units == 'IN'else 4
+            val_x = float(self.ui.grid_gap_x_entry.get_value()) * factor
+            self.ui.grid_gap_x_entry.set_value(val_x, decimals=dec)
+            if not self.ui.grid_gap_link_cb.isChecked():
+                val_y = float(self.ui.grid_gap_y_entry.get_value()) * factor
+                self.ui.grid_gap_y_entry.set_value(val_y, decimals=dec)
 
             units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
             for obj in self.collection.get_list():

+ 42 - 21
FlatCAMObj.py

@@ -1646,7 +1646,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
                         exc.app.log.warning("Failed to copy option.", option)
 
             for drill in exc.drills:
-                exc_tool_dia = float('%.3f' % exc.tools[drill['tool']]['C'])
+                exc_tool_dia = float('%.4f' % exc.tools[drill['tool']]['C'])
 
                 if exc_tool_dia not in custom_dict_drills:
                     custom_dict_drills[exc_tool_dia] = [drill['point']]
@@ -1654,7 +1654,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
                     custom_dict_drills[exc_tool_dia].append(drill['point'])
 
             for slot in exc.slots:
-                exc_tool_dia = float('%.3f' % exc.tools[slot['tool']]['C'])
+                exc_tool_dia = float('%.4f' % exc.tools[slot['tool']]['C'])
 
                 if exc_tool_dia not in custom_dict_slots:
                     custom_dict_slots[exc_tool_dia] = [[slot['start'], slot['stop']]]
@@ -1747,7 +1747,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
                 temp_tools[tool_name_temp] = spec_temp
 
                 for drill in exc_final.drills:
-                    exc_tool_dia = float('%.3f' % exc_final.tools[drill['tool']]['C'])
+                    exc_tool_dia = float('%.4f' % exc_final.tools[drill['tool']]['C'])
                     if exc_tool_dia == ordered_dia:
                         temp_drills.append(
                             {
@@ -1757,7 +1757,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
                         )
 
                 for slot in exc_final.slots:
-                    slot_tool_dia = float('%.3f' % exc_final.tools[slot['tool']]['C'])
+                    slot_tool_dia = float('%.4f' % exc_final.tools[slot['tool']]['C'])
                     if slot_tool_dia == ordered_dia:
                         temp_slots.append(
                             {
@@ -1833,7 +1833,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
             if self.units == 'MM':
                 dia = QtWidgets.QTableWidgetItem('%.2f' % (self.tools[tool_no]['C']))
             else:
-                dia = QtWidgets.QTableWidgetItem('%.3f' % (self.tools[tool_no]['C']))
+                dia = QtWidgets.QTableWidgetItem('%.4f' % (self.tools[tool_no]['C']))
 
             dia.setFlags(QtCore.Qt.ItemIsEnabled)
 
@@ -1851,7 +1851,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
                 if self.units == 'MM':
                     t_offset = self.tool_offset[float('%.2f' % float(self.tools[tool_no]['C']))]
                 else:
-                    t_offset = self.tool_offset[float('%.3f' % float(self.tools[tool_no]['C']))]
+                    t_offset = self.tool_offset[float('%.4f' % float(self.tools[tool_no]['C']))]
             except KeyError:
                     t_offset = self.app.defaults['excellon_offset']
             tool_offset_item = QtWidgets.QTableWidgetItem('%s' % str(t_offset))
@@ -2026,7 +2026,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
                 if self.units == 'MM':
                     dia = float('%.2f' % float(value['C']))
                 else:
-                    dia = float('%.3f' % float(value['C']))
+                    dia = float('%.4f' % float(value['C']))
                 self.tool_offset[dia] = t_default_offset
 
         # Show/Hide Advanced Options
@@ -2090,7 +2090,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         if self.units == 'MM':
             dia = float('%.2f' % float(self.ui.tools_table.item(row_of_item_changed, 1).text()))
         else:
-            dia = float('%.3f' % float(self.ui.tools_table.item(row_of_item_changed, 1).text()))
+            dia = float('%.4f' % float(self.ui.tools_table.item(row_of_item_changed, 1).text()))
 
         current_table_offset_edited = None
         if self.ui.tools_table.currentItem() is not None:
@@ -2958,7 +2958,15 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
         })
 
         if "cnctooldia" not in self.options:
-            self.options["cnctooldia"] =  self.app.defaults["geometry_cnctooldia"]
+            # self.options["cnctooldia"] =  self.app.defaults["geometry_cnctooldia"]
+            try:
+                self.options["cnctooldia"] = [
+                    float(eval(dia)) for dia in str(self.app.defaults["geometry_cnctooldia"]).split(",")
+                ]
+            except Exception as e:
+                log.error("At least one tool diameter needed. Verify in Edit -> Preferences -> Geometry General -> "
+                          "Tool dia. %s" % str(e))
+                return
 
         self.options["startz"] = self.app.defaults["geometry_startz"]
 
@@ -3229,19 +3237,31 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
                 if def_key == opt_key:
                     self.default_data[def_key] = deepcopy(opt_val)
 
+        try:
+            tools_list = [
+                float(eval(dia)) for dia in self.options["cnctooldia"].split(",")
+            ]
+        except Exception as e:
+            log.error("At least one tool diameter needed. Verify in Edit -> Preferences -> Geometry General -> "
+                      "Tool dia. %s" % str(e))
+            return
+
         self.tooluid += 1
+
         if not self.tools:
-            self.tools.update({
-                self.tooluid: {
-                    'tooldia': float(self.options["cnctooldia"]),
-                    'offset': ('Path'),
-                    'offset_value': 0.0,
-                    'type': _('Rough'),
-                    'tool_type': 'C1',
-                    'data': self.default_data,
-                    'solid_geometry': self.solid_geometry
-                }
-            })
+            for toold in tools_list:
+                self.tools.update({
+                    self.tooluid: {
+                        'tooldia': float(toold),
+                        'offset': ('Path'),
+                        'offset_value': 0.0,
+                        'type': _('Rough'),
+                        'tool_type': 'C1',
+                        'data': self.default_data,
+                        'solid_geometry': self.solid_geometry
+                    }
+                })
+                self.tooluid += 1
         else:
             # if self.tools is not empty then it can safely be assumed that it comes from an opened project.
             # Because of the serialization the self.tools list on project save, the dict keys (members of self.tools
@@ -3482,7 +3502,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
                     tooldia = float(self.ui.addtool_entry.get_value().replace(',', '.'))
                 except ValueError:
                     change_message = True
-                    tooldia = float(self.app.defaults["geometry_cnctooldia"])
+                    tooldia = self.options["cnctooldia"][0]
 
             if tooldia is None:
                 self.build_ui()
@@ -5300,6 +5320,7 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
         else:
             self.ui.cnc_tools_table.hide()
 
+        self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
 
         offset = 0
         tool_idx = 0

+ 12 - 0
README.md

@@ -9,6 +9,18 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+22.06.2019
+
+- some GUI layout optimizations in Edit -> Preferences
+- added the possibility for multiple tool diameters in the Edit -> Preferences -> Geometry -> Geometry General -> Tool dia separated by comma
+- fixed scaling for the multiple tool diameters in Edit -> Preferences -> Geometry -> Geometry General -> Tool dia, for NCC tools more than 2 and for Solderpaste nozzles more than 2
+- fixed bug in CNCJob where the CNC Tools table will show always only 2 decimals for Tool diameters regardless of the current measuring units
+- made the tools diameters decimals in case of INCH FlatCAM units to be 4 instead of 3
+- fixed bug in updating Grid values whenever toggling the FlatCAM units and the X, Y Grid values are linked, bugs which caused the Y value to be scaled incorrectly
+- set the decimals for Grid values to be set to 6 if the units of FlatCAM is INCH and to set to 4 if FlatCAM units are METRIC
+- updated translations
+- updated the Russian translate from 51% complete to 69% complete using the Yandex translation engine
+
 20.06.2019
 
 - fixed Scale and Buffer Tool in Gerber Editor

+ 3 - 3
camlib.py

@@ -5353,7 +5353,7 @@ class CNCjob(Geometry):
                             if self.units == 'MM':
                                 current_tooldia = float('%.2f' % float(exobj.tools[tool]["C"]))
                             else:
-                                current_tooldia = float('%.3f' % float(exobj.tools[tool]["C"]))
+                                current_tooldia = float('%.4f' % float(exobj.tools[tool]["C"]))
 
                             # TODO apply offset only when using the GUI, for TclCommand this will create an error
                             # because the values for Z offset are created in build_ui()
@@ -5451,7 +5451,7 @@ class CNCjob(Geometry):
                             if self.units == 'MM':
                                 current_tooldia = float('%.2f' % float(exobj.tools[tool]["C"]))
                             else:
-                                current_tooldia = float('%.3f' % float(exobj.tools[tool]["C"]))
+                                current_tooldia = float('%.4f' % float(exobj.tools[tool]["C"]))
 
                             # TODO apply offset only when using the GUI, for TclCommand this will create an error
                             # because the values for Z offset are created in build_ui()
@@ -5507,7 +5507,7 @@ class CNCjob(Geometry):
                         if self.units == 'MM':
                             current_tooldia = float('%.2f' % float(exobj.tools[tool]["C"]))
                         else:
-                            current_tooldia = float('%.3f' % float(exobj.tools[tool]["C"]))
+                            current_tooldia = float('%.4f' % float(exobj.tools[tool]["C"]))
 
                         # TODO apply offset only when using the GUI, for TclCommand this will create an error
                         # because the values for Z offset are created in build_ui()

+ 3 - 3
flatcamEditors/FlatCAMExcEditor.py

@@ -1209,7 +1209,7 @@ class FlatCAMExcEditor(QtCore.QObject):
         for drill in self.exc_obj.drills:
             if drill['tool'] in self.exc_obj.tools:
                 if self.units == 'IN':
-                    tool_dia = float('%.3f' % self.exc_obj.tools[drill['tool']]['C'])
+                    tool_dia = float('%.4f' % self.exc_obj.tools[drill['tool']]['C'])
                 else:
                     tool_dia = float('%.2f' % self.exc_obj.tools[drill['tool']]['C'])
 
@@ -1238,7 +1238,7 @@ class FlatCAMExcEditor(QtCore.QObject):
             # but use the real order found in the exc_obj.tools
             for k, v in self.exc_obj.tools.items():
                 if self.units == 'IN':
-                    tool_dia = float('%.3f' % v['C'])
+                    tool_dia = float('%.4f' % v['C'])
                 else:
                     tool_dia = float('%.2f' % v['C'])
                 self.tool2tooldia[int(k)] = tool_dia
@@ -1324,7 +1324,7 @@ class FlatCAMExcEditor(QtCore.QObject):
             if self.units == 'MM':
                 dia = QtWidgets.QTableWidgetItem('%.2f' % self.olddia_newdia[tool_no])
             else:
-                dia = QtWidgets.QTableWidgetItem('%.3f' % self.olddia_newdia[tool_no])
+                dia = QtWidgets.QTableWidgetItem('%.4f' % self.olddia_newdia[tool_no])
 
             dia.setFlags(QtCore.Qt.ItemIsEnabled)
 

+ 4 - 1
flatcamEditors/FlatCAMGeoEditor.py

@@ -3059,8 +3059,11 @@ class FlatCAMGeoEditor(QtCore.QObject):
                 val = float(self.app.ui.grid_gap_x_entry.get_value())
             except ValueError:
                 return
+
+            units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
+            dec = 6 if units == 'IN' else 4
             if self.app.ui.grid_gap_link_cb.isChecked():
-                self.app.ui.grid_gap_y_entry.set_value(val)
+                self.app.ui.grid_gap_y_entry.set_value(val, decimals=dec)
 
         self.app.ui.grid_gap_x_entry.setValidator(QtGui.QDoubleValidator())
         self.app.ui.grid_gap_x_entry.textChanged.connect(

+ 26 - 47
flatcamGUI/FlatCAMGUI.py

@@ -4096,7 +4096,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
         self.combine_passes_cb.setToolTip(
             _("Combine all passes into one object")
         )
-        grid0.addWidget(self.combine_passes_cb, 4, 0)
+        grid0.addWidget(self.combine_passes_cb, 4, 0, 1, 2)
 
         # ## Clear non-copper regions
         self.clearcopper_label = QtWidgets.QLabel(_("<b>Clear non-copper:</b>"))
@@ -4468,8 +4468,8 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
         hlay2.addWidget(self.excellon_format_lower_mm_entry, QtCore.Qt.AlignLeft)
         hlay2.addStretch()
 
-        hlay3 = QtWidgets.QHBoxLayout()
-        self.layout.addLayout(hlay3)
+        grid2 = QtWidgets.QGridLayout()
+        self.layout.addLayout(grid2)
 
         self.excellon_zeros_label = QtWidgets.QLabel(_('Default <b>Zeros</b>:'))
         self.excellon_zeros_label.setAlignment(QtCore.Qt.AlignLeft)
@@ -4480,7 +4480,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
               "If TZ is checked then Trailing Zeros are kept\n"
               "and Leading Zeros are removed.")
         )
-        hlay3.addWidget(self.excellon_zeros_label)
+        grid2.addWidget(self.excellon_zeros_label, 0, 0)
 
         self.excellon_zeros_radio = RadioSet([{'label': 'LZ', 'value': 'L'},
                                               {'label': 'TZ', 'value': 'T'}])
@@ -4493,11 +4493,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
               "If TZ is checked then Trailing Zeros are kept\n"
               "and Leading Zeros are removed.")
         )
-        hlay3.addStretch()
-        hlay3.addWidget(self.excellon_zeros_radio, QtCore.Qt.AlignRight)
-
-        hlay4 = QtWidgets.QHBoxLayout()
-        self.layout.addLayout(hlay4)
+        grid2.addWidget(self.excellon_zeros_radio, 0, 1)
 
         self.excellon_units_label = QtWidgets.QLabel(_('Default <b>Units</b>:'))
         self.excellon_units_label.setAlignment(QtCore.Qt.AlignLeft)
@@ -4508,7 +4504,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
               "Some Excellon files don't have an header\n"
               "therefore this parameter will be used.")
         )
-        hlay4.addWidget(self.excellon_units_label)
+        grid2.addWidget(self.excellon_units_label, 1, 0)
 
         self.excellon_units_radio = RadioSet([{'label': 'INCH', 'value': 'INCH'},
                                               {'label': 'MM', 'value': 'METRIC'}])
@@ -4517,27 +4513,14 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
               "Some Excellon files don't have an header\n"
               "therefore this parameter will be used.")
         )
-        hlay4.addStretch()
-        hlay4.addWidget(self.excellon_units_radio, QtCore.Qt.AlignRight)
+        grid2.addWidget(self.excellon_units_radio, 1, 1)
 
-        hlay5 = QtWidgets.QVBoxLayout()
-        self.layout.addLayout(hlay5)
-
-        self.empty_label = QtWidgets.QLabel("")
-        hlay5.addWidget(self.empty_label)
-
-        hlay6 = QtWidgets.QVBoxLayout()
-        self.layout.addLayout(hlay6)
+        grid2.addWidget(QtWidgets.QLabel(""), 2, 0)
 
         self.excellon_general_label = QtWidgets.QLabel(_("<b>Excellon Optimization:</b>"))
-        hlay6.addWidget(self.excellon_general_label)
-
-        # Create a form layout for the Excellon general settings
-        form_box_excellon = QtWidgets.QFormLayout()
-        hlay6.addLayout(form_box_excellon)
+        grid2.addWidget(self.excellon_general_label, 3, 0, 1, 2)
 
         self.excellon_optimization_label = QtWidgets.QLabel(_('Algorithm:   '))
-        self.excellon_optimization_label.setAlignment(QtCore.Qt.AlignLeft)
         self.excellon_optimization_label.setToolTip(
             _("This sets the optimization type for the Excellon drill path.\n"
               "If MH is checked then Google OR-Tools algorithm with MetaHeuristic\n"
@@ -4548,6 +4531,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
               "If DISABLED, then FlatCAM works in 32bit mode and it uses \n"
               "Travelling Salesman algorithm for path optimization.")
         )
+        grid2.addWidget(self.excellon_optimization_label, 4, 0)
 
         self.excellon_optimization_radio = RadioSet([{'label': 'MH', 'value': 'M'},
                                      {'label': 'Basic', 'value': 'B'}])
@@ -4561,8 +4545,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
               "If DISABLED, then FlatCAM works in 32bit mode and it uses \n"
               "Travelling Salesman algorithm for path optimization.")
         )
-
-        form_box_excellon.addRow(self.excellon_optimization_label, self.excellon_optimization_radio)
+        grid2.addWidget(self.excellon_optimization_radio, 4, 1)
 
         self.optimization_time_label = QtWidgets.QLabel(_('Optimization Time:   '))
         self.optimization_time_label.setAlignment(QtCore.Qt.AlignLeft)
@@ -4573,10 +4556,11 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
               "In seconds.")
 
         )
+        grid2.addWidget(self.optimization_time_label, 5, 0)
 
         self.optimization_time_entry = IntEntry()
         self.optimization_time_entry.setValidator(QtGui.QIntValidator(0, 999))
-        form_box_excellon.addRow(self.optimization_time_label, self.optimization_time_entry)
+        grid2.addWidget(self.optimization_time_entry, 5, 1)
 
         current_platform = platform.architecture()[0]
         if current_platform == '64bit':
@@ -4744,25 +4728,23 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
         self.mill_hole_label.setToolTip(
             _("Create Geometry for milling holes.")
         )
-        self.layout.addWidget(self.mill_hole_label)
+        grid2.addWidget(excellon_gcode_type_label, 11, 0, 1, 2)
 
-        grid3 = QtWidgets.QGridLayout()
-        self.layout.addLayout(grid3)
         tdlabel = QtWidgets.QLabel(_('Drill Tool dia:'))
         tdlabel.setToolTip(
             _("Diameter of the cutting tool.")
         )
-        grid3.addWidget(tdlabel, 0, 0)
+        grid2.addWidget(tdlabel, 12, 0)
         self.tooldia_entry = LengthEntry()
-        grid3.addWidget(self.tooldia_entry, 0, 1)
+        grid2.addWidget(self.tooldia_entry, 12, 1)
         stdlabel = QtWidgets.QLabel(_('Slot Tool dia:'))
         stdlabel.setToolTip(
             _("Diameter of the cutting tool\n"
               "when milling slots.")
         )
-        grid3.addWidget(stdlabel, 1, 0)
+        grid2.addWidget(stdlabel, 13, 0)
         self.slot_tooldia_entry = LengthEntry()
-        grid3.addWidget(self.slot_tooldia_entry, 1, 1)
+        grid2.addWidget(self.slot_tooldia_entry, 13, 1)
 
         grid4 = QtWidgets.QGridLayout()
         self.layout.addLayout(grid4)
@@ -5162,6 +5144,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
 
         grid0 = QtWidgets.QGridLayout()
         self.layout.addLayout(grid0)
+
         # Number of circle steps for circular aperture linear approximation
         self.circle_steps_label = QtWidgets.QLabel(_("Circle Steps:"))
         self.circle_steps_label.setToolTip(
@@ -5173,21 +5156,17 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
         grid0.addWidget(self.circle_steps_entry, 1, 1)
 
         # Tools
-        self.tools_label = QtWidgets.QLabel(_("<b>Tools</b>"))
-        self.layout.addWidget(self.tools_label)
-
-        grid0_b = QtWidgets.QGridLayout()
-        self.layout.addLayout(grid0_b)
+        self.tools_label = QtWidgets.QLabel(_("<b>Tools:</b>"))
+        grid0.addWidget(self.tools_label, 2, 0, 1, 2)
 
         # Tooldia
-        tdlabel = QtWidgets.QLabel(_('Tool dia:                   '))
+        tdlabel = QtWidgets.QLabel(_('Tool dia:'))
         tdlabel.setToolTip(
-            _("The diameter of the cutting\n"
-              "tool..")
+            _("Diameters of the cutting tools, separated by ','")
         )
-        grid0_b.addWidget(tdlabel, 0, 0)
-        self.cnctooldia_entry = LengthEntry()
-        grid0_b.addWidget(self.cnctooldia_entry, 0, 1)
+        grid0.addWidget(tdlabel, 3, 0)
+        self.cnctooldia_entry = FCEntry()
+        grid0.addWidget(self.cnctooldia_entry, 3, 1)
 
         self.layout.addStretch()
 

+ 3 - 2
flatcamGUI/GUIElements.py

@@ -390,12 +390,13 @@ class FCEntry2(FCEntry):
     def on_edit_finished(self):
         self.clearFocus()
 
-    def set_value(self, val):
+    def set_value(self, val, decimals=4):
         try:
             fval = float(val)
         except ValueError:
             return
-        self.setText('%.4f' % fval)
+
+        self.setText('%.*f' % (decimals, fval))
 
 
 class EvalEntry(QtWidgets.QLineEdit):

+ 2 - 2
flatcamParsers/ParseDXF.py

@@ -91,7 +91,7 @@ def dxfarc2shapely(arc, n_points=100):
     #     angle += step_angle
     #
     #
-    # log.debug("X = %.3f, Y = %.3f, Radius = %.3f, start_angle = %.1f, stop_angle = %.1f, step_angle = %.3f, dir=%s" %
+    # log.debug("X = %.4f, Y = %.4f, Radius = %.4f, start_angle = %.1f, stop_angle = %.1f, step_angle = %.4f, dir=%s" %
     #           (center_x, center_y, radius, start_angle, end_angle, step_angle, dir))
     #
     # geo = LineString(point_list)
@@ -142,7 +142,7 @@ def dxfarc2shapely(arc, n_points=100):
             y = center_y + radius * math.sin(math.radians(- end_angle))
         point_list.append((x, y))
 
-    # log.debug("X = %.3f, Y = %.3f, Radius = %.3f, start_angle = %.1f, stop_angle = %.1f, step_angle = %.3f" %
+    # log.debug("X = %.4f, Y = %.4f, Radius = %.4f, start_angle = %.1f, stop_angle = %.1f, step_angle = %.4f" %
     #           (center_x, center_y, radius, start_angle, end_angle, step_angle))
 
     geo = LineString(point_list)

+ 1 - 1
flatcamTools/ToolNonCopperClear.py

@@ -404,7 +404,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
                     if self.units == 'MM':
                         dia = QtWidgets.QTableWidgetItem('%.2f' % tooluid_value['tooldia'])
                     else:
-                        dia = QtWidgets.QTableWidgetItem('%.3f' % tooluid_value['tooldia'])
+                        dia = QtWidgets.QTableWidgetItem('%.4f' % tooluid_value['tooldia'])
 
                     dia.setFlags(QtCore.Qt.ItemIsEnabled)
 

+ 1 - 1
flatcamTools/ToolPaint.py

@@ -468,7 +468,7 @@ class ToolPaint(FlatCAMTool, Gerber):
                     if self.units == 'MM':
                         dia = QtWidgets.QTableWidgetItem('%.2f' % tooluid_value['tooldia'])
                     else:
-                        dia = QtWidgets.QTableWidgetItem('%.3f' % tooluid_value['tooldia'])
+                        dia = QtWidgets.QTableWidgetItem('%.4f' % tooluid_value['tooldia'])
 
                     dia.setFlags(QtCore.Qt.ItemIsEnabled)
 

+ 1 - 1
flatcamTools/ToolSolderPaste.py

@@ -548,7 +548,7 @@ class SolderPaste(FlatCAMTool):
                     if self.units == 'MM':
                         dia = QtWidgets.QTableWidgetItem('%.2f' % tooluid_value['tooldia'])
                     else:
-                        dia = QtWidgets.QTableWidgetItem('%.3f' % tooluid_value['tooldia'])
+                        dia = QtWidgets.QTableWidgetItem('%.4f' % tooluid_value['tooldia'])
 
                     dia.setFlags(QtCore.Qt.ItemIsEnabled)
 

BIN
locale/de/LC_MESSAGES/strings.mo


Разница между файлами не показана из-за своего большого размера
+ 184 - 184
locale/de/LC_MESSAGES/strings.po


BIN
locale/en/LC_MESSAGES/strings.mo


Разница между файлами не показана из-за своего большого размера
+ 184 - 185
locale/en/LC_MESSAGES/strings.po


BIN
locale/ro/LC_MESSAGES/strings.mo


Разница между файлами не показана из-за своего большого размера
+ 184 - 184
locale/ro/LC_MESSAGES/strings.po


BIN
locale/ru/LC_MESSAGES/strings.mo


Разница между файлами не показана из-за своего большого размера
+ 283 - 253
locale/ru/LC_MESSAGES/strings.po


Разница между файлами не показана из-за своего большого размера
+ 183 - 183
locale_template/strings.pot


Некоторые файлы не были показаны из-за большого количества измененных файлов