コード例 #1
0
ファイル: PlanePolarDialog.cpp プロジェクト: Adrien81/XCSoar
void
PlanePolarWidget::Update()
{
  LoadPolarShape(plane.polar_shape);
  UpdatePolarLabel();

  LoadValue(REFERENCE_MASS, plane.reference_mass);
  LoadValue(DRY_MASS, plane.dry_mass);
}
コード例 #2
0
ファイル: PlanePolarDialog.cpp プロジェクト: StefanL74/XCSoar
static void
Update()
{
  UpdateCaption();

  loading = true;
  LoadPolarShape(*dialog, plane.polar_shape);

  LoadFormProperty(*dialog, _T("ReferenceMassEdit"), plane.reference_mass);
  LoadFormProperty(*dialog, _T("DryMassEdit"), plane.dry_mass);
  loading = false;

  UpdatePolarLabel();
  UpdateInvalidLabel();
}
コード例 #3
0
void
PolarConfigPanel::LoadFromFile()
{
  ComboList list;
  PolarFileVisitor fv(list);

  // Fill list
  VisitDataFiles(_T("*.plr"), fv);

  // Sort list
  list.Sort();

  // Show selection dialog
  int result = ComboPicker(_("Load Polar From File"), list, NULL);
  if (result >= 0) {
    const TCHAR* path = list[result].StringValue;
    PolarInfo polar;
    PolarGlue::LoadFromFile(polar, path);

    LoadPolarShape(form, polar.shape);

    LoadFormProperty(form, _T("prpPolarReferenceMass"), polar.reference_mass);
    LoadFormProperty(form, _T("prpPolarDryMass"), polar.reference_mass);
    LoadFormProperty(form, _T("prpPolarMaxBallast"), polar.max_ballast);

    if (positive(polar.wing_area))
      LoadFormProperty(form, _T("prpPolarWingArea"), polar.wing_area);

    if (positive(polar.v_no))
      LoadFormProperty(form, _T("prpMaxManoeuveringSpeed"), UnitGroup::HORIZONTAL_SPEED,
                       polar.v_no);

    CommonInterface::SetComputerSettings().plane.polar_name =
        list[result].StringValueFormatted;
    UpdatePolarTitle();
    UpdatePolarInvalidLabel();
  }
}
コード例 #4
0
void
PolarConfigPanel::LoadInternal()
{
  ComboList list;
  unsigned len = PolarStore::Count();
  for (unsigned i = 0; i < len; i++)
    list.Append(i, PolarStore::GetItem(i).name);

  list.Sort();

  /* let the user select */

  int result = ComboPicker(_("Load Polar"), list, NULL);
  if (result >= 0) {
    const PolarStore::Item &item = PolarStore::GetItem(list[result].DataFieldIndex);

    LoadPolarShape(form, item.ToPolarShape());

    LoadFormProperty(form, _T("prpPolarReferenceMass"), fixed(item.reference_mass));
    LoadFormProperty(form, _T("prpPolarDryMass"), fixed(item.reference_mass));
    LoadFormProperty(form, _T("prpPolarMaxBallast"), fixed(item.max_ballast));

    if (item.wing_area > 0.0)
      LoadFormProperty(form, _T("prpPolarWingArea"), fixed(item.wing_area));

    if (item.v_no > 0.0)
      LoadFormProperty(form, _T("prpMaxManoeuveringSpeed"), UnitGroup::HORIZONTAL_SPEED,
                       fixed(item.v_no));

    if (item.contest_handicap > 0)
      LoadFormProperty(form, _T("prpHandicap"), item.contest_handicap);

    CommonInterface::SetComputerSettings().plane.polar_name = item.name;
    UpdatePolarTitle();
    UpdatePolarInvalidLabel();
  }
}