static void TestWinPilot(wp_vector org_wp) { Waypoints way_points; if (!TestWayPointFile(_T("test/data/waypoints.dat"), way_points, org_wp.size())) { skip(10 * org_wp.size(), 0, "opening waypoint file failed"); return; } wp_vector::iterator it; for (it = org_wp.begin(); it < org_wp.end(); it++) { const Waypoint *wp = GetWayPoint(*it, way_points); TestWinPilotWayPoint(*it, wp); } }
static void TestZander(wp_vector org_wp) { Waypoints way_points; if (!TestWayPointFile(_T("test/data/waypoints.wpz"), way_points, org_wp.size())) { skip(10 * org_wp.size(), 0, "opening waypoint file failed"); return; } wp_vector::iterator it; for (it = org_wp.begin(); it < org_wp.end(); it++) { if (it->Name.length() > 12) it->Name = it->Name.erase(12); trim_inplace(it->Name); const Waypoint *wp = GetWayPoint(*it, way_points); TestZanderWayPoint(*it, wp); } }
bool CWayPointManager::Reload() { CXMLTreeNode newFile; if (!newFile.LoadFile(m_Filename.c_str())) { std::string msg_error = "WayPointManager::Load->Error al intentar leer el archivo xml: " + m_Filename; LOGGER->AddNewLog(ELL_ERROR, msg_error.c_str()); return false; } CXMLTreeNode l_wps = newFile["waypoints"]; if( l_wps.Exists() ) { uint16 l_Count = l_wps.GetNumChildren(); for(uint16 i=0; i<l_Count; ++i) { std::string l_Type = l_wps(i).GetName(); if( l_Type == "group" ) { CXMLTreeNode groupChild = l_wps(i); std::string groupName = groupChild.GetPszProperty("name", "", true); if(m_WPGroups.find(groupName) == m_WPGroups.end()) { m_WPGroups[groupName] = WayPointList(); } uint16 l_CountGroup = groupChild.GetNumChildren(); for(uint16 j = 0; j < l_CountGroup; ++j) { std::string l_TypeChild = groupChild(j).GetName(); if(l_TypeChild == "waypoint") { std::string wpName = groupChild(j).GetPszProperty("name", "", true); Vect3f wpPos = groupChild(j).GetVect3fProperty("position", Vect3f(0.0f, 0.0f, 0.0f), true); CWayPoint* wp = new CWayPoint(wpName, wpPos); m_WPGroups[groupName].push_back(wp); } if(l_TypeChild == "Brothers") { CXMLTreeNode broChild = groupChild(j); uint16 broChildCount = broChild.GetNumChildren(); std::string wpName = broChild.GetPszProperty("wave_point_name", "", true); CWayPoint* wp = GetWayPoint(groupName, wpName); assert(wp); for (uint16 x = 0; x < broChildCount; ++x) { std::string l_TypeBroChild = broChild(x).GetName(); if(l_TypeBroChild == "Brother") { std::string broName = broChild(x).GetPszProperty("name", "", true); CWayPoint* wpBro = GetWayPoint(groupName, broName); assert(wpBro); wp->AddBrother(wpBro); } } } } } } } else { return false; } return true; }