bool COrbitTask::GetRegistrations(STRING_LIST &List) { List.push_front("NAV_X"); List.push_front("NAV_Y"); List.push_front("NAV_YAW"); //always call base class version CMOOSBehaviour::GetRegistrations(List); return true; }
bool CLimitBox::GetRegistrations(STRING_LIST &List) { List.push_front("NAV_DEPTH"); List.push_front("NAV_X"); List.push_front("NAV_Y"); //always call base class version CMOOSBehaviour::GetRegistrations(List); return true; }
bool CThirdPartyTask::GetRegistrations(STRING_LIST &List) { List.push_front(m_sJob); //always call base class version CMOOSBehaviour::GetRegistrations(List); return true; }
bool CZPatternTask::GetRegistrations(STRING_LIST &List) { List.push_front("NAV_DEPTH"); List.push_front("NAV_PITCH"); //always call base class version CMOOSBehaviour::GetRegistrations(List); return true; }
bool CManualControl::GetRegistrations(STRING_LIST &List) { DOF_MAP::iterator i; for(i=m_ManualDOFs.begin(); i!=m_ManualDOFs.end(); i++) List.push_front((string)"MANUAL_"+i->first); //always call base class version CSGMOOSBehaviour::GetRegistrations(List); return true; }
bool CMOOSCommServer::GetClientNames(STRING_LIST &sList) { sList.clear(); SOCKETFD_2_CLIENT_NAME_MAP::iterator p; for(p = m_Socket2ClientMap.begin();p!=m_Socket2ClientMap.end();p++) { sList.push_front(p->second); } return true; }
bool CHelmApp::CTransaction::BuildParameterList(string sList, STRING_LIST &ParameterList) { //remove the whitespace MOOSRemoveChars(sList," "); //sList has format: //LOCATION=0,0,0|RADIUS=5 while(!sList.empty()) { string sWhat = MOOSChomp(sList,"|"); MOOSToUpper(sWhat); ParameterList.push_front(sWhat); } return true; }
bool CProcessConfigReader::GetConfiguration(std::string sAppName, STRING_LIST &Params) { int nBrackets = 0; Params.clear(); Reset(); std::string sKey = "PROCESSCONFIG="+sAppName; if(GoTo(sKey)) { std::string sBracket = GetNextValidLine(); if(sBracket.find("{")==0) { nBrackets++; while(!GetFile()->eof()) { std::string sLine = GetNextValidLine(); MOOSRemoveChars(sLine," \t\r"); if(sLine.find("}")!=0) { #if(1) // jckerken 8-12-2004 // ignore if param = <empty string> std::string sTmp(sLine); std::string sTok = MOOSChomp(sTmp, "="); MOOSTrimWhiteSpace(sTok); // Handle potential whitespaces. MOOSTrimWhiteSpace(sTmp); if (sTok.size() > 0) { MOOSTrimWhiteSpace(sTmp); if (!sTmp.empty()) { Params.push_front(sTok+std::string("=")+sTmp); // Was: sLine } else if(sLine.find("[")!=std::string::npos || sLine.find("]")!=std::string::npos) { Params.push_front(sTok+std::string("=")+sTmp); // Was: sLine } } else { Params.push_front(sTok+std::string("=")+sTmp); // Was: sLine } #else Params.push_front(sLine); #endif } else { return true; } //quick error check - we don't allow nested { on single lines if(sLine.find("{")==0) { MOOSTrace("CProcessConfigReader::GetConfiguration() missing \"}\" syntax error in mission file\n"); } } } } return false; }
bool CHelmApp::InitialiseTransactors() { //a CTransaction object is responsible for knowing about transactions m_Transaction.Initialise(); //FORMAT is //ALLOW = JOBNAME@CLIENT:TASK1,TASK2|SessionTimeOut=value STRING_LIST Params; PERMISSIONS_MAP PermissionsMap; SESSION_TIMEOUT_MAP SessionTimeOutMap; if(m_MissionReader.GetConfiguration(m_sAppName,Params)) { STRING_LIST::iterator p; for(p=Params.begin();p!=Params.end();p++) { string sParam = *p; //get rid of the whitespace MOOSRemoveChars(sParam," "); string sWhat = MOOSChomp(sParam,"="); MOOSToUpper(sWhat); if(MOOSStrCmp(sWhat,"ALLOW")) { //Tasks that can be fired by the JOB@CLIENT string sClientInfo = MOOSChomp(sParam,"|"); string sWho = MOOSChomp(sClientInfo,":"); MOOSToUpper(sWho); STRING_LIST Tasks; while(!sClientInfo.empty()) { string sUpperParam = MOOSChomp(sClientInfo,","); MOOSToUpper(sUpperParam); Tasks.push_front(sUpperParam); } PermissionsMap[sWho] = Tasks; //SessionTimeOuts for these particular Tasks string sVar = MOOSChomp(sParam, "="); MOOSToUpper(sVar); if(MOOSStrCmp(sVar, "SESSIONTIMEOUT")) { double dfVal = atof(sParam.c_str()); if((dfVal > 0) && (dfVal < MAX_SESSION_TIMEOUT)) { SessionTimeOutMap[sWho] = dfVal; } else if((dfVal > 0) && (dfVal > MAX_SESSION_TIMEOUT)) { SessionTimeOutMap[sWho] = MAX_SESSION_TIMEOUT; } } } } //make sure the Transacation knows about these maps m_Transaction.SetPermissionsMap(PermissionsMap); m_Transaction.SetSessionTimeOutMap(SessionTimeOutMap); } //we initially are not talking to anyone m_Comms.Notify("CURRENT_THIRDPARTY", "NONE"); return true; }