[parser] Maintenance
This commit is contained in:
parent
b83c79f6b0
commit
efddc3d44c
2 changed files with 14 additions and 13 deletions
src/Airports/GenAirports
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "parser.hxx"
|
||||
|
||||
|
||||
bool Parser::GetAirportDefinition(char* line, std::string& icao)
|
||||
{
|
||||
bool match = false;
|
||||
|
@ -44,8 +45,7 @@ void Parser::set_debug(const std::string& path, std::vector<std::string> runway_
|
|||
debug_path = path;
|
||||
|
||||
/* Find any ids for our tile */
|
||||
for (unsigned int i = 0; i < runway_defs.size(); i++) {
|
||||
std::string dsd = runway_defs[i];
|
||||
for (std::string& dsd : runway_defs) {
|
||||
size_t d_pos = dsd.find(":");
|
||||
|
||||
std::string icao = dsd.substr(0, d_pos);
|
||||
|
@ -71,8 +71,7 @@ void Parser::set_debug(const std::string& path, std::vector<std::string> runway_
|
|||
debug_runways[icao] = shapes;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < pavement_defs.size(); i++) {
|
||||
std::string dsd = pavement_defs[i];
|
||||
for (std::string& dsd : pavement_defs) {
|
||||
size_t d_pos = dsd.find(":");
|
||||
|
||||
std::string icao = dsd.substr(0, d_pos);
|
||||
|
@ -98,8 +97,7 @@ void Parser::set_debug(const std::string& path, std::vector<std::string> runway_
|
|||
debug_pavements[icao] = shapes;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < taxiway_defs.size(); i++) {
|
||||
std::string dsd = taxiway_defs[i];
|
||||
for (std::string& dsd : taxiway_defs) {
|
||||
size_t d_pos = dsd.find(":");
|
||||
|
||||
std::string icao = dsd.substr(0, d_pos);
|
||||
|
@ -125,8 +123,7 @@ void Parser::set_debug(const std::string& path, std::vector<std::string> runway_
|
|||
debug_taxiways[icao] = shapes;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < feature_defs.size(); i++) {
|
||||
std::string dsd = feature_defs[i];
|
||||
for (std::string& dsd : feature_defs) {
|
||||
size_t d_pos = dsd.find(":");
|
||||
|
||||
std::string icao = dsd.substr(0, d_pos);
|
||||
|
@ -225,7 +222,11 @@ void Parser::run()
|
|||
}
|
||||
|
||||
log_time = time(0);
|
||||
TG_LOG(SG_GENERAL, SG_ALERT, "Finished airport " << icao << " : parse " << parse_time << " : build " << build_time << " : clean " << clean_time << " : tesselate " << triangulation_time);
|
||||
TG_LOG(SG_GENERAL, SG_ALERT, "Finished airport " << icao <<
|
||||
" : parse " << parse_time <<
|
||||
" : build " << build_time <<
|
||||
" : clean " << clean_time <<
|
||||
" : tesselate " << triangulation_time);
|
||||
} else {
|
||||
TG_LOG(SG_GENERAL, SG_INFO, "Not an airport at pos " << pos << " line is: " << line);
|
||||
}
|
||||
|
@ -499,9 +500,9 @@ int Parser::ParseLine(char* line)
|
|||
case WATER_RUNWAY_CODE:
|
||||
SetState(STATE_PARSE_SIMPLE);
|
||||
TG_LOG(SG_GENERAL, SG_DEBUG, "Parsing water runway: " << line);
|
||||
cur_waterrunway = std::make_shared<WaterRunway>(line);
|
||||
cur_waterRunway = std::make_shared<WaterRunway>(line);
|
||||
if (cur_airport) {
|
||||
cur_airport->AddWaterRunway(cur_waterrunway);
|
||||
cur_airport->AddWaterRunway(cur_waterRunway);
|
||||
}
|
||||
break;
|
||||
case HELIPAD_CODE:
|
||||
|
|
|
@ -125,7 +125,7 @@ public:
|
|||
cur_airport(nullptr),
|
||||
cur_taxiway(nullptr),
|
||||
cur_runway(nullptr),
|
||||
cur_waterrunway(nullptr),
|
||||
cur_waterRunway(nullptr),
|
||||
cur_helipad(nullptr),
|
||||
cur_pavement(nullptr),
|
||||
cur_boundary(nullptr),
|
||||
|
@ -171,7 +171,7 @@ private:
|
|||
std::shared_ptr<Airport> cur_airport;
|
||||
std::shared_ptr<Taxiway> cur_taxiway;
|
||||
std::shared_ptr<Runway> cur_runway;
|
||||
std::shared_ptr<WaterRunway> cur_waterrunway;
|
||||
std::shared_ptr<WaterRunway> cur_waterRunway;
|
||||
std::shared_ptr<Helipad> cur_helipad;
|
||||
std::shared_ptr<ClosedPoly> cur_pavement;
|
||||
std::shared_ptr<ClosedPoly> cur_boundary;
|
||||
|
|
Loading…
Add table
Reference in a new issue