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


Java MonitoringMode类代码示例

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


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

示例1: OpcUaMonitoredItem

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
public OpcUaMonitoredItem(
    OpcUaClient client,
    UInteger clientHandle,
    ReadValueId readValueId,
    UInteger monitoredItemId,
    StatusCode statusCode,
    double revisedSamplingInterval,
    UInteger revisedQueueSize,
    ExtensionObject filterResult,
    MonitoringMode monitoringMode,
    ExtensionObject monitoringFilter) {

    this.client = client;
    this.clientHandle = clientHandle;
    this.readValueId = readValueId;
    this.monitoredItemId = monitoredItemId;
    this.statusCode = statusCode;
    this.revisedSamplingInterval = revisedSamplingInterval;
    this.revisedQueueSize = revisedQueueSize;
    this.filterResult = filterResult;
    this.monitoringMode = monitoringMode;
    this.monitoringFilter = monitoringFilter;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:24,代码来源:OpcUaMonitoredItem.java

示例2: MonitoredDataItem

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
public MonitoredDataItem(
    UInteger id,
    UInteger subscriptionId,
    ReadValueId readValueId,
    MonitoringMode monitoringMode,
    TimestampsToReturn timestamps,
    UInteger clientHandle,
    double samplingInterval,
    ExtensionObject filter,
    UInteger queueSize,
    boolean discardOldest) throws UaException {

    super(id, subscriptionId, readValueId, monitoringMode,
        timestamps, clientHandle, samplingInterval, queueSize, discardOldest);

    installFilter(filter);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:18,代码来源:MonitoredDataItem.java

示例3: MonitoredEventItem

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
public MonitoredEventItem(
    UInteger id,
    UInteger subscriptionId,
    ReadValueId readValueId,
    MonitoringMode monitoringMode,
    TimestampsToReturn timestamps,
    UInteger clientHandle,
    double samplingInterval,
    UInteger queueSize,
    boolean discardOldest,
    ExtensionObject filter) throws UaException {

    super(id, subscriptionId, readValueId, monitoringMode,
        timestamps, clientHandle, samplingInterval, queueSize, discardOldest);

    installFilter(filter);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:18,代码来源:MonitoredEventItem.java

示例4: BaseMonitoredItem

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
protected BaseMonitoredItem(
    UInteger id,
    UInteger subscriptionId,
    ReadValueId readValueId,
    MonitoringMode monitoringMode,
    TimestampsToReturn timestamps,
    UInteger clientHandle,
    double samplingInterval,
    UInteger queueSize,
    boolean discardOldest) {

    this.id = id;
    this.subscriptionId = subscriptionId;
    this.readValueId = readValueId;
    this.monitoringMode = monitoringMode;
    this.timestamps = timestamps;
    this.clientHandle = clientHandle.longValue();
    this.samplingInterval = samplingInterval;
    this.discardOldest = discardOldest;

    setQueueSize(queueSize);

    queue = new RingBuffer<>(this.queueSize);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:25,代码来源:BaseMonitoredItem.java

示例5: decode

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
@Override
public SetMonitoringModeRequest decode(UaDecoder decoder) throws UaSerializationException {
    RequestHeader requestHeader = (RequestHeader) decoder.readBuiltinStruct("RequestHeader", RequestHeader.class);
    UInteger subscriptionId = decoder.readUInt32("SubscriptionId");
    MonitoringMode monitoringMode = MonitoringMode.from(decoder.readInt32("MonitoringMode"));
    UInteger[] monitoredItemIds = decoder.readArray("MonitoredItemIds", decoder::readUInt32, UInteger.class);

    return new SetMonitoringModeRequest(requestHeader, subscriptionId, monitoringMode, monitoredItemIds);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:10,代码来源:SetMonitoringModeRequest.java

示例6: decode

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
@Override
public MonitoredItemCreateRequest decode(UaDecoder decoder) throws UaSerializationException {
    ReadValueId itemToMonitor = (ReadValueId) decoder.readBuiltinStruct("ItemToMonitor", ReadValueId.class);
    MonitoringMode monitoringMode = MonitoringMode.from(decoder.readInt32("MonitoringMode"));
    MonitoringParameters requestedParameters = (MonitoringParameters) decoder.readBuiltinStruct("RequestedParameters", MonitoringParameters.class);

    return new MonitoredItemCreateRequest(itemToMonitor, monitoringMode, requestedParameters);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:9,代码来源:MonitoredItemCreateRequest.java

示例7: createItemAndWait

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
private void createItemAndWait(
    UaSubscription.NotificationListener notificationListener,
    Object notificationLock) throws InterruptedException, ExecutionException {

    // create a subscription and a monitored item
    UaSubscription subscription = client.getSubscriptionManager().createSubscription(1000.0).get();
    subscription.addNotificationListener(notificationListener);

    ReadValueId readValueId = new ReadValueId(
        Identifiers.Server_ServerStatus_State,
        AttributeId.Value.uid(), null, QualifiedName.NULL_VALUE);

    MonitoringParameters parameters = new MonitoringParameters(
        uint(1),    // client handle
        1000.0,     // sampling interval
        null,       // no (default) filter
        uint(10),   // queue size
        true);      // discard oldest

    MonitoredItemCreateRequest request = new MonitoredItemCreateRequest(
        readValueId, MonitoringMode.Reporting, parameters);

    synchronized (notificationLock) {
        subscription.createMonitoredItems(TimestampsToReturn.Both, newArrayList(request)).get();
        notificationLock.wait(5000);
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:28,代码来源:OpcUaClientIT.java

示例8: setMonitoringMode

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
@Override
public CompletableFuture<SetMonitoringModeResponse> setMonitoringMode(UInteger subscriptionId,
                                                                      MonitoringMode monitoringMode,
                                                                      List<UInteger> monitoredItemIds) {

    return getSession().thenCompose(session -> {
        SetMonitoringModeRequest request = new SetMonitoringModeRequest(
            newRequestHeader(session.getAuthenticationToken()),
            subscriptionId,
            monitoringMode,
            a(monitoredItemIds, UInteger.class));

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

示例9: setMonitoringMode

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
@Override
public CompletableFuture<List<StatusCode>> setMonitoringMode(MonitoringMode monitoringMode,
                                                             List<UaMonitoredItem> items) {

    List<UInteger> monitoredItemIds = items.stream()
        .map(UaMonitoredItem::getMonitoredItemId)
        .collect(Collectors.toList());

    CompletableFuture<SetMonitoringModeResponse> future =
        client.setMonitoringMode(subscriptionId, monitoringMode, monitoredItemIds);

    return future.thenApply(response -> {
        List<StatusCode> results = l(response.getResults());

        for (int i = 0; i < monitoredItemIds.size(); i++) {
            UInteger id = monitoredItemIds.get(i);
            OpcUaMonitoredItem item = itemsByServerHandle.get(id);

            StatusCode result = results.get(i);
            if (result.isGood() && item != null) {
                item.setMonitoringMode(monitoringMode);
            }
        }

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

示例10: setMonitoringMode

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
@Override
public synchronized void setMonitoringMode(MonitoringMode monitoringMode) {
    if (monitoringMode == MonitoringMode.Disabled) {
        lastValue = null;
    }

    super.setMonitoringMode(monitoringMode);
}
 
开发者ID:eclipse,项目名称:milo,代码行数:9,代码来源:MonitoredDataItem.java

示例11: setMonitoringMode

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
public void setMonitoringMode(MonitoringMode monitoringMode) {
    this.monitoringMode = monitoringMode;

    if (monitoringMode == MonitoringMode.Disabled) {
        queue.clear();
    }
}
 
开发者ID:eclipse,项目名称:milo,代码行数:8,代码来源:BaseMonitoredItem.java

示例12: SetMonitoringModeRequest

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
public SetMonitoringModeRequest(RequestHeader requestHeader, UInteger subscriptionId, MonitoringMode monitoringMode, UInteger[] monitoredItemIds) {
    this.requestHeader = requestHeader;
    this.subscriptionId = subscriptionId;
    this.monitoringMode = monitoringMode;
    this.monitoredItemIds = monitoredItemIds;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:7,代码来源:SetMonitoringModeRequest.java

示例13: MonitoredItemCreateRequest

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
public MonitoredItemCreateRequest(ReadValueId itemToMonitor, MonitoringMode monitoringMode, MonitoringParameters requestedParameters) {
    this.itemToMonitor = itemToMonitor;
    this.monitoringMode = monitoringMode;
    this.requestedParameters = requestedParameters;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:6,代码来源:MonitoredItemCreateRequest.java

示例14: testSubscribe

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
@Test
public void testSubscribe() throws Exception {
    logger.info("testSubscribe()");

    // create a subscription and a monitored item
    UaSubscription subscription = client.getSubscriptionManager().createSubscription(1000.0).get();

    List<MonitoredItemCreateRequest> requests = new ArrayList<>();

    for (int i = 0; i < 10; i++) {
        ReadValueId readValueId = new ReadValueId(
            Identifiers.Server_ServerStatus_State,
            AttributeId.Value.uid(), null, QualifiedName.NULL_VALUE);

        MonitoringParameters parameters = new MonitoringParameters(
            uint(i),    // client handle
            1000.0,     // sampling interval
            null,       // no (default) filter
            uint(10),   // queue size
            true);      // discard oldest

        MonitoredItemCreateRequest request = new MonitoredItemCreateRequest(
            readValueId, MonitoringMode.Reporting, parameters);

        requests.add(request);
    }

    @SuppressWarnings("unchecked")
    CompletableFuture<DataValue>[] cfs = new CompletableFuture[10];

    for (int i = 0; i < 10; i++) {
        CompletableFuture<DataValue> f = new CompletableFuture<>();
        f.thenAccept(value -> logger.info("received {}", value));
        cfs[i] = f;
    }

    BiConsumer<UaMonitoredItem, Integer> callback =
        (item, idx) -> item.setValueConsumer(cfs[idx]::complete);

    List<UaMonitoredItem> items = subscription
        .createMonitoredItems(TimestampsToReturn.Both, requests, callback).get();

    assertTrue(items.stream().allMatch(item -> item.getStatusCode().isGood()));
    assertNotNull(FutureUtils.sequence(cfs).get(5, TimeUnit.SECONDS));
}
 
开发者ID:eclipse,项目名称:milo,代码行数:46,代码来源:OpcUaClientIT.java

示例15: getMonitoringMode

import org.eclipse.milo.opcua.stack.core.types.enumerated.MonitoringMode; //导入依赖的package包/类
@Override
public MonitoringMode getMonitoringMode() {
    return monitoringMode;
}
 
开发者ID:eclipse,项目名称:milo,代码行数:5,代码来源:OpcUaMonitoredItem.java


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