您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetDataField函数代码示例

51自学网 2021-06-01 21:06:18
  C++
这篇教程C++ GetDataField函数代码示例写得很实用,希望能帮到您。

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

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

示例1: FinishPortField

boolDeviceEditWidget::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,


示例2: if

voidPageLayoutEditWidget::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,


示例3: GetPortType

voidDeviceEditWidget::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,


示例4: FinishPortField

boolDeviceEditWidget::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,


示例5: assert

voidTaskCalculatorPanel::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,


示例6: FinishPortField

boolDeviceEditWidget::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,


示例7:

voidInfoBoxesConfigWidget::RefreshEditContentDescription(){  DataFieldEnum &df = (DataFieldEnum &)GetDataField(CONTENT);  WndFrame &description = (WndFrame &)GetRow(DESCRIPTION);  description.SetText(df.GetHelp() != nullptr ? df.GetHelp() : _T(""));}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:7,


示例8: GetValueString

boolWaypointEditWidget::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,


示例9: assert

RoughTimeRowFormWidget::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,


示例10: ShowError

inline voidReplayControlWidget::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,


示例11: GetValueAngle

voidWindSettingsPanel::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,


示例12: GetPortType

voidDeviceEditWidget::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,


示例13: SelectProfile

boolStartupWidget::Save(bool &changed){  const DataFieldFileReader &dff =    (const DataFieldFileReader &)GetDataField(PROFILE);  SelectProfile(dff.GetPathFile());  changed = true;  return true;}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:10,


示例14:

boolStartupWidget::Save(bool &changed){  const auto &dff = (const FileDataField &)GetDataField(PROFILE);  if (!SelectProfile(dff.GetPathFile()))    return false;  changed = true;  return true;}
开发者ID:Advi42,项目名称:XCSoar,代码行数:11,


示例15: CopyString

inline voidFontEditWidget::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,


示例16: GetDataField

boolAirspaceClassRendererSettingsPanel::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,


示例17: GetDataField

boolRowFormWidget::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,


示例18: GetDataField

boolRowFormWidget::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,


示例19: SetRowEnabled

voidRASPSettingsPanel::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,


示例20: GetControl

voidFontEditWidget::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,


示例21: assert

boolRowFormWidget::SaveValue(unsigned i, UnitGroup unit_group,                         const char *registry_key, fixed &value) const{  const DataFieldFloat &df =    (const DataFieldFloat &)GetDataField(i);  assert(df.GetType() == DataField::Type::REAL);  const Unit unit = Units::GetUserUnitByGroup(unit_group);  fixed new_value = df.GetAsFixed();  fixed old_value = Units::ToUserUnit(value, unit);  if (fabs(new_value - old_value) < df.GetStep() / 100)    return false;  value = Units::ToSysUnit(new_value, unit);  Profile::Set(registry_key, value);  return true;}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:19,


示例22: GetValueInteger

voidVegaParametersWidget::UpdateUI(){  for (unsigned i = 0, end = parameters.size(); i != end; ++i) {    Parameter &parameter = parameters[i];    if (loaded) {      const int ui_value = GetValueInteger(i);      if (ui_value != parameter.value)        /* don't update parameters that were changed by the user */        continue;    }    auto x = device.GetSetting(parameter.name);    if (x.first) {      parameter.value = x.second;      GetDataField(i).SetAsInteger(x.second);      GetControl(i).RefreshDisplay();    }  }  loaded = true;}
开发者ID:Advi42,项目名称:XCSoar,代码行数:22,


示例23: gettext

voidRASPSettingsPanel::FillItemControl(){  auto &df = (DataFieldEnum &)GetDataField(ITEM);  df.ClearChoices();  df.AddChoice(-1, _T("none"), _T("none"), nullptr);  for (unsigned i = 0; i < rasp->GetItemCount(); i++) {    const auto &mi = rasp->GetItemInfo(i);    const TCHAR *label = mi.label;    if (label != nullptr)      label = gettext(label);    const TCHAR *help = mi.help;    if (help != nullptr)      help = gettext(help);    df.AddChoice(i, mi.name, label, help);  }  const WeatherUIState &state = CommonInterface::GetUIState().weather;  df.Set(state.map);}
开发者ID:Advi42,项目名称:XCSoar,代码行数:23,



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


C++ GetDataNode函数代码示例
C++ GetData64函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。