本文整理汇总了C++中GlidePolar::set_mc方法的典型用法代码示例。如果您正苦于以下问题:C++ GlidePolar::set_mc方法的具体用法?C++ GlidePolar::set_mc怎么用?C++ GlidePolar::set_mc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlidePolar
的用法示例。
在下文中一共展示了GlidePolar::set_mc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
GlidePolar
AbortTask::get_safety_polar() const
{
const fixed mc_safety = task_behaviour.get_safety_mc(glide_polar.get_mc());
GlidePolar polar = glide_polar;
polar.set_mc(mc_safety);
return polar;
}
示例2: SettingsComputer
void
MapWindow::DrawWaypoints(Canvas &canvas)
{
GlidePolar polar = get_glide_polar();
polar.set_mc(min(Calculated().common_stats.current_risk_mc,
SettingsComputer().safety_mc));
way_point_renderer.render(canvas, label_block,
render_projection, SettingsMap(),
SettingsComputer(), polar,
ToAircraftState(Basic()),
task);
}
示例3: LocalPath
/**
* Loads calculated values from the persistent memory file
* @param Calculated DERIVED_INFO the values should be loaded into
*/
void
LoadCalculationsPersist(DERIVED_INFO *Calculated,
ProtectedTaskManager &protected_task_manager,
GlideComputer &glide_computer)
{
return; // do nothing, this is broken for CommonStats
// Get the persistent memory filename
if (szCalculationsPersistFileName[0] == 0) {
if (is_altair()) {
LocalPath(szCalculationsPersistFileName, _T("persist/xcsoar-persist.log"));
LocalPath(szCalculationsPersistDirectory, _T("persist"));
} else {
LocalPath(szCalculationsPersistFileName, _T("xcsoar-persist.log"));
_tcscpy(szCalculationsPersistDirectory, GetPrimaryDataPath());
}
}
// Debug Log
LogStartUp(_T("LoadCalculationsPersist"));
unsigned sizein;
// Try to open the persistent memory file
FILE *file = _tfopen(szCalculationsPersistFileName, _T("rb"));
if (file == NULL) {
LogStartUp(_T("LoadCalculationsPersist file not found"));
return;
}
fread(&sizein, sizeof(sizein), 1, file);
if (sizein != sizeof(*Calculated)) {
fclose(file);
return;
}
// Read persistent memory into Calculated
fread(Calculated, sizeof(*Calculated), 1, file);
fread(&sizein, sizeof(sizein), 1, file);
if (sizein != sizeof(glide_computer.GetFlightStats())) {
glide_computer.ResetFlight();
fclose(file);
return;
}
// Read persistent memory into FlightStats
fread(&glide_computer.GetFlightStats(), sizeof(glide_computer.GetFlightStats()), 1, file);
/// @todo persistence for OLC data
fread(&sizein, sizeof(sizein), 1, file);
if (sizein != 4 * sizeof(double)) {
fclose(file);
return;
}
GlidePolar polar = glide_computer.SettingsComputer().glide_polar_task;
double MACCREADY = polar.get_mc();
double BUGS = polar.get_bugs();
double BALLAST = polar.get_ballast();
// Read persistent memory into MacCready, QNH, bugs, ballast and temperature
fread(&MACCREADY, sizeof(double), 1, file);
fread(&BUGS, sizeof(double), 1, file);
fread(&BALLAST, sizeof(double), 1, file);
fread(&CuSonde::maxGroundTemperature,
sizeof(CuSonde::maxGroundTemperature), 1, file);
// ReadFile(hFile,&CRUISE_EFFICIENCY,
// size,&dwBytesWritten,(OVERLAPPED*)NULL);
MACCREADY = min(10.0, max(MACCREADY, 0.0));
BUGS = min(1.0, max(BUGS, 0.0));
BALLAST = min(1.0, max(BALLAST, 0.0));
// CRUISE_EFFICIENCY = min(1.5, max(CRUISE_EFFICIENCY,0.75));
polar.set_mc(fixed(MACCREADY));
polar.set_bugs(fixed(BUGS));
polar.set_ballast(fixed(BALLAST));
protected_task_manager.set_glide_polar(polar);
LogStartUp(_T("LoadCalculationsPersist OK"));
fclose(file);
}