예제 #1
0
bool
DevicesConfigPanel::Save(bool &_changed, bool &_require_restart)
{
  bool changed = false, require_restart = false;

  if (!SaveDeviceConfig())
    return false;

  changed |= SaveFormProperty(form, _T("prpSetSystemTimeFromGPS"),
                              szProfileSetSystemTimeFromGPS,
                              CommonInterface::SetComputerSettings().set_system_time_from_gps);

  changed |= SaveFormProperty(form, _T("prpIgnoreNMEAChecksum"),
                              szProfileIgnoreNMEAChecksum,
                              NMEAParser::ignore_checksum);

  if (DevicePortChanged) {
    changed = true;
    for (unsigned i = 0; i < NUMDEV; ++i)
      Profile::SetDeviceConfig(i, device_config[i]);
  }

  _changed |= changed;
  _require_restart |= require_restart;

  return true;
}
예제 #2
0
bool
WindSetupPanel::Save(bool &_changed, bool &_require_restart)
{
  bool changed = false, require_restart = false;

  const NMEAInfo &basic = XCSoarInterface::Basic();
  WindSettings &settings = CommonInterface::SetComputerSettings().wind;
  const bool external_wind = basic.external_wind_available &&
    settings.use_external_wind;

  if (!external_wind) {
    unsigned auto_wind_mode = settings.GetLegacyAutoWindMode();
    if (SaveFormProperty(form, _T("prpAutoWind"), szProfileAutoWind,
                         auto_wind_mode)) {
      settings.SetLegacyAutoWindMode(auto_wind_mode);
      changed = true;
    }
  }

  changed |= SaveFormProperty(form, _T("prpTrailDrift"),
                              XCSoarInterface::
                              SetMapSettings().trail_drift_enabled);
  ActionInterface::SendMapSettings();

  _changed |= changed;
  _require_restart |= require_restart;
  return true;
}
예제 #3
0
bool
DevicesConfigPanel::Save(bool &requirerestart)
{
  DevicePortChanged =
    FinishDeviceFields(device_config[0],
                       (WndProperty*)wf->FindByName(_T("prpComPort1")),
                       (WndProperty*)wf->FindByName(_T("prpComSpeed1")),
                       (WndProperty*)wf->FindByName(_T("prpComDevice1")));

  DevicePortChanged =
    FinishDeviceFields(device_config[1],
                       (WndProperty*)wf->FindByName(_T("prpComPort2")),
                       (WndProperty*)wf->FindByName(_T("prpComSpeed2")),
                       (WndProperty*)wf->FindByName(_T("prpComDevice2"))) ||
    DevicePortChanged;

  changed |= SaveFormProperty(*wf, _T("prpSetSystemTimeFromGPS"),
                              szProfileSetSystemTimeFromGPS,
                              XCSoarInterface::SetSettingsMap().SetSystemTimeFromGPS);

  changed |= SaveFormProperty(*wf, _T("prpIgnoreNMEAChecksum"),
                              szProfileIgnoreNMEAChecksum,
                              NMEAParser::ignore_checksum);

  if (DevicePortChanged) {
    changed = true;
    for (unsigned i = 0; i < NUMDEV; ++i)
      Profile::SetDeviceConfig(i, device_config[i]);
    if (!is_embedded())
      requirerestart = true;
  }

  return changed;
}
예제 #4
0
static void
UpdatePlane()
{
  SavePolarShape(*dialog, plane.polar_shape);

  SaveFormProperty(*dialog, _T("ReferenceMassEdit"), plane.reference_mass);
  SaveFormProperty(*dialog, _T("DryMassEdit"), plane.dry_mass);
}
예제 #5
0
bool
RouteConfigPanel::Save()
{
  bool changed = false;
  WndProperty *wp;
  SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SetSettingsComputer();

  wp = (WndProperty*)wf->FindByName(_T("prpRoutePlannerMode"));
  if (wp) {
    DataFieldEnum &df = *(DataFieldEnum *)wp->GetDataField();
    if ((int)settings_computer.route_planner.mode != df.GetAsInteger()) {
      settings_computer.route_planner.mode = (RoutePlannerConfig::Mode)df.GetAsInteger();
      Profile::Set(szProfileRoutePlannerMode,
                   (unsigned)settings_computer.route_planner.mode);
      changed = true;
    }
  }

  wp = (WndProperty*)wf->FindByName(_T("prpReachPolarMode"));
  if (wp) {
    DataFieldEnum &df = *(DataFieldEnum *)wp->GetDataField();
    if ((int)settings_computer.route_planner.reach_polar_mode != df.GetAsInteger()) {
      settings_computer.route_planner.reach_polar_mode =
        (RoutePlannerConfig::PolarMode)df.GetAsInteger();
      Profile::Set(szProfileReachPolarMode,
                   (unsigned)settings_computer.route_planner.reach_polar_mode);
      changed = true;
    }
  }

  changed |= SaveFormPropertyEnum(*wf, _T("prpFinalGlideTerrain"),
                                  szProfileFinalGlideTerrain,
                                  settings_computer.FinalGlideTerrain);

  changed |= SaveFormProperty(*wf, _T("prpRoutePlannerAllowClimb"),
                              szProfileRoutePlannerAllowClimb,
                              settings_computer.route_planner.allow_climb);

  changed |= SaveFormProperty(*wf, _T("prpRoutePlannerUseCeiling"),
                              szProfileRoutePlannerUseCeiling,
                              settings_computer.route_planner.use_ceiling);

  wp = (WndProperty*)wf->FindByName(_T("prpTurningReach"));
  if (wp) {
    DataFieldEnum &df = *(DataFieldEnum *)wp->GetDataField();
    if ((int)settings_computer.route_planner.reach_calc_mode != df.GetAsInteger()) {
      settings_computer.route_planner.reach_calc_mode =
        (RoutePlannerConfig::ReachMode)df.GetAsInteger();
      Profile::Set(szProfileTurningReach,
                   (unsigned)settings_computer.route_planner.reach_calc_mode);
      changed = true;
    }
  }

  return changed;
}
예제 #6
0
static void
UpdatePlane()
{
  SaveFormProperty(*dialog, _T("HandicapEdit"), plane.handicap);
  SaveFormProperty(*dialog, _T("WingAreaEdit"), plane.wing_area);
  SaveFormProperty(*dialog, _T("MaxBallastEdit"), plane.max_ballast);
  SaveFormProperty(*dialog, _T("DumpTimeEdit"), plane.dump_time);
  SaveFormProperty(*dialog, _T("MaxSpeedEdit"),
                   UnitGroup::HORIZONTAL_SPEED, plane.max_speed);
}
예제 #7
0
static void
UpdatePlane()
{
  SaveFormProperty(*dialog, _T("HandicapEdit"), plane.handicap);
  SaveFormProperty(*dialog, _T("WingAreaEdit"), plane.wing_area);
  SaveFormProperty(*dialog, _T("MaxBallastEdit"), plane.max_ballast);
  SaveFormProperty(*dialog, _T("DumpTimeEdit"), plane.dump_time);
  SaveFormProperty(*dialog, _T("MaxSpeedEdit"),
                   ugHorizontalSpeed, plane.max_speed);
}
bool
WaypointDisplayConfigPanel::Save()
{
  WaypointRendererSettings &settings =
    CommonInterface::SetSettingsMap().waypoint;

  bool changed = false;
  WndProperty *wp;

  changed |= SaveFormPropertyEnum(*wf, _T("prpWaypointLabels"),
                                  szProfileDisplayText,
                                  settings.display_text_type);

  changed |= SaveFormPropertyEnum(*wf, _T("prpWaypointArrivalHeightDisplay"),
                                  szProfileWaypointArrivalHeightDisplay,
                                  settings.arrival_height_display);

  changed |= SaveFormPropertyEnum(*wf, _T("prpWaypointLabelStyle"),
                                  szProfileWaypointLabelStyle,
                                  settings.landable_render_mode);

  changed |= SaveFormPropertyEnum(*wf, _T("prpWaypointLabelSelection"),
                                  szProfileWaypointLabelSelection,
                                  settings.label_selection);

  wp = (WndProperty*)wf->FindByName(_T("prpAppIndLandable"));
  if (wp) {
    if (settings.landable_style != (IndLandable_t)(wp->GetDataField()->GetAsInteger())) {
      settings.landable_style = (IndLandable_t)(wp->GetDataField()->GetAsInteger());
      Profile::Set(szProfileAppIndLandable, settings.landable_style);
      changed = true;

      CommonInterface::main_window.look->waypoint.Initialise(settings);
    }
  }

  changed |= SaveFormProperty(*wf, _T("prpAppUseSWLandablesRendering"),
                              szProfileAppUseSWLandablesRendering,
                              settings.vector_landable_rendering);

  changed |= SaveFormProperty(*wf, _T("prpAppLandableRenderingScale"),
                              szProfileAppLandableRenderingScale,
                              settings.landable_rendering_scale);

  changed |= SaveFormProperty(*wf, _T("prpAppScaleRunwayLength"),
                              szProfileAppScaleRunwayLength,
                              settings.scale_runway_length);


  return changed;
}
예제 #9
0
파일: dlgVoice.cpp 프로젝트: Mrdini/XCSoar
static bool
SaveFromForm(const WndForm &form, SETTINGS_COMPUTER &settings)
{
  return
    SaveFormProperty(form, _T("prpVoiceClimbRate"),
                     settings.EnableVoiceClimbRate,
                     szProfileVoiceClimbRate) ||
    SaveFormProperty(form, _T("prpVoiceTerrain"),
                     settings.EnableVoiceTerrain, szProfileVoiceTerrain) ||
    SaveFormProperty(form, _T("prpVoiceWaypointDistance"),
                     settings.EnableVoiceWaypointDistance,
                     szProfileVoiceWaypointDistance) ||
    SaveFormProperty(form, _T("prpVoiceTaskAltitudeDifference"),
                     settings.EnableVoiceTaskAltitudeDifference,
                     szProfileVoiceTaskAltitudeDifference) ||
    SaveFormProperty(form, _T("prpVoiceMacCready"),
                     settings.EnableVoiceMacCready,
                     szProfileVoiceMacCready) ||
    SaveFormProperty(form, _T("prpVoiceNewWaypoint"),
                     settings.EnableVoiceNewWaypoint,
                     szProfileVoiceNewWaypoint) ||
    SaveFormProperty(form, _T("prpVoiceInSector"),
                     settings.EnableVoiceInSector, szProfileVoiceInSector) ||
    SaveFormProperty(form, _T("prpVoiceAirspace"),
                     settings.EnableVoiceAirspace, szProfileVoiceAirspace);
}
예제 #10
0
static bool
SaveFromForm(const WndForm &form, VoiceSettings &settings)
{
  return
    SaveFormProperty(form, _T("prpVoiceClimbRate"),
                     settings.voice_climb_rate_enabled,
                     ProfileKeys::VoiceClimbRate) ||
    SaveFormProperty(form, _T("prpVoiceTerrain"),
                     settings.voice_terrain_enabled, ProfileKeys::VoiceTerrain) ||
    SaveFormProperty(form, _T("prpVoiceWaypointDistance"),
                     settings.voice_waypoint_distance_enabled,
                     ProfileKeys::VoiceWaypointDistance) ||
    SaveFormProperty(form, _T("prpVoiceTaskAltitudeDifference"),
                     settings.voice_task_altitude_difference_enabled,
                     ProfileKeys::VoiceTaskAltitudeDifference) ||
    SaveFormProperty(form, _T("prpVoiceMacCready"),
                     settings.voice_mac_cready_enabled,
                     ProfileKeys::VoiceMacCready) ||
    SaveFormProperty(form, _T("prpVoiceNewWaypoint"),
                     settings.voice_new_waypoint_enabled,
                     ProfileKeys::VoiceNewWaypoint) ||
    SaveFormProperty(form, _T("prpVoiceInSector"),
                     settings.voice_in_sector_enabled, ProfileKeys::VoiceInSector) ||
    SaveFormProperty(form, _T("prpVoiceAirspace"),
                     settings.voice_airspace_enabled, ProfileKeys::VoiceAirspace);
}
예제 #11
0
static bool
SaveFormToPolar(SubForm &form, PolarInfo &polar)
{
  bool changed = SavePolarShape(form, polar.shape);

  changed |= SaveFormProperty(form, _T("prpPolarReferenceMass"), polar.reference_mass);
  changed |= SaveFormProperty(form, _T("prpPolarMaxBallast"), polar.max_ballast);

  changed |= SaveFormProperty(form, _T("prpPolarWingArea"), polar.wing_area);
  changed |= SaveFormProperty(form, _T("prpMaxManoeuveringSpeed"),
                              UnitGroup::HORIZONTAL_SPEED, polar.v_no);

  return changed;
}
예제 #12
0
bool
TaskRulesConfigPanel::Save(bool &_changed, bool &_require_restart)
{
  bool changed = false, require_restart = false;

  ComputerSettings &settings_computer = XCSoarInterface::SetComputerSettings();
  TaskBehaviour &task_behaviour = settings_computer.task;

  OrderedTaskBehaviour &otb = task_behaviour.ordered_defaults;
  changed |= SaveFormProperty(form, _T("prpStartMaxSpeed"),
                              ugHorizontalSpeed,
                              otb.start_max_speed,
                              szProfileStartMaxSpeed);

  changed |= SaveFormProperty(form, _T("prpStartMaxSpeedMargin"),
                              ugHorizontalSpeed,
                              task_behaviour.start_max_speed_margin,
                              szProfileStartMaxSpeedMargin);

  changed |= SaveFormProperty(form, _T("prpStartMaxHeight"), ugAltitude,
                              otb.start_max_height,
                              szProfileStartMaxHeight);

  changed |= SaveFormProperty(form, _T("prpStartMaxHeightMargin"), ugAltitude,
                              task_behaviour.start_max_height_margin,
                              szProfileStartMaxHeightMargin);

  changed |= SaveFormPropertyEnum(form, _T("prpStartHeightRef"),
                                  szProfileStartHeightRef,
                                  otb.start_max_height_ref);

  changed |= SaveFormProperty(form, _T("prpFinishMinHeight"), ugAltitude,
                              otb.finish_min_height,
                              szProfileFinishMinHeight);

  changed |= SaveFormPropertyEnum(form, _T("prpFinishHeightRef"),
                                  szProfileFinishHeightRef,
                                  otb.finish_min_height_ref);

  changed |= SaveFormPropertyEnum(form, _T("prpContests"), szProfileOLCRules,
                                  task_behaviour.contest);

  _changed |= changed;
  _require_restart |= require_restart;

  return true;
}
bool
VarioConfigPanel::Save()
{
  bool changed = false;

  changed |= SaveFormProperty(*wf, _T("prpAppGaugeVarioSpeedToFly"),
                              szProfileAppGaugeVarioSpeedToFly,
                              XCSoarInterface::main_window.vario->ShowSpeedToFly);

  changed |= SaveFormProperty(*wf, _T("prpAppGaugeVarioAvgText"),
                              szProfileAppGaugeVarioAvgText,
                              XCSoarInterface::main_window.vario->ShowAvgText);

  changed |= SaveFormProperty(*wf, _T("prpAppGaugeVarioMc"),
                              szProfileAppGaugeVarioMc,
                              XCSoarInterface::main_window.vario->ShowMc);

  changed |= SaveFormProperty(*wf, _T("prpAppGaugeVarioBugs"),
                              szProfileAppGaugeVarioBugs,
                              XCSoarInterface::main_window.vario->ShowBugs);

  changed |= SaveFormProperty(*wf, _T("prpAppGaugeVarioBallast"),
                              szProfileAppGaugeVarioBallast,
                              XCSoarInterface::main_window.vario->ShowBallast);

  changed |= SaveFormProperty(*wf, _T("prpAppGaugeVarioGross"),
                              szProfileAppGaugeVarioGross,
                              XCSoarInterface::main_window.vario->ShowGross);

  changed |= SaveFormProperty(*wf, _T("prpAppAveNeedle"), szProfileAppAveNeedle,
                              XCSoarInterface::main_window.vario->ShowAveNeedle);

  return changed;
}
예제 #14
0
static void
UpdatePlane()
{
  SaveFormProperty(*dialog, _T("V1Edit"), ugHorizontalSpeed, plane.v1);
  SaveFormProperty(*dialog, _T("V2Edit"), ugHorizontalSpeed, plane.v2);
  SaveFormProperty(*dialog, _T("V3Edit"), ugHorizontalSpeed, plane.v3);
  SaveFormProperty(*dialog, _T("W1Edit"), ugVerticalSpeed, plane.w1);
  SaveFormProperty(*dialog, _T("W2Edit"), ugVerticalSpeed, plane.w2);
  SaveFormProperty(*dialog, _T("W3Edit"), ugVerticalSpeed, plane.w3);

  SaveFormProperty(*dialog, _T("ReferenceMassEdit"), plane.reference_mass);
  SaveFormProperty(*dialog, _T("DryMassEdit"), plane.dry_mass);
}
예제 #15
0
static void
UpdatePlane()
{
  SaveFormProperty(*dialog, _T("Registration"), plane.registration);
  SaveFormProperty(*dialog, _T("CompetitionID"), plane.competition_id);
  SaveFormProperty(*dialog, _T("Type"), plane.type);
  SaveFormProperty(*dialog, _T("HandicapEdit"), plane.handicap);
  SaveFormProperty(*dialog, _T("WingAreaEdit"), plane.wing_area);
  SaveFormProperty(*dialog, _T("MaxBallastEdit"), plane.max_ballast);
  SaveFormProperty(*dialog, _T("DumpTimeEdit"), plane.dump_time);
  SaveFormProperty(*dialog, _T("MaxSpeedEdit"),
                   UnitGroup::HORIZONTAL_SPEED, plane.max_speed);
}
예제 #16
0
static void
UpdatePlane()
{
  SaveFormProperty(*dialog, _T("V1Edit"), UnitGroup::HORIZONTAL_SPEED, plane.v1);
  SaveFormProperty(*dialog, _T("V2Edit"), UnitGroup::HORIZONTAL_SPEED, plane.v2);
  SaveFormProperty(*dialog, _T("V3Edit"), UnitGroup::HORIZONTAL_SPEED, plane.v3);
  SaveFormProperty(*dialog, _T("W1Edit"), UnitGroup::VERTICAL_SPEED, plane.w1);
  SaveFormProperty(*dialog, _T("W2Edit"), UnitGroup::VERTICAL_SPEED, plane.w2);
  SaveFormProperty(*dialog, _T("W3Edit"), UnitGroup::VERTICAL_SPEED, plane.w3);

  SaveFormProperty(*dialog, _T("ReferenceMassEdit"), plane.reference_mass);
  SaveFormProperty(*dialog, _T("DryMassEdit"), plane.dry_mass);
}
예제 #17
0
파일: Util.cpp 프로젝트: Mrdini/XCSoar
bool
SaveFormProperty(const WndForm &form, const TCHAR *field, const TCHAR *reg,
                 short &value)
{
  if (SaveFormProperty(form, field, value)) {
    Profile::Set(reg, value);
    return true;
  } else {
    return false;
  }
}
예제 #18
0
static bool
SaveFormToPolar(SubForm &form, PolarInfo &polar)
{
  bool changed = SaveFormProperty(form, _T("prpPolarV1"), ugHorizontalSpeed, polar.v1);
  changed |= SaveFormProperty(form, _T("prpPolarV2"), ugHorizontalSpeed, polar.v2);
  changed |= SaveFormProperty(form, _T("prpPolarV3"), ugHorizontalSpeed, polar.v3);

  changed |= SaveFormProperty(form, _T("prpPolarW1"), ugVerticalSpeed, polar.w1);
  changed |= SaveFormProperty(form, _T("prpPolarW2"), ugVerticalSpeed, polar.w2);
  changed |= SaveFormProperty(form, _T("prpPolarW3"), ugVerticalSpeed, polar.w3);

  changed |= SaveFormProperty(form, _T("prpPolarReferenceMass"), polar.reference_mass);
  changed |= SaveFormProperty(form, _T("prpPolarMaxBallast"), polar.max_ballast);

  changed |= SaveFormProperty(form, _T("prpPolarWingArea"), polar.wing_area);
  changed |= SaveFormProperty(form, _T("prpMaxManoeuveringSpeed"),
                              ugHorizontalSpeed, polar.v_no);

  return changed;
}
예제 #19
0
파일: Util.cpp 프로젝트: Mrdini/XCSoar
bool
SaveFormProperty(const WndForm &form, const TCHAR *control_name,
                 bool &value, const TCHAR *registry_name)
{
  assert(control_name != NULL);
  assert(registry_name != NULL);

  if (!SaveFormProperty(form, control_name, value))
    return false;

  Profile::Set(registry_name, value);
  return true;
}
예제 #20
0
파일: Util.cpp 프로젝트: Mrdini/XCSoar
bool
SaveFormProperty(const WndForm &form, const TCHAR *control_name,
                 UnitGroup_t unit_group, unsigned &value,
                 const TCHAR *registry_name)
{
  int value2 = value;
  if (SaveFormProperty(form, control_name, unit_group, value2,
                       registry_name)) {
    value = value2;
    return true;
  } else
    return false;
}
예제 #21
0
파일: Util.cpp 프로젝트: Mrdini/XCSoar
bool
SaveFormProperty(const WndForm &form, const TCHAR *control_name,
                 UnitGroup_t unit_group, fixed &value,
                 const TCHAR *registry_name)
{
  assert(registry_name != NULL);

  if (!SaveFormProperty(form, control_name, unit_group, value))
    return false;

  Profile::Set(registry_name, value);
  return true;
}
bool
GaugesConfigPanel::Save()
{
  bool changed = false;

  changed |= SaveFormProperty(*wf, _T("prpEnableFLARMGauge"),
                              szProfileEnableFLARMGauge,
                              XCSoarInterface::SetSettingsMap().EnableFLARMGauge);

  changed |= SaveFormProperty(*wf, _T("prpAutoCloseFlarmDialog"),
                              szProfileAutoCloseFlarmDialog,
                              XCSoarInterface::SetSettingsMap().AutoCloseFlarmDialog);

  changed |= SaveFormProperty(*wf, _T("prpEnableTAGauge"),
                              szProfileEnableTAGauge,
                              XCSoarInterface::SetSettingsMap().EnableTAGauge);

  changed |= SaveFormProperty(*wf, _T("prpEnableThermalProfile"),
                              szProfileEnableThermalProfile,
                              XCSoarInterface::SetSettingsMap().EnableThermalProfile);

  return changed;
}
예제 #23
0
파일: Weather.cpp 프로젝트: macsux/XCSoar
bool
InfoBoxContentWind::PnlSetupOnTabPreHide()
{
  const NMEAInfo &basic = XCSoarInterface::Basic();
  SETTINGS_COMPUTER &settings_computer =
    XCSoarInterface::SetSettingsComputer();
  const bool external_wind = basic.external_wind_available &&
    settings_computer.ExternalWind;

  if (!external_wind)
    SaveFormProperty(*dlgInfoBoxAccess::GetWindowForm(), _T("prpAutoWind"), szProfileAutoWind,
                     settings_computer.AutoWindMode);

  DataFieldEnum* dfe = (DataFieldEnum*)((WndProperty*)dlgInfoBoxAccess::GetWindowForm()->FindByName(_T("prpAutoWind")))->GetDataField();

  if (_tcscmp(dfe->GetAsString(), _("Manual")) == 0)
    settings_computer.ManualWindAvailable.Update(basic.clock);

  SaveFormProperty(*dlgInfoBoxAccess::GetWindowForm(), _T("prpTrailDrift"),
                   XCSoarInterface::SetSettingsMap().EnableTrailDrift);
  ActionInterface::SendSettingsMap();

  return true;
}
예제 #24
0
void dlgConfigFontsShowModal()
{
  wf = LoadDialog(CallBackTable, XCSoarInterface::main_window,
                  Layout::landscape ?
                  _T("IDR_XML_CONFIG_FONTS_L") : _T("IDR_XML_CONFIG_FONTS"));

  if (wf == NULL)
    return;

  ((WndButton *)wf->FindByName(_T("cmdClose")))->SetOnClickNotify(OnCloseClicked);

  UISettings &ui_settings = CommonInterface::SetUISettings();

  LoadFormProperty(*wf, _T("prpUseCustomFonts"), ui_settings.custom_fonts);

  ShowFontEditButtons(ui_settings.custom_fonts);
  RefreshFonts();

  FontRegistryChanged = false;
  changed = false;

  wf->ShowModal();

  changed |= SaveFormProperty(*wf, _T("prpUseCustomFonts"),
                              szProfileUseCustomFonts,
                              ui_settings.custom_fonts);

  TempInfoWindowFont.reset();
  TempTitleWindowFont.reset();
  TempMapWindowFont.reset();
  TempTitleSmallWindowFont.reset();
  TempMapWindowBoldFont.reset();
  TempCDIWindowFont.reset();
  TempMapLabelFont.reset();
  TempMapLabelImportantFont.reset();

  if (changed) {
    Profile::Save();

    MessageBoxX(_("Changes to configuration saved.  Restart XCSoar to apply changes."),
                _T(""), MB_OK);
  }

  delete wf;
}
예제 #25
0
bool
PolarConfigPanel::Save(bool &_changed, bool &_require_restart)
{
  bool changed = false;

  ComputerSettings &settings_computer = CommonInterface::SetComputerSettings();

  changed |= SavePolarShape(form, settings_computer.plane.polar_shape);

  changed |= SaveFormProperty(form, _T("prpPolarReferenceMass"),
                              settings_computer.plane.reference_mass);

  changed |= SaveFormProperty(form, _T("prpPolarDryMass"),
                              settings_computer.plane.dry_mass);

  changed |= SaveFormProperty(form, _T("prpPolarMaxBallast"),
                              settings_computer.plane.max_ballast);

  changed |= SaveFormProperty(form, _T("prpPolarWingArea"),
                              settings_computer.plane.wing_area);

  changed |= SaveFormProperty(form, _T("prpMaxManoeuveringSpeed"),
                              UnitGroup::HORIZONTAL_SPEED,
                              settings_computer.plane.max_speed);

  changed |= SaveFormProperty(form, _T("prpHandicap"),
                              settings_computer.plane.handicap);

  changed |= SaveFormProperty(form, _T("prpBallastSecsToEmpty"),
                              settings_computer.plane.dump_time);

  if (changed) {
    PlaneGlue::DetachFromPlaneFile();
    PlaneGlue::ToProfile(settings_computer.plane);
    PlaneGlue::Synchronize(settings_computer.plane, settings_computer,
                           settings_computer.polar.glide_polar_task);

    if (protected_task_manager != NULL)
      protected_task_manager->SetGlidePolar(settings_computer.polar.glide_polar_task);
  }

  _changed |= changed;
  return true;
}
예제 #26
0
bool
VarioConfigPanel::Save(bool &_changed, bool &_require_restart)
{
  bool changed = false, require_restart = false;

  VarioSettings &settings = CommonInterface::SetUISettings().vario;

  changed |= SaveFormProperty(form, _T("prpAppGaugeVarioSpeedToFly"),
                              szProfileAppGaugeVarioSpeedToFly,
                              settings.ShowSpeedToFly);

  changed |= SaveFormProperty(form, _T("prpAppGaugeVarioAvgText"),
                              szProfileAppGaugeVarioAvgText,
                              settings.ShowAvgText);

  changed |= SaveFormProperty(form, _T("prpAppGaugeVarioMc"),
                              szProfileAppGaugeVarioMc,
                              settings.ShowMc);

  changed |= SaveFormProperty(form, _T("prpAppGaugeVarioBugs"),
                              szProfileAppGaugeVarioBugs,
                              settings.ShowBugs);

  changed |= SaveFormProperty(form, _T("prpAppGaugeVarioBallast"),
                              szProfileAppGaugeVarioBallast,
                              settings.ShowBallast);

  changed |= SaveFormProperty(form, _T("prpAppGaugeVarioGross"),
                              szProfileAppGaugeVarioGross,
                              settings.ShowGross);

  changed |= SaveFormProperty(form, _T("prpAppAveNeedle"), szProfileAppAveNeedle,
                              settings.ShowAveNeedle);

  _changed |= changed;
  _require_restart |= require_restart;

  return true;
}
예제 #27
0
bool
TaskRulesConfigPanel::Save()
{
  bool changed = false;
  SETTINGS_COMPUTER &settings_computer = XCSoarInterface::SetSettingsComputer();

  changed |= SaveFormProperty(*wf, _T("prpStartMaxSpeed"),
                                  ugHorizontalSpeed,
                                  settings_computer.ordered_defaults.start_max_speed,
                                  szProfileStartMaxSpeed);

  changed |= SaveFormProperty(*wf, _T("prpStartMaxSpeedMargin"),
                                  ugHorizontalSpeed,
                                  settings_computer.start_max_speed_margin,
                                  szProfileStartMaxSpeedMargin);

  changed |= SaveFormProperty(*wf, _T("prpStartMaxHeight"), ugAltitude,
                                  settings_computer.ordered_defaults.start_max_height,
                                  szProfileStartMaxHeight);

  changed |= SaveFormProperty(*wf, _T("prpStartMaxHeightMargin"), ugAltitude,
                                  settings_computer.start_max_height_margin,
                                  szProfileStartMaxHeightMargin);

  changed |= SaveFormProperty(*wf, _T("prpStartHeightRef"), ugAltitude,
                                  settings_computer.ordered_defaults.start_max_height_ref,
                                  szProfileStartHeightRef);

  changed |= SaveFormProperty(*wf, _T("prpFinishMinHeight"), ugAltitude,
                                  settings_computer.ordered_defaults.finish_min_height,
                                  szProfileFinishMinHeight);

  unsigned t = settings_computer.contest;
  changed |= SaveFormProperty(*wf, _T("prpContests"), szProfileOLCRules, t);
  settings_computer.contest = (Contests) t;

  return changed;
}
예제 #28
0
bool
LoggerConfigPanel::Save(bool &_changed, bool &_require_restart)
{
  bool changed = false, require_restart = false;

  ComputerSettings &settings_computer =
    XCSoarInterface::SetComputerSettings();
  Plane &plane = settings_computer.plane;

  changed |= SaveFormProperty(form, _T("prpLoggerTimeStepCruise"),
                              szProfileLoggerTimeStepCruise,
                              settings_computer.logger_time_step_cruise);

  changed |= SaveFormProperty(form, _T("prpLoggerTimeStepCircling"),
                              szProfileLoggerTimeStepCircling,
                              settings_computer.logger_time_step_circling);

  changed |= SaveFormPropertyToProfile(form, _T("PilotName"),
                                       szProfilePilotName);
  changed |= SaveFormProperty(form, _T("AircraftType"), plane.type);
  changed |= SaveFormProperty(form, _T("AircraftReg"), plane.registration);
  changed |= SaveFormProperty(form, _T("CompetitionID"), plane.competition_id);
  changed |= SaveFormPropertyToProfile(form, _T("LoggerID"), szProfileLoggerID);

  changed |= SaveFormProperty(form, _T("prpLoggerShortName"),
                              szProfileLoggerShort,
                              settings_computer.logger_short_name);

  /* GUI label is "Enable Auto Logger" */
  changed |= SaveFormPropertyNegated(form, _T("prpDisableAutoLogger"),
                                     szProfileDisableAutoLogger,
                                     settings_computer.auto_logger_disabled);

  if (changed)
    PlaneGlue::ToProfile(settings_computer.plane);

  _changed |= changed;
  _require_restart |= require_restart;

  return true;
}
예제 #29
0
bool
LoggerConfigPanel::Save()
{
  SETTINGS_COMPUTER &settings_computer =
    XCSoarInterface::SetSettingsComputer();
  Plane &plane = settings_computer.plane;

  bool changed = false;

  changed |= SaveFormProperty(*wf, _T("prpLoggerTimeStepCruise"),
                              szProfileLoggerTimeStepCruise,
                              settings_computer.LoggerTimeStepCruise);

  changed |= SaveFormProperty(*wf, _T("prpLoggerTimeStepCircling"),
                              szProfileLoggerTimeStepCircling,
                              settings_computer.LoggerTimeStepCircling);

  changed |= SaveFormPropertyToProfile(*wf, _T("PilotName"),
                                       szProfilePilotName);
  changed |= SaveFormProperty(*wf, _T("AircraftType"), plane.type);
  changed |= SaveFormProperty(*wf, _T("AircraftReg"), plane.registration);
  changed |= SaveFormProperty(*wf, _T("CompetitionID"), plane.competition_id);
  changed |= SaveFormPropertyToProfile(*wf, _T("LoggerID"), szProfileLoggerID);

  changed |= SaveFormProperty(*wf, _T("prpLoggerShortName"),
                              szProfileLoggerShort,
                              settings_computer.LoggerShortName);

  /* GUI label is "Enable Auto Logger" */
  changed |= SaveFormPropertyNegated(*wf, _T("prpDisableAutoLogger"),
                                     szProfileDisableAutoLogger,
                                     settings_computer.DisableAutoLogger);

  if (changed)
    PlaneGlue::ToProfile(settings_computer.plane);

  return changed;
}
예제 #30
0
bool
PolarConfigPanel::Save(bool &_changed, bool &_require_restart)
{
  bool changed = false;

  ComputerSettings &settings_computer = XCSoarInterface::SetComputerSettings();

  changed |= SaveFormProperty(form, _T("prpPolarV1"), ugHorizontalSpeed,
                              settings_computer.plane.v1);
  changed |= SaveFormProperty(form, _T("prpPolarV2"), ugHorizontalSpeed,
                              settings_computer.plane.v2);
  changed |= SaveFormProperty(form, _T("prpPolarV3"), ugHorizontalSpeed,
                              settings_computer.plane.v3);

  changed |= SaveFormProperty(form, _T("prpPolarW1"), ugVerticalSpeed,
                              settings_computer.plane.w1);
  changed |= SaveFormProperty(form, _T("prpPolarW2"), ugVerticalSpeed,
                              settings_computer.plane.w2);
  changed |= SaveFormProperty(form, _T("prpPolarW3"), ugVerticalSpeed,
                              settings_computer.plane.w3);

  changed |= SaveFormProperty(form, _T("prpPolarReferenceMass"),
                              settings_computer.plane.reference_mass);

  changed |= SaveFormProperty(form, _T("prpPolarDryMass"),
                              settings_computer.plane.dry_mass);

  changed |= SaveFormProperty(form, _T("prpPolarMaxBallast"),
                              settings_computer.plane.max_ballast);

  changed |= SaveFormProperty(form, _T("prpPolarWingArea"),
                              settings_computer.plane.wing_area);

  changed |= SaveFormProperty(form, _T("prpMaxManoeuveringSpeed"),
                              ugHorizontalSpeed,
                              settings_computer.plane.max_speed);

  changed |= SaveFormProperty(form, _T("prpHandicap"),
                              settings_computer.plane.handicap);

  changed |= SaveFormProperty(form, _T("prpBallastSecsToEmpty"),
                              settings_computer.plane.dump_time);

  if (changed) {
    PlaneGlue::ToProfile(settings_computer.plane);
    PlaneGlue::Synchronize(settings_computer.plane, settings_computer,
                           settings_computer.glide_polar_task);

    if (protected_task_manager != NULL)
      protected_task_manager->SetGlidePolar(settings_computer.glide_polar_task);
  }

  _changed |= changed;
  return true;
}