From 8e687c5054423541888c6e6b45ecde99b7344033 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 28 May 2020 04:22:46 +0300 Subject: [PATCH] - fixed some issues related to using the new Numerical... GUI elements --- AppGUI/GUIElements.py | 2 +- AppTools/ToolIsolation.py | 6 +++--- CHANGELOG.md | 1 + camlib.py | 21 ++++++++++++++++----- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/AppGUI/GUIElements.py b/AppGUI/GUIElements.py index 9594fb6d..0a17690c 100644 --- a/AppGUI/GUIElements.py +++ b/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: /,*,+,-,% """ diff --git a/AppTools/ToolIsolation.py b/AppTools/ToolIsolation.py index b8c26c20..d8ca928a 100644 --- a/AppTools/ToolIsolation.py +++ b/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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 95bdff47..f707d118 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/camlib.py b/camlib.py index 5e461043..2f134b84 100644 --- a/camlib.py +++ b/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)]