Added warning suppression for all missing speeds and changed default to true

This commit is contained in:
Markus Lampert
2020-12-14 18:25:27 -08:00
parent 385c9b844c
commit 63dbf329aa
5 changed files with 77 additions and 40 deletions

View File

@@ -27,11 +27,13 @@
# include <boost/regex.hpp>
#endif
#include <Base/Writer.h>
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/Parameter.h>
#include <Base/Reader.h>
#include <Base/Stream.h>
#include <Base/Exception.h>
#include <Base/Console.h>
#include <Base/Writer.h>
// 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<Command*>::const_iterator it = vpcCommands.begin();it!=vpcCommands.end();++it) {
for (std::vector<Command*>::const_iterator it = vpcCommands.begin();it!=vpcCommands.end();++it) {
std::string name = (*it)->Name;
float feedrate = (*it)->getParam("F");