/** * Return a DebugReplay, either direct from file or from memory, * depending on the keep_flight flag. Don't forget to delete * the replay after use. */ DebugReplay *Replay() { DebugReplay *replay; if (keep_flight) replay = DebugReplayVector::Create(*fixes); else replay = DebugReplayIGC::Create(flight_file); if (qnh_available) replay->SetQNH(qnh); return 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; } }