当前位置: 首页>>代码示例>>C++>>正文


C++ ProfileMap::SetEnum方法代码示例

本文整理汇总了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);
}
开发者ID:CnZoom,项目名称:XcSoarPull,代码行数:7,代码来源:AirspaceConfig.cpp

示例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);
}
开发者ID:kwtskran,项目名称:XCSoar,代码行数:74,代码来源:DeviceConfig.cpp


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