예제 #1
0
static void
SetBallast(void)
{
  WndProperty* wp;

  wp = (WndProperty*)wf->FindByName(_T("prpBallast"));
  if (wp) {
    if (glide_polar.IsBallastable()) {
      DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
      df.SetAsFloat(glide_polar.GetBallastLitres());
    } else
      wp->hide();

    wp->RefreshDisplay();
  }
  wp = (WndProperty*)wf->FindByName(_T("prpWingLoading"));
  if (wp) {
    const fixed wl = glide_polar.GetWingLoading();
    if (wl > fixed_zero) {
      DataFieldFloat &df = *(DataFieldFloat *)wp->GetDataField();
      df.SetAsFloat(wl);
    } else
      wp->hide();

    wp->RefreshDisplay();
  }
}
예제 #2
0
void
ExperimentalConfigPanel::Init(WndForm *_wf)
{
  assert(_wf != NULL);
  wf = _wf;
  WndProperty *wp;

  if (!is_windows_ce() || is_altair()) {
    wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxModel"));
    if (wp) {
      wp->hide();
    }
  }

#if defined(_WIN32_WCE) && !defined(GNAV)
// VENTA-ADDON Model change config menu 11
  wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxModel"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Generic"));
    dfe->addEnumText(_T("HP31x"));
    dfe->addEnumText(_T("MedionP5"));
    dfe->addEnumText(_T("MIO"));
    dfe->addEnumText(_T("Nokia500")); // VENTA3
    dfe->addEnumText(_T("PN6000"));
    dfe->Set((int)GlobalModelType);
    wp->RefreshDisplay();
  }
#endif
}
  void
  Visit(const SectorZone& oz)
  {
    hide_all();
    WndFrame* wp = ((WndFrame *)wf->FindByName(_T("frmOZSector")));
    if (wp)
      wp->show();

    LoadFormProperty(*wf, _T("prpOZSectorRadius"),
                     ugDistance, oz.getRadius());
    LoadFormProperty(*wf, _T("prpOZSectorStartRadial"),
                     oz.getStartRadial().value_degrees());
    LoadFormProperty(*wf, _T("prpOZSectorFinishRadial"),
                     oz.getEndRadial().value_degrees());
    WndProperty* wap = (WndProperty*)wf->FindByName(_T("prpOZSectorInnerRadius"));
    if (wap) {
      wap->hide();
    }
  }
예제 #4
0
void
LayoutConfigPanel::Init(WndForm *_wf)
{
  assert(_wf != NULL);
  wf = _wf;
  WndProperty *wp;

  if (Display::RotateSupported()) {
    wp = (WndProperty*)wf->FindByName(_T("prpDisplayOrientation"));
    assert(wp != NULL);

    DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
    dfe->addEnumText(_("Default"));
    dfe->addEnumText(_("Portrait"));
    dfe->addEnumText(_("Landscape"));
    dfe->Set(Profile::GetDisplayOrientation());
    wp->RefreshDisplay();
  } else {
    wp = (WndProperty*)wf->FindByName(_T("prpDisplayOrientation"));
    assert(wp != NULL);
    wp->hide();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxGeom"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();

    dfe->addEnumText(_("8 Top + Bottom (Portrait)"),
                     InfoBoxLayout::ibTop4Bottom4);
    dfe->addEnumText(_("8 Bottom (Portrait)"), InfoBoxLayout::ibBottom8);
    dfe->addEnumText(_("8 Top (Portrait)"), InfoBoxLayout::ibTop8);
    dfe->addEnumText(_("8 Left + Right (Landscape)"),
                     InfoBoxLayout::ibLeft4Right4);
    dfe->addEnumText(_("8 Left (Landscape)"), InfoBoxLayout::ibLeft8);
    dfe->addEnumText(_("8 Right (Landscape)"), InfoBoxLayout::ibRight8);
    dfe->addEnumText(_("9 Right + Vario (Landscape)"), InfoBoxLayout::ibGNav);
    dfe->addEnumText(_("5 Right (Square)"), InfoBoxLayout::ibSquare);
    dfe->addEnumText(_("12 Right (Landscape)"), InfoBoxLayout::ibRight12);
    dfe->addEnumText(_("12 Bottom (Portrait)"), InfoBoxLayout::ibBottom12);
    dfe->addEnumText(_("24 Right (Landscape)"), InfoBoxLayout::ibRight24);
    dfe->Set(InfoBoxLayout::InfoBoxGeometry);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpAppStatusMessageAlignment"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Center"));
    dfe->addEnumText(_("Topleft"));
    dfe->Set(Appearance.StateMessageAlign);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpDialogStyle"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Full width"));
    dfe->addEnumText(_("Scaled"));
    dfe->addEnumText(_("Scaled centered"));
    dfe->addEnumText(_("Fixed"));
    dfe->Set(DialogStyleSetting);
    wp->RefreshDisplay();
  }

  LoadFormProperty(*wf, _T("prpAppInverseInfoBox"),
                   Appearance.InverseInfoBox);

  LoadFormProperty(*wf, _T("prpAppInfoBoxColors"), Appearance.InfoBoxColors);

  wp = (WndProperty*)wf->FindByName(_T("prpAppInfoBoxBorder"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Box"));
    dfe->addEnumText(_("Tab"));
    dfe->Set(Appearance.InfoBoxBorder);
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpTabDialogStyle"));
  if (wp) {
    DataFieldEnum* dfe;
    dfe = (DataFieldEnum*)wp->GetDataField();
    dfe->addEnumText(_("Text"));
    dfe->addEnumText(_("Icons"));
    dfe->Set(Appearance.DialogTabStyle);
    wp->RefreshDisplay();
  }

}
예제 #5
0
static void
SetUnits()
{
  WndProperty* wp;
  switch (Units::GetCoordinateFormat()) {
  case cfDDMMSS: // ("DDMMSS");
  case cfDDMMSSss: // ("DDMMSS.ss");
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeDDDD"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeDDDD"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLongitudemmm"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLatitudemmm"));
    assert(wp != NULL);
    wp->hide();

    break;

  case cfDDMMmmm: // ("DDMM.mmm");
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeDDDD"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeDDDD"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeS"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeS"));
    assert(wp != NULL);
    wp->hide();

    break;

  case cfDDdddd: // ("DD.dddd");
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeM"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeM"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeS"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeS"));
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLongitudemmm"));
    // hide this field for DD.dddd format
    assert(wp != NULL);
    wp->hide();

    wp = (WndProperty*)wf->FindByName(_T("prpLatitudemmm"));
    assert(wp != NULL);
    wp->hide();

    break;
  }
}
예제 #6
0
static void SetUnits(void) {
  WndProperty* wp;
  switch (Units::GetCoordinateFormat()) {
  case 0: // ("DDMMSS");
  case 1: // ("DDMMSS.ss");
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeDDDD"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeDDDD"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudemmm"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLatitudemmm"));
    if (wp) {
      wp->hide();
    }
    break;
  case 2: // ("DDMM.mmm");
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeDDDD"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeDDDD"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeS"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeS"));
    if (wp) {
      wp->hide();
    }
    break;
  case 3: // ("DD.dddd");
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeM"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeM"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudeS"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLatitudeS"));
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLongitudemmm"));
    // hide this field for DD.dddd format
    if (wp) {
      wp->hide();
    }
    wp = (WndProperty*)wf->FindByName(_T("prpLatitudemmm"));
    if (wp) {
      wp->hide();
    }
    break;
  }
}
예제 #7
0
static void
RefreshCalculator(void)
{
  WndProperty* wp;

  // update outputs
  wp = (WndProperty*)wf->FindByName(_T("prpAATEst"));
  if (wp) {
    wp->GetDataField()->SetAsFloat((
        XCSoarInterface::Calculated().common_stats.task_time_remaining +
        XCSoarInterface::Calculated().common_stats.task_time_elapsed) / 60);
    wp->RefreshDisplay();
  }

  // update outputs
  wp = (WndProperty*)wf->FindByName(_T("prpAATTime"));
  if (wp) {
    if (XCSoarInterface::Calculated().task_stats.has_targets) {
      wp->GetDataField()->SetAsFloat(
          protected_task_manager.get_ordered_task_behaviour().aat_min_time / 60);
      wp->RefreshDisplay();
    } else {
      wp->hide();
    }
  }

  wp = (WndProperty*)wf->FindByName(_T("prpDistance"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(Units::ToUserDistance(
        XCSoarInterface::Calculated().task_stats.total.solution_planned.Vector.Distance));
    wp->GetDataField()->SetUnits(Units::GetDistanceName());
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpMacCready"));
  if (wp) {
    wp->GetDataField()->SetUnits(Units::GetVerticalSpeedName());
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpEffectiveMacCready"));
  if (wp) {
    wp->GetDataField()->SetUnits(Units::GetVerticalSpeedName());
    wp->GetDataField()->SetAsFloat(Units::ToUserVSpeed(emc));
    wp->RefreshDisplay();
  }

  /*
  wp = (WndProperty*)wf->FindByName(_T("prpRange"));
  if (wp) {
    wp->RefreshDisplay();
    wp->set_visible(task.getSettings().AATEnabled &&
                    task.ValidTaskPoint(task.getActiveIndex() + 1));
    wp->GetDataField()->SetAsFloat(Range*100.0);
    wp->RefreshDisplay();
  }

  fixed v1;
  if (XCSoarInterface::Calculated().TaskTimeToGo>0) {
    v1 = XCSoarInterface::Calculated().TaskDistanceToGo/
      XCSoarInterface::Calculated().TaskTimeToGo;
  } else {
    v1 = 0;
  }
  */

  wp = (WndProperty*)wf->FindByName(_T("prpSpeedRemaining"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(Units::ToUserTaskSpeed(
        XCSoarInterface::Calculated().task_stats.total.remaining_effective.get_speed()));
    wp->GetDataField()->SetUnits(Units::GetTaskSpeedName());
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpSpeedAchieved"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(Units::ToUserTaskSpeed(
        XCSoarInterface::Calculated().task_stats.total.travelled.get_speed()));
    wp->GetDataField()->SetUnits(Units::GetTaskSpeedName());
    wp->RefreshDisplay();
  }

  wp = (WndProperty*)wf->FindByName(_T("prpCruiseEfficiency"));
  if (wp) {
    wp->GetDataField()->SetAsFloat(cruise_efficiency * 100);
    wp->RefreshDisplay();
  }
}