本文整理汇总了C++中ParamList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamList::append方法的具体用法?C++ ParamList::append怎么用?C++ ParamList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamList
的用法示例。
在下文中一共展示了ParamList::append方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toAction
/*! Converts this \l{RuleAction} to a normal \l{Action}.
* \sa Action, */
Action RuleAction::toAction() const
{
Action action(m_actionTypeId, m_deviceId);
ParamList params;
foreach (const RuleActionParam &ruleActionParam, m_ruleActionParams) {
Param param;
param.setName(ruleActionParam.name());
param.setValue(ruleActionParam.value());
params.append(param);
}
示例2: setParamValue
/*! Sets the \a value of the \l{Param} with the given \a paramName. */
void Device::setParamValue(const QString ¶mName, const QVariant &value)
{
ParamList params;
foreach (Param param, m_params) {
if (param.name() == paramName) {
param.setValue(value);
}
params.append(param);
}
m_params = params;
}
示例3: params
void TestEvents::params()
{
Event event;
ParamList params;
Param p("foo", "bar");
params.append(p);
event.setParams(params);
QVERIFY(event.param("foo").value().toString() == "bar");
QVERIFY(!event.param("baz").value().isValid());
}
示例4: buttonPressed
void DevicePluginLircd::buttonPressed(const QString &remoteName, const QString &buttonName, int repeat)
{
Device *remote = nullptr;
QList<Device*> configuredRemotes = deviceManager()->findConfiguredDevices(lircdDeviceClassId);
foreach (Device *device, configuredRemotes) {
if (device->paramValue("remoteName").toString() == remoteName) {
remote = device;
break;
}
}
if (!remote) {
qCWarning(dcLircd) << "Unhandled remote" << remoteName << buttonName;
return;
}
qCDebug(dcLircd) << "found remote" << remoteName << supportedDevices().first().eventTypes().count();
ParamList params;
Param buttonParam("button", buttonName);
params.append(buttonParam);
Param repeatParam("repeat", repeat);
params.append(repeatParam);
Event event(LircKeypressEventTypeId, remote->id(), params);
emitEvent(event);
}
示例5: discoverDevices
DeviceManager::DeviceError DevicePluginDateTime::discoverDevices(const DeviceClassId &deviceClassId, const ParamList ¶ms)
{
Q_UNUSED(deviceClassId);
QList<DeviceDescriptor> deviceDescriptors;
foreach (QByteArray timeZone, QTimeZone::availableTimeZoneIds()) {
QByteArray continent = params.paramValue("continent").toByteArray();
if(timeZone.contains(continent)){
DeviceDescriptor descriptor(dateTimeDeviceClassId, timeZone.right(timeZone.length() - (continent.length() + 1)), continent);
ParamList params;
params.append(Param("timezone", timeZone));
descriptor.setParams(params);
deviceDescriptors.append(descriptor);
}
}
示例6: radioData
void DevicePluginIntertechno::radioData(const QList<int> &rawData)
{
// filter right here a wrong signal length
if(rawData.length() != 49){
return;
}
QList<Device*> deviceList = deviceManager()->findConfiguredDevices(intertechnoRemote);
if(deviceList.isEmpty()){
return;
}
int delay = rawData.first()/31;
QByteArray binCode;
// =======================================
// average 314
if(delay > 300 && delay < 400){
// go trough all 48 timings (without sync signal)
for(int i = 1; i <= 48; i+=2 ){
int div;
int divNext;
// if short
if(rawData.at(i) <= 700){
div = 1;
}else{
div = 3;
}
// if long
if(rawData.at(i+1) < 700){
divNext = 1;
}else{
divNext = 3;
}
// _
// if we have | |___ = 0 -> in 4 delays => 1000
// _
// if we have ___| | = 1 -> in 4 delays => 0001
if(div == 1 && divNext == 3){
binCode.append('0');
}else if(div == 3 && divNext == 1){
binCode.append('1');
}else{
return;
}
}
}else{
return;
}
// =======================================
// Check nibble 16-19, must be 0001
if(binCode.mid(16,4) != "0001"){
return;
}
// =======================================
// Get family code
QString familyCode;
bool ok;
QByteArray familyCodeBin = binCode.left(8);
int famiyCodeInt = familyCodeBin.toInt(&ok,2);
if(!ok){
return;
}
switch (famiyCodeInt) {
case 0b00000000:
familyCode = "A";
break;
case 0b01000000:
familyCode = "B";
break;
case 0b00010000:
familyCode = "C";
break;
case 0b01010000:
familyCode = "D";
break;
case 0b00000100:
familyCode = "E";
break;
case 0b01000100:
familyCode = "F";
break;
case 0b00010100:
familyCode = "G";
break;
case 0b01010100:
familyCode = "H";
break;
case 0b00000001:
familyCode = "I";
break;
//.........这里部分代码省略.........