• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AttributeId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.milo.opcua.stack.core.AttributeId的典型用法代码示例。如果您正苦于以下问题:Java AttributeId类的具体用法?Java AttributeId怎么用?Java AttributeId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AttributeId类属于org.eclipse.milo.opcua.stack.core包,在下文中一共展示了AttributeId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getViewAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default DataValue getViewAttribute(
    AttributeContext context,
    ViewNode node,
    AttributeId attributeId) throws UaException {

    switch (attributeId) {
        case ContainsNoLoops:
            return dv(getContainsNoLoops(context, node));

        case EventNotifier:
            return dv(getEventNotifier(context, node));

        default:
            return getBaseAttribute(context, node, attributeId);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:17,代码来源:GetSetViewNode.java


示例2: testStack

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
public CompletableFuture<ReadResponse> testStack(NodeId nodeId) {
    RequestHeader header = new RequestHeader(
        NodeId.NULL_VALUE,
        DateTime.now(),
        uint(requestHandle.getAndIncrement()),
        uint(0),
        null,
        uint(60000),
        null
    );

    ReadRequest request = new ReadRequest(
        header,
        0.0,
        TimestampsToReturn.Neither,
        new ReadValueId[]{
            new ReadValueId(
                nodeId,
                AttributeId.Value.uid(),
                null,
                null)
        }
    );

    return client.sendRequest(request);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:27,代码来源:ClientExample.java


示例3: setViewAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default void setViewAttribute(
    AttributeContext context,
    ViewNode node,
    AttributeId attributeId,
    DataValue value) throws UaException {

    switch (attributeId) {
        case ContainsNoLoops:
            setContainsNoLoops(context, node, AttributeUtil.extract(value));
            break;
        case EventNotifier:
            setEventNotifier(context, node, AttributeUtil.extract(value));
            break;

        default:
            setBaseAttribute(context, node, attributeId, value);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:19,代码来源:GetSetViewNode.java


示例4: readDataAttributes

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
private CompletableFuture<List<DataValue>> readDataAttributes(Session session, Namespace namespace, NodeId itemId) {
    Function<AttributeId, ReadValueId> f = id ->
        new ReadValueId(itemId, id.uid(), null, QualifiedName.NULL_VALUE);

    CompletableFuture<List<DataValue>> future = new CompletableFuture<>();

    ReadContext readContext = new ReadContext(
        server, session, future, new DiagnosticsContext<>());

    List<ReadValueId> attributes = newArrayList(
        f.apply(AttributeId.AccessLevel),
        f.apply(AttributeId.UserAccessLevel),
        f.apply(AttributeId.MinimumSamplingInterval));

    namespace.read(readContext, 0.0, TimestampsToReturn.Neither, attributes);

    return future;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:19,代码来源:SubscriptionManager.java


示例5: setReferenceTypeAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default void setReferenceTypeAttribute(
    AttributeContext context,
    ReferenceTypeNode node,
    AttributeId attributeId,
    DataValue value) throws UaException {

    switch (attributeId) {
        case IsAbstract:
            setIsAbstract(context, node, AttributeUtil.extract(value));
            break;
        case Symmetric:
            setSymmetric(context, node, AttributeUtil.extract(value));
            break;
        case InverseName:
            setInverseName(context, node, AttributeUtil.extract(value));
            break;

        default:
            setBaseAttribute(context, node, attributeId, value);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:22,代码来源:GetSetReferenceTypeNode.java


示例6: getVariableTypeAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default DataValue getVariableTypeAttribute(
    AttributeContext context,
    VariableTypeNode node,
    AttributeId attributeId) throws UaException {

    switch (attributeId) {
        case Value:
            return getValue(context, node);

        case DataType:
            return dv(getDataType(context, node));

        case ValueRank:
            return dv(getValueRank(context, node));

        case ArrayDimensions:
            return dv(getArrayDimensions(context, node));

        case IsAbstract:
            return dv(getIsAbstract(context, node));

        default:
            return getBaseAttribute(context, node, attributeId);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:26,代码来源:GetSetVariableTypeNode.java


示例7: read

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
public static CompletableFuture<List<DataValue>> read(
        final OpcUaClient client,
        final AttributeId attributeId,
        final NodeId... nodeIds) {

    return client
            .read(
                    0,
                    Both,
                    asList(nodeIds),
                    nCopies(nodeIds.length, attributeId.uid()));
}
 
开发者ID:ctron,项目名称:milo-ece2017,代码行数:13,代码来源:Read.java


示例8: write

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
@Override
public void write(WriteContext context, List<WriteValue> writeValues) {
    List<StatusCode> results = Lists.newArrayListWithCapacity(writeValues.size());

    for (WriteValue writeValue : writeValues) {
        ServerNode node = server.getNodeMap().get(writeValue.getNodeId());

        if (node != null) {
            try {
                node.writeAttribute(
                    new AttributeContext(context),
                    writeValue.getAttributeId(),
                    writeValue.getValue(),
                    writeValue.getIndexRange()
                );

                results.add(StatusCode.GOOD);

                logger.info(
                    "Wrote value {} to {} attribute of {}",
                    writeValue.getValue().getValue(),
                    AttributeId.from(writeValue.getAttributeId()).map(Object::toString).orElse("unknown"),
                    node.getNodeId());
            } catch (UaException e) {
                logger.error("Unable to write value={}", writeValue.getValue(), e);
                results.add(e.getStatusCode());
            }
        } else {
            results.add(new StatusCode(StatusCodes.Bad_NodeIdUnknown));
        }
    }

    context.complete(results);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:35,代码来源:ExampleNamespace.java


示例9: setObjectTypeAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default void setObjectTypeAttribute(
    AttributeContext context,
    ObjectTypeNode node,
    AttributeId attributeId,
    DataValue value) throws UaException {

    switch (attributeId) {
        case IsAbstract:
            setIsAbstract(context, node, AttributeUtil.extract(value));
            break;

        default:
            setBaseAttribute(context, node, attributeId, value);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:16,代码来源:GetSetObjectTypeNode.java


示例10: getAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
@Override
public Optional<DataValue> getAttribute(NodeId nodeId, AttributeId attributeId) {
    Map<AttributeId, DataValue> attributes = cache.getIfPresent(nodeId);

    try {
        return attributes == null ?
            Optional.empty() :
            Optional.ofNullable(attributes.get(attributeId));
    } catch (ClassCastException e) {
        return Optional.empty();
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:13,代码来源:DefaultNodeCache.java


示例11: setObjectAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default void setObjectAttribute(
    AttributeContext context,
    ObjectNode node,
    AttributeId attributeId,
    DataValue value) throws UaException {

    switch (attributeId) {
        case EventNotifier:
            setEventNotifier(context, node, AttributeUtil.extract(value));
            break;

        default:
            setBaseAttribute(context, node, attributeId, value);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:16,代码来源:GetSetObjectNode.java


示例12: buildCache

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
private Cache<NodeId, Map<AttributeId, DataValue>> buildCache() {
    return CacheBuilder.newBuilder()
        .expireAfterWrite(expireAfterNanos, TimeUnit.NANOSECONDS)
        .maximumSize(maximumSize)
        .recordStats()
        .build();
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:DefaultNodeCache.java


示例13: getObjectTypeAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default DataValue getObjectTypeAttribute(
    AttributeContext context,
    ObjectTypeNode node,
    AttributeId attributeId) throws UaException {

    switch (attributeId) {
        case IsAbstract:
            return dv(getIsAbstract(context, node));

        default:
            return getBaseAttribute(context, node, attributeId);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:14,代码来源:GetSetObjectTypeNode.java


示例14: getUserWriteMasks

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
public static Set<WriteMask> getUserWriteMasks(
    ServerNode node,
    AttributeContext internalContext) throws UaException {

    UInteger userWriteMask = extract(
        node.getAttribute(
            internalContext,
            AttributeId.UserWriteMask
        )
    );

    return WriteMask.fromMask(userWriteMask);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:14,代码来源:AttributeUtil.java


示例15: setAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
@Override
public void setAttribute(AttributeContext context,
                         AttributeId attributeId,
                         DataValue value) throws UaException {

    attributeDelegate.get().setAttribute(context, this, attributeId, value);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:UaNode.java


示例16: setDataTypeAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default void setDataTypeAttribute(
    AttributeContext context,
    DataTypeNode node,
    AttributeId attributeId,
    DataValue value) throws UaException {

    switch (attributeId) {
        case IsAbstract:
            setIsAbstract(context, node, AttributeUtil.extract(value));
            break;

        default:
            setBaseAttribute(context, node, attributeId, value);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:16,代码来源:GetSetDataTypeNode.java


示例17: writeAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
protected CompletableFuture<StatusCode> writeAttribute(AttributeId attributeId, DataValue value) {
    WriteValue writeValue = new WriteValue(
        nodeId, attributeId.uid(), null, value);

    return client.write(newArrayList(writeValue)).thenApply(response -> {
        StatusCode statusCode = l(response.getResults()).get(0);

        if (statusCode.isGood()) {
            nodeCache.invalidate(nodeId, attributeId);
        }

        return statusCode;
    });
}
 
开发者ID:eclipse,项目名称:milo,代码行数:15,代码来源:UaNode.java


示例18: setVariableAttribute

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
default void setVariableAttribute(
    AttributeContext context,
    VariableNode node,
    AttributeId attributeId,
    DataValue value) throws UaException {

    switch (attributeId) {
        case Value:
            setValue(context, node, value);
            break;
        case DataType:
            setDataType(context, node, AttributeUtil.extract(value));
            break;
        case ValueRank:
            setValueRank(context, node, AttributeUtil.extract(value));
            break;
        case ArrayDimensions:
            setArrayDimensions(context, node, AttributeUtil.extract(value));
            break;
        case AccessLevel:
            setAccessLevel(context, node, AttributeUtil.extract(value));
            break;
        case UserAccessLevel:
            setUserAccessLevel(context, node, AttributeUtil.extract(value));
            break;
        case MinimumSamplingInterval:
            setMinimumSamplingInterval(context, node, AttributeUtil.extract(value));
            break;
        case Historizing:
            setHistorizing(context, node, AttributeUtil.extract(value));
            break;

        default:
            setBaseAttribute(context, node, attributeId, value);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:37,代码来源:GetSetVariableNode.java


示例19: installFilter

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
@Override
protected void installFilter(ExtensionObject filterXo) throws UaException {
    if (filterXo == null || filterXo.decode() == null) {
        this.filter = DEFAULT_FILTER;
    } else {
        Object filterObject = filterXo.decode();

        if (filterObject instanceof MonitoringFilter) {
            if (filterObject instanceof DataChangeFilter) {
                this.filter = ((DataChangeFilter) filterObject);

                DeadbandType deadbandType = DeadbandType.from(filter.getDeadbandType().intValue());

                if (deadbandType == null) {
                    throw new UaException(StatusCodes.Bad_DeadbandFilterInvalid);
                }

                if (deadbandType == DeadbandType.Percent) {
                    // Percent deadband is not currently implemented
                    throw new UaException(StatusCodes.Bad_FilterNotAllowed);
                }

                if (deadbandType == DeadbandType.Absolute &&
                    !AttributeId.Value.isEqual(getReadValueId().getAttributeId())) {

                    // Absolute deadband is only allowed for Value attributes
                    throw new UaException(StatusCodes.Bad_FilterNotAllowed);
                }
            } else if (filterObject instanceof AggregateFilter) {
                throw new UaException(StatusCodes.Bad_MonitoredItemFilterUnsupported);
            } else if (filterObject instanceof EventFilter) {
                throw new UaException(StatusCodes.Bad_FilterNotAllowed);
            }
        } else {
            throw new UaException(StatusCodes.Bad_MonitoredItemFilterInvalid);
        }
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:39,代码来源:MonitoredDataItem.java


示例20: getAccessLevels

import org.eclipse.milo.opcua.stack.core.AttributeId; //导入依赖的package包/类
public static Set<AccessLevel> getAccessLevels(
    ServerNode node,
    AttributeContext context) throws UaException {

    UByte accessLevel = extract(
        node.getAttribute(
            context,
            AttributeId.AccessLevel)
    );

    return AccessLevel.fromMask(accessLevel);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:13,代码来源:AttributeUtil.java



注:本文中的org.eclipse.milo.opcua.stack.core.AttributeId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockRailDetector类代码示例发布时间:2022-05-23
下一篇:
Java BooleanParameter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap