diff --git a/.gitignore b/.gitignore index 30a8ae85..15c9c9f5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ tests/tmp/ build/ /venv/ +/venv/ # General for macOS .DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index 7524f35c..112da3ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM Evo beta ================================================= +19.11.2022 + +- added a 'return' button when a fatal error is encountered allowing the user to continue the work +- fixed a crash in Milling Plugin when trying to mill slots that do not have drills in the same file + 9.11.2022 - when changing the style for the decorations from Preferences, now change is applied immediately diff --git a/FlatCAM.py b/FlatCAM.py index da2f78df..b4652c4b 100644 --- a/FlatCAM.py +++ b/FlatCAM.py @@ -134,13 +134,19 @@ if __name__ == '__main__': msgbox.setIcon(QtWidgets.QMessageBox.Icon.Critical) bt_yes = msgbox.addButton("Quit", QtWidgets.QMessageBox.ButtonRole.YesRole) + bt_ret = msgbox.addButton("Return", QtWidgets.QMessageBox.ButtonRole.NoRole) msgbox.setDefaultButton(bt_yes) # msgbox.setTextFormat(Qt.TextFormat.RichText) msgbox.exec() + + response = msgbox.clickedButton() + if response == bt_ret: + pass except Exception: - pass - QtWidgets.QApplication.quit() + QtWidgets.QApplication.quit() + else: + QtWidgets.QApplication.quit() # or QtWidgets.QApplication.exit(0) sys.excepthook = excepthook diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index c681a5d3..11fc626b 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -2819,18 +2819,27 @@ class ToolMilling(AppTool, Excellon): buff_dia = float(tools_dict[tool]['tooldia']) / 2.0 + offset if mill_type in ['drills', 'both']: - drills_tool_geo = [ - d_p.buffer(buff_dia) for d_p in tools_dict[tool]['drills'] - ] - total_paint_geo = drills_tool_geo - elif mill_type in ['slots', 'both']: - slots_tool_geo = [ - LineString(s_l).buffer(buff_dia) for s_l in tools_dict[tool]['slots'] - ] - total_paint_geo = slots_tool_geo - elif mill_type == 'both': + try: + drills_tool_geo = [ + d_p.buffer(buff_dia) for d_p in tools_dict[tool]['drills'] + ] + total_paint_geo = drills_tool_geo + except KeyError: + total_paint_geo = [] + if mill_type in ['slots', 'both']: + try: + slots_tool_geo = [ + LineString(s_l).buffer(buff_dia) for s_l in tools_dict[tool]['slots'] + ] + total_paint_geo = slots_tool_geo + except KeyError: + total_paint_geo = [] + if mill_type == 'both': total_paint_geo = drills_tool_geo + slots_tool_geo + if not total_paint_geo: + continue + pol_nr = 0 geo_len = len(total_paint_geo) cp = []