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


C++ ParamList::append方法代码示例

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

示例2: setParamValue

/*! Sets the \a value of the \l{Param} with the given \a paramName. */
void Device::setParamValue(const QString &paramName, const QVariant &value)
{
    ParamList params;
    foreach (Param param, m_params) {
        if (param.name() == paramName) {
            param.setValue(value);
        }
        params.append(param);
    }
    m_params = params;
}
开发者ID:tonnenpinguin,项目名称:guh,代码行数:12,代码来源:device.cpp

示例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());
}
开发者ID:defc0n1,项目名称:guh,代码行数:11,代码来源:testevents.cpp

示例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);
}
开发者ID:defc0n1,项目名称:guh,代码行数:24,代码来源:devicepluginlircd.cpp

示例5: discoverDevices

DeviceManager::DeviceError DevicePluginDateTime::discoverDevices(const DeviceClassId &deviceClassId, const ParamList &params)
{
    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);
        }
    }
开发者ID:haklein,项目名称:guh,代码行数:15,代码来源:deviceplugindatetime.cpp

示例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;
//.........这里部分代码省略.........
开发者ID:mzanetti,项目名称:guh,代码行数:101,代码来源:devicepluginintertechno.cpp


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