Explorar el Código

- fixed issue after Geometry object edit; the GCode made from and edited object did not reflect the changes in the object
- in Object UI, the Scale FCDoubleSpinner will no longer work for Return key press due of issues of unwanted scaling on focusOut event

Marius Stanciu hace 6 años
padre
commit
38756175f6
Se han modificado 3 ficheros con 18 adiciones y 11 borrados
  1. 11 6
      FlatCAMObj.py
  2. 2 0
      README.md
  3. 5 5
      flatcamEditors/FlatCAMGeoEditor.py

+ 11 - 6
FlatCAMObj.py

@@ -177,23 +177,28 @@ class FlatCAMObj(QtCore.QObject):
 
 
         assert isinstance(self.ui, ObjectUI)
         assert isinstance(self.ui, ObjectUI)
         self.ui.name_entry.returnPressed.connect(self.on_name_activate)
         self.ui.name_entry.returnPressed.connect(self.on_name_activate)
+
         try:
         try:
             # it will raise an exception for those FlatCAM objects that do not build UI with the common elements
             # it will raise an exception for those FlatCAM objects that do not build UI with the common elements
             self.ui.offset_button.clicked.connect(self.on_offset_button_click)
             self.ui.offset_button.clicked.connect(self.on_offset_button_click)
         except (TypeError, AttributeError):
         except (TypeError, AttributeError):
             pass
             pass
+
         try:
         try:
             self.ui.scale_button.clicked.connect(self.on_scale_button_click)
             self.ui.scale_button.clicked.connect(self.on_scale_button_click)
         except (TypeError, AttributeError):
         except (TypeError, AttributeError):
             pass
             pass
+
         try:
         try:
             self.ui.offsetvector_entry.returnPressed.connect(self.on_offset_button_click)
             self.ui.offsetvector_entry.returnPressed.connect(self.on_offset_button_click)
         except (TypeError, AttributeError):
         except (TypeError, AttributeError):
             pass
             pass
-        try:
-            self.ui.scale_entry.returnPressed.connect(self.on_scale_button_click)
-        except (TypeError, AttributeError):
-            pass
+
+        # Creates problems on focusOut
+        # try:
+        #     self.ui.scale_entry.returnPressed.connect(self.on_scale_button_click)
+        # except (TypeError, AttributeError):
+        #     pass
         # self.ui.skew_button.clicked.connect(self.on_skew_button_click)
         # self.ui.skew_button.clicked.connect(self.on_skew_button_click)
 
 
     def build_ui(self):
     def build_ui(self):
@@ -212,9 +217,9 @@ class FlatCAMObj(QtCore.QObject):
             # HACK: disconnect the scale entry signal since on focus out event will trigger an undesired scale()
             # HACK: disconnect the scale entry signal since on focus out event will trigger an undesired scale()
             # it seems that the takewidget() does generate a focus out event for the QDoubleSpinbox ...
             # it seems that the takewidget() does generate a focus out event for the QDoubleSpinbox ...
             # and reconnect after the takeWidget() is done
             # and reconnect after the takeWidget() is done
-            self.ui.scale_entry.returnPressed.disconnect(self.on_scale_button_click)
+            # self.ui.scale_entry.returnPressed.disconnect(self.on_scale_button_click)
             self.app.ui.selected_scroll_area.takeWidget()
             self.app.ui.selected_scroll_area.takeWidget()
-            self.ui.scale_entry.returnPressed.connect(self.on_scale_button_click)
+            # self.ui.scale_entry.returnPressed.connect(self.on_scale_button_click)
         except Exception as e:
         except Exception as e:
             self.app.log.debug("FlatCAMObj.build_ui() --> Nothing to remove: %s" % str(e))
             self.app.log.debug("FlatCAMObj.build_ui() --> Nothing to remove: %s" % str(e))
         self.app.ui.selected_scroll_area.setWidget(self.ui)
         self.app.ui.selected_scroll_area.setWidget(self.ui)

+ 2 - 0
README.md

@@ -15,6 +15,8 @@ CAD program, and create G-Code for Isolation routing.
 - Calibration Tool - added preferences values
 - Calibration Tool - added preferences values
 - Calibration Tool - more work on it
 - Calibration Tool - more work on it
 - reverted this change: "selected object in Project used to ask twice for UI build" because it will not build the UI when a tab is closed for Document object and the object is selected
 - reverted this change: "selected object in Project used to ask twice for UI build" because it will not build the UI when a tab is closed for Document object and the object is selected
+- fixed issue after Geometry object edit; the GCode made from and edited object did not reflect the changes in the object
+- in Object UI, the Scale FCDoubleSpinner will no longer work for Return key press due of issues of unwanted scaling on focusOut event
 
 
 8.12.2019
 8.12.2019
 
 

+ 5 - 5
flatcamEditors/FlatCAMGeoEditor.py

@@ -4277,11 +4277,11 @@ class FlatCAMGeoEditor(QtCore.QObject):
             for shape in self.storage.get_objects():
             for shape in self.storage.get_objects():
                 fcgeometry.tools[self.multigeo_tool]['solid_geometry'].append(shape.geo)
                 fcgeometry.tools[self.multigeo_tool]['solid_geometry'].append(shape.geo)
             self.multigeo_tool = None
             self.multigeo_tool = None
-        else:
-            fcgeometry.solid_geometry = []
-            # for shape in self.shape_buffer:
-            for shape in self.storage.get_objects():
-                fcgeometry.solid_geometry.append(shape.geo)
+
+        fcgeometry.solid_geometry = []
+        # for shape in self.shape_buffer:
+        for shape in self.storage.get_objects():
+            fcgeometry.solid_geometry.append(shape.geo)
 
 
     def update_options(self, obj):
     def update_options(self, obj):
         if self.paint_tooldia:
         if self.paint_tooldia: