tResult cSensorAnalyzer::Init(tInitStage eStage, __exception) { RETURN_IF_FAILED(cBaseQtFilter::Init(eStage, __exception_ptr)); if (eStage == StageFirst) { THROW_IF_FAILED(CreateInputPins(__exception_ptr)); } else if (StageNormal == eStage) { m_sensorPresets.resize(LIST_LENGTH); //THROW_IF_FAILED(LoadConfigurationData("default")); } else if(eStage == StageGraphReady) { //m_pWidget->SetSensorPresets(m_sensorPresets); cFilename filepath = GetPropertyStr("Directory for Sensorpresets"); ADTF_GET_CONFIG_FILENAME(filepath); cString path = filepath.CreateAbsolutePath("."); emit DirectoryReceived(QString(path.GetPtr())); // no ids were set so far m_bIDsVoltageSet= tFalse; m_bIDsInerMeasUnitSet= tFalse; m_bIDsWheelDataSet= tFalse; m_bIDsUltrasonicSet = tFalse; } RETURN_NOERROR; }
tResult cSensorAnalyzer::LoadConfigurationData(cString filename) { //Get path of configuration file //EDS macro is resolved automatically because it is a file property m_fileConfig = filename;//GetPropertyStr("Filename for Sensorpresets"); if (m_fileConfig.IsEmpty()) LOG_WARNING("Configuration file not found for Analyzer"); ADTF_GET_CONFIG_FILENAME(m_fileConfig); m_fileConfig = m_fileConfig.CreateAbsolutePath("."); if (cFileSystem::Exists(m_fileConfig)) { cDOM oDOM; oDOM.Load(m_fileConfig); cDOMElementRefList oElems; if(IS_OK(oDOM.FindNodes("presets/sensorPreset", oElems))) { for (cDOMElementRefList::iterator itElem = oElems.begin(); itElem != oElems.end(); ++itElem) { cDOMElement* pConfigElement; tSensorPreset newSensorPreset; if (IS_OK((*itElem)->FindNode("sensor", pConfigElement))) { newSensorPreset.sensorName = cString(pConfigElement->GetData()); if (IS_OK((*itElem)->FindNode("nominalValue", pConfigElement))) newSensorPreset.nominalValue = static_cast<tFloat32>(cString(pConfigElement->GetData()).AsFloat64()); if (IS_OK((*itElem)->FindNode("maxPosDeviation", pConfigElement))) newSensorPreset.maxPosDeviation = static_cast<tFloat32>(cString(pConfigElement->GetData()).AsFloat64()); if (IS_OK((*itElem)->FindNode("maxNegDeviation", pConfigElement))) newSensorPreset.maxNegDeviation = static_cast<tFloat32>(cString(pConfigElement->GetData()).AsFloat64()); } /*LOG_INFO(cString::Format("Name %s, Nominal: %f, NegDev: %f, PosDev: %f", newSensorPreset.sensorName.GetPtr(), newSensorPreset.nominalValue, newSensorPreset.maxNegDeviation, newSensorPreset.maxPosDeviation ));*/ addParsedElement(newSensorPreset); } } else { LOG_WARNING("Configured configuration file does not contain valid xml scheme"); } } else { LOG_WARNING("Configured configuration file not found (yet).Will appear after extracting the extended data"); } RETURN_NOERROR; }
tResult StateControlManagementSlim::LoadSCMStructureData() { // Get path of structure file m_strStructureFileName = GetPropertyStr("Configuration File For StateControlManagement"); // check if file exits if (m_strStructureFileName.IsEmpty()) { #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: XML-File for structural configuration not found, please check property!" << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_FILE,cString::Format("SCM: XML-File for structural configuration not found, please check property!")); } // create absolute path ADTF_GET_CONFIG_FILENAME(m_strStructureFileName); m_strStructureFileName = m_strStructureFileName.CreateAbsolutePath("."); //Load file, parse configuration, print the data if (cFileSystem::Exists(m_strStructureFileName)) { cDOM oDOM; oDOM.Load(m_strStructureFileName); m_SCMstructureList.clear(); cDOMElementRefList oScManeuverElems; cDOMElementRefList oScStepElems; cDOMElement* oScLevelActiveElem; cDOMElement* oScLevelPassiveElem; cDOMElementRefList oScFilterIDActiveElems; cDOMElementRefList oScFilterIDPassiveElems; cDOMElement* oScActionElem; cDOMElementRefList oScRequestElems; /* counters for checking if structural configuration file of StateControlManagement was correctly implemented by user, which means * that both maneuvers and steps start at id=0 and are implemented in ascending order in the xml-file, with NO gaps existing between ids! */ tUInt32 manCounter = 0; tUInt32 stepCounter = 0; //read first scManeuver Element if(IS_OK(oDOM.FindNodes("SCM-Structure-List/SCM-Maneuver", oScManeuverElems))) { //iterate through scManeuvers for (cDOMElementRefList::iterator itScManeuverElem = oScManeuverElems.begin(); itScManeuverElem != oScManeuverElems.end(); ++itScManeuverElem) { //if scManeuver found sc_Maneuver scManeuver; // declare object of scManeuver for saving purpose scManeuver.id = (*itScManeuverElem)->GetAttributeUInt32("id"); if(manCounter != scManeuver.id){ #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: Invalid structure of xml-file at maneuver " << scManeuver.id << ". Maneuvers must have ascending order and start at ID = 0. No gaps allowed. Check file!" << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_FILE,cString::Format("SCM: Invalid structure of xml-file at maneuver %d. Maneuvers must have ascending order and start at ID = 0. No gaps allowed. Check file!",scManeuver.id)); } if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: Maneuver %d ;",scManeuver.id)); if(IS_OK((*itScManeuverElem)->FindNodes("SCM-Step", oScStepElems))) { stepCounter = 0; //iterate through scSteps for(cDOMElementRefList::iterator itScStepsElem = oScStepElems.begin(); itScStepsElem != oScStepElems.end(); ++itScStepsElem) { //if scStep found sc_Step scStep; scStep.id = (*itScStepsElem)->GetAttributeUInt32("id"); if(stepCounter != scStep.id){ #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: Invalid structure of xml-file in maneuver " << scManeuver.id << ", step " << scStep.id << ". Maneuvers must have ascending order and start at ID = 0. No gaps allowed. Check file!" << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_FILE,cString::Format("SCM: Invalid structure of xml-file in maneuver %d, step %d. Steps must have ascending order and start at ID = 0. No gaps allowed. Check file!",scManeuver.id,scStep.id)); } if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: ---> Step %d ;",scStep.id)); // PATH FOR ACTIVITYLEVEL: ACTIVE if(IS_OK((*itScStepsElem)->FindNode("SCM-ActivityLevel/SCM-Active", oScLevelActiveElem))) { if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: -----> ACTIVE:")); //if scActivityLevel_ACTIVE found if(IS_OK(oScLevelActiveElem->FindNodes("SCM-FilterID", oScFilterIDActiveElems))) { //iterate through scFilterID_Active for(cDOMElementRefList::iterator itScFilterIDActiveElem = oScFilterIDActiveElems.begin(); itScFilterIDActiveElem != oScFilterIDActiveElems.end(); ++itScFilterIDActiveElem) { //if ScFilterID_Active found, Element of List FilterList active sc_Filter_active scFilterActive; scFilterActive.filterID= (*itScFilterIDActiveElem)->GetAttributeUInt32("id"); if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: -------> FilterID %d ;",scFilterActive.filterID)); // inside ID, there is only SCM-Action, so only search for specific node if(IS_OK((*itScFilterIDActiveElem)->FindNode("SCM-Action", oScActionElem))) { scFilterActive.action.enabled = oScActionElem->GetAttributeBool("enable"); if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: ---------> enable %d ;",scFilterActive.action.enabled)); scFilterActive.action.started = oScActionElem->GetAttributeBool("start"); if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: ---------> start %d ;",scFilterActive.action.started)); scFilterActive.action.command = oScActionElem->GetAttributeUInt32("command"); if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: ---------> command %d ;",scFilterActive.action.command)); } // Push found FilterActive Commands into Filter-Active-list for current step scStep.activityLvl.active.FilterList.push_back(scFilterActive); } } } // PATH FOR ACTIVITYLEVEL: PASSIVE if(IS_OK((*itScStepsElem)->FindNode("SCM-ActivityLevel/SCM-Passive", oScLevelPassiveElem))) { if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: -----> PASSIVE:")); //if scActivityLevel_PASSIVE found if(IS_OK(oScLevelPassiveElem->FindNodes("SCM-FilterID", oScFilterIDPassiveElems))) { //iterate through scFilterID_Passive for(cDOMElementRefList::iterator itScFilterIDPassiveElem = oScFilterIDPassiveElems.begin(); itScFilterIDPassiveElem != oScFilterIDPassiveElems.end(); ++itScFilterIDPassiveElem) { //if ScFilterID_Passive found, Element of List FilterList passive sc_Filter_passive scFilterPassive; scFilterPassive.filterID= (*itScFilterIDPassiveElem)->GetAttributeUInt32("id"); if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: -------> FilterID %d ;",scFilterPassive.filterID)); // inside ID, there can be several SCM-Requests if(IS_OK((*itScFilterIDPassiveElem)->FindNodes("SCM-Request", oScRequestElems))) { //iterate through scFilterID_Passive for(cDOMElementRefList::iterator itScReqeustElems = oScRequestElems.begin(); itScReqeustElems != oScRequestElems.end(); ++itScReqeustElems) { //if sc_Request found, Element of List Request sc_Request scRequest; scRequest.request = (*itScReqeustElems)->GetAttributeUInt32("status"); scRequest.command = (*itScReqeustElems)->GetAttributeUInt32("command"); scFilterPassive.Requests.push_back(scRequest); if(m_bPrintStrucModeEnabled) LOG_WARNING(cString::Format("SCM: ---------> status %d, command %d ;",scRequest.request,scRequest.command)); } } // Push found FilterPassive Commands into Filter-Passive-list for current step scStep.activityLvl.passive.FilterList.push_back(scFilterPassive); } } } // Push found steps into step-list scManeuver.Steps.push_back(scStep); stepCounter++; // increase step counter } } m_SCMstructureList.push_back(scManeuver); manCounter++; // increase maneuver counter } } if (oScManeuverElems.size() > 0) { if(m_bDebugModeEnabled) LOG_WARNING(cString::Format("SCM: Loaded Structural Configuration file successfully.")); #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << "SCM: Loaded Structural Configuration file successfully." << std::endl; #endif } else { #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: no valid Configuration Data found in file!" << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_FILE, cString::Format("SCM: no valid Configuration Data found in file!")); } } else { #ifdef WRITE_DEBUG_OUTPUT_TO_FILE scm_logfile << std::endl << "### --- " << std::endl << "SCM ERROR: Structural configuration file not found!" << std::endl; #endif RETURN_AND_LOG_ERROR_STR(ERR_INVALID_FILE,cString::Format("SCM: Structural configuration file not found!")); } RETURN_NOERROR; }
tResult cMarkerDetectFilter::Init(tInitStage eStage, __exception) { RETURN_IF_FAILED(cFilter::Init(eStage, __exception_ptr)); if (eStage == StageFirst) { //create the video rgb input pin RETURN_IF_FAILED(m_oPinInputVideo.Create("Video_RGB_input",IPin::PD_Input, static_cast<IPinEventSink*>(this))); RETURN_IF_FAILED(RegisterPin(&m_oPinInputVideo)); //create the video rgb output pin RETURN_IF_FAILED(m_oPinOutputVideo.Create("Video_RGB_output", IPin::PD_Output, static_cast<IPinEventSink*>(this))); RETURN_IF_FAILED(RegisterPin(&m_oPinOutputVideo)); // create the description manager cObjectPtr<IMediaDescriptionManager> pDescManager; RETURN_IF_FAILED(_runtime->GetObject(OID_ADTF_MEDIA_DESCRIPTION_MANAGER,IID_ADTF_MEDIA_DESCRIPTION_MANAGER, (tVoid**)&pDescManager,__exception_ptr)); tChar const * strDescSignalLanacc_man = pDescManager->GetMediaDescription("tSignalValue"); RETURN_IF_POINTER_NULL(strDescSignalLanacc_man); cObjectPtr<IMediaType> pTypeSignalmaneuver_lanacc = new cMediaType(0, 0, 0, "tSignalValue", strDescSignalLanacc_man, IMediaDescription::MDF_DDL_DEFAULT_VERSION); RETURN_IF_FAILED(pTypeSignalmaneuver_lanacc->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&mediatype_Lan_Acc_Man)); RETURN_IF_FAILED(Lan_Acc_Man.Create("Lan_Acc_Man", pTypeSignalmaneuver_lanacc, static_cast<IPinEventSink*> (this))); RETURN_IF_FAILED(RegisterPin(&Lan_Acc_Man)); tChar const * strDescSignalmaneuver_accspeed = pDescManager->GetMediaDescription("tSignalValue"); RETURN_IF_POINTER_NULL(strDescSignalmaneuver_accspeed); cObjectPtr<IMediaType> pTypeSignalmaneuver_accspeed = new cMediaType(0, 0, 0, "tSignalValue", strDescSignalmaneuver_accspeed, IMediaDescription::MDF_DDL_DEFAULT_VERSION); RETURN_IF_FAILED(pTypeSignalmaneuver_accspeed->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&mediatype_Lan_Acc_Speed)); RETURN_IF_FAILED(Lan_Acc_Speed.Create("Lane_Speed", pTypeSignalmaneuver_accspeed, static_cast<IPinEventSink*> (this))); RETURN_IF_FAILED(RegisterPin(&Lan_Acc_Speed)); tChar const * strDescSignalmaneuver_idJury = pDescManager->GetMediaDescription("tSignalValue"); RETURN_IF_POINTER_NULL(strDescSignalmaneuver_idJury); cObjectPtr<IMediaType> pTypeSignalmaneuver_idjury = new cMediaType(0, 0, 0, "tSignalValue", strDescSignalmaneuver_idJury, IMediaDescription::MDF_DDL_DEFAULT_VERSION); RETURN_IF_FAILED(pTypeSignalmaneuver_idjury->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&mediatype_maneuverid_Jury)); RETURN_IF_FAILED(maneuverid_Jury.Create("maneuverid_Jury", pTypeSignalmaneuver_idjury, static_cast<IPinEventSink*> (this))); RETURN_IF_FAILED(RegisterPin(&maneuverid_Jury)); tChar const * strDescSignalmaneuver_id = pDescManager->GetMediaDescription("tSignalValue"); RETURN_IF_POINTER_NULL(strDescSignalmaneuver_id); cObjectPtr<IMediaType> pTypeSignalmaneuver_id = new cMediaType(0, 0, 0, "tSignalValue", strDescSignalmaneuver_id, IMediaDescription::MDF_DDL_DEFAULT_VERSION); RETURN_IF_FAILED(pTypeSignalmaneuver_id->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&mediatype_maneuver_id)); RETURN_IF_FAILED(maneuver_id.Create("Maneuver_ID", pTypeSignalmaneuver_id, static_cast<IPinEventSink*> (this))); RETURN_IF_FAILED(RegisterPin(&maneuver_id)); tChar const * strDescSignalmaneuver_finish = pDescManager->GetMediaDescription("tBoolSignalValue"); RETURN_IF_POINTER_NULL(strDescSignalmaneuver_finish); cObjectPtr<IMediaType> pTypeSignalmaneuver_finish = new cMediaType(0, 0, 0, "tBoolSignalValue", strDescSignalmaneuver_finish, IMediaDescription::MDF_DDL_DEFAULT_VERSION); RETURN_IF_FAILED(pTypeSignalmaneuver_finish->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&mediatype_maneuver_finish)); RETURN_IF_FAILED(maneuver_finish.Create("Maneuver_int_Finish", pTypeSignalmaneuver_finish, static_cast<IPinEventSink*> (this))); RETURN_IF_FAILED(RegisterPin(&maneuver_finish)); // create the description for the road sign pin tChar const * strDesc = pDescManager->GetMediaDescription("tRoadSign"); RETURN_IF_POINTER_NULL(strDesc); cObjectPtr<IMediaType> pType = new cMediaType(0, 0, 0, "tRoadSign", strDesc, IMediaDescription::MDF_DDL_DEFAULT_VERSION); // create the road sign OutputPin RETURN_IF_FAILED(m_oPinRoadSign.Create("RoadSign", pType, this)); RETURN_IF_FAILED(RegisterPin(&m_oPinRoadSign)); // set the description for the road sign pin RETURN_IF_FAILED(pType->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescriptionRoadSign)); // create the description for the road sign pin tChar const * strDescExt = pDescManager->GetMediaDescription("tRoadSignExt"); RETURN_IF_POINTER_NULL(strDescExt); cObjectPtr<IMediaType> pTypeExt = new cMediaType(0, 0, 0, "tRoadSignExt", strDescExt, IMediaDescription::MDF_DDL_DEFAULT_VERSION); // create the extended road sign OutputPin RETURN_IF_FAILED(m_oPinRoadSignExt.Create("RoadSign_ext", pTypeExt, this)); RETURN_IF_FAILED(RegisterPin(&m_oPinRoadSignExt)); // set the description for the extended road sign pin RETURN_IF_FAILED(pTypeExt->GetInterface(IID_ADTF_MEDIA_TYPE_DESCRIPTION, (tVoid**)&m_pDescriptionRoadSignExt)); } else if (eStage == StageNormal) { // get the propeerties ReadProperties(NULL); m_iOutputMode = GetPropertyInt("Video Output Pin"); m_f32MarkerSize = static_cast<tFloat32>(GetPropertyFloat("Size of Markers")); m_bDebugModeEnabled = GetPropertyBool("Debug Output to Console"); imshowflag = GetPropertyBool(MD_ENABLE_IMSHOW); imshowflag_ver = GetPropertyBool(MD_ENABLE_IMSHOW_VER); m_bCamaraParamsLoaded = tFalse; //Get path of marker configuration file cFilename fileConfig = GetPropertyStr("Dictionary File For Markers"); //create absolute path for marker configuration file ADTF_GET_CONFIG_FILENAME(fileConfig); fileConfig = fileConfig.CreateAbsolutePath("."); //check if marker configuration file exits if (fileConfig.IsEmpty() || !(cFileSystem::Exists(fileConfig))) { LOG_ERROR("Dictionary File for Markers not found"); RETURN_ERROR(ERR_INVALID_FILE); } else { //try to read the marker configuration file if(m_Dictionary.fromFile(string(fileConfig))==false) { RETURN_ERROR(ERR_INVALID_FILE); LOG_ERROR("Dictionary File for Markers could not be read"); } if(m_Dictionary.size()==0) { RETURN_ERROR(ERR_INVALID_FILE); LOG_ERROR("Dictionary File does not contain valid markers or could not be read sucessfully"); } //set marker configuration file to highlyreliable markers class if (!(HighlyReliableMarkers::loadDictionary(m_Dictionary)==tTrue)) { //LOG_ERROR("Dictionary File could not be read for highly reliable markers"); } } //Get path of calibration file with camera paramters cFilename fileCalibration = GetPropertyStr("Calibration File for used Camera"); ; //Get path of calibration file with camera paramters ADTF_GET_CONFIG_FILENAME(fileCalibration); fileCalibration = fileCalibration.CreateAbsolutePath("."); //check if calibration file with camera paramters exits if (fileCalibration.IsEmpty() || !(cFileSystem::Exists(fileCalibration))) { LOG_ERROR("Calibration File for camera not found"); } else { // read the calibration file with camera paramters exits and save to member variable m_TheCameraParameters.readFromXMLFile(fileCalibration.GetPtr()); cv::FileStorage camera_data (fileCalibration.GetPtr(),cv::FileStorage::READ); camera_data ["camera_matrix"] >> m_Intrinsics; camera_data ["distortion_coefficients"] >> m_Distorsion; m_bCamaraParamsLoaded = tTrue; } }
tResult cJuryTransmitter::loadManeuverList() { m_maneuverListFile = GetPropertyStr("ManeuverFile"); if (m_maneuverListFile.IsEmpty()) { LOG_ERROR("Jury Module: Maneuver file not found"); RETURN_ERROR(ERR_INVALID_FILE); } ADTF_GET_CONFIG_FILENAME(m_maneuverListFile); m_maneuverListFile = m_maneuverListFile.CreateAbsolutePath("."); //Load file, parse configuration, print the data if (cFileSystem::Exists(m_maneuverListFile)) { cDOM oDOM; oDOM.Load(m_maneuverListFile); cDOMElementRefList oSectorElems; cDOMElementRefList oManeuverElems; //read first Sector Elem if(IS_OK(oDOM.FindNodes("AADC-Maneuver-List/AADC-Sector", oSectorElems))) { //iterate through sectors for (cDOMElementRefList::iterator itSectorElem = oSectorElems.begin(); itSectorElem != oSectorElems.end(); ++itSectorElem) { //if sector found tSector sector; sector.id = (*itSectorElem)->GetAttributeUInt32("id"); if(IS_OK((*itSectorElem)->FindNodes("AADC-Maneuver", oManeuverElems))) { //iterate through maneuvers for(cDOMElementRefList::iterator itManeuverElem = oManeuverElems.begin(); itManeuverElem != oManeuverElems.end(); ++itManeuverElem) { tAADC_Maneuver man; man.id = (*itManeuverElem)->GetAttributeUInt32("id"); man.action = (*itManeuverElem)->GetAttribute("action"); sector.maneuverList.push_back(man); } } m_sectorList.push_back(sector); } } if (oSectorElems.size() > 0) { LOG_INFO("Jury Module: Loaded Maneuver file successfully."); } else { LOG_ERROR("Jury Moduler: no valid Maneuver Data found!"); RETURN_ERROR(ERR_INVALID_FILE); } } else { LOG_ERROR("Jury Module: no valid Maneuver File found!"); RETURN_ERROR(ERR_INVALID_FILE); } //OUTPUT DATA TO LOG //for(int i = 0; i < m_sectorList.size(); i++) //{ // LOG_INFO(cString::Format("Driver Module: Sector ID %d",m_sectorList[i].id)); // for(int j = 0; j < m_sectorList[i].maneuverList.size(); j++) // { // LOG_INFO(cString::Format("\tManeuver ID: %d", m_sectorList[i].maneuverList.at(j).id)); // LOG_INFO(cString::Format("\tManeuver action: %s", m_sectorList[i].maneuverList.at(j).action.GetPtr())); // } //} RETURN_NOERROR; }
tResult DriverFilter::loadManeuverList() { this->maneuverListFile = GetPropertyStr(PROP_NAME); if (this->maneuverListFile.IsEmpty()) { LOG_ERROR("DriverFilter: Maneuver file not found"); RETURN_ERROR(ERR_INVALID_FILE); } ADTF_GET_CONFIG_FILENAME(maneuverListFile); this->maneuverListFile = this->maneuverListFile.CreateAbsolutePath("."); //Load file, parse configuration, print the data if (cFileSystem::Exists(this->maneuverListFile)) { cDOM oDOM; oDOM.Load(this->maneuverListFile); cDOMElementRefList oSectorElems; cDOMElementRefList oManeuverElems; //read first Sector Elem if(IS_OK(oDOM.FindNodes("AADC-Maneuver-List/AADC-Sector", oSectorElems))) { //iterate through sectors for (cDOMElementRefList::iterator itSectorElem = oSectorElems.begin(); itSectorElem != oSectorElems.end(); ++itSectorElem) { //if sector found tSector sector; sector.id = (*itSectorElem)->GetAttributeUInt32("id"); if(IS_OK((*itSectorElem)->FindNodes("AADC-Maneuver", oManeuverElems))) { //iterate through maneuvers for(cDOMElementRefList::iterator itManeuverElem = oManeuverElems.begin(); itManeuverElem != oManeuverElems.end(); ++itManeuverElem) { tAADC_Maneuver man; man.id = (*itManeuverElem)->GetAttributeUInt32("id"); man.action = (*itManeuverElem)->GetAttribute("action"); sector.maneuverList.push_back(man); } } this->sectorList.push_back(sector); } } if (oSectorElems.size() > 0) { LOG_INFO("DriverFilter: Loaded Maneuver file successfully."); } else { LOG_ERROR("DriverFilter: no valid Maneuver Data found!"); RETURN_ERROR(ERR_INVALID_FILE); } } else { LOG_ERROR("DriverFilter: no valid Maneuver File found!"); RETURN_ERROR(ERR_INVALID_FILE); } RETURN_NOERROR; }