Pārlūkot izejas kodu

- made the visibility change (when using the Spacebar key in Project Tab) to be not threaded and to use the enabled property of the ShapesCollection which should be faster

Marius Stanciu 5 gadi atpakaļ
vecāks
revīzija
b106081311
3 mainītis faili ar 20 papildinājumiem un 17 dzēšanām
  1. 8 13
      AppObjects/FlatCAMObj.py
  2. 8 4
      AppTools/ToolIsolation.py
  3. 4 0
      CHANGELOG.md

+ 8 - 13
AppObjects/FlatCAMObj.py

@@ -459,20 +459,15 @@ class FlatCAMObj(QtCore.QObject):
     def visible(self, value, threaded=True):
         log.debug("FlatCAMObj.visible()")
 
-        def worker_task(app_obj):
-            self.shapes.visible = value
+        # self.shapes.visible = value   # maybe this is slower in VisPy
+        self.shapes.enabled = value
 
-            if self.app.is_legacy is False:
-                # Not all object types has annotations
-                try:
-                    self.annotation.visible = value
-                except Exception:
-                    pass
-
-        if threaded is False:
-            worker_task(app_obj=self.app)
-        else:
-            self.app.worker_task.emit({'fcn': worker_task, 'params': [self]})
+        if self.app.is_legacy is False:
+            # Not all object types has annotations
+            try:
+                self.annotation.visible = value
+            except Exception:
+                pass
 
     @property
     def drawing_tolerance(self):

+ 8 - 4
AppTools/ToolIsolation.py

@@ -1004,7 +1004,11 @@ class ToolIsolation(AppTool, Gerber):
 
         self.on_tool_type(val=self.tool_type_radio.get_value())
 
-        outname = self.app.collection.get_by_name(self.object_combo.get_value()).options['name']
+        loaded_obj = self.app.collection.get_by_name(self.object_combo.get_value())
+        if loaded_obj:
+            outname = loaded_obj.options['name']
+        else:
+            outname = ''
 
         # init the working variables
         self.default_data.clear()
@@ -2030,9 +2034,9 @@ class ToolIsolation(AppTool, Gerber):
                     # transfer the Cut Z and Vtip and VAngle values in case that we use the V-Shape tool in
                     # Gerber UI
                     if tool_type.lower() == 'v':
-                        new_cutz = self.ui.cutz_spinner.get_value()
-                        new_vtipdia = self.ui.tipdia_spinner.get_value()
-                        new_vtipangle = self.ui.tipangle_spinner.get_value()
+                        new_cutz = self.cutz_entry.get_value()
+                        new_vtipdia = self.tipdia_entry.get_value()
+                        new_vtipangle = self.tipangle_entry.get_value()
                         tool_type = 'V'
                         tool_data.update({
                             "name": iso_name,

+ 4 - 0
CHANGELOG.md

@@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta
 
 =================================================
 
+28.05.2020
+
+- made the visibility change (when using the Spacebar key in Project Tab) to be not threaded and to use the enabled property of the ShapesCollection which should be faster
+
 27.05.2020
 
 - working on Isolation Tool: made to work the Isolation with multiple tools without rest machining