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


C++ StandardFieldPtr::doubleAlarm方法代码示例

本文整理汇总了C++中StandardFieldPtr::doubleAlarm方法的典型用法代码示例。如果您正苦于以下问题:C++ StandardFieldPtr::doubleAlarm方法的具体用法?C++ StandardFieldPtr::doubleAlarm怎么用?C++ StandardFieldPtr::doubleAlarm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StandardFieldPtr的用法示例。


在下文中一共展示了StandardFieldPtr::doubleAlarm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test_builder

void test_builder()
{
    testDiag("test_builder");

    NTEnumBuilderPtr builder = NTEnum::createBuilder();
    testOk(builder.get() != 0, "Got builder");

    StructureConstPtr structure = builder->
            addDescriptor()->
            addAlarm()->
            addTimeStamp()->
            add("valueAlarm",standardField->doubleAlarm()) ->
            add("extra",fieldCreate->createScalarArray(pvString)) ->
            createStructure();
    testOk1(structure.get() != 0);
    if (!structure)
        return;

    testOk1(NTEnum::is_a(structure));
    testOk1(structure->getID() == NTEnum::URI);
    testOk1(structure->getNumberFields() == 6);
    testOk1(structure->getField("value").get() != 0);
    testOk1(structure->getField("descriptor").get() != 0);
    testOk1(structure->getField("alarm").get() != 0);
    testOk1(structure->getField("timeStamp").get() != 0);

    FieldConstPtr valueField = structure->getField("value");
    testOk(valueField.get() != 0 &&
           ntField->isEnumerated(valueField), "value is enum");

    std::cout << *structure << std::endl;

}
开发者ID:epicsdeb,项目名称:epics-nt,代码行数:33,代码来源:ntenumTest.cpp

示例2: test_builder

void test_builder()
{
    testDiag("test_builder");

    NTScalarBuilderPtr builder = NTScalar::createBuilder();
    testOk(builder.get() != 0, "Got builder");

    StructureConstPtr structure = builder->
            value(pvDouble)->
            addDescriptor()->
            addAlarm()->
            addTimeStamp()->
            addDisplay()->
            addControl()->
            add("valueAlarm",standardField->doubleAlarm()) ->
            add("extra",fieldCreate->createScalarArray(pvString)) ->
            createStructure();
    testOk1(structure.get() != 0);
    if (!structure)
        return;

    testOk1(NTScalar::is_a(structure));
    testOk1(structure->getID() == NTScalar::URI);
    testOk1(structure->getNumberFields() == 8);
    testOk1(structure->getField("value").get() != 0);
    testOk1(structure->getField("descriptor").get() != 0);
    testOk1(structure->getField("alarm").get() != 0);
    testOk1(structure->getField("timeStamp").get() != 0);
    testOk1(structure->getField("display").get() != 0);
    testOk1(structure->getField("control").get() != 0);

    testOk(dynamic_pointer_cast<const Scalar>(structure->getField("value")).get() != 0 &&
            dynamic_pointer_cast<const Scalar>(structure->getField("value"))->getScalarType() == pvDouble, "value type");

    std::cout << *structure << std::endl;

    // no value set
    try
    {
        structure = builder->
                addDescriptor()->
                addAlarm()->
                addTimeStamp()->
                addDisplay()->
                addControl()->
                createStructure();
        testFail("no value type set");
    } catch (std::runtime_error &) {
        testPass("no value type set");
    }
}
开发者ID:epicsdeb,项目名称:epics-nt,代码行数:51,代码来源:ntscalarTest.cpp

示例3: testPVNTField

void testPVNTField()
{
    testDiag("testPVNTField");

    StringArray choices;
    choices.resize(3);
    choices[0] = "one";
    choices[1] = "two";
    choices[2] = "three";
    PVStructurePtr pvStructure = PVStructurePtr(
        pvntField->createEnumerated(choices));
    cout << *pvStructure << endl;
    testOk1(ntField->isEnumerated(pvStructure->getStructure()));

    pvStructure = PVStructurePtr(pvntField->createTimeStamp());
    cout << *pvStructure << endl;
    testOk1(ntField->isTimeStamp(pvStructure->getStructure()));

    pvStructure = PVStructurePtr(pvntField->createAlarm());
    cout << *pvStructure << endl;
    testOk1(ntField->isAlarm(pvStructure->getStructure()));

    pvStructure = PVStructurePtr(pvntField->createDisplay());
    cout << *pvStructure << endl;
    testOk1(ntField->isDisplay(pvStructure->getStructure()));

    pvStructure = PVStructurePtr(pvDataCreate->createPVStructure(standardField->doubleAlarm()));
    cout << *pvStructure << endl;
    testOk1(ntField->isAlarmLimit(pvStructure->getStructure()));

    PVStructureArrayPtr pvStructureArray = PVStructureArrayPtr(
        pvntField->createEnumeratedArray());
    cout << *pvStructure << endl;
    cout << *pvStructureArray->getStructureArray()->getStructure();

    pvStructureArray = PVStructureArrayPtr(
        pvntField->createTimeStampArray());
    cout << *pvStructure << endl;
    cout << *pvStructureArray->getStructureArray()->getStructure();

    pvStructureArray = PVStructureArrayPtr(
        pvntField->createAlarmArray());
    cout << *pvStructure << endl;
    cout << *pvStructureArray->getStructureArray()->getStructure();
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:45,代码来源:ntfieldTest.cpp

示例4: testNTField

void testNTField()
{
    testDiag("testNTField");

    StructureConstPtr structureConstPtr = ntField->createEnumerated();
    cout << *structureConstPtr << endl;
    testOk1(ntField->isEnumerated(structureConstPtr));

    structureConstPtr = ntField->createTimeStamp();
    cout << *structureConstPtr << endl;
    testOk1(ntField->isTimeStamp(structureConstPtr));

    structureConstPtr = ntField->createAlarm();
    cout << *structureConstPtr << endl;
    testOk1(ntField->isAlarm(structureConstPtr));

    structureConstPtr = ntField->createDisplay();
    cout << *structureConstPtr << endl;
    testOk1(ntField->isDisplay(structureConstPtr));

    structureConstPtr = standardField->doubleAlarm();
    cout << *structureConstPtr << endl;
    testOk1(ntField->isAlarmLimit(structureConstPtr));

    structureConstPtr = ntField->createControl();
    cout << *structureConstPtr << endl;
    testOk1(ntField->isControl(structureConstPtr));

    StructureArrayConstPtr structureArrayConstPtr
        = ntField->createEnumeratedArray();
    cout << *structureConstPtr << endl;

    structureArrayConstPtr = ntField->createTimeStampArray();
    cout << *structureConstPtr << endl;

    structureArrayConstPtr = ntField->createAlarmArray();
    cout << *structureConstPtr << endl;
}
开发者ID:ncanestrari,项目名称:EPICS-EPICS_V4,代码行数:38,代码来源:ntfieldTest.cpp


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