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

- fixed bug in the Paint Tool that did not allow choosing a Paint Method that was not Standard
- made sure that in the FlatCAMGeometry.merge() all the source data is deepcopy-ed in the final object

Marius Stanciu 6 лет назад
Родитель
Сommit
0fd2037edc
3 измененных файлов с 11 добавлено и 25 удалено
  1. 2 2
      FlatCAMObj.py
  2. 2 0
      README.md
  3. 7 23
      flatcamTools/ToolPaint.py

+ 2 - 2
FlatCAMObj.py

@@ -5529,7 +5529,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
             for option in geo.options:
                 if option is not 'name':
                     try:
-                        geo_final.options[option] = geo.options[option]
+                        geo_final.options[option] = deepcopy(geo.options[option])
                     except Exception as e:
                         log.warning("Failed to copy option %s. Error: %s" % (str(option), str(e)))
 
@@ -5542,7 +5542,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
                 if multigeo is None or multigeo is False:
                     geo_final.multigeo = False
                     try:
-                        geo_final.solid_geometry.append(geo.solid_geometry)
+                        geo_final.solid_geometry.append(deepcopy(geo.solid_geometry))
                     except Exception as e:
                         log.debug("FlatCAMGeometry.merge() --> %s" % str(e))
                 else:

+ 2 - 0
README.md

@@ -12,6 +12,8 @@ CAD program, and create G-Code for Isolation routing.
 6.11.2019
 
 - the "CRTL+S" key combo when the Preferences Tab is in focus will save the Preferences instead of saving the Project
+- fixed bug in the Paint Tool that did not allow choosing a Paint Method that was not Standard
+- made sure that in the FlatCAMGeometry.merge() all the source data is deepcopy-ed in the final object
 
 5.11.2019
 

+ 7 - 23
flatcamTools/ToolPaint.py

@@ -1281,21 +1281,14 @@ class ToolPaint(FlatCAMTool, Gerber):
                     obj.solid_geometry = obj.solid_geometry.buffer(0)
 
         poly = self.find_polygon(point=inside_pt, geoset=obj.solid_geometry)
-        paint_method = method if method is None else self.paintmethod_combo.get_value()
+
+        paint_method = method if method is not None else self.paintmethod_combo.get_value()
 
         if margin is not None:
             paint_margin = margin
         else:
-            try:
-                paint_margin = float(self.paintmargin_entry.get_value())
-            except ValueError:
-                # try to convert comma to decimal point. if it's still not working error message and return
-                try:
-                    paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
-                except ValueError:
-                    self.app.inform.emit('[ERROR_NOTCL] %s' %
-                                         _("Wrong value format entered, use a number."))
-                    return
+            paint_margin = float(self.paintmargin_entry.get_value())
+
         # determine if to use the progressive plotting
         if self.app.defaults["tools_paint_plotting"] == 'progressive':
             prog_plot = True
@@ -1558,21 +1551,12 @@ class ToolPaint(FlatCAMTool, Gerber):
         Usage of the different one is related to when this function is called from a TcL command.
         :return:
         """
-        paint_method = method if method is None else self.paintmethod_combo.get_value()
+        paint_method = method if method is not None else self.paintmethod_combo.get_value()
 
         if margin is not None:
             paint_margin = margin
         else:
-            try:
-                paint_margin = float(self.paintmargin_entry.get_value())
-            except ValueError:
-                # try to convert comma to decimal point. if it's still not working error message and return
-                try:
-                    paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
-                except ValueError:
-                    self.app.inform.emit('[ERROR_NOTCL] %s' %
-                                         _("Wrong value format entered, use a number."))
-                    return
+            paint_margin = float(self.paintmargin_entry.get_value())
 
         # determine if to use the progressive plotting
         if self.app.defaults["tools_paint_plotting"] == 'progressive':
@@ -2035,7 +2019,7 @@ class ToolPaint(FlatCAMTool, Gerber):
         Usage of the different one is related to when this function is called from a TcL command.
         :return:
         """
-        paint_method = method if method is None else self.paintmethod_combo.get_value()
+        paint_method = method if method is not None else self.paintmethod_combo.get_value()
 
         if margin is not None:
             paint_margin = margin