From 63dbf329aa3e8230de6d93fa562a0c3da49189cc Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 14 Dec 2020 18:25:27 -0800 Subject: [PATCH] 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():