當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetDataField函數代碼示例

本文整理匯總了C++中GetDataField函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetDataField函數的具體用法?C++ GetDataField怎麽用?C++ GetDataField使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetDataField函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: FinishPortField

bool
DeviceEditWidget::Save(bool &_changed, bool &require_restart)
{
  bool changed = false;

  changed |= FinishPortField(config, (const DataFieldEnum &)GetDataField(Port));

  if (config.UsesSpeed()) {
    changed |= SaveValue(BaudRate, config.baud_rate);
    changed |= SaveValue(BulkBaudRate, config.bulk_baud_rate);
  }

  if (config.UsesTCPPort())
    changed |= SaveValue(TCPPort, config.tcp_port);


  if (config.UsesDriver()) {
    changed |= SaveValue(Driver, config.driver_name.buffer(),
                         config.driver_name.MAX_SIZE);

    if (CanReceiveSettings(GetDataField(Driver)))
      changed |= SaveValue(SyncFromDevice, config.sync_from_device);

    if (CanSendSettings(GetDataField(Driver)))
      changed |= SaveValue(SyncToDevice, config.sync_to_device);

    changed |= SaveValue(IgnoreCheckSum, config.ignore_checksum);
  }

  _changed |= changed;
  return true;
}
開發者ID:davidswelt,項目名稱:XCSoar,代碼行數:32,代碼來源:DeviceEditWidget.cpp

示例2: if

void
PageLayoutEditWidget::OnModified(DataField &df)
{
  if (&df == &GetDataField(MAIN)) {
    const DataFieldEnum &dfe = (const DataFieldEnum &)df;
    value.main = (PageLayout::Main)dfe.GetValue();
  } else if (&df == &GetDataField(INFO_BOX_PANEL)) {
    const DataFieldEnum &dfe = (const DataFieldEnum &)df;
    const unsigned ibp = dfe.GetValue();
    if (ibp == IBP_AUTO) {
      value.infobox_config.enabled = true;
      value.infobox_config.auto_switch = true;
      value.infobox_config.panel = 0;
    } else if (ibp == IBP_NONE)
      value.infobox_config.enabled = false;
    else if (ibp < InfoBoxSettings::MAX_PANELS) {
      value.infobox_config.enabled = true;
      value.infobox_config.auto_switch = false;
      value.infobox_config.panel = ibp;
    }
  } else if (&df == &GetDataField(BOTTOM)) {
    const DataFieldEnum &dfe = (const DataFieldEnum &)df;
    value.bottom = (PageLayout::Bottom)dfe.GetValue();
  } else {
    gcc_unreachable();
  }

  listener.OnModified(value);
}
開發者ID:rjsikarwar,項目名稱:XCSoar,代碼行數:29,代碼來源:PagesConfigPanel.cpp

示例3: GetPortType

void
DeviceEditWidget::UpdateVisibilities()
{
  const DeviceConfig::PortType type = GetPortType(GetDataField(Port));
  const bool maybe_bluetooth =
    DeviceConfig::MaybeBluetooth(type, GetDataField(Port).GetAsString());
  const bool k6bt = maybe_bluetooth && GetValueBoolean(K6Bt);
  const bool uses_speed = DeviceConfig::UsesSpeed(type) || k6bt;

  SetRowAvailable(BaudRate, uses_speed);
  SetRowAvailable(BulkBaudRate, uses_speed &&
                  DeviceConfig::UsesDriver(type));
  SetRowVisible(BulkBaudRate, uses_speed &&
                DeviceConfig::UsesDriver(type) &&
                SupportsBulkBaudRate(GetDataField(Driver)));
  SetRowAvailable(IP_ADDRESS, DeviceConfig::UsesIPAddress(type));
  SetRowAvailable(TCPPort, DeviceConfig::UsesTCPPort(type));
  SetRowAvailable(I2CBus, DeviceConfig::UsesI2C(type));
  SetRowAvailable(I2CAddr, DeviceConfig::UsesI2C(type) &&
                type != DeviceConfig::PortType::NUNCHUCK);
  SetRowAvailable(PressureUsage, DeviceConfig::IsPressureSensor(type));
  SetRowVisible(Driver, DeviceConfig::UsesDriver(type));
  SetRowVisible(SyncFromDevice, DeviceConfig::UsesDriver(type) &&
                CanReceiveSettings(GetDataField(Driver)));
  SetRowVisible(SyncToDevice, DeviceConfig::UsesDriver(type) &&
                CanSendSettings(GetDataField(Driver)));
  SetRowAvailable(K6Bt, maybe_bluetooth);
}
開發者ID:M-Scholli,項目名稱:XCSoar,代碼行數:28,代碼來源:DeviceEditWidget.cpp

示例4: FinishPortField

bool
DeviceEditWidget::Save(bool &_changed)
{
  bool changed = false;

  changed |= FinishPortField(config, (const DataFieldEnum &)GetDataField(Port));

  if (config.MaybeBluetooth())
    changed |= SaveValue(K6Bt, config.k6bt);

  if (config.UsesSpeed()) {
    changed |= SaveValue(BaudRate, config.baud_rate);
    changed |= SaveValue(BulkBaudRate, config.bulk_baud_rate);
  }

  if (config.UsesIPAddress())
    changed |= SaveValue(IP_ADDRESS, config.ip_address);

  if (config.UsesTCPPort())
    changed |= SaveValue(TCPPort, config.tcp_port);

  if (config.UsesI2C()) {
    changed |= SaveValue(I2CBus, config.i2c_bus);
    changed |= SaveValue(I2CAddr, config.i2c_addr);
    changed |= SaveValueEnum(PressureUsage, config.press_use);
  }

  if (config.UsesDriver()) {
    changed |= SaveValue(Driver, config.driver_name);

    if (CanReceiveSettings(GetDataField(Driver)))
      changed |= SaveValue(SyncFromDevice, config.sync_from_device);

    if (CanSendSettings(GetDataField(Driver)))
      changed |= SaveValue(SyncToDevice, config.sync_to_device);

    if (CanPassThrough(GetDataField(Driver))) {
      changed |= SaveValue(UseSecondDriver, config.use_second_device);
      changed |= SaveValue(SecondDriver, config.driver2_name.buffer(),
                           config.driver2_name.CAPACITY);
    }
  }

  if (CommonInterface::Basic().sensor_calibration_available)
    changed = true;

  _changed |= changed;
  return true;
}
開發者ID:ThomasXBMC,項目名稱:XCSoar,代碼行數:49,代碼來源:DeviceEditWidget.cpp

示例5: assert

void
TaskCalculatorPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  assert(protected_task_manager != nullptr);

  instance = this;

  Add(new TextWidget());
  SetRowVisible(WARNING, false);

  AddReadOnly(_("Assigned task time"));
  AddReadOnly(_("Estimated task time"));
  AddReadOnly(_("Task distance"), nullptr, _T("%.0f %s"),
              UnitGroup::DISTANCE, fixed(0));

  AddFloat(_("Set MacCready"),
           _("Adjusts MC value used in the calculator.  "
             "Use this to determine the effect on estimated task time due to changes in conditions.  "
             "This value will not affect the main computer's setting if the dialog is exited with the Cancel button."),
           _T("%.1f %s"), _T("%.1f"),
           fixed(0), Units::ToUserVSpeed(fixed(5)),
           GetUserVerticalSpeedStep(), false, fixed(0),
           this);
  DataFieldFloat &mc_df = (DataFieldFloat &)GetDataField(MC);
  mc_df.SetFormat(GetUserVerticalSpeedFormat(false, false));

  AddReadOnly(_("AAT range"),
              /* xgettext:no-c-format */
              _("For AAT tasks, this value tells you how far based on the targets of your task you will fly relative to the minimum and maximum possible tasks. -100% indicates the minimum AAT distance.  0% is the nominal AAT distance.  +100% is maximum AAT distance."),
              _T("%.0f %%"), fixed(0));

  AddReadOnly(_("Speed remaining"), nullptr, _T("%.0f %s"),
              UnitGroup::TASK_SPEED, fixed(0));

  AddReadOnly(_("Achieved MacCready"), nullptr, _T("%.1f %s"),
              UnitGroup::VERTICAL_SPEED, fixed(0));
  DataFieldFloat &emc_df = (DataFieldFloat &)GetDataField(EFFECTIVE_MC);
  emc_df.SetFormat(GetUserVerticalSpeedFormat(false, false));

  AddReadOnly(_("Achieved speed"), nullptr, _T("%.0f %s"),
              UnitGroup::TASK_SPEED, fixed(0));

  AddFloat(_("Cruise efficiency"),
           _("Efficiency of cruise.  100 indicates perfect MacCready performance, greater than 100 indicates better than MacCready performance is achieved through flying in streets.  Less than 100 is appropriate if you fly considerably off-track.  This value estimates your cruise efficiency according to the current flight history with the set MC value.  Calculation begins after task is started."),
           _T("%.0f %%"), _T("%.0f"),
           fixed(0), fixed(100), fixed(1), false, fixed(0),
           this);
}
開發者ID:DRIZO,項目名稱:xcsoar,代碼行數:48,代碼來源:TaskCalculatorPanel.cpp

示例6: FinishPortField

bool
DeviceEditWidget::Save(bool &_changed, bool &require_restart)
{
  bool changed = false;

  changed |= FinishPortField(config, (const DataFieldEnum &)GetDataField(Port));

  if (config.MaybeBluetooth())
    changed |= SaveValue(K6Bt, config.k6bt);

  if (config.UsesSpeed() || (config.MaybeBluetooth() && config.k6bt)) {
    changed |= SaveValue(BaudRate, config.baud_rate);
    changed |= SaveValue(BulkBaudRate, config.bulk_baud_rate);
  }

  if (config.UsesTCPPort())
    changed |= SaveValue(TCPPort, config.tcp_port);

  if (config.UsesI2C()) {
    changed |= SaveValue(I2CBus, config.i2c_bus);
    changed |= SaveValue(I2CAddr, config.i2c_addr);
    changed |= SaveValueEnum(PressureUsage, config.press_use);
  }

  if (config.UsesDriver()) {
    changed |= SaveValue(Driver, config.driver_name.buffer(),
                         config.driver_name.MAX_SIZE);

    if (CanReceiveSettings(GetDataField(Driver)))
      changed |= SaveValue(SyncFromDevice, config.sync_from_device);

    if (CanSendSettings(GetDataField(Driver)))
      changed |= SaveValue(SyncToDevice, config.sync_to_device);

    changed |= SaveValue(IgnoreCheckSum, config.ignore_checksum);
  }

  if (CommonInterface::Basic().sensor_calibration_available)
    changed = true;

#ifndef NDEBUG
  if (config.UsesPort())
    changed |= SaveValue(DumpPort, config.dump_port);
#endif

  _changed |= changed;
  return true;
}
開發者ID:jerryshu,項目名稱:xcsoar,代碼行數:48,代碼來源:DeviceEditWidget.cpp

示例7:

void
InfoBoxesConfigWidget::RefreshEditContentDescription()
{
  DataFieldEnum &df = (DataFieldEnum &)GetDataField(CONTENT);
  WndFrame &description = (WndFrame &)GetRow(DESCRIPTION);
  description.SetText(df.GetHelp() != nullptr ? df.GetHelp() : _T(""));
}
開發者ID:ThomasXBMC,項目名稱:XCSoar,代碼行數:7,代碼來源:dlgConfigInfoboxes.cpp

示例8: GetValueString

bool
WaypointEditWidget::Save(bool &_changed)
{
  bool changed = false;
  value.name = GetValueString(NAME);
  value.comment = GetValueString(COMMENT);
  value.location = ((GeoPointDataField &)GetDataField(LOCATION)).GetValue();
  changed |= SaveValue(ELEVATION, UnitGroup::ALTITUDE, value.elevation);
  _changed |= changed;

  switch (GetValueInteger(TYPE)) {
  case 1:
    value.flags.turn_point = true;
    value.type = Waypoint::Type::AIRFIELD;
    break;

  case 2:
    value.type = Waypoint::Type::OUTLANDING;
    break;

  default:
    value.type = Waypoint::Type::NORMAL;
    value.flags.turn_point = true;
    break;
  };

  return true;
}
開發者ID:rkohel,項目名稱:XCSoar,代碼行數:28,代碼來源:dlgWaypointEdit.cpp

示例9: assert

RoughTime
RowFormWidget::GetValueRoughTime(unsigned i) const
{
  const RoughTimeDataField &df =
    (const RoughTimeDataField &)GetDataField(i);
  assert(df.GetType() == DataField::Type::ROUGH_TIME);
  return df.GetValue();
}
開發者ID:StefanL74,項目名稱:XCSoar,代碼行數:8,代碼來源:RowFormWidget.cpp

示例10: ShowError

inline void
ReplayControlWidget::OnStartClicked()
{
  const auto &df = (const FileDataField &)GetDataField(FILE);
  const Path path = df.GetPathFile();
  Error error;
  if (!replay->Start(path, error))
    ShowError(error, _("Replay"));
}
開發者ID:MaxPower-No1,項目名稱:XCSoar,代碼行數:9,代碼來源:ReplayDialog.cpp

示例11: GetValueAngle

void
WindSettingsPanel::OnModified(DataField &df)
{
  if (!edit_manual_wind)
    return;

  const NMEAInfo &basic = CommonInterface::Basic();
  WindSettings &settings = CommonInterface::SetComputerSettings().wind;

  if (&df == &GetDataField(Speed) || &df == &GetDataField(Direction)) {
    settings.manual_wind.norm = Units::ToSysWindSpeed(GetValueFloat(Speed));
    settings.manual_wind.bearing = GetValueAngle(Direction);
    settings.manual_wind_available.Update(basic.clock);
    manual_modified = true;
  }

  UpdateVector();
}
開發者ID:CnZoom,項目名稱:XcSoarPull,代碼行數:18,代碼來源:WindSettingsPanel.cpp

示例12: GetPortType

void
DeviceEditWidget::UpdateVisibilities()
{
  const DeviceConfig::PortType type = GetPortType(GetDataField(Port));

  SetRowAvailable(BaudRate, DeviceConfig::UsesSpeed(type));
  SetRowAvailable(BulkBaudRate, DeviceConfig::UsesSpeed(type) &&
                  DeviceConfig::UsesDriver(type));
  SetRowVisible(BulkBaudRate, DeviceConfig::UsesSpeed(type) &&
                DeviceConfig::UsesDriver(type) &&
                SupportsBulkBaudRate(GetDataField(Driver)));
  SetRowAvailable(TCPPort, DeviceConfig::UsesTCPPort(type));
  SetRowVisible(Driver, DeviceConfig::UsesDriver(type));
  SetRowVisible(SyncFromDevice, DeviceConfig::UsesDriver(type) &&
                CanReceiveSettings(GetDataField(Driver)));
  SetRowVisible(SyncToDevice, DeviceConfig::UsesDriver(type) &&
                CanSendSettings(GetDataField(Driver)));
  SetRowVisible(IgnoreCheckSum, DeviceConfig::UsesDriver(type));
}
開發者ID:davidswelt,項目名稱:XCSoar,代碼行數:19,代碼來源:DeviceEditWidget.cpp

示例13: SelectProfile

bool
StartupWidget::Save(bool &changed)
{
  const DataFieldFileReader &dff =
    (const DataFieldFileReader &)GetDataField(PROFILE);
  SelectProfile(dff.GetPathFile());
  changed = true;

  return true;
}
開發者ID:DRIZO,項目名稱:xcsoar,代碼行數:10,代碼來源:dlgStartup.cpp

示例14:

bool
StartupWidget::Save(bool &changed)
{
  const auto &dff = (const FileDataField &)GetDataField(PROFILE);
  if (!SelectProfile(dff.GetPathFile()))
    return false;

  changed = true;

  return true;
}
開發者ID:Advi42,項目名稱:XCSoar,代碼行數:11,代碼來源:StartupDialog.cpp

示例15: CopyString

inline void
FontEditWidget::SaveValues()
{
#ifdef USE_GDI
  CopyString(data.lfFaceName, GetDataField(FACE).GetAsString(), LF_FACESIZE);
#endif

  data.lfHeight = GetValueInteger(HEIGHT);
  data.lfWeight = GetValueBoolean(WEIGHT) ? 700 : 500;
  data.lfItalic = GetValueBoolean(ITALIC);
}
開發者ID:MindMil,項目名稱:XCSoar,代碼行數:11,代碼來源:FontEdit.cpp


注:本文中的GetDataField函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。