本文整理汇总了C++中ProfileMap::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ ProfileMap::Set方法的具体用法?C++ ProfileMap::Set怎么用?C++ ProfileMap::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProfileMap
的用法示例。
在下文中一共展示了ProfileMap::Set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeAirspaceSettingName
void
Profile::SetAirspaceMode(ProfileMap &map,
unsigned i, bool display, bool warning)
{
char name[64];
MakeAirspaceSettingName(name, "AirspaceDisplay", i);
map.Set(name, display);
MakeAirspaceSettingName(name, "AirspaceWarning", i);
map.Set(name, warning);
}
示例2: PortTypeToString
static void
WritePortType(ProfileMap &map, unsigned n, DeviceConfig::PortType type)
{
const char *value = PortTypeToString(type);
if (value == NULL)
return;
char name[64];
MakeDeviceSettingName(name, "Port", n, "Type");
map.Set(name, value);
}
示例3: assert
void
Profile::Save(ProfileMap &map, const FlarmColorDatabase &db)
{
std::string ids[4];
for (const auto &i : db) {
assert(i.first.IsDefined());
assert((int)i.second < (int)FlarmColor::COUNT);
if (i.second == FlarmColor::NONE)
continue;
unsigned color_index = (int)i.second - 1;
char id_buffer[16];
ids[color_index] += i.first.Format(id_buffer);
ids[color_index] += ',';
}
map.Set("FriendsGreen", ids[0].c_str());
map.Set("FriendsBlue", ids[1].c_str());
map.Set("FriendsYellow", ids[2].c_str());
map.Set("FriendsMagenta", ids[3].c_str());
}
示例4:
bool
SetProfilePasswordDialog(ProfileMap &map)
{
StringBuffer<TCHAR, 80> new_password;
new_password.clear();
if (!TextEntryDialog(new_password, _("Enter a new password")))
return false;
if (new_password.empty())
map.erase(ProfileKeys::Password);
else
map.Set(ProfileKeys::Password, new_password);
return true;
}
示例5: reader
bool
Profile::LoadFile(ProfileMap &map, const TCHAR *path, Error &error)
{
FileLineReaderA reader(path, error);
if (reader.error())
return false;
KeyValueFileReader kvreader(reader);
KeyValuePair pair;
while (kvreader.Read(pair))
/* ignore the "Vega*" values; the Vega driver used to abuse the
profile to pass messages between the driver and the user
interface */
if (!StringIsEqual(pair.key, "Vega", 4))
map.Set(pair.key, pair.value);
return true;
}
示例6: 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);
}