void PrintHelper::gototask_print(GotoTask& task, const AircraftState &state) { abstracttask_print(task, state); if (task.tp) { std::ofstream f1("results/res-goto.txt"); taskpoint_print(f1,*task.tp,state); } }
void PrintHelper::gototask_print(const GotoTask &task, const AircraftState &state) { abstracttask_print(task, state); const TaskWaypoint *tp = task.GetActiveTaskPoint(); if (tp != nullptr) { std::ofstream f1("output/results/res-goto.txt"); taskpoint_print(f1, *tp, state); } }
void PrintHelper::aborttask_print(AbortTask& task, const AircraftState &state) { abstracttask_print(task, state); std::ofstream f1("results/res-abort-task.txt"); f1 << "#### Task points\n"; for (unsigned i=0; i<task.task_points.size(); i++) { GeoPoint l = task.task_points[i].GetLocation(); f1 << "## point " << i << " ###################\n"; if (i==task.active_task_point) { f1 << state.location.longitude << " " << state.location.latitude << "\n"; } f1 << l.longitude << " " << l.latitude << "\n"; f1 << "\n"; } }
void PrintHelper::aborttask_print(const AbortTask &task, const AircraftState &state) { abstracttask_print(task, state); std::ofstream f1("output/results/res-abort-task.txt"); f1 << "#### Task points\n"; for (unsigned i = 0; i < task.TaskSize(); ++i) { GeoPoint l = task.GetAlternate(i).GetLocation(); f1 << "## point " << i << " ###################\n"; if (i == task.GetActiveTaskPointIndex()) { f1 << state.location.longitude << " " << state.location.latitude << "\n"; } f1 << l.longitude << " " << l.latitude << "\n"; f1 << "\n"; } }
void PrintHelper::orderedtask_print(const OrderedTask &task, const AircraftState &state) { abstracttask_print(task, state); if (!task.CheckTask()) return; std::ofstream fi("output/results/res-isolines.txt"); for (unsigned i = 0; i < task.TaskSize(); ++i) { const OrderedTaskPoint &tp = task.GetPoint(i); fi << "## point " << i << "\n"; if (tp.GetType() == TaskPointType::AAT) { aatpoint_print(fi, (const AATPoint &)tp, state, task.GetTaskProjection(), 1); } else { orderedtaskpoint_print(fi, tp, state, 1); } fi << "\n"; } std::ofstream f1("output/results/res-task.txt"); f1 << "#### Task points\n"; for (unsigned i = 0; i < task.TaskSize(); ++i) { f1 << "## point " << i << " ###################\n"; const OrderedTaskPoint &tp = task.GetPoint(i); if (tp.GetType() == TaskPointType::AAT) { aatpoint_print(f1, (const AATPoint &)tp, state, task.GetTaskProjection(), 0); } else { orderedtaskpoint_print(f1, tp, state, 0); } f1 << "\n"; } std::ofstream f5("output/results/res-ssample.txt"); f5 << "#### Task sampled points\n"; for (unsigned i =0 ; i < task.TaskSize(); ++i) { const OrderedTaskPoint &tp = task.GetPoint(i); f5 << "## point " << i << "\n"; sampledtaskpoint_print_samples(f5, tp, state); f5 << "\n"; } std::ofstream f2("output/results/res-max.txt"); f2 << "#### Max task\n"; for (unsigned i = 0; i < task.TaskSize(); ++i) { const OrderedTaskPoint &tp = task.GetPoint(i); f2 << tp.GetLocationMax().longitude << " " << tp.GetLocationMax().latitude << "\n"; } std::ofstream f3("output/results/res-min.txt"); f3 << "#### Min task\n"; for (unsigned i = 0; i < task.TaskSize(); ++i) { const OrderedTaskPoint &tp = task.GetPoint(i); f3 << tp.GetLocationMin().longitude << " " << tp.GetLocationMin().latitude << "\n"; } std::ofstream f4("output/results/res-rem.txt"); f4 << "#### Remaining task\n"; for (unsigned i = 0; i < task.TaskSize(); ++i) { const OrderedTaskPoint &tp = task.GetPoint(i); f4 << tp.GetLocationRemaining().longitude << " " << tp.GetLocationRemaining().latitude << "\n"; } }
void PrintHelper::orderedtask_print(OrderedTask& task, const AircraftState &state) { abstracttask_print(task, state); if (!task.stats.task_valid) return; std::ofstream fi("results/res-isolines.txt"); for (unsigned i=0; i<task.task_points.size(); i++) { fi << "## point " << i << "\n"; if (task.task_points[i]->type == TaskPoint::AAT) { aatpoint_print(fi, (AATPoint&)*task.task_points[i], state, task.GetTaskProjection(), 1); } else { orderedtaskpoint_print(fi,*task.task_points[i],state,1); } fi << "\n"; } std::ofstream f1("results/res-task.txt"); f1 << "#### Task points\n"; for (unsigned i=0; i<task.task_points.size(); i++) { f1 << "## point " << i << " ###################\n"; if (task.task_points[i]->type == TaskPoint::AAT) { aatpoint_print(f1, (AATPoint&)*task.task_points[i], state, task.GetTaskProjection(), 0); } else { orderedtaskpoint_print(f1,*task.task_points[i],state,0); } f1 << "\n"; } std::ofstream f5("results/res-ssample.txt"); f5 << "#### Task sampled points\n"; for (unsigned i=0; i<task.task_points.size(); i++) { f5 << "## point " << i << "\n"; sampledtaskpoint_print_samples(f5,*task.task_points[i],state); f5 << "\n"; } std::ofstream f2("results/res-max.txt"); f2 << "#### Max task\n"; for (unsigned i=0; i<task.task_points.size(); i++) { OrderedTaskPoint *tp = task.task_points[i]; f2 << tp->GetLocationMax().longitude << " " << tp->GetLocationMax().latitude << "\n"; } std::ofstream f3("results/res-min.txt"); f3 << "#### Min task\n"; for (unsigned i=0; i<task.task_points.size(); i++) { OrderedTaskPoint *tp = task.task_points[i]; f3 << tp->GetLocationMin().longitude << " " << tp->GetLocationMin().latitude << "\n"; } std::ofstream f4("results/res-rem.txt"); f4 << "#### Remaining task\n"; for (unsigned i=0; i<task.task_points.size(); i++) { OrderedTaskPoint *tp = task.task_points[i]; f4 << tp->GetLocationRemaining().longitude << " " << tp->GetLocationRemaining().latitude << "\n"; } }