From 9fb7dbe0c52e615ba273a1d3f82fed14567f7818 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 3 Dec 2020 15:41:12 +0200 Subject: [PATCH] - in Gerber Editor - for Disc and SemiDisc tools now it is allowed to start without a defined aperture; it will be assumed that we work with an aperture with size zero --- CHANGELOG.md | 1 + appEditors/AppGerberEditor.py | 48 ++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61bc948d..eff74357 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta - in Gerber Editor - modified the UI - in Gerber Editor - added new parameters for selected polygons: is_valid and area +- in Gerber Editor - for Disc and SemiDisc tools now it is allowed to start without a defined aperture; it will be assumed that we work with an aperture with size zero 2.12.2020 diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index 161f1987..e8444870 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -1638,17 +1638,18 @@ class DiscEditorGrb(ShapeToolEditorGrb): try: size_ap = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size']) except KeyError: - self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % - _("You need to preselect a aperture in the Aperture Table that has a size.")) - try: - QtGui.QGuiApplication.restoreOverrideCursor() - except Exception: - pass - self.dont_execute = True - self.draw_app.in_action = False - self.complete = True - self.draw_app.select_tool('select') - return + size_ap = 0.0 + # self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % + # _("You need to preselect a aperture in the Aperture Table that has a size.")) + # try: + # QtGui.QGuiApplication.restoreOverrideCursor() + # except Exception: + # pass + # self.dont_execute = True + # self.draw_app.in_action = False + # self.complete = True + # self.draw_app.select_tool('select') + # return self.buf_val = (size_ap / 2) if size_ap > 0 else 0.0000001 @@ -1761,17 +1762,18 @@ class DiscSemiEditorGrb(ShapeToolEditorGrb): try: size_ap = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size']) except KeyError: - self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % - _("You need to preselect a aperture in the Aperture Table that has a size.")) - try: - QtGui.QGuiApplication.restoreOverrideCursor() - except Exception: - pass - self.dont_execute = True - self.draw_app.in_action = False - self.complete = True - self.draw_app.select_tool('select') - return + size_ap = 0.0 + # self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % + # _("You need to preselect a aperture in the Aperture Table that has a size.")) + # try: + # QtGui.QGuiApplication.restoreOverrideCursor() + # except Exception: + # pass + # self.dont_execute = True + # self.draw_app.in_action = False + # self.complete = True + # self.draw_app.select_tool('select') + # return self.buf_val = (size_ap / 2) if size_ap > 0 else 0.0000001 @@ -4373,7 +4375,7 @@ class AppGerberEditor(QtCore.QObject): self.app.log.debug("on_tool_select('%s')" % tool) - if self.last_aperture_selected is None and current_tool != 'select': + if self.last_aperture_selected is None and current_tool not in ['select', 'disc', 'semidisc']: # self.draw_app.select_tool('select') self.complete = True current_tool = 'select'