static void ComputeCircling(DebugReplay &replay, const CirclingSettings &circling_settings) { circling_computer.TurnRate(replay.SetCalculated(), replay.Basic(), replay.Calculated().flight); circling_computer.Turning(replay.SetCalculated(), replay.Basic(), replay.Calculated().flight, circling_settings); }
static void Run(DebugReplay &replay, Result &result, Trace &full_trace, Trace &triangle_trace, Trace &sprint_trace) { CirclingSettings circling_settings; circling_settings.SetDefaults(); bool released = false; GeoPoint last_location = GeoPoint::Invalid(); constexpr Angle max_longitude_change = Angle::Degrees(30); constexpr Angle max_latitude_change = Angle::Degrees(1); while (replay.Next()) { ComputeCircling(replay, circling_settings); const MoreData &basic = replay.Basic(); Update(basic, replay.Calculated(), result); flight_phase_detector.Update(replay.Basic(), replay.Calculated()); if (!basic.time_available || !basic.location_available || !basic.NavAltitudeAvailable()) continue; if (last_location.IsValid() && ((last_location.latitude - basic.location.latitude).Absolute() > max_latitude_change || (last_location.longitude - basic.location.longitude).Absolute() > max_longitude_change)) /* there was an implausible warp, which is usually triggered by an invalid point declared "valid" by a bugged logger; if that happens, we stop the analysis, because the IGC file is obviously broken */ break; last_location = basic.location; if (!released && !negative(replay.Calculated().flight.release_time)) { released = true; full_trace.EraseEarlierThan(replay.Calculated().flight.release_time); triangle_trace.EraseEarlierThan(replay.Calculated().flight.release_time); sprint_trace.EraseEarlierThan(replay.Calculated().flight.release_time); } if (released && !replay.Calculated().flight.flying) /* the aircraft has landed, stop here */ /* TODO: at some point, we might want to emit the analysis of all flights in this IGC file */ break; const TracePoint point(basic); full_trace.push_back(point); triangle_trace.push_back(point); sprint_trace.push_back(point); } Update(replay.Basic(), replay.Calculated(), result); Finish(replay.Basic(), replay.Calculated(), result); flight_phase_detector.Finish(); }
int main(int argc, char **argv) { Args args(argc, argv, "DRIVER FILE"); DebugReplay *replay = CreateDebugReplay(args); if (replay == NULL) return EXIT_FAILURE; args.ExpectEnd(); printf("# time quality wind_bearing (deg) wind_speed (m/s) grndspeed (m/s) tas (m/s) bearing (deg)\n"); WindEKFGlue wind_ekf; wind_ekf.Reset(); while (replay->Next()) { const MoreData &data = replay->Basic(); WindEKFGlue::Result result = wind_ekf.Update(data, replay->Calculated()); if (result.quality > 0) printf("%d %d %d %g %g %g %d\n", (int)data.time, result.quality, (int)result.wind.bearing.Degrees(), (double)result.wind.norm, (double)data.ground_speed, (double)data.true_airspeed, (int)data.track.Degrees()); } delete replay; }
int main(int argc, char **argv) { Args args(argc, argv, "DRIVER FILE"); DebugReplay *replay = CreateDebugReplay(args); if (replay == NULL) return EXIT_FAILURE; args.ExpectEnd(); printf("# time quality wind_bearing (deg) wind_speed (m/s)\n"); CirclingComputer circling_computer; CirclingWind circling_wind; while (replay->Next()) { circling_computer.TurnRate(replay->SetCalculated(), replay->Basic(), replay->LastBasic(), replay->Calculated(), replay->LastCalculated()); circling_computer.Turning(replay->SetCalculated(), replay->Basic(), replay->LastBasic(), replay->Calculated(), replay->LastCalculated(), replay->GetComputerSettings()); if ((replay->LastCalculated().turn_mode == CirclingMode::POSSIBLE_CLIMB && replay->Calculated().turn_mode == CirclingMode::CLIMB) || (replay->LastCalculated().turn_mode == CirclingMode::POSSIBLE_CRUISE && replay->Calculated().turn_mode == CirclingMode::CRUISE)) circling_wind.NewFlightMode(replay->Calculated()); CirclingWind::Result result = circling_wind.NewSample(replay->Basic()); if (result.quality > 0) { fixed mag = hypot(result.wind.x, result.wind.y); Angle bearing; if (result.wind.y == fixed_zero && result.wind.x == fixed_zero) bearing = Angle::Zero(); else bearing = Angle::Radians(atan2(result.wind.y, result.wind.x)).AsBearing(); printf("%d %d %d %g\n", (int)replay->Basic().time, result.quality, (int)bearing.Degrees(), (double)mag); } } delete replay; }
int main(int argc, char **argv) { Args args(argc, argv, "DRIVER FILE"); DebugReplay *replay = CreateDebugReplay(args); if (replay == NULL) return EXIT_FAILURE; args.ExpectEnd(); printf("# time wind_bearing (deg) wind_speed (m/s) grndspeed (m/s) tas (m/s) bearing (deg)\n"); CirclingSettings circling_settings; circling_settings.SetDefaults(); CirclingComputer circling_computer; circling_computer.Reset(); WindEKFGlue wind_ekf; wind_ekf.Reset(); while (replay->Next()) { const MoreData &data = replay->Basic(); const DerivedInfo &calculated = replay->Calculated(); circling_computer.TurnRate(replay->SetCalculated(), data, calculated.flight); WindEKFGlue::Result result = wind_ekf.Update(data, replay->Calculated()); if (result.quality > 0) { TCHAR time_buffer[32]; FormatTime(time_buffer, data.time); _tprintf(_T("%s %d %g %g %g %d\n"), time_buffer, (int)result.wind.bearing.Degrees(), (double)result.wind.norm, (double)data.ground_speed, (double)data.true_airspeed, (int)data.track.Degrees()); } } delete replay; }
int main(int argc, char **argv) { Args args(argc, argv, "DRIVER FILE"); DebugReplay *replay = CreateDebugReplay(args); if (replay == NULL) return EXIT_FAILURE; args.ExpectEnd(); printf("# time wind_bearing (deg) wind_speed (m/s)\n"); GlidePolar glide_polar(fixed(0)); CirclingSettings circling_settings; WindSettings wind_settings; wind_settings.SetDefaults(); CirclingComputer circling_computer; circling_computer.Reset(); WindComputer wind_computer; wind_computer.Reset(); Validity last; last.Clear(); while (replay->Next()) { const MoreData &basic = replay->Basic(); const DerivedInfo &calculated = replay->Calculated(); circling_computer.TurnRate(replay->SetCalculated(), basic, calculated.flight); circling_computer.Turning(replay->SetCalculated(), basic, calculated.flight, circling_settings); wind_computer.Compute(wind_settings, glide_polar, basic, replay->SetCalculated()); if (calculated.estimated_wind_available.Modified(last)) { TCHAR time_buffer[32]; FormatTime(time_buffer, replay->Basic().time); _tprintf(_T("%s %d %g\n"), time_buffer, (int)calculated.estimated_wind.bearing.Degrees(), (double)calculated.estimated_wind.norm); } last = calculated.estimated_wind_available; } delete replay; }
int main(int argc, char **argv) { Args args(argc, argv, "DRIVER FILE"); DebugReplay *replay = CreateDebugReplay(args); if (replay == NULL) return EXIT_FAILURE; args.ExpectEnd(); WaveSettings settings; settings.SetDefaults(); settings.enabled = true; WaveComputer wave; wave.Reset(); WaveResult result; result.Clear(); while (replay->Next()) { const MoreData &basic = replay->Basic(); const DerivedInfo &calculated = replay->Calculated(); wave.Compute(basic, calculated.flight, result, settings); } delete replay; for (const auto &w : result.waves) { TCHAR time_buffer[32]; if (w.time >= 0) FormatTime(time_buffer, w.time); else _tcscpy(time_buffer, _T("?")); _tprintf(_T("wave: t=%s location=%f,%f a=%f,%f b=%f,%f location=%s normal=%f\n"), time_buffer, (double)w.location.longitude.Degrees(), (double)w.location.latitude.Degrees(), (double)w.a.longitude.Degrees(), (double)w.a.latitude.Degrees(), (double)w.b.longitude.Degrees(), (double)w.b.latitude.Degrees(), FormatGeoPoint(w.location, CoordinateFormat::DDMMSS).c_str(), (double)w.normal.Degrees()); } return EXIT_SUCCESS; }
static int TestOLC(DebugReplay &replay) { for (int i = 1; replay.Next(); i++) { if (i % 500 == 0) { putchar('.'); fflush(stdout); } const AircraftState state = ToAircraftState(replay.Basic(), replay.Calculated()); full_trace.append(state); sprint_trace.append(state); full_trace.optimise_if_old(); sprint_trace.optimise_if_old(); olc_sprint.UpdateIdle(); } olc_classic.SolveExhaustive(); olc_fai.SolveExhaustive(); olc_league.SolveExhaustive(); olc_plus.SolveExhaustive(); putchar('\n'); std::cout << "classic\n"; PrintHelper::print(olc_classic.GetStats().get_contest_result()); std::cout << "league\n"; PrintHelper::print(olc_league.GetStats().get_contest_result()); std::cout << "fai\n"; PrintHelper::print(olc_fai.GetStats().get_contest_result()); std::cout << "sprint\n"; PrintHelper::print(olc_sprint.GetStats().get_contest_result()); std::cout << "plus\n"; PrintHelper::print(olc_plus.GetStats().get_contest_result()); olc_classic.Reset(); olc_fai.Reset(); olc_sprint.Reset(); olc_league.Reset(); olc_plus.Reset(); full_trace.clear(); sprint_trace.clear(); return 0; }
int main(int argc, char **argv) { Args args(argc, argv, "DRIVER FILE"); DebugReplay *replay = CreateDebugReplay(args); if (replay == NULL) return EXIT_FAILURE; args.ExpectEnd(); Trace trace; while (replay->Next()) { const AircraftState state = ToAircraftState(replay->Basic(), replay->Calculated()); trace.append(state); } delete replay; }
int main(int argc, char **argv) { Args args(argc, argv, "DRIVER FILE OUTFILE"); DebugReplay *replay = CreateDebugReplay(args); if (replay == NULL) return EXIT_FAILURE; const auto path = args.ExpectNextPath(); args.ExpectEnd(); FlightLogger logger; logger.SetPath(path); logger.Reset(); while (replay->Next()) logger.Tick(replay->Basic(), replay->Calculated()); delete replay; }
void Flight::ReadFlight() { fixes = new std::vector<IGCFixEnhanced>; DebugReplay *replay = DebugReplayIGC::Create(flight_file); if (replay) { if (qnh_available) replay->SetQNH(qnh); while (replay->Next()) { IGCFixEnhanced fix; fix.Clear(); if (fix.Apply(replay->Basic(), replay->Calculated())) { fixes->push_back(fix); } } delete replay; } }
PyObject* xcsoar_Airspaces_findIntrusions(Pyxcsoar_Airspaces *self, PyObject *args) { PyObject *py_flight = nullptr; if (!PyArg_ParseTuple(args, "O", &py_flight)) { PyErr_SetString(PyExc_AttributeError, "Can't parse argument."); return nullptr; } DebugReplay *replay = ((Pyxcsoar_Flight*)py_flight)->flight->Replay(); if (replay == nullptr) { PyErr_SetString(PyExc_IOError, "Can't start replay - file not found."); return nullptr; } PyObject *py_result = PyDict_New(); Airspaces::AirspaceVector last_airspaces; while (replay->Next()) { const MoreData &basic = replay->Basic(); if (!basic.time_available || !basic.location_available || !basic.NavAltitudeAvailable()) continue; Airspaces::AirspaceVector airspaces = self->airspace_database->FindInside( ToAircraftState(basic, replay->Calculated()) ); for (auto it = airspaces.begin(); it != airspaces.end(); it++) { PyObject *py_name = PyString_FromString((*it).GetAirspace().GetName()); PyObject *py_airspace = nullptr, *py_period = nullptr; if (PyDict_Contains(py_result, py_name) == 0) { // this is the first fix inside this airspace py_airspace = PyList_New(0); PyDict_SetItem(py_result, py_name, py_airspace); py_period = PyList_New(0); PyList_Append(py_airspace, py_period); Py_DECREF(py_period); } else { // this airspace was hit some time before... py_airspace = PyDict_GetItem(py_result, py_name); // check if the last fix was already inside this airspace auto in_last = std::find(last_airspaces.begin(), last_airspaces.end(), *it); if (in_last == last_airspaces.end()) { // create a new period py_period = PyList_New(0); PyList_Append(py_airspace, py_period); Py_DECREF(py_period); } else { py_period = PyList_GET_ITEM(py_airspace, PyList_GET_SIZE(py_airspace) - 1); } } PyList_Append(py_period, Py_BuildValue("{s:N,s:N}", "time", Python::BrokenDateTimeToPy(basic.date_time_utc), "location", Python::WriteLonLat(basic.location))); } last_airspaces.swap(airspaces); } delete replay; return py_result; }
static void Run(DebugReplay &replay, OrderedTask &task, const GlidePolar &glide_polar) { Validity last_location_available; last_location_available.Clear(); AircraftState last_as; bool last_as_valid = false; bool task_finished = false; unsigned active_taskpoint_index(-1); char time_buffer[32]; while (replay.Next()) { const MoreData &basic = replay.Basic(); const DerivedInfo &calculated = replay.Calculated(); if (!basic.location_available) { last_location_available.Clear(); continue; } const AircraftState current_as = ToAircraftState(basic, calculated); if (!last_location_available) { last_as = current_as; last_as_valid = true; last_location_available = basic.location_available; continue; } if (!basic.location_available.Modified(last_location_available)) continue; if (!last_as_valid) { last_as = current_as; last_as_valid = true; last_location_available = basic.location_available; continue; } task.Update(current_as, last_as, glide_polar); task.UpdateIdle(current_as, glide_polar); task.SetTaskAdvance().SetArmed(true); if (task.GetActiveIndex() != active_taskpoint_index) { active_taskpoint_index = task.GetActiveIndex(); FormatISO8601(time_buffer, basic.date_time_utc); printf("%s active_taskpoint_index=%u\n", time_buffer, active_taskpoint_index); } const TaskStats &task_stats = task.GetStats(); if (task_finished != task_stats.task_finished) { task_finished = true; FormatISO8601(time_buffer, basic.date_time_utc); printf("%s task finished\n", time_buffer); } last_as = current_as; last_as_valid = true; } const TaskStats &task_stats = task.GetStats(); printf("task_started=%d task_finished=%d\n", task_stats.start.task_started, task_stats.task_finished); printf("task elapsed %ds\n", (int)task_stats.total.time_elapsed); printf("task speed %1.2f kph\n", double(task_stats.total.travelled.GetSpeed() * 3.6)); printf("travelled distance %1.3f km\n", double(task_stats.total.travelled.GetDistance() / 1000)); printf("scored distance %1.3f km\n", double(task_stats.distance_scored / 1000)); if (task_stats.total.time_elapsed > 0) printf("scored speed %1.2f kph\n", double(task_stats.distance_scored / task_stats.total.time_elapsed * 3.6)); }
static int TestOLC(DebugReplay &replay) { bool released = false; for (int i = 1; replay.Next(); i++) { if (i % 500 == 0) { putchar('.'); fflush(stdout); } const MoreData &basic = replay.Basic(); if (!basic.time_available || !basic.location_available || !basic.NavAltitudeAvailable()) continue; if (!released && !negative(replay.Calculated().flight.release_time)) { released = true; triangle_trace.EraseEarlierThan(replay.Calculated().flight.release_time); full_trace.EraseEarlierThan(replay.Calculated().flight.release_time); sprint_trace.EraseEarlierThan(replay.Calculated().flight.release_time); } const TracePoint point(basic); triangle_trace.push_back(point); full_trace.push_back(point); sprint_trace.push_back(point); olc_sprint.UpdateIdle(); olc_league.UpdateIdle(); } olc_classic.SolveExhaustive(); olc_fai.SolveExhaustive(); olc_league.SolveExhaustive(); olc_plus.SolveExhaustive(); dmst.SolveExhaustive(); xcontest.SolveExhaustive(); sis_at.SolveExhaustive(); olc_netcoupe.SolveExhaustive(); putchar('\n'); std::cout << "classic\n"; PrintHelper::print(olc_classic.GetStats().GetResult()); std::cout << "league\n"; std::cout << "# league\n"; PrintHelper::print(olc_league.GetStats().GetResult(0)); std::cout << "# classic\n"; PrintHelper::print(olc_league.GetStats().GetResult(1)); std::cout << "fai\n"; PrintHelper::print(olc_fai.GetStats().GetResult()); std::cout << "sprint\n"; PrintHelper::print(olc_sprint.GetStats().GetResult()); std::cout << "plus\n"; std::cout << "# classic\n"; PrintHelper::print(olc_plus.GetStats().GetResult(0)); std::cout << "# triangle\n"; PrintHelper::print(olc_plus.GetStats().GetResult(1)); std::cout << "# plus\n"; PrintHelper::print(olc_plus.GetStats().GetResult(2)); std::cout << "dmst\n"; PrintHelper::print(dmst.GetStats().GetResult()); std::cout << "xcontest\n"; std::cout << "# free\n"; PrintHelper::print(xcontest.GetStats().GetResult(0)); std::cout << "# triangle\n"; PrintHelper::print(xcontest.GetStats().GetResult(1)); std::cout << "sis_at\n"; PrintHelper::print(sis_at.GetStats().GetResult(0)); std::cout << "netcoupe\n"; PrintHelper::print(olc_netcoupe.GetStats().GetResult()); olc_classic.Reset(); olc_fai.Reset(); olc_sprint.Reset(); olc_league.Reset(); olc_plus.Reset(); dmst.Reset(); olc_netcoupe.Reset(); full_trace.clear(); sprint_trace.clear(); return 0; }
void Run(DebugReplay &replay, FlightPhaseDetector &flight_phase_detector, WindList &wind_list, const BrokenDateTime &takeoff_time, const BrokenDateTime &scoring_start_time, const BrokenDateTime &scoring_end_time, const BrokenDateTime &landing_time, Trace &full_trace, Trace &triangle_trace, Trace &sprint_trace, ComputerSettings &computer_settings) { GeoPoint last_location = GeoPoint::Invalid(); constexpr Angle max_longitude_change = Angle::Degrees(30); constexpr Angle max_latitude_change = Angle::Degrees(1); CirclingSettings circling_settings; circling_settings.SetDefaults(); CirclingComputer circling_computer; circling_computer.Reset(); GlidePolar glide_polar(0); WindSettings wind_settings; wind_settings.SetDefaults(); WindComputer wind_computer; wind_computer.Reset(); Validity last_wind; last_wind.Clear(); const Waypoints waypoints; AutoQNH auto_qnh(5); auto_qnh.Reset(); const int64_t takeoff_unix = takeoff_time.ToUnixTimeUTC(); const int64_t landing_unix = landing_time.ToUnixTimeUTC(); int64_t scoring_start_unix, scoring_end_unix; if (scoring_start_time.IsPlausible()) scoring_start_unix = scoring_start_time.ToUnixTimeUTC(); else scoring_start_unix = std::numeric_limits<int64_t>::max(); if (scoring_end_time.IsPlausible()) scoring_end_unix = scoring_end_time.ToUnixTimeUTC(); else scoring_end_unix = 0; while (replay.Next()) { const MoreData &basic = replay.Basic(); const int64_t date_time_utc = basic.date_time_utc.ToUnixTimeUTC(); if (date_time_utc < takeoff_unix) continue; if (date_time_utc > landing_unix) break; circling_computer.TurnRate(replay.SetCalculated(), replay.Basic(), replay.Calculated().flight); circling_computer.Turning(replay.SetCalculated(), replay.Basic(), replay.Calculated().flight, circling_settings); flight_phase_detector.Update(replay.Basic(), replay.Calculated()); wind_computer.Compute(wind_settings, glide_polar, basic, replay.SetCalculated()); if (replay.Calculated().estimated_wind_available.Modified(last_wind)) { wind_list.push_back(WindListItem(basic.date_time_utc, basic.gps_altitude, replay.Calculated().estimated_wind)); } last_wind = replay.Calculated().estimated_wind_available; auto_qnh.Process(basic, replay.SetCalculated(), computer_settings, waypoints); if (!computer_settings.pressure_available && replay.Calculated().pressure_available) { computer_settings.pressure = replay.Calculated().pressure; computer_settings.pressure_available = replay.Calculated().pressure_available; } if (!basic.time_available || !basic.location_available || !basic.NavAltitudeAvailable()) continue; if (last_location.IsValid() && ((last_location.latitude - basic.location.latitude).Absolute() > max_latitude_change || (last_location.longitude - basic.location.longitude).Absolute() > max_longitude_change)) /* there was an implausible warp, which is usually triggered by an invalid point declared "valid" by a bugged logger; if that happens, we stop the analysis, because the IGC file is obviously broken */ break; last_location = basic.location; if (date_time_utc >= scoring_start_unix && date_time_utc <= scoring_end_unix) { const TracePoint point(basic); full_trace.push_back(point); triangle_trace.push_back(point); sprint_trace.push_back(point); } } flight_phase_detector.Finish(); }
bool Run(DebugReplay &replay, FlightTimeResult &result) { bool released = false; bool powered = false; GeoPoint last_location = GeoPoint::Invalid(); constexpr Angle max_longitude_change = Angle::Degrees(30); constexpr Angle max_latitude_change = Angle::Degrees(1); replay.SetCalculated().Reset(); replay.SetFlyingComputer().Reset(); while (replay.Next()) { const MoreData &basic = replay.Basic(); Update(basic, replay.Calculated(), result); if (!basic.time_available || !basic.location_available || !basic.NavAltitudeAvailable()) continue; if (last_location.IsValid() && ((last_location.latitude - basic.location.latitude).Absolute() > max_latitude_change || (last_location.longitude - basic.location.longitude).Absolute() > max_longitude_change)) /* there was an implausible warp, which is usually triggered by an invalid point declared "valid" by a bugged logger; if that happens, we stop the analysis, because the IGC file is obviously broken */ break; last_location = basic.location; if (!released && !negative(replay.Calculated().flight.release_time)) { released = true; } if (replay.Calculated().flight.powered != powered) { powered = replay.Calculated().flight.powered; PowerState power_state; if (powered) { power_state.time = basic.GetDateTimeAt(replay.Calculated().flight.power_on_time); power_state.location = replay.Calculated().flight.power_on_location; power_state.state = PowerState::ON; } else { power_state.time = basic.GetDateTimeAt(replay.Calculated().flight.power_off_time); power_state.location = replay.Calculated().flight.power_off_location; power_state.state = PowerState::OFF; } result.power_states.push_back(power_state); } if (released && !replay.Calculated().flight.flying) /* the aircraft has landed, stop here */ /* TODO: at some point, we might want to emit the analysis of all flights in this IGC file */ break; } Update(replay.Basic(), replay.Calculated(), result); Finish(replay.Basic(), replay.Calculated(), result); // landing detected or eof? if (replay.Tell() != replay.Size()) return false; else return true; }
int main(int argc, char **argv) { int start = -1, end = -1; unsigned max_points = 1000; Args args(argc, argv, "[options] DRIVER FILE\n" "Options:\n" " --start=5000 Begin flight path at 5000 sec after UTC midnight,\n" " if not defined takeoff time is used\n" " --end=15000 End flight path at 15000 sec after UTC midnight,\n" " if not defined the last timestamp in the file is used\n" " --max-points=1000 Maximum number of trace points in output (default = 1000)"); const char *arg; while ((arg = args.PeekNext()) != nullptr && *arg == '-') { args.Skip(); const char *value; if ((value = StringAfterPrefix(arg, "--max-points=")) != nullptr) { unsigned _max_points = strtol(value, NULL, 10); if (_max_points > 0) max_points = _max_points; } else if ((value = StringAfterPrefix(arg, "--start=")) != nullptr) { char *endptr; start = strtol(value, &endptr, 10); if (endptr == value || *endptr != '\0' || start < 0) { fputs("The start parameter could not be parsed correctly.\n", stderr); args.UsageError(); } } else if ((value = StringAfterPrefix(arg, "--end=")) != nullptr) { char *endptr; end = strtol(value, &endptr, 10); if (endptr == value || *endptr != '\0' || end < 0) { fputs("The end parameter could not be parsed correctly.\n", stderr); args.UsageError(); } } else { args.UsageError(); } } if (start >= 0 && end >= 0 && start >= end) { fputs("The start parameter has to be smaller than the end parameter.\n", stderr); args.UsageError(); } DebugReplay *replay = CreateDebugReplay(args); if (replay == nullptr) return EXIT_FAILURE; args.ExpectEnd(); Trace trace(0, Trace::null_time, max_points); bool takeoff = false; while (replay->Next()) { const MoreData &basic = replay->Basic(); const DerivedInfo &calculated = replay->Calculated(); if (!basic.time_available || !basic.location_available || !basic.NavAltitudeAvailable()) continue; if (start >= 0 && (int)basic.time < start) continue; if (end >= 0 && (int)basic.time > end) break; trace.push_back(TracePoint(basic)); if (start < 0 && calculated.flight.flying && !takeoff) { takeoff = true; trace.EraseEarlierThan(calculated.flight.takeoff_time); } } delete replay; for (auto i = trace.begin(), end = trace.end(); i != end; ++i) { const TracePoint &point = *i; printf("%u %f %f %d %u\n", point.GetTime(), (double)point.GetLocation().latitude.Degrees(), (double)point.GetLocation().longitude.Degrees(), point.GetIntegerAltitude(), point.GetEngineNoiseLevel()); } }