static Window * OnCreateCrossSectionControl(ContainerWindow &parent, PixelRect rc, const WindowStyle style) { csw = new CrossSectionControl(look->cross_section, look->map.airspace, look->chart); csw->Create(parent, rc, style); csw->SetAirspaces(airspaces); csw->SetTerrain(terrain); UpdateCrossSection(); return csw; }
static Window * OnCreateCrossSectionControl(ContainerWindow &parent, int left, int top, unsigned width, unsigned height, const WindowStyle style) { csw = new CrossSectionControl(look->cross_section, look->airspace, look->chart); csw->set(parent, left, top, width, height, style); csw->set_airspaces(airspaces); csw->set_terrain(terrain); UpdateCrossSection(); return csw; }
static Window * OnCreateCrossSectionControl(ContainerWindow &parent, PixelScalar left, PixelScalar top, UPixelScalar width, UPixelScalar height, const WindowStyle style) { csw = new CrossSectionControl(look->cross_section, look->map.airspace, look->chart); csw->set(parent, left, top, width, height, style); csw->set_airspaces(airspaces); csw->set_terrain(terrain); UpdateCrossSection(); return csw; }
static void Update() { TCHAR sTmp[1000]; assert(wf != NULL); assert(wInfo != NULL); assert(wGrid != NULL); assert(csw != NULL); assert(glide_computer != NULL); const ComputerSettings &settings_computer = blackboard->GetComputerSettings(); const DerivedInfo &calculated = blackboard->Calculated(); switch (page) { case AnalysisPage::BAROGRAPH: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Barograph")); wf->SetCaption(sTmp); BarographCaption(sTmp, glide_computer->GetFlightStats()); wInfo->SetCaption(sTmp); SetCalcCaption(_("Settings")); break; case AnalysisPage::CLIMB: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Climb")); wf->SetCaption(sTmp); ClimbChartCaption(sTmp, glide_computer->GetFlightStats()); wInfo->SetCaption(sTmp); SetCalcCaption(_("Task Calc")); break; case AnalysisPage::THERMAL_BAND: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Thermal Band")); wf->SetCaption(sTmp); ClimbChartCaption(sTmp, glide_computer->GetFlightStats()); wInfo->SetCaption(sTmp); SetCalcCaption(_T("")); break; case AnalysisPage::WIND: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Wind at Altitude")); wf->SetCaption(sTmp); wInfo->SetCaption(_T("")); SetCalcCaption(_("Set Wind")); break; case AnalysisPage::POLAR: _stprintf(sTmp, _T("%s: %s (%s %d kg)"), _("Analysis"), _("Glide Polar"), _("Mass"), (int)settings_computer.polar.glide_polar_task.GetTotalMass()); wf->SetCaption(sTmp); GlidePolarCaption(sTmp, settings_computer.polar.glide_polar_task); wInfo->SetCaption(sTmp); SetCalcCaption(_("Settings")); break; case AnalysisPage::TEMPTRACE: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Temp Trace")); wf->SetCaption(sTmp); TemperatureChartCaption(sTmp, glide_computer->GetCuSonde()); wInfo->SetCaption(sTmp); SetCalcCaption(_("Settings")); break; case AnalysisPage::TASK_SPEED: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Task Speed")); wf->SetCaption(sTmp); wInfo->SetCaption(_T("")); SetCalcCaption(_("Task Calc")); break; case AnalysisPage::TASK: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Task")); wf->SetCaption(sTmp); FlightStatisticsRenderer::CaptionTask(sTmp, calculated); wInfo->SetCaption(sTmp); SetCalcCaption(_("Task calc")); break; case AnalysisPage::OLC: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), ContestToString(settings_computer.contest.contest)); wf->SetCaption(sTmp); SetCalcCaption(_T("")); FlightStatisticsRenderer::CaptionOLC(sTmp, settings_computer.contest, calculated); wInfo->SetCaption(sTmp); break; case AnalysisPage::AIRSPACE: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Airspace")); wf->SetCaption(sTmp); wInfo->SetCaption(_T("")); SetCalcCaption(_("Warnings")); break; case AnalysisPage::COUNT: gcc_unreachable(); } switch (page) { case AnalysisPage::AIRSPACE: UpdateCrossSection(); csw->Invalidate(); csw->Show(); wGrid->Hide(); break; default: csw->Hide(); wGrid->Show(); wGrid->Invalidate(); break; } }
static void Update(void) { TCHAR sTmp[1000]; assert(wf != NULL); assert(wInfo != NULL); assert(wGrid != NULL); assert(csw != NULL); assert(glide_computer != NULL); const ComputerSettings &settings_computer = blackboard->GetComputerSettings(); const DerivedInfo &calculated = blackboard->Calculated(); FlightStatisticsRenderer fs(glide_computer->GetFlightStats(), look->chart, look->map); switch (page) { case ANALYSIS_PAGE_BAROGRAPH: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Barograph")); wf->SetCaption(sTmp); fs.CaptionBarograph(sTmp); wInfo->SetCaption(sTmp); SetCalcCaption(_("Settings")); break; case ANALYSIS_PAGE_CLIMB: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Climb")); wf->SetCaption(sTmp); fs.CaptionClimb(sTmp); wInfo->SetCaption(sTmp); SetCalcCaption(_("Task Calc")); break; case ANALYSIS_PAGE_THERMAL_BAND: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Thermal Band")); wf->SetCaption(sTmp); fs.CaptionClimb(sTmp); wInfo->SetCaption(sTmp); SetCalcCaption(_T("")); break; case ANALYSIS_PAGE_WIND: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Wind At Altitude")); wf->SetCaption(sTmp); wInfo->SetCaption(_T("")); SetCalcCaption(_("Set Wind")); break; case ANALYSIS_PAGE_POLAR: _stprintf(sTmp, _T("%s: %s (%s %d kg)"), _("Analysis"), _("Glide Polar"), _("Mass"), (int)settings_computer.glide_polar_task.GetTotalMass()); wf->SetCaption(sTmp); fs.CaptionPolar(sTmp, settings_computer.glide_polar_task); wInfo->SetCaption(sTmp); SetCalcCaption(_("Settings")); break; case ANALYSIS_PAGE_TEMPTRACE: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Temp Trace")); wf->SetCaption(sTmp); fs.CaptionTempTrace(sTmp, glide_computer->GetCuSonde()); wInfo->SetCaption(sTmp); SetCalcCaption(_("Settings")); break; case ANALYSIS_PAGE_TASK_SPEED: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Task Speed")); wf->SetCaption(sTmp); wInfo->SetCaption(_T("")); SetCalcCaption(_("Task Calc")); break; case ANALYSIS_PAGE_TASK: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Task")); wf->SetCaption(sTmp); fs.CaptionTask(sTmp, calculated); wInfo->SetCaption(sTmp); SetCalcCaption(_("Task calc")); break; case ANALYSIS_PAGE_OLC: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), ContestToString(settings_computer.task.contest)); wf->SetCaption(sTmp); SetCalcCaption(_T("")); fs.CaptionOLC(sTmp, settings_computer.task, calculated); wInfo->SetCaption(sTmp); break; case ANALYSIS_PAGE_AIRSPACE: _stprintf(sTmp, _T("%s: %s"), _("Analysis"), _("Airspace")); wf->SetCaption(sTmp); wInfo->SetCaption(_T("")); SetCalcCaption(_("Warnings")); break; case ANALYSIS_PAGE_COUNT: assert(false); break; } switch (page) { case ANALYSIS_PAGE_AIRSPACE: UpdateCrossSection(); csw->invalidate(); csw->show(); wGrid->hide(); break; default: csw->hide(); wGrid->show(); wGrid->invalidate(); break; } }