From 95b2a20228098abb573f890733e259e247b477ff Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 13 Dec 2020 21:51:31 -0800 Subject: [PATCH 1/9] Added preference option to suppress missing rapid speed warning --- src/Mod/Path/Gui/DlgSettingsPathColor.cpp | 2 + src/Mod/Path/Gui/DlgSettingsPathColor.ui | 36 ++++++++++++++-- src/Mod/Path/PathScripts/PathOp.py | 3 +- src/Mod/Path/PathScripts/PathPreferences.py | 48 +++++++++++---------- 4 files changed, 63 insertions(+), 26 deletions(-) diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp index d2db05acb2..b68ed7de28 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp @@ -67,6 +67,7 @@ void DlgSettingsPathColor::saveSettings() ui->DefaultBBoxNormalColor->onSave(); ui->DefaultSelectionStyle->onSave(); ui->DefaultTaskPanelLayout->onSave(); + ui->WarningSuppressRapidSpeeds->onSave(); } void DlgSettingsPathColor::loadSettings() @@ -83,6 +84,7 @@ void DlgSettingsPathColor::loadSettings() ui->DefaultBBoxNormalColor->onRestore(); ui->DefaultSelectionStyle->onRestore(); ui->DefaultTaskPanelLayout->onRestore(); + ui->WarningSuppressRapidSpeeds->onRestore(); } /** diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.ui b/src/Mod/Path/Gui/DlgSettingsPathColor.ui index fe18cf2843..ecfbcc1882 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.ui +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.ui @@ -6,12 +6,12 @@ 0 0 - 483 - 536 + 512 + 633 - Path colors + GUI @@ -449,6 +449,31 @@ + + + + Warnings + + + + + + Suppress warning about setting the rapid speed rates for accurate cycle time calculation + + + Suppress missing rapid speeds warning + + + WarningSuppressRapidSpeeds + + + Mod/Path + + + + + + @@ -472,6 +497,11 @@ QComboBox
Gui/PrefWidgets.h
+ + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
DefaultNormalPathColor diff --git a/src/Mod/Path/PathScripts/PathOp.py b/src/Mod/Path/PathScripts/PathOp.py index ee1cde01dc..a618d9f026 100644 --- a/src/Mod/Path/PathScripts/PathOp.py +++ b/src/Mod/Path/PathScripts/PathOp.py @@ -27,6 +27,7 @@ from PySide import QtCore import Path import PathScripts.PathGeom as PathGeom import PathScripts.PathLog as PathLog +import PathScripts.PathPreferences as PathPreferences import PathScripts.PathUtil as PathUtil import PathScripts.PathUtils as PathUtils from PathScripts.PathUtils import waiting_effects @@ -551,7 +552,7 @@ class ObjectOp(object): PathLog.warning(translate("Path", "Tool Controller feedrates required to calculate the cycle time.")) return translate('Path', 'Feedrate Error') - if hRapidrate == 0 or vRapidrate == 0: + if (hRapidrate == 0 or vRapidrate == 0) and not PathPreferences.suppressRapidSpeedsWarning(): PathLog.warning(translate("Path", "Add Tool Controller Rapid Speeds on the SetupSheet for more accurate cycle times.")) # Get the cycle time in seconds diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py index 6954c4b977..d41326ae30 100644 --- a/src/Mod/Path/PathScripts/PathPreferences.py +++ b/src/Mod/Path/PathScripts/PathPreferences.py @@ -29,35 +29,36 @@ import PathScripts.PathLog as PathLog # PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) # PathLog.trackModule() -DefaultFilePath = "DefaultFilePath" -DefaultJobTemplate = "DefaultJobTemplate" -DefaultStockTemplate = "DefaultStockTemplate" -DefaultTaskPanelLayout = "DefaultTaskPanelLayout" +DefaultFilePath = "DefaultFilePath" +DefaultJobTemplate = "DefaultJobTemplate" +DefaultStockTemplate = "DefaultStockTemplate" +DefaultTaskPanelLayout = "DefaultTaskPanelLayout" -PostProcessorDefault = "PostProcessorDefault" -PostProcessorDefaultArgs = "PostProcessorDefaultArgs" -PostProcessorBlacklist = "PostProcessorBlacklist" -PostProcessorOutputFile = "PostProcessorOutputFile" -PostProcessorOutputPolicy = "PostProcessorOutputPolicy" +PostProcessorDefault = "PostProcessorDefault" +PostProcessorDefaultArgs = "PostProcessorDefaultArgs" +PostProcessorBlacklist = "PostProcessorBlacklist" +PostProcessorOutputFile = "PostProcessorOutputFile" +PostProcessorOutputPolicy = "PostProcessorOutputPolicy" -LastPathToolBit = "LastPathToolBit" -LastPathToolLibrary = "LastPathToolLibrary" -LastPathToolShape = "LastPathToolShape" -LastPathToolTable = "LastPathToolTable" +LastPathToolBit = "LastPathToolBit" +LastPathToolLibrary = "LastPathToolLibrary" +LastPathToolShape = "LastPathToolShape" +LastPathToolTable = "LastPathToolTable" -LastFileToolBit = "LastFileToolBit" -LastFileToolLibrary = "LastFileToolLibrary" -LastFileToolShape = "LastFileToolShape" +LastFileToolBit = "LastFileToolBit" +LastFileToolLibrary = "LastFileToolLibrary" +LastFileToolShape = "LastFileToolShape" -UseLegacyTools = "UseLegacyTools" -UseAbsoluteToolPaths = "UseAbsoluteToolPaths" -OpenLastLibrary = "OpenLastLibrary" +UseLegacyTools = "UseLegacyTools" +UseAbsoluteToolPaths = "UseAbsoluteToolPaths" +OpenLastLibrary = "OpenLastLibrary" # Linear tolerance to use when generating Paths, eg when tessellating geometry -GeometryTolerance = "GeometryTolerance" -LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" +GeometryTolerance = "GeometryTolerance" +LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" -EnableExperimentalFeatures = "EnableExperimentalFeatures" +WarningSuppressRapidSpeeds = "WarningSuppressRapidSpeeds" +EnableExperimentalFeatures = "EnableExperimentalFeatures" def preferences(): @@ -259,6 +260,9 @@ def setDefaultTaskPanelLayout(style): def experimentalFeaturesEnabled(): return preferences().GetBool(EnableExperimentalFeatures, False) +def suppressRapidSpeedsWarning(): + return preferences().GetBool(WarningSuppressRapidSpeeds, False) + def lastFileToolLibrary(): filename = preferences().GetString(LastFileToolLibrary) From eb9cd1e7dadd7c21a59c08660ebed6ed33ceb84a Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 13 Dec 2020 22:03:21 -0800 Subject: [PATCH 2/9] Preference setting so suppress logging the selection mode as a warning. --- src/Mod/Path/Gui/DlgSettingsPathColor.cpp | 2 + src/Mod/Path/Gui/DlgSettingsPathColor.ui | 16 +++++++ src/Mod/Path/PathScripts/PathPreferences.py | 4 ++ src/Mod/Path/PathScripts/PathSelection.py | 49 ++++++++++++++------- 4 files changed, 55 insertions(+), 16 deletions(-) diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp index b68ed7de28..282018c81a 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp @@ -68,6 +68,7 @@ void DlgSettingsPathColor::saveSettings() ui->DefaultSelectionStyle->onSave(); ui->DefaultTaskPanelLayout->onSave(); ui->WarningSuppressRapidSpeeds->onSave(); + ui->WarningSuppressSelectionMode->onSave(); } void DlgSettingsPathColor::loadSettings() @@ -85,6 +86,7 @@ void DlgSettingsPathColor::loadSettings() ui->DefaultSelectionStyle->onRestore(); ui->DefaultTaskPanelLayout->onRestore(); ui->WarningSuppressRapidSpeeds->onRestore(); + ui->WarningSuppressSelectionMode->onRestore(); } /** diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.ui b/src/Mod/Path/Gui/DlgSettingsPathColor.ui index ecfbcc1882..9f0e630295 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.ui +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.ui @@ -471,6 +471,22 @@ + + + + Suppress warning whenever a Path selection mode is activated + + + Suppress selection mode warning + + + WarningSuppressSelectionMode + + + Mod/Path + + + diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py index d41326ae30..f750016372 100644 --- a/src/Mod/Path/PathScripts/PathPreferences.py +++ b/src/Mod/Path/PathScripts/PathPreferences.py @@ -58,6 +58,7 @@ GeometryTolerance = "GeometryTolerance" LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" WarningSuppressRapidSpeeds = "WarningSuppressRapidSpeeds" +WarningSuppressSelectionMode = "WarningSuppressSelectionMode" EnableExperimentalFeatures = "EnableExperimentalFeatures" @@ -263,6 +264,9 @@ def experimentalFeaturesEnabled(): def suppressRapidSpeedsWarning(): return preferences().GetBool(WarningSuppressRapidSpeeds, False) +def suppressSelectionModeWarning(): + return preferences().GetBool(WarningSuppressSelectionMode, False) + def lastFileToolLibrary(): filename = preferences().GetString(LastFileToolLibrary) diff --git a/src/Mod/Path/PathScripts/PathSelection.py b/src/Mod/Path/PathScripts/PathSelection.py index 11a75b31a1..055bfb1757 100644 --- a/src/Mod/Path/PathScripts/PathSelection.py +++ b/src/Mod/Path/PathScripts/PathSelection.py @@ -25,6 +25,7 @@ import FreeCAD import FreeCADGui import PathScripts.PathLog as PathLog +import PathScripts.PathPreferences as PathPreferences import PathScripts.PathUtils as PathUtils import math @@ -286,52 +287,62 @@ class ALLGate(PathBaseGate): def contourselect(): FreeCADGui.Selection.addSelectionGate(CONTOURGate()) - FreeCAD.Console.PrintWarning("Contour Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Contour Select Mode\n") def eselect(): FreeCADGui.Selection.addSelectionGate(EGate()) - FreeCAD.Console.PrintWarning("Edge Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Edge Select Mode\n") def drillselect(): FreeCADGui.Selection.addSelectionGate(DRILLGate()) - FreeCAD.Console.PrintWarning("Drilling Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Drilling Select Mode\n") def engraveselect(): FreeCADGui.Selection.addSelectionGate(ENGRAVEGate()) - FreeCAD.Console.PrintWarning("Engraving Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Engraving Select Mode\n") def fselect(): FreeCADGui.Selection.addSelectionGate(FACEGate()) # Was PROFILEGate() - FreeCAD.Console.PrintWarning("Profiling Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Profiling Select Mode\n") def chamferselect(): FreeCADGui.Selection.addSelectionGate(CHAMFERGate()) - FreeCAD.Console.PrintWarning("Deburr Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Deburr Select Mode\n") def profileselect(): FreeCADGui.Selection.addSelectionGate(PROFILEGate()) - FreeCAD.Console.PrintWarning("Profiling Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Profiling Select Mode\n") def pocketselect(): FreeCADGui.Selection.addSelectionGate(POCKETGate()) - FreeCAD.Console.PrintWarning("Pocketing Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Pocketing Select Mode\n") def adaptiveselect(): FreeCADGui.Selection.addSelectionGate(ADAPTIVEGate()) - FreeCAD.Console.PrintWarning("Adaptive Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Adaptive Select Mode\n") def slotselect(): FreeCADGui.Selection.addSelectionGate(ALLGate()) - FreeCAD.Console.PrintWarning("Slot Cutter Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Slot Cutter Select Mode\n") def surfaceselect(): @@ -339,26 +350,31 @@ def surfaceselect(): if(MESHGate() or FACEGate()): gate = True FreeCADGui.Selection.addSelectionGate(gate) - FreeCAD.Console.PrintWarning("Surfacing Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Surfacing Select Mode\n") def vcarveselect(): FreeCADGui.Selection.addSelectionGate(VCARVEGate()) - FreeCAD.Console.PrintWarning("Vcarve Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Vcarve Select Mode\n") def probeselect(): FreeCADGui.Selection.addSelectionGate(PROBEGate()) - FreeCAD.Console.PrintWarning("Probe Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Probe Select Mode\n") def customselect(): - FreeCAD.Console.PrintWarning("Custom Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Custom Select Mode\n") def turnselect(): FreeCADGui.Selection.addSelectionGate(TURNGate()) - FreeCAD.Console.PrintWarning("Turning Select Mode\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Turning Select Mode\n") def select(op): @@ -392,4 +408,5 @@ def select(op): def clear(): FreeCADGui.Selection.removeSelectionGate() - FreeCAD.Console.PrintWarning("Free Select\n") + if not PathPreferences.suppressSelectionModeWarning(): + FreeCAD.Console.PrintWarning("Free Select\n") From 69e9639a9eef6e117faa56948630d2bb5f8ab616 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 13 Dec 2020 22:06:15 -0800 Subject: [PATCH 3/9] Replaced print messages with PathLog statements --- src/Mod/Path/PathScripts/PathUtils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index c53b7a2ab6..5bc5011756 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -401,7 +401,7 @@ def getToolControllers(obj, proxy=None): except Exception: # pylint: disable=broad-except job = None - print("op={} ({})".format(obj.Label, type(obj))) + PathLog.debug("op={} ({})".format(obj.Label, type(obj))) if job: return [c for c in job.ToolController if proxy.isToolSupported(obj, c.Tool)] return [] @@ -538,7 +538,7 @@ def arc(cx, cy, sx, sy, ex, ey, horizFeed=0, ez=None, ccw=False): eps = 0.01 if (math.sqrt((cx - sx)**2 + (cy - sy)**2) - math.sqrt((cx - ex)**2 + (cy - ey)**2)) >= eps: - print("ERROR: Illegal arc: Start and end radii not equal") + PathLog.error(translate("Path", "Illegal arc: Start and end radii not equal")) return "" retstr = "" From c7e914ecc075138e3c023a513ffd2f37a3c1e01d Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 13 Dec 2020 22:15:32 -0800 Subject: [PATCH 4/9] Added hidden preference to suppress the opencamlib error --- src/Mod/Path/InitGui.py | 3 ++- src/Mod/Path/PathScripts/PathPreferences.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/InitGui.py b/src/Mod/Path/InitGui.py index d1feaff6a5..3b7f906e91 100644 --- a/src/Mod/Path/InitGui.py +++ b/src/Mod/Path/InitGui.py @@ -129,7 +129,8 @@ class PathWorkbench (Workbench): threedcmdgroup = ['Path_3dTools'] FreeCADGui.addCommand('Path_3dTools', PathCommandGroup(threedopcmdlist, QtCore.QT_TRANSLATE_NOOP("Path", '3D Operations'))) except ImportError: - FreeCAD.Console.PrintError("OpenCamLib is not working!\n") + if not PathPreferences.suppressOpenCamLibWarning(): + FreeCAD.Console.PrintError("OpenCamLib is not working!\n") self.appendToolbar(QtCore.QT_TRANSLATE_NOOP("Path", "Project Setup"), projcmdlist) self.appendToolbar(QtCore.QT_TRANSLATE_NOOP("Path", "Tool Commands"), toolcmdlist) diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py index f750016372..ee6c842c43 100644 --- a/src/Mod/Path/PathScripts/PathPreferences.py +++ b/src/Mod/Path/PathScripts/PathPreferences.py @@ -58,7 +58,8 @@ GeometryTolerance = "GeometryTolerance" LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" WarningSuppressRapidSpeeds = "WarningSuppressRapidSpeeds" -WarningSuppressSelectionMode = "WarningSuppressSelectionMode" +WarningSuppressSelectionMode = "WarningSuppressSelectionMode" +WarningSuppressOpenCamLib = "WarningSuppressOpenCamLib" EnableExperimentalFeatures = "EnableExperimentalFeatures" @@ -267,6 +268,9 @@ def suppressRapidSpeedsWarning(): def suppressSelectionModeWarning(): return preferences().GetBool(WarningSuppressSelectionMode, False) +def suppressOpenCamLibWarning(): + return preferences().GetBool(WarningSuppressOpenCamLib, False) + def lastFileToolLibrary(): filename = preferences().GetString(LastFileToolLibrary) From 933e13131e58e21e105310cab8f586c3159bec13 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 14 Dec 2020 18:25:27 -0800 Subject: [PATCH 5/9] Added warning suppression for all missing speeds and changed default to true --- src/Mod/Path/App/Path.cpp | 24 +++++---- src/Mod/Path/Gui/DlgSettingsPathColor.cpp | 2 + src/Mod/Path/Gui/DlgSettingsPathColor.ui | 29 +++++++++- src/Mod/Path/PathScripts/PathOp.py | 2 +- src/Mod/Path/PathScripts/PathPreferences.py | 60 +++++++++++---------- 5 files changed, 77 insertions(+), 40 deletions(-) diff --git a/src/Mod/Path/App/Path.cpp b/src/Mod/Path/App/Path.cpp index 12b0119e56..c47a03e9de 100644 --- a/src/Mod/Path/App/Path.cpp +++ b/src/Mod/Path/App/Path.cpp @@ -27,11 +27,13 @@ # include #endif -#include +#include +#include +#include +#include #include #include -#include -#include +#include // KDL stuff - at the moment, not used //#include "Mod/Robot/App/kdl_cp/path_line.hpp" @@ -150,27 +152,31 @@ double Toolpath::getLength() double Toolpath::getCycleTime(double hFeed, double vFeed, double hRapid, double vRapid) { // check the feedrates are set - if ((hFeed == 0) || (vFeed == 0)){ - Base::Console().Warning("Feed Rate Error: Check Tool Controllers have Feed Rates"); + if ((hFeed == 0) || (vFeed == 0)) { + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Path"); + if (!hGrp->GetBool("WarningsSuppressAllSpeeds", true)) { + Base::Console().Warning("Feed Rate Error: Check Tool Controllers have Feed Rates"); + } return 0; } - if (hRapid == 0){ + if (hRapid == 0) { hRapid = hFeed; } - if (vRapid == 0){ + if (vRapid == 0) { vRapid = vFeed; } - if(vpcCommands.size()==0) + if (vpcCommands.size() == 0) { return 0; + } double l = 0; double time = 0; bool verticalMove = false; Vector3d last(0,0,0); Vector3d next; - for(std::vector::const_iterator it = vpcCommands.begin();it!=vpcCommands.end();++it) { + for (std::vector::const_iterator it = vpcCommands.begin();it!=vpcCommands.end();++it) { std::string name = (*it)->Name; float feedrate = (*it)->getParam("F"); diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp index 282018c81a..ed1e365af5 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp @@ -67,6 +67,7 @@ void DlgSettingsPathColor::saveSettings() ui->DefaultBBoxNormalColor->onSave(); ui->DefaultSelectionStyle->onSave(); ui->DefaultTaskPanelLayout->onSave(); + ui->WarningSuppressAllSpeeds->onSave(); ui->WarningSuppressRapidSpeeds->onSave(); ui->WarningSuppressSelectionMode->onSave(); } @@ -85,6 +86,7 @@ void DlgSettingsPathColor::loadSettings() ui->DefaultBBoxNormalColor->onRestore(); ui->DefaultSelectionStyle->onRestore(); ui->DefaultTaskPanelLayout->onRestore(); + ui->WarningSuppressAllSpeeds->onRestore(); ui->WarningSuppressRapidSpeeds->onRestore(); ui->WarningSuppressSelectionMode->onRestore(); } diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.ui b/src/Mod/Path/Gui/DlgSettingsPathColor.ui index 9f0e630295..f3d7e8aa1f 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.ui +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.ui @@ -7,7 +7,7 @@ 0 0 512 - 633 + 691 @@ -455,14 +455,36 @@ Warnings + + + + Suppress all warnings about setting speed rates for accurate cycle time calculation + + + Suppress all missing speeds warning + + + true + + + WarningSuppressAllSpeeds + + + Mod/Path + + + - Suppress warning about setting the rapid speed rates for accurate cycle time calculation + Suppress warning about setting the rapid speed rates for accurate cycle time calculation. Ignored if all speed warnings are already suppressed. Suppress missing rapid speeds warning + + true + WarningSuppressRapidSpeeds @@ -479,6 +501,9 @@ Suppress selection mode warning + + true + WarningSuppressSelectionMode diff --git a/src/Mod/Path/PathScripts/PathOp.py b/src/Mod/Path/PathScripts/PathOp.py index a618d9f026..8b2679a295 100644 --- a/src/Mod/Path/PathScripts/PathOp.py +++ b/src/Mod/Path/PathScripts/PathOp.py @@ -548,7 +548,7 @@ class ObjectOp(object): hRapidrate = tc.HorizRapid.Value vRapidrate = tc.VertRapid.Value - if hFeedrate == 0 or vFeedrate == 0: + if (hFeedrate == 0 or vFeedrate == 0) and not PathPreferences.suppressAllSpeedsWarning(): PathLog.warning(translate("Path", "Tool Controller feedrates required to calculate the cycle time.")) return translate('Path', 'Feedrate Error') diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py index ee6c842c43..d914568631 100644 --- a/src/Mod/Path/PathScripts/PathPreferences.py +++ b/src/Mod/Path/PathScripts/PathPreferences.py @@ -29,38 +29,39 @@ import PathScripts.PathLog as PathLog # PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) # PathLog.trackModule() -DefaultFilePath = "DefaultFilePath" -DefaultJobTemplate = "DefaultJobTemplate" -DefaultStockTemplate = "DefaultStockTemplate" -DefaultTaskPanelLayout = "DefaultTaskPanelLayout" +DefaultFilePath = "DefaultFilePath" +DefaultJobTemplate = "DefaultJobTemplate" +DefaultStockTemplate = "DefaultStockTemplate" +DefaultTaskPanelLayout = "DefaultTaskPanelLayout" -PostProcessorDefault = "PostProcessorDefault" -PostProcessorDefaultArgs = "PostProcessorDefaultArgs" -PostProcessorBlacklist = "PostProcessorBlacklist" -PostProcessorOutputFile = "PostProcessorOutputFile" -PostProcessorOutputPolicy = "PostProcessorOutputPolicy" +PostProcessorDefault = "PostProcessorDefault" +PostProcessorDefaultArgs = "PostProcessorDefaultArgs" +PostProcessorBlacklist = "PostProcessorBlacklist" +PostProcessorOutputFile = "PostProcessorOutputFile" +PostProcessorOutputPolicy = "PostProcessorOutputPolicy" -LastPathToolBit = "LastPathToolBit" -LastPathToolLibrary = "LastPathToolLibrary" -LastPathToolShape = "LastPathToolShape" -LastPathToolTable = "LastPathToolTable" +LastPathToolBit = "LastPathToolBit" +LastPathToolLibrary = "LastPathToolLibrary" +LastPathToolShape = "LastPathToolShape" +LastPathToolTable = "LastPathToolTable" -LastFileToolBit = "LastFileToolBit" -LastFileToolLibrary = "LastFileToolLibrary" -LastFileToolShape = "LastFileToolShape" +LastFileToolBit = "LastFileToolBit" +LastFileToolLibrary = "LastFileToolLibrary" +LastFileToolShape = "LastFileToolShape" -UseLegacyTools = "UseLegacyTools" -UseAbsoluteToolPaths = "UseAbsoluteToolPaths" -OpenLastLibrary = "OpenLastLibrary" +UseLegacyTools = "UseLegacyTools" +UseAbsoluteToolPaths = "UseAbsoluteToolPaths" +OpenLastLibrary = "OpenLastLibrary" # Linear tolerance to use when generating Paths, eg when tessellating geometry -GeometryTolerance = "GeometryTolerance" -LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" +GeometryTolerance = "GeometryTolerance" +LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" -WarningSuppressRapidSpeeds = "WarningSuppressRapidSpeeds" -WarningSuppressSelectionMode = "WarningSuppressSelectionMode" -WarningSuppressOpenCamLib = "WarningSuppressOpenCamLib" -EnableExperimentalFeatures = "EnableExperimentalFeatures" +WarningSuppressRapidSpeeds = "WarningSuppressRapidSpeeds" +WarningSuppressAllSpeeds = "WarningSuppressAllSpeeds" +WarningSuppressSelectionMode = "WarningSuppressSelectionMode" +WarningSuppressOpenCamLib = "WarningSuppressOpenCamLib" +EnableExperimentalFeatures = "EnableExperimentalFeatures" def preferences(): @@ -262,14 +263,17 @@ def setDefaultTaskPanelLayout(style): def experimentalFeaturesEnabled(): return preferences().GetBool(EnableExperimentalFeatures, False) +def suppressAllSpeedsWarning(): + return preferences().GetBool(WarningSuppressAllSpeeds, True) + def suppressRapidSpeedsWarning(): - return preferences().GetBool(WarningSuppressRapidSpeeds, False) + return suppressAllSpeedsWarning() or preferences().GetBool(WarningSuppressRapidSpeeds, True) def suppressSelectionModeWarning(): - return preferences().GetBool(WarningSuppressSelectionMode, False) + return preferences().GetBool(WarningSuppressSelectionMode, True) def suppressOpenCamLibWarning(): - return preferences().GetBool(WarningSuppressOpenCamLib, False) + return preferences().GetBool(WarningSuppressOpenCamLib, True) def lastFileToolLibrary(): From 698414058495344399d53b747f10309dd9b7f413 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Tue, 15 Dec 2020 20:09:55 -0800 Subject: [PATCH 6/9] Disabled '... postprocessor loaded' messages --- src/Mod/Path/PathScripts/post/centroid_post.py | 2 +- src/Mod/Path/PathScripts/post/dumper_post.py | 2 +- src/Mod/Path/PathScripts/post/dynapath_post.py | 2 +- src/Mod/Path/PathScripts/post/example_post.py | 2 +- src/Mod/Path/PathScripts/post/fablin_post.py | 2 +- src/Mod/Path/PathScripts/post/grbl_post.py | 2 +- src/Mod/Path/PathScripts/post/jtech_post.py | 2 +- src/Mod/Path/PathScripts/post/linuxcnc_post.py | 2 +- src/Mod/Path/PathScripts/post/mach3_mach4_post.py | 2 +- src/Mod/Path/PathScripts/post/marlin_post.py | 2 +- src/Mod/Path/PathScripts/post/opensbp_post.py | 2 +- src/Mod/Path/PathScripts/post/rml_post.py | 2 +- src/Mod/Path/PathScripts/post/smoothie_post.py | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Mod/Path/PathScripts/post/centroid_post.py b/src/Mod/Path/PathScripts/post/centroid_post.py index 002a325ab1..747d65792a 100644 --- a/src/Mod/Path/PathScripts/post/centroid_post.py +++ b/src/Mod/Path/PathScripts/post/centroid_post.py @@ -324,4 +324,4 @@ def parse(pathobj): return out -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/dumper_post.py b/src/Mod/Path/PathScripts/post/dumper_post.py index 197d2f8ced..efa8262e07 100644 --- a/src/Mod/Path/PathScripts/post/dumper_post.py +++ b/src/Mod/Path/PathScripts/post/dumper_post.py @@ -94,4 +94,4 @@ def parse(pathobj): out += str(c) + "\n" return out -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/dynapath_post.py b/src/Mod/Path/PathScripts/post/dynapath_post.py index f59ee7c40e..20fd1c65b2 100644 --- a/src/Mod/Path/PathScripts/post/dynapath_post.py +++ b/src/Mod/Path/PathScripts/post/dynapath_post.py @@ -367,4 +367,4 @@ def parse(pathobj): return out -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/example_post.py b/src/Mod/Path/PathScripts/post/example_post.py index 4509b4d216..8163008fd9 100644 --- a/src/Mod/Path/PathScripts/post/example_post.py +++ b/src/Mod/Path/PathScripts/post/example_post.py @@ -100,4 +100,4 @@ def parse(inputstring): print("done postprocessing.") return output -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/fablin_post.py b/src/Mod/Path/PathScripts/post/fablin_post.py index 3b6aca293a..fd96b4474e 100644 --- a/src/Mod/Path/PathScripts/post/fablin_post.py +++ b/src/Mod/Path/PathScripts/post/fablin_post.py @@ -300,4 +300,4 @@ def parse(pathobj): return out -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/grbl_post.py b/src/Mod/Path/PathScripts/post/grbl_post.py index 47e3c92c87..c32fe1396b 100755 --- a/src/Mod/Path/PathScripts/post/grbl_post.py +++ b/src/Mod/Path/PathScripts/post/grbl_post.py @@ -570,4 +570,4 @@ def drill_translate(outstring, cmd, params): return trBuff -print(__name__ + ": GCode postprocessor loaded.") +# print(__name__ + ": GCode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/jtech_post.py b/src/Mod/Path/PathScripts/post/jtech_post.py index ef83220551..ff9825dc46 100644 --- a/src/Mod/Path/PathScripts/post/jtech_post.py +++ b/src/Mod/Path/PathScripts/post/jtech_post.py @@ -333,4 +333,4 @@ def parse(pathobj): return out -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/linuxcnc_post.py b/src/Mod/Path/PathScripts/post/linuxcnc_post.py index 691b018f85..6f22d93142 100644 --- a/src/Mod/Path/PathScripts/post/linuxcnc_post.py +++ b/src/Mod/Path/PathScripts/post/linuxcnc_post.py @@ -398,4 +398,4 @@ def parse(pathobj): return out -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/mach3_mach4_post.py b/src/Mod/Path/PathScripts/post/mach3_mach4_post.py index cb1392ab95..f2ca58259d 100644 --- a/src/Mod/Path/PathScripts/post/mach3_mach4_post.py +++ b/src/Mod/Path/PathScripts/post/mach3_mach4_post.py @@ -434,4 +434,4 @@ def parse(pathobj): return out -print(__name__ + " gcode postprocessor loaded.") \ No newline at end of file +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/marlin_post.py b/src/Mod/Path/PathScripts/post/marlin_post.py index 5e4c6ea02d..44fad8210e 100644 --- a/src/Mod/Path/PathScripts/post/marlin_post.py +++ b/src/Mod/Path/PathScripts/post/marlin_post.py @@ -763,7 +763,7 @@ def drill_translate(outlist, cmd, params): return Drill.gcode -print(__name__ + ': GCode postprocessor loaded.') +# print(__name__ + ': GCode postprocessor loaded.') # PEP8 format passed using: http://pep8online.com/, which primarily covers # indentation and line length. Some other aspects of PEP8 which have not diff --git a/src/Mod/Path/PathScripts/post/opensbp_post.py b/src/Mod/Path/PathScripts/post/opensbp_post.py index b99c86602f..9a33ddec30 100644 --- a/src/Mod/Path/PathScripts/post/opensbp_post.py +++ b/src/Mod/Path/PathScripts/post/opensbp_post.py @@ -364,4 +364,4 @@ def linenumber(): return "" -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/rml_post.py b/src/Mod/Path/PathScripts/post/rml_post.py index fd28d957f4..ad2c83c2f5 100644 --- a/src/Mod/Path/PathScripts/post/rml_post.py +++ b/src/Mod/Path/PathScripts/post/rml_post.py @@ -256,5 +256,5 @@ def parse(inputstring): return '\n'.join(output) -print (__name__ + " gcode postprocessor loaded.") +# print (__name__ + " gcode postprocessor loaded.") diff --git a/src/Mod/Path/PathScripts/post/smoothie_post.py b/src/Mod/Path/PathScripts/post/smoothie_post.py index 8ce7d99a45..34d41b3bab 100644 --- a/src/Mod/Path/PathScripts/post/smoothie_post.py +++ b/src/Mod/Path/PathScripts/post/smoothie_post.py @@ -425,4 +425,4 @@ def parse(pathobj): return out -print(__name__ + " gcode postprocessor loaded.") +# print(__name__ + " gcode postprocessor loaded.") From 354af74b61e717069eedd24b76d3c6aabc4b6597 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Tue, 15 Dec 2020 20:11:40 -0800 Subject: [PATCH 7/9] Disabled path wb dis-/activated msgs --- src/Mod/Path/InitGui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/InitGui.py b/src/Mod/Path/InitGui.py index 3b7f906e91..e26c2fe0da 100644 --- a/src/Mod/Path/InitGui.py +++ b/src/Mod/Path/InitGui.py @@ -168,10 +168,11 @@ class PathWorkbench (Workbench): def Activated(self): # update the translation engine FreeCADGui.updateLocale() - Msg("Path workbench activated\n") + # Msg("Path workbench activated\n") def Deactivated(self): - Msg("Path workbench deactivated\n") + # Msg("Path workbench deactivated\n") + pass def ContextMenu(self, recipient): import PathScripts From 5049a98748e257867aab7ea3bd72de55daa0cb93 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Tue, 15 Dec 2020 20:16:06 -0800 Subject: [PATCH 8/9] Changed print to debug msg --- src/Mod/Path/PathScripts/PathMillFace.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathMillFace.py b/src/Mod/Path/PathScripts/PathMillFace.py index e87a24e80b..a932b3efbc 100644 --- a/src/Mod/Path/PathScripts/PathMillFace.py +++ b/src/Mod/Path/PathScripts/PathMillFace.py @@ -41,12 +41,8 @@ __doc__ = "Class and implementation of Mill Facing operation." __contributors__ = "russ4262 (Russell Johnson)" -DEBUG = False -if DEBUG: - PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) - PathLog.trackModule() -else: - PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) +PathLog.setLevel(PathLog.Level.INFO, PathLog.thisModule()) +# PathLog.trackModule() # Qt translation handling @@ -82,7 +78,7 @@ class ObjectFace(PathPocketBase.ObjectPocket): obj.OpStartDepth = job.Stock.Shape.BoundBox.ZMax if len(obj.Base) >= 1: - print('processing') + PathLog.debug('processing') sublist = [] for i in obj.Base: o = i[0] From bb747142350890f9a1456c226deb625071cebba7 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Tue, 15 Dec 2020 21:55:27 -0800 Subject: [PATCH 9/9] Print deburr tool info only once. --- src/Mod/Path/PathScripts/PathDeburr.py | 45 ++++++++++------ src/Mod/Path/PathTests/TestPathDeburr.py | 67 +++++++++++++++++++++--- 2 files changed, 88 insertions(+), 24 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDeburr.py b/src/Mod/Path/PathScripts/PathDeburr.py index 4f23603d05..ba530dc366 100644 --- a/src/Mod/Path/PathScripts/PathDeburr.py +++ b/src/Mod/Path/PathScripts/PathDeburr.py @@ -23,6 +23,7 @@ import FreeCAD import PathScripts.PathEngraveBase as PathEngraveBase +import PathScripts.PathGeom as PathGeom import PathScripts.PathLog as PathLog import PathScripts.PathOp as PathOp import PathScripts.PathOpTools as PathOpTools @@ -48,35 +49,44 @@ def translate(context, text, disambig=None): return QtCore.QCoreApplication.translate(context, text, disambig) -def toolDepthAndOffset(width, extraDepth, tool): +def toolDepthAndOffset(width, extraDepth, tool, printInfo): '''toolDepthAndOffset(width, extraDepth, tool) ... return tuple for given\n parameters.''' if not hasattr(tool, 'Diameter'): raise ValueError('Deburr requires tool with diameter\n') - if not hasattr(tool, 'CuttingEdgeAngle'): - angle = 180 - FreeCAD.Console.PrintMessage('The selected tool has No CuttingEdgeAngle property. Assuming Endmill\n') - else: + suppressInfo = False + if hasattr(tool, 'CuttingEdgeAngle'): angle = float(tool.CuttingEdgeAngle) - - if not hasattr(tool, 'FlatRadius'): - toolOffset = float(tool.Diameter / 2) - FreeCAD.Console.PrintMessage('The selected tool has no FlatRadius property. Using Diameter\n') + if PathGeom.isRoughly(angle, 180) or PathGeom.isRoughly(angle, 0): + angle = 180 + toolOffset = float(tool.Diameter) / 2 + else: + if hasattr(tool, 'TipDiameter'): + toolOffset = float(tool.TipDiameter) / 2 + elif hasattr(tool, 'FlatRadius'): + toolOffset = float(tool.FlatRadius) + else: + toolOffset = 0.0 + if printInfo and not suppressInfo: + FreeCAD.Console.PrintMessage(translate('PathDeburr', "The selected tool has no FlatRadius and no TipDiameter property. Assuming {}\n").format("Endmill" if angle == 180 else "V-Bit")) + suppressInfo = True else: - toolOffset = float(tool.FlatRadius) - - if angle == 0: angle = 180 + toolOffset = float(tool.Diameter) / 2 + if printInfo: + FreeCAD.Console.PrintMessage(translate('PathDeburr', 'The selected tool has no CuttingEdgeAngle property. Assuming Endmill\n')) + suppressInfo = True + tan = math.tan(math.radians(angle / 2)) - toolDepth = 0 if 0 == tan else width / tan + toolDepth = 0 if PathGeom.isRoughly(tan, 0) else width / tan depth = toolDepth + extraDepth - extraOffset = float(tool.Diameter) / 2 - width if angle == 180 else extraDepth / tan + extraOffset = -width if angle == 180 else (extraDepth / tan) offset = toolOffset + extraOffset - return (depth, offset) + return (depth, offset, suppressInfo) class ObjectDeburr(PathEngraveBase.ObjectOp): @@ -110,8 +120,11 @@ class ObjectDeburr(PathEngraveBase.ObjectOp): def opExecute(self, obj): PathLog.track(obj.Label) + if not hasattr(self, 'printInfo'): + self.printInfo = True try: - (depth, offset) = toolDepthAndOffset(obj.Width.Value, obj.ExtraDepth.Value, self.tool) + (depth, offset, suppressInfo) = toolDepthAndOffset(obj.Width.Value, obj.ExtraDepth.Value, self.tool, self.printInfo) + self.printInfo = not suppressInfo except ValueError as e: msg = "{} \n No path will be generated".format(e) raise ValueError(msg) diff --git a/src/Mod/Path/PathTests/TestPathDeburr.py b/src/Mod/Path/PathTests/TestPathDeburr.py index 48692a4e48..901851143b 100644 --- a/src/Mod/Path/PathTests/TestPathDeburr.py +++ b/src/Mod/Path/PathTests/TestPathDeburr.py @@ -38,16 +38,18 @@ class TestPathDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0 tool.CuttingEdgeAngle = 180 - (depth, offset) = PathDeburr.toolDepthAndOffset(1, 0.01, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.01, tool, True) self.assertRoughly(0.01, depth) self.assertRoughly(9, offset) + self.assertFalse(info) # legacy tools - no problem, same result tool.CuttingEdgeAngle = 0 - (depth, offset) = PathDeburr.toolDepthAndOffset(1, 0.01, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.01, tool, True) self.assertRoughly(0.01, depth) self.assertRoughly(9, offset) + self.assertFalse(info) def test01(self): '''Verify chamfer depth and offset for a 90° v-bit.''' @@ -55,13 +57,15 @@ class TestPathDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0 tool.CuttingEdgeAngle = 90 - (depth, offset) = PathDeburr.toolDepthAndOffset(1, 0, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0, tool, True) self.assertRoughly(1, depth) self.assertRoughly(0, offset) + self.assertFalse(info) - (depth, offset) = PathDeburr.toolDepthAndOffset(1, 0.2, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.2, tool, True) self.assertRoughly(1.2, depth) self.assertRoughly(0.2, offset) + self.assertFalse(info) def test02(self): '''Verify chamfer depth and offset for a 90° v-bit with non 0 flat radius.''' @@ -69,13 +73,15 @@ class TestPathDeburr(PathTestUtils.PathTestBase): tool.FlatRadius = 0.3 tool.CuttingEdgeAngle = 90 - (depth, offset) = PathDeburr.toolDepthAndOffset(1, 0, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0, tool, True) self.assertRoughly(1, depth) self.assertRoughly(0.3, offset) + self.assertFalse(info) - (depth, offset) = PathDeburr.toolDepthAndOffset(2, 0.2, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(2, 0.2, tool, True) self.assertRoughly(2.2, depth) self.assertRoughly(0.5, offset) + self.assertFalse(info) def test03(self): '''Verify chamfer depth and offset for a 60° v-bit with non 0 flat radius.''' @@ -85,10 +91,55 @@ class TestPathDeburr(PathTestUtils.PathTestBase): td = 1.73205 - (depth, offset) = PathDeburr.toolDepthAndOffset(1, 0, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0, tool, True) self.assertRoughly(td, depth) self.assertRoughly(10, offset) + self.assertFalse(info) - (depth, offset) = PathDeburr.toolDepthAndOffset(3, 1, tool) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(3, 1, tool, True) self.assertRoughly(td * 3 + 1, depth) self.assertRoughly(10 + td, offset) + self.assertFalse(info) + + def test10(self): + '''Verify missing cutting endge angle info prints only once.''' + + class FakeEndmill(object): + def __init__(self, dia): + self.Diameter = dia + + tool = FakeEndmill(10) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, True) + self.assertRoughly(0.1, depth) + self.assertRoughly(4, offset) + self.assertTrue(info) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + self.assertRoughly(0.1, depth) + self.assertRoughly(4, offset) + self.assertTrue(info) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + self.assertRoughly(0.1, depth) + self.assertRoughly(4, offset) + self.assertTrue(info) + + def test11(self): + '''Verify missing tip diameter info prints only once.''' + + class FakePointyBit(object): + def __init__(self, dia, angle): + self.Diameter = dia + self.CuttingEdgeAngle = angle + + tool = FakePointyBit(10, 90) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, True) + self.assertRoughly(1.1, depth) + self.assertRoughly(0.1, offset) + self.assertTrue(info) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + self.assertRoughly(1.1, depth) + self.assertRoughly(0.1, offset) + self.assertTrue(info) + (depth, offset, info) = PathDeburr.toolDepthAndOffset(1, 0.1, tool, not info) + self.assertRoughly(1.1, depth) + self.assertRoughly(0.1, offset) + self.assertTrue(info)