Jelajahi Sumber

- fixed some issues related to using the new Numerical... GUI elements

Marius Stanciu 5 tahun lalu
induk
melakukan
8e687c5054
4 mengubah file dengan 21 tambahan dan 9 penghapusan
  1. 1 1
      AppGUI/GUIElements.py
  2. 3 3
      AppTools/ToolIsolation.py
  3. 1 0
      CHANGELOG.md
  4. 16 5
      camlib.py

+ 1 - 1
AppGUI/GUIElements.py

@@ -671,7 +671,7 @@ class NumericalEvalEntry(EvalEntry):
         self.setValidator(validator)
 
 
-class NumericalEvalTupleEntry(EvalEntry):
+class NumericalEvalTupleEntry(FCEntry):
     """
     Will evaluate the input and return a value. Accepts only float numbers and formulas using the operators: /,*,+,-,%
     """

+ 3 - 3
AppTools/ToolIsolation.py

@@ -1,8 +1,8 @@
 # ##########################################################
 # FlatCAM: 2D Post-processing for Manufacturing            #
-# File Modified by: Marius Adrian Stanciu (c)              #
-# Date: 3/10/2019                                          #
-# MIT Licence                                              #
+# File by:  Marius Adrian Stanciu (c)                      #
+# Date:     5/25/2020                                      #
+# License:  MIT Licence                                    #
 # ##########################################################
 
 from PyQt5 import QtWidgets, QtCore, QtGui

+ 1 - 0
CHANGELOG.md

@@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
 - 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
 - updated the Tool Database class to have the Isolation Tool data
 - Isolation Tool - made to work the adding of tools from database
+- fixed some issues related to using the new Numerical... GUI elements
 
 27.05.2020
 

+ 16 - 5
camlib.py

@@ -4143,7 +4143,8 @@ class CNCjob(Geometry):
         self.dwell = dwell
         self.dwelltime = float(dwelltime) if dwelltime is not None else self.app.defaults["geometry_dwelltime"]
 
-        self.startz = float(startz) if startz is not None else self.app.defaults["geometry_startz"]
+        self.startz = float(startz) if startz is not None and startz != '' else self.app.defaults["geometry_startz"]
+
         self.z_end = float(endz) if endz is not None else self.app.defaults["geometry_endz"]
 
         self.xy_end = endxy if endxy != '' and endxy else self.app.defaults["geometry_endxy"]
@@ -4831,15 +4832,25 @@ class CNCjob(Geometry):
         # Current path: temporary storage until tool is
         # lifted or lowered.
         if self.toolchange_xy_type == "excellon":
-            if self.app.defaults["excellon_toolchangexy"] == '':
+            if self.app.defaults["excellon_toolchangexy"] == '' or self.app.defaults["excellon_toolchangexy"] is None:
                 pos_xy = (0, 0)
             else:
-                pos_xy = [float(eval(a)) for a in self.app.defaults["excellon_toolchangexy"].split(",")]
+                pos_xy = self.app.defaults["excellon_toolchangexy"]
+                try:
+                    pos_xy = [float(eval(a)) for a in pos_xy.split(",")]
+                except Exception:
+                    if len(pos_xy) != 2:
+                        pos_xy = (0, 0)
         else:
-            if self.app.defaults["geometry_toolchangexy"] == '':
+            if self.app.defaults["geometry_toolchangexy"] == '' or self.app.defaults["geometry_toolchangexy"] is None:
                 pos_xy = (0, 0)
             else:
-                pos_xy = [float(eval(a)) for a in self.app.defaults["geometry_toolchangexy"].split(",")]
+                pos_xy = self.app.defaults["geometry_toolchangexy"]
+                try:
+                    pos_xy = [float(eval(a)) for a in pos_xy.split(",")]
+                except Exception:
+                    if len(pos_xy) != 2:
+                        pos_xy = (0, 0)
 
         path = [pos_xy]
         # path = [(0, 0)]