本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例7:
void
InfoBoxesConfigWidget::RefreshEditContentDescription()
{
DataFieldEnum &df = (DataFieldEnum &)GetDataField(CONTENT);
WndFrame &description = (WndFrame &)GetRow(DESCRIPTION);
description.SetText(df.GetHelp() != nullptr ? df.GetHelp() : _T(""));
}
示例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;
}
示例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();
}
示例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"));
}
示例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();
}
示例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));
}
示例13: SelectProfile
bool
StartupWidget::Save(bool &changed)
{
const DataFieldFileReader &dff =
(const DataFieldFileReader &)GetDataField(PROFILE);
SelectProfile(dff.GetPathFile());
changed = true;
return true;
}
示例14:
bool
StartupWidget::Save(bool &changed)
{
const auto &dff = (const FileDataField &)GetDataField(PROFILE);
if (!SelectProfile(dff.GetPathFile()))
return false;
changed = true;
return true;
}
示例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);
}