本文整理汇总了C++中TaskManager::GetGlidePolar方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskManager::GetGlidePolar方法的具体用法?C++ TaskManager::GetGlidePolar怎么用?C++ TaskManager::GetGlidePolar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskManager
的用法示例。
在下文中一共展示了TaskManager::GetGlidePolar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ta
TestFlightResult
run_flight(TestFlightComponents components, TaskManager &task_manager,
const AutopilotParameters &parms, const int n_wind,
const double speed_factor)
{
AircraftStateFilter *aircraft_filter = components.aircraft_filter;
Airspaces *airspaces = components.airspaces;
TestFlightResult result;
TaskAccessor ta(task_manager, fixed_300);
PrintTaskAutoPilot autopilot(parms);
AircraftSim aircraft;
autopilot.SetDefaultLocation(GeoPoint(Angle::Degrees(1), Angle::Degrees(0)));
unsigned print_counter=0;
if (n_wind)
aircraft.SetWind(wind_to_mag(n_wind), wind_to_dir(n_wind));
autopilot.SetSpeedFactor(fixed(speed_factor));
Directory::Create(_T("output/results"));
std::ofstream f4("output/results/res-sample.txt");
std::ofstream f5("output/results/res-sample-filtered.txt");
bool do_print = verbose;
bool first = true;
static const fixed fixed_10(10);
const AirspaceAircraftPerformance perf(task_manager.GetGlidePolar());
if (aircraft_filter)
aircraft_filter->Reset(aircraft.GetState());
autopilot.Start(ta);
aircraft.Start(autopilot.location_start, autopilot.location_previous,
parms.start_alt);
AirspaceWarningManager *airspace_warnings;
if (airspaces) {
airspace_warnings = new AirspaceWarningManager(*airspaces);
airspace_warnings->Reset(aircraft.GetState());
} else {
airspace_warnings = NULL;
}
do {
if ((task_manager.GetActiveTaskPointIndex() == 1) &&
first && (task_manager.GetStats().total.time_elapsed > fixed_10)) {
result.time_remaining = (double)task_manager.GetStats().total.time_remaining_now;
first = false;
result.time_planned = (double)task_manager.GetStats().total.time_planned;
if (verbose > 1) {
printf("# time remaining %g\n", result.time_remaining);
printf("# time planned %g\n", result.time_planned);
}
}
if (do_print) {
PrintHelper::taskmanager_print(task_manager, aircraft.GetState());
const AircraftState state = aircraft.GetState();
f4 << state.time << " "
<< state.location.longitude << " "
<< state.location.latitude << " "
<< state.altitude << "\n";
f4.flush();
if (aircraft_filter) {
f5 << aircraft_filter->GetSpeed() << " "
<< aircraft_filter->GetBearing() << " "
<< aircraft_filter->GetClimbRate() << "\n";
f5.flush();
}
}
if (airspaces) {
scan_airspaces(aircraft.GetState(), *airspaces, perf,
do_print,
autopilot.GetTarget(ta));
}
if (airspace_warnings) {
if (verbose > 1) {
bool warnings_updated = airspace_warnings->Update(aircraft.GetState(),
task_manager.GetGlidePolar(),
task_manager.GetStats(),
false, 1);
if (warnings_updated) {
printf("# airspace warnings updated, size %d\n",
(int)airspace_warnings->size());
print_warnings(*airspace_warnings);
WaitPrompt();
}
}
}
//.........这里部分代码省略.........