本文整理汇总了C++中ProfileMap::GetEnum方法的典型用法代码示例。如果您正苦于以下问题:C++ ProfileMap::GetEnum方法的具体用法?C++ ProfileMap::GetEnum怎么用?C++ ProfileMap::GetEnum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProfileMap
的用法示例。
在下文中一共展示了ProfileMap::GetEnum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
void
Profile::Load(const ProfileMap &map, TaskBehaviour &settings)
{
Load(map, settings.glide);
map.Get(ProfileKeys::AATTimeMargin, settings.optimise_targets_margin);
map.Get(ProfileKeys::AutoMc, settings.auto_mc);
map.GetEnum(ProfileKeys::AutoMcMode, settings.auto_mc_mode);
unsigned Temp;
if (map.Get(ProfileKeys::RiskGamma, Temp))
settings.risk_gamma = fixed(Temp) / 10;
if (map.Get(ProfileKeys::SafetyMacCready, Temp))
settings.safety_mc = fixed(Temp) / 10;
map.Get(ProfileKeys::SafetyAltitudeArrival, settings.safety_height_arrival);
map.GetEnum(ProfileKeys::TaskType, settings.task_type_default);
Load(map, settings.start_margins);
Load(map, settings.sector_defaults);
Load(map, settings.ordered_defaults);
map.GetEnum(ProfileKeys::AbortTaskMode, settings.abort_task_mode);
Load(map, settings.route_planner);
}
示例2:
void
Profile::Load(const ProfileMap &map, DialogSettings &settings)
{
map.GetEnum(ProfileKeys::AppTextInputStyle, settings.text_input_style);
map.GetEnum(ProfileKeys::AppDialogTabStyle, settings.tab_style);
map.Get(ProfileKeys::UserLevel, settings.expert);
}
示例3: Load
void
Profile::Load(const ProfileMap &map, UISettings &settings)
{
Load(map, settings.display);
map.Get(ProfileKeys::MenuTimeout, settings.menu_timeout);
#ifndef GNAV
map.Get(ProfileKeys::UIScale, settings.scale);
if (settings.scale < 50 || settings.scale > 200)
settings.scale = 100;
#endif
map.Get(ProfileKeys::EnableTAGauge, settings.enable_thermal_assistant_gauge);
map.Get(ProfileKeys::AirspaceWarningDialog, settings.enable_airspace_warning_dialog);
map.GetEnum(ProfileKeys::AppStatusMessageAlignment, settings.popup_message_position);
map.GetEnum(ProfileKeys::HapticFeedback, settings.haptic_feedback);
Load(map, settings.format);
Load(map, settings.map);
Load(map, settings.info_boxes);
Load(map, settings.vario);
Load(map, settings.traffic);
Load(map, settings.pages);
Load(map, settings.dialog);
Load(map, settings.sound);
}
示例4:
void
Profile::Load(const ProfileMap &map, TrailSettings &settings)
{
map.Get(ProfileKeys::TrailDrift, settings.wind_drift_enabled);
map.Get(ProfileKeys::SnailWidthScale, settings.scaling_enabled);
map.GetEnum(ProfileKeys::SnailType, settings.type);
map.GetEnum(ProfileKeys::SnailTrail, settings.length);
}
示例5:
void
Profile::Load(const ProfileMap &map, SectorDefaults &settings)
{
map.GetEnum(ProfileKeys::StartType, settings.start_type);
map.Get(ProfileKeys::StartRadius, settings.start_radius);
map.GetEnum(ProfileKeys::TurnpointType, settings.turnpoint_type);
map.Get(ProfileKeys::TurnpointRadius, settings.turnpoint_radius);
map.GetEnum(ProfileKeys::FinishType, settings.finish_type);
map.Get(ProfileKeys::FinishRadius, settings.finish_radius);
}
示例6:
void
Profile::Load(const ProfileMap &map, FeaturesSettings &settings)
{
map.GetEnum(ProfileKeys::FinalGlideTerrain, settings.final_glide_terrain);
map.Get(ProfileKeys::BlockSTF, settings.block_stf_enabled);
map.Get(ProfileKeys::EnableNavBaroAltitude, settings.nav_baro_altitude_enabled);
}
示例7: Load
void
Profile::Load(const ProfileMap &map, ComputerSettings &settings)
{
Load(map, settings.wind);
Load(map, settings.polar);
Load(map, settings.team_code);
Load(map, settings.voice);
Load(map, settings.poi);
Load(map, settings.features);
Load(map, settings.airspace);
Load(map, settings.circling);
Load(map, settings.wave);
map.GetEnum(ProfileKeys::AverEffTime, settings.average_eff_time);
map.Get(ProfileKeys::SetSystemTimeFromGPS, settings.set_system_time_from_gps);
LoadUTCOffset(map, settings.utc_offset);
Load(map, settings.task);
Load(map, settings.contest);
Load(map, settings.logger);
#ifdef HAVE_TRACKING
Load(map, settings.tracking);
#endif
Load(map, settings.weather);
}
示例8: unsigned
static void
Load(const ProfileMap &map, FAITriangleSettings &settings)
{
FAITriangleSettings::Threshold threshold;
if (map.GetEnum(ProfileKeys::FAITriangleThreshold, threshold) &&
unsigned(threshold) < unsigned(FAITriangleSettings::Threshold::MAX))
settings.threshold = threshold;
}
示例9: defined
void
Profile::Load(const ProfileMap &map, AirspaceRendererSettings &settings)
{
map.GetEnum(ProfileKeys::AirspaceLabelSelection, settings.label_selection);
map.Get(ProfileKeys::AirspaceBlackOutline, settings.black_outline);
map.GetEnum(ProfileKeys::AltMode, settings.altitude_mode);
map.Get(ProfileKeys::ClipAlt, settings.clip_altitude);
#if defined(HAVE_HATCHED_BRUSH) && defined(HAVE_ALPHA_BLEND)
map.Get(ProfileKeys::AirspaceTransparency, settings.transparency);
#endif
map.GetEnum(ProfileKeys::AirspaceFillMode, settings.fill_mode);
for (unsigned i = 0; i < AIRSPACECLASSCOUNT; i++)
Load(map, i, settings.classes[i]);
}
示例10:
static bool
GetPressureUnit(const ProfileMap &map, const char *key, Unit &value)
{
Unit tmp;
if (!map.GetEnum(key, tmp) || !ValidPressureUnit(tmp))
return false;
value = tmp;
return true;
}
示例11:
void
Profile::Load(const ProfileMap &map, ContestSettings &settings)
{
if (map.GetEnum(ProfileKeys::OLCRules, settings.contest)) {
/* handle out-dated Sprint rule in profile */
if (settings.contest == Contest::OLC_SPRINT)
settings.contest = Contest::OLC_LEAGUE;
}
map.Get(ProfileKeys::PredictContest, settings.predict);
}
示例12: Load
void
Profile::Load(const ProfileMap &map, TrackingSettings &settings)
{
#ifdef HAVE_LIVETRACK24
map.Get(ProfileKeys::TrackingInterval, settings.interval);
map.GetEnum(ProfileKeys::TrackingVehicleType, settings.vehicleType);
map.Get(ProfileKeys::TrackingVehicleName, settings.vehicle_name);
#endif
#ifdef HAVE_SKYLINES_TRACKING
Load(map, settings.skylines);
#endif
#ifdef HAVE_LIVETRACK24
Load(map, settings.livetrack24);
#endif
}
示例13: GetLegacySpeedUnit
static bool
GetSpeedUnit(const ProfileMap &map, const char *key, const char *legacy_key,
Unit &value_r)
{
Unit tmp;
if (!map.GetEnum(key, tmp))
/* migrate from XCSoar <= 6.2 profile */
return GetLegacySpeedUnit(map, legacy_key, value_r);
if (!ValidSpeedUnit(tmp))
return false;
value_r = tmp;
return true;
}
示例14: MakeAirspaceSettingName
void
Profile::Load(const ProfileMap &map,
unsigned i, AirspaceClassRendererSettings &settings)
{
char name[64];
MakeAirspaceSettingName(name, "AirspaceDisplay", i);
if (!map.Get(name, settings.display)) {
// Load setting from legacy key-value pair
MakeAirspaceSettingName(name, "AirspaceMode", i);
unsigned value;
if (map.Get(name, value))
settings.display = (value & 0x1) != 0;
}
#ifdef HAVE_HATCHED_BRUSH
MakeAirspaceSettingName(name, "Brush", i);
map.Get(name, settings.brush);
if (settings.brush >= ARRAY_SIZE(AirspaceLook::brushes))
settings.brush = 0;
#endif
MakeAirspaceSettingName(name, "AirspaceBorderColor", i);
if (!map.GetColor(name, settings.border_color))
GetAirspaceColor(map, i, settings.border_color);
MakeAirspaceSettingName(name, "AirspaceFillColor", i);
if (!map.GetColor(name, settings.fill_color))
GetAirspaceColor(map, i, settings.fill_color);
MakeAirspaceSettingName(name, "AirspaceBorderWidth", i);
map.Get(name, settings.border_width);
MakeAirspaceSettingName(name, "AirspaceFillMode", i);
map.GetEnum(name, settings.fill_mode);
}
示例15: ReadPortType
void
Profile::GetDeviceConfig(const ProfileMap &map, unsigned n,
DeviceConfig &config)
{
char buffer[64];
bool have_port_type = ReadPortType(map, n, config.port_type);
MakeDeviceSettingName(buffer, "Port", n, "BluetoothMAC");
map.Get(buffer, config.bluetooth_mac);
MakeDeviceSettingName(buffer, "Port", n, "IOIOUartID");
map.Get(buffer, config.ioio_uart_id);
MakeDeviceSettingName(buffer, "Port", n, "IPAddress");
if (!map.Get(buffer, config.ip_address))
config.ip_address.clear();
MakeDeviceSettingName(buffer, "Port", n, "TCPPort");
if (!map.Get(buffer, config.tcp_port))
config.tcp_port = 4353;
config.path.clear();
if ((!have_port_type ||
config.port_type == DeviceConfig::PortType::SERIAL) &&
!LoadPath(map, config, n) && LoadPortIndex(map, config, n))
config.port_type = DeviceConfig::PortType::SERIAL;
MakeDeviceSettingName(buffer, "Port", n, "BaudRate");
if (!map.Get(buffer, config.baud_rate)) {
/* XCSoar before 6.2 used to store a "speed index", not the real
baud rate - try to import the old settings */
static constexpr unsigned speed_index_table[] = {
1200,
2400,
4800,
9600,
19200,
38400,
57600,
115200
};
MakeDeviceSettingName(buffer, "Speed", n, "Index");
unsigned speed_index;
if (map.Get(buffer, speed_index) &&
speed_index < ARRAY_SIZE(speed_index_table))
config.baud_rate = speed_index_table[speed_index];
}
MakeDeviceSettingName(buffer, "Port", n, "BulkBaudRate");
if (!map.Get(buffer, config.bulk_baud_rate))
config.bulk_baud_rate = 0;
strcpy(buffer, "DeviceA");
buffer[strlen(buffer) - 1] += n;
map.Get(buffer, config.driver_name);
MakeDeviceSettingName(buffer, "Port", n, "Enabled");
map.Get(buffer, config.enabled);
MakeDeviceSettingName(buffer, "Port", n, "SyncFromDevice");
map.Get(buffer, config.sync_from_device);
MakeDeviceSettingName(buffer, "Port", n, "SyncToDevice");
map.Get(buffer, config.sync_to_device);
MakeDeviceSettingName(buffer, "Port", n, "K6Bt");
map.Get(buffer, config.k6bt);
MakeDeviceSettingName(buffer, "Port", n, "I2C_Bus");
map.Get(buffer, config.i2c_bus);
MakeDeviceSettingName(buffer, "Port", n, "I2C_Addr");
map.Get(buffer, config.i2c_addr);
MakeDeviceSettingName(buffer, "Port", n, "PressureUse");
map.GetEnum(buffer, config.press_use);
MakeDeviceSettingName(buffer, "Port", n, "SensorOffset");
map.Get(buffer, config.sensor_offset);
MakeDeviceSettingName(buffer, "Port", n, "SensorFactor");
map.Get(buffer, config.sensor_factor);
MakeDeviceSettingName(buffer, "Port", n, "UseSecondDevice");
map.Get(buffer, config.use_second_device);
MakeDeviceSettingName(buffer, "Port", n, "SecondDevice");
map.Get(buffer, config.driver2_name);
}