コード例 #1
0
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;
}
コード例 #2
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;
}
コード例 #3
0
ファイル: RouteConfigPanel.cpp プロジェクト: Mrdini/XCSoar
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;
}
コード例 #4
0
void
TaskPropertiesPanel::ReadValues()
{
  OrderedTaskBehaviour &p = ordered_task->GetOrderedTaskBehaviour();

  TaskFactoryType newtype = ordered_task->GetFactoryType();
  *task_changed |= SaveFormPropertyEnum(form, _T("prpTaskType"), newtype);

  int min_time = GetFormValueInteger(form, _T("prpMinTime"));
  if (min_time != (int)p.aat_min_time) {
    p.aat_min_time = fixed(min_time);
    *task_changed = true;
  }

  unsigned max_height =
    iround(Units::ToSysAltitude(GetFormValueFixed(form, _T("prpStartMaxHeight"))));
  if (max_height != p.start_max_height) {
    p.start_max_height = max_height;
    *task_changed = true;
  }

  fixed max_speed =
    Units::ToSysSpeed(GetFormValueFixed(form, _T("prpStartMaxSpeed")));
  if (max_speed != p.start_max_speed) {
    p.start_max_speed = max_speed;
    *task_changed = true;
  }

  unsigned min_height =
    iround(Units::ToSysAltitude(GetFormValueFixed(form, _T("prpFinishMinHeight"))));
  if (min_height != p.finish_min_height) {
    p.finish_min_height = min_height;
    *task_changed = true;
  }

  HeightReferenceType height_ref_start = (HeightReferenceType)
      GetFormValueInteger(form, _T("prpStartHeightRef"));
  if (height_ref_start != p.start_max_height_ref) {
    p.start_max_height_ref = height_ref_start;
    *task_changed = true;
  }

  HeightReferenceType height_ref_finish = (HeightReferenceType)
      GetFormValueInteger(form, _T("prpFinishHeightRef"));
  if (height_ref_finish != p.finish_min_height_ref) {
    p.finish_min_height_ref = height_ref_finish;
    *task_changed = true;
  }
}
コード例 #5
0
ファイル: pnlTaskProperties.cpp プロジェクト: macsux/XCSoar
static void 
ReadValues()
{
  OrderedTaskBehaviour &p = ordered_task->get_ordered_task_behaviour();

  TaskBehaviour::Factory_t newtype = ordered_task->get_factory_type();
  *task_changed |= SaveFormPropertyEnum(*wf, _T("prpTaskType"), newtype);

  fixed min_time = GetFormValueFixed(*wf, _T("prpMinTime")) * 60;
  if (min_time != p.aat_min_time) {
    p.aat_min_time = min_time;
    *task_changed = true;
  }

  unsigned max_height =
    iround(Units::ToSysAltitude(GetFormValueFixed(*wf, _T("prpStartMaxHeight"))));
  if (max_height != p.start_max_height) {
    p.start_max_height = max_height;
    *task_changed = true;
  }

  fixed max_speed =
    Units::ToSysSpeed(GetFormValueFixed(*wf, _T("prpStartMaxSpeed")));
  if (max_speed != p.start_max_speed) {
    p.start_max_speed = max_speed;
    *task_changed = true;
  }

  unsigned min_height =
    iround(Units::ToSysAltitude(GetFormValueFixed(*wf, _T("prpFinishMinHeight"))));
  if (min_height != p.finish_min_height) {
    p.finish_min_height = min_height;
    *task_changed = true;
  }

  HeightReferenceType height_ref_start = (HeightReferenceType)
      GetFormValueInteger(*wf, _T("prpStartHeightRef"));
  if (height_ref_start != p.start_max_height_ref) {
    p.start_max_height_ref = height_ref_start;
    *task_changed = true;
  }

  HeightReferenceType height_ref_finish = (HeightReferenceType)
      GetFormValueInteger(*wf, _T("prpFinishHeightRef"));
  if (height_ref_finish != p.finish_min_height_ref) {
    p.finish_min_height_ref = height_ref_finish;
    *task_changed = true;
  }
}