本文整理汇总了C++中ProfileMap::SetEnum方法的典型用法代码示例。如果您正苦于以下问题:C++ ProfileMap::SetEnum方法的具体用法?C++ ProfileMap::SetEnum怎么用?C++ ProfileMap::SetEnum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProfileMap
的用法示例。
在下文中一共展示了ProfileMap::SetEnum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeAirspaceSettingName
void
Profile::SetAirspaceFillMode(ProfileMap &map, unsigned i, uint8_t mode)
{
char name[64];
MakeAirspaceSettingName(name, "AirspaceFillMode", i);
map.SetEnum(name, (AirspaceClassRendererSettings::FillMode)mode);
}
示例2: WritePortType
void
Profile::SetDeviceConfig(ProfileMap &map,
unsigned n, const DeviceConfig &config)
{
char buffer[64];
WritePortType(map, n, config.port_type);
MakeDeviceSettingName(buffer, "Port", n, "BluetoothMAC");
map.Set(buffer, config.bluetooth_mac);
MakeDeviceSettingName(buffer, "Port", n, "IOIOUartID");
map.Set(buffer, config.ioio_uart_id);
MakeDeviceSettingName(buffer, "Port", n, "Path");
map.Set(buffer, config.path);
MakeDeviceSettingName(buffer, "Port", n, "BaudRate");
map.Set(buffer, config.baud_rate);
MakeDeviceSettingName(buffer, "Port", n, "BulkBaudRate");
map.Set(buffer, config.bulk_baud_rate);
MakeDeviceSettingName(buffer, "Port", n, "IPAddress");
map.Set(buffer, config.ip_address);
MakeDeviceSettingName(buffer, "Port", n, "TCPPort");
map.Set(buffer, config.tcp_port);
strcpy(buffer, "DeviceA");
buffer[strlen(buffer) - 1] += n;
map.Set(buffer, config.driver_name);
MakeDeviceSettingName(buffer, "Port", n, "Enabled");
map.Set(buffer, config.enabled);
MakeDeviceSettingName(buffer, "Port", n, "SyncFromDevice");
map.Set(buffer, config.sync_from_device);
MakeDeviceSettingName(buffer, "Port", n, "SyncToDevice");
map.Set(buffer, config.sync_to_device);
MakeDeviceSettingName(buffer, "Port", n, "K6Bt");
map.Set(buffer, config.k6bt);
MakeDeviceSettingName(buffer, "Port", n, "I2C_Bus");
map.Set(buffer, config.i2c_bus);
MakeDeviceSettingName(buffer, "Port", n, "I2C_Addr");
map.Set(buffer, config.i2c_addr);
MakeDeviceSettingName(buffer, "Port", n, "PressureUse");
map.SetEnum(buffer, config.press_use);
MakeDeviceSettingName(buffer, "Port", n, "SensorOffset");
auto offset = DeviceConfig::UsesCalibration(config.port_type) ? config.sensor_offset : fixed(0);
// Has new calibration data been delivered ?
if (CommonInterface::Basic().sensor_calibration_available)
offset = CommonInterface::Basic().sensor_calibration_offset;
map.Set(buffer, offset);
MakeDeviceSettingName(buffer, "Port", n, "SensorFactor");
auto factor = DeviceConfig::UsesCalibration(config.port_type) ? config.sensor_factor : fixed(0);
// Has new calibration data been delivered ?
if (CommonInterface::Basic().sensor_calibration_available)
factor = CommonInterface::Basic().sensor_calibration_factor;
map.Set(buffer, factor);
MakeDeviceSettingName(buffer, "Port", n, "UseSecondDevice");
map.Set(buffer, config.use_second_device);
MakeDeviceSettingName(buffer, "Port", n, "SecondDevice");
map.Set(buffer, config.driver2_name);
}