• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetDataField函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetDataField函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDataField函数的具体用法?C++ GetDataField怎么用?C++ GetDataField使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetDataField函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GetDataField

bool
AirspaceClassRendererSettingsPanel::Save(bool &changed)
{
  if (border_color_changed) {
    Profile::SetAirspaceBorderColor(type, settings.border_color);
    changed = true;
  }

  if (fill_color_changed) {
    Profile::SetAirspaceFillColor(type, settings.fill_color);
    changed = true;
  }

#ifdef HAVE_HATCHED_BRUSH
  if (fill_brush_changed) {
    Profile::SetAirspaceBrush(type, settings.brush);
    changed = true;
  }
#endif

  const auto &border_width_df = GetDataField(BorderWidth);
  unsigned border_width = border_width_df.GetAsInteger();
  if (border_width != settings.border_width) {
    settings.border_width = border_width;
    Profile::SetAirspaceBorderWidth(type, border_width);
    changed = true;
  }

  const auto &fill_mode_df = GetDataField(FillMode);
  auto fill_mode = (AirspaceClassRendererSettings::FillMode)fill_mode_df.GetAsInteger();
  if (fill_mode != settings.fill_mode) {
    settings.fill_mode = fill_mode;
    Profile::SetAirspaceFillMode(type, (unsigned)fill_mode);
    changed = true;
  }

  if (changed)
    CommonInterface::SetMapSettings().airspace.classes[type] = settings;

  return true;
}
开发者ID:rjsikarwar,项目名称:XCSoar,代码行数:41,代码来源:AirspaceCRendererSettingsPanel.cpp


示例17: GetDataField

bool
RowFormWidget::SaveValue(unsigned i, TCHAR *string, size_t max_size) const
{
  const TCHAR *new_value = GetDataField(i).GetAsString();
  assert(new_value != NULL);

  if (_tcscmp(string, new_value) == 0)
    return false;

  CopyString(string, new_value, max_size);
  return true;
}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:12,代码来源:RowFormWidget.cpp


示例18: GetDataField

bool
RowFormWidget::SaveValue(unsigned i, TCHAR *string, size_t max_size) const
{
  const TCHAR *new_value = GetDataField(i).GetAsString();
  assert(new_value != nullptr);

  if (StringIsEqual(string, new_value))
    return false;

  CopyTruncateString(string, max_size, new_value);
  return true;
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:12,代码来源:EditRowFormWidget.cpp


示例19: SetRowEnabled

void
RASPSettingsPanel::UpdateTimeControl()
{
  const DataFieldEnum &item = (const DataFieldEnum &)GetDataField(ITEM);

  const int item_index = item.GetValue();
  SetRowEnabled(TIME, item_index >= 0);

  if (item_index >= 0) {
    DataFieldEnum &time_df = (DataFieldEnum &)GetDataField(TIME);
    time_df.ClearChoices();
    time_df.addEnumText(_("Now"));

    rasp->ForEachTime(item_index, [&time_df](BrokenTime t){
        TCHAR timetext[10];
        _stprintf(timetext, _T("%02u:%02u"), t.hour, t.minute);
        time_df.addEnumText(timetext, t.GetMinuteOfDay());
      });

    if (time.IsPlausible())
      time_df.Set(time.GetMinuteOfDay());
    GetControl(TIME).RefreshDisplay();
  }
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:24,代码来源:RASPDialog.cpp


示例20: GetControl

void
FontEditWidget::Load()
{
#ifdef USE_GDI
  {
    DataFieldEnum &df = (DataFieldEnum &)GetDataField(FACE);
    df.SetStringAutoAdd(data.lfFaceName);
    GetControl(FACE).RefreshDisplay();
  }
#endif

  LoadValue(HEIGHT, (int)data.lfHeight);
  LoadValue(WEIGHT, data.lfWeight > 500);
  LoadValue(ITALIC, !!data.lfItalic);

  UpdatePreview();
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:17,代码来源:FontEdit.cpp



注:本文中的GetDataField函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetDataNode函数代码示例发布时间:2022-05-30
下一篇:
C++ GetData64函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap