bool CZPatternTask::SetParam(string sParam, string sVal) { MOOSToUpper(sParam); MOOSToUpper(sVal); if(!CMOOSBehaviour::SetParam(sParam,sVal)) { if(MOOSStrCmp(sParam,"THRUST")) { m_Thrust.SetCurrent(atof(sVal.c_str()),MOOSTime()); } else if(MOOSStrCmp(sParam,"TOLERANCE")) { m_dfTolerance = atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"PATTERN")) { if(MOOSStrCmp(sVal,"YOYO")) { m_ePatternType = MOOS_Z_PATTERN_YOYO; } else if(MOOSStrCmp(sVal,"SQUARE")) { m_ePatternType = MOOS_Z_PATTERN_SQUARE; } } else if(MOOSStrCmp(sParam,"LEVELTIME")) { m_dfLevelDuration = atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"MAXDEPTH")) { m_dfMaxDepth = atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"MINDEPTH")) { m_dfMinDepth = atof(sVal.c_str()); } else { //hmmm - it wasn't for us at all: base class didn't understand either MOOSTrace("Param \"%s\" not understood!\n",sParam.c_str()); return false; } } return true; }
bool CLimitBox::SetParam(string sParam, string sVal) { MOOSToUpper(sParam); MOOSToUpper(sVal); if(!CMOOSBehaviour::SetParam(sParam,sVal)) { //alwasy make it very important m_nPriority = 0; //this is for us... if(MOOSStrCmp(sParam,"XMIN")) { m_dfXMin=atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"XMAX")) { m_dfXMax=atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"YMIN")) { m_dfYMin=atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"YMAX")) { m_dfYMax=atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"DEPTHMAX")) { m_dfDepthMax=atof(sVal.c_str()); } else if(MOOSStrCmp(sParam,"IGNORETIME")) { m_dfIgnoreTime=atof(sVal.c_str()); } else { MOOSTrace("CLimitBox::unknown param %s",sParam.c_str()); return false; } } return true; }
DBLogEvent(const std::string & event_name, const std::string & event_client, const std::string & event_details, const std::string & event_time): event_name_(event_name), event_client_(event_client), event_details_(event_details), event_time_(event_time) { MOOSToUpper(event_name_); }
bool CSingleAction::SetParam(string sParam, string sVal) { MOOSToUpper(sParam); if(sParam == "ACTION") { m_sVarName = MOOSChomp(sVal,":"); m_sValue = sVal; return true; } return CSGMOOSBehaviour::SetParam(sParam, sVal); }
bool CMOOSNavTopDownCalEngine::OnRxTopDownControl(string sInstruction) { MOOSToUpper(sInstruction); if(MOOSStrCmp(sInstruction,"STOP")) { SetOnline(false); SetState(OFFLINE); return true; } else if(MOOSStrCmp(sInstruction,"START")) { OnStart(); return true; } else if(MOOSStrCmp(sInstruction,"CALCULATE")) { //ok try and calculate now.... return Calculate(MOOSTime()); } else if(sInstruction.find("FOCUS")!=string::npos) { MOOSChomp(sInstruction,"="); int nNew = atoi(sInstruction.c_str()); if(nNew!=0) { m_nActiveChannel = nNew; AddToOutput("Manual set of TDC focus to channel %d",nNew); SetFocus(nNew); } } else { AddToOutput("Unknown top down cal control command"); return false; } return true; }
bool CThirdPartyTask::OnNewInstruction(string sInstruction,double dfTimeNow) { MOOSToUpper(sInstruction); MOOSRemoveChars(sInstruction," \t"); if(sInstruction.find("ACTUATION:")!=string::npos) { return OnActuationInstruction(sInstruction,dfTimeNow); } else if(sInstruction.find("STATUS:")!=string::npos) { //eg "STATUS:ENABLE=TRUE" return OnStatusInstruction(sInstruction,dfTimeNow); } else { MOOSTrace("Unknown thirdparty command! : %s",sInstruction.c_str()); return false; } }