- fixed a bug where end_xy parameter in Drilling Tool was not used

- fixed an issue in Delete All method in the app_Main.py
This commit is contained in:
Marius Stanciu 2020-09-24 14:37:06 +03:00
parent 7e4585e65f
commit dab3a5f703
6 changed files with 37 additions and 7 deletions

View File

@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta
=================================================
24.09.2020
- fixed a bug where end_xy parameter in Drilling Tool was not used
- fixed an issue in Delete All method in the app_Main.py
23.09.2020
- added support for virtual units in SVG parser; warning: it may require the support for units which is not implemented yet

View File

@ -700,6 +700,16 @@ class NumericalEvalTupleEntry(EvalEntry):
validator = QtGui.QRegExpValidator(regex, self)
self.setValidator(validator)
def get_value(self):
raw = str(self.text()).strip(' ')
try:
evaled = eval(raw)
except Exception as e:
if raw != '':
log.error("Could not evaluate val: %s, error: %s" % (str(raw), str(e)))
return None
return evaled
class FCColorEntry(QtWidgets.QFrame):

View File

@ -221,7 +221,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
if self.app.is_legacy is False:
self.probing_shapes = ShapeCollection(parent=self.app.plotcanvas.view.scene, layers=1)
else:
self.probing_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name=name + "_voronoi_shapes")
self.probing_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name=name + "_probing_shapes")
# Attributes to be included in serialization
# Always append to it because it carries contents

View File

@ -9,7 +9,8 @@ from PyQt5 import QtWidgets, QtCore, QtGui
from appTool import AppTool
from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCButton, \
FCComboBox, OptionalInputSection, FCSpinner, NumericalEvalEntry, OptionalHideInputSection, FCLabel
FCComboBox, OptionalInputSection, FCSpinner, NumericalEvalEntry, OptionalHideInputSection, FCLabel, \
NumericalEvalTupleEntry
from appParsers.ParseExcellon import Excellon
from copy import deepcopy
@ -793,6 +794,10 @@ class ToolDrilling(AppTool, Excellon):
current_widget2.returnPressed.connect(self.form_to_storage)
elif isinstance(current_widget2, FCComboBox):
current_widget2.currentIndexChanged.connect(self.form_to_storage)
elif isinstance(current_widget2, NumericalEvalEntry):
current_widget2.editingFinished.connect(self.form_to_storage)
elif isinstance(current_widget2, NumericalEvalTupleEntry):
current_widget2.editingFinished.connect(self.form_to_storage)
self.t_ui.order_radio.activated_custom[str].connect(self.on_order_changed)
@ -862,7 +867,16 @@ class ToolDrilling(AppTool, Excellon):
current_widget2.currentIndexChanged.disconnect(self.form_to_storage)
except (TypeError, ValueError):
pass
elif isinstance(current_widget2, NumericalEvalEntry):
try:
current_widget2.editingFinished.disconnect(self.form_to_storage)
except (TypeError, ValueError):
pass
elif isinstance(current_widget2, NumericalEvalTupleEntry):
try:
current_widget2.editingFinished.disconnect(self.form_to_storage)
except (TypeError, ValueError):
pass
try:
self.t_ui.order_radio.activated_custom[str].disconnect()
except (TypeError, ValueError):
@ -2436,7 +2450,7 @@ class DrillingUI:
"If no value is entered then there is no move\n"
"on X,Y plane at the end of the job.")
)
self.endxy_entry = NumericalEvalEntry(border_color='#0069A9')
self.endxy_entry = NumericalEvalTupleEntry(border_color='#0069A9')
self.endxy_entry.setPlaceholderText(_("X,Y coordinates"))
self.endxy_entry.setObjectName("e_endxy")

View File

@ -4609,7 +4609,7 @@ class App(QtCore.QObject):
del obj_active.text_col
obj_active.annotation.clear(update=True)
del obj_active.annotation
obj_active.voronoi_shapes.clear(update=True)
obj_active.probing_shapes.clear(update=True)
except AttributeError as e:
log.debug(
"App.on_delete() --> delete annotations on a FlatCAMCNCJob object. %s" % str(e)

View File

@ -3164,6 +3164,7 @@ class CNCjob(Geometry):
self.startz = None
self.z_end = tool_dict["tools_drill_endz"]
self.xy_end = tool_dict["tools_drill_endxy"]
try:
if self.xy_end == '':
self.xy_end = None
@ -3176,7 +3177,7 @@ class CNCjob(Geometry):
self.xy_end = [float(eval(a)) for a in self.xy_end.split(",")]
if self.xy_end and len(self.xy_end) != 2:
self.app.inform.emit('[ERROR]%s' % _("The End X,Y format has to be (x, y)."))
self.app.inform.emit('[ERROR] %s' % _("The End X,Y format has to be (x, y)."))
return 'fail'
except Exception as e:
log.debug("camlib.CNCJob.generate_from_excellon_by_tool() xy_end --> %s" % str(e))
@ -6803,7 +6804,7 @@ class CNCjob(Geometry):
:rtype: list
"""
# TODO: This takes forever. Too much data?
# This takes forever. Too much data?
# self.app.inform.emit('%s: %s' % (_("Unifying Geometry from parsed Geometry segments"),
# str(len(self.gcode_parsed))))
# self.solid_geometry = cascaded_union([geo['geom'] for geo in self.gcode_parsed])