All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.epics.pvaClient.PvaClientMultiMonitorDouble Maven / Gradle / Ivy

There is a newer version: 4.3.2
Show newest version

/**
 * Copyright - See the COPYRIGHT that is included with this distribution.
 * EPICS pvData is distributed subject to a Software License Agreement found
 * in file LICENSE that is included with this distribution.
 */

package org.epics.pvaClient;

import org.epics.pvdata.property.TimeStamp;
import org.epics.pvdata.property.TimeStampFactory;
import org.epics.pvdata.pv.Status;

/**
 * Provides a monitor to multiple channels where each channel has a numeric scalar value field.
 * @author mrk
 * @since 2015.06
 */
public class PvaClientMultiMonitorDouble
{
    /**
     * Factory method that creates a PvaClientMultiMonitorDouble.
     * @param pvaClientMultiChannel The interface to PvaClientMultiChannel.
     * @param pvaClientChannelArray The PvaClientChannel array.
     * @return The interface.
     */
    static public PvaClientMultiMonitorDouble create(
            PvaClientMultiChannel pvaClientMultiChannel,
            PvaClientChannel[] pvaClientChannelArray)
    {
        return new PvaClientMultiMonitorDouble(pvaClientMultiChannel,pvaClientChannelArray);
    }

    /** Destroy the pvAccess connection.
     */
    public void destroy()
    {
        if(PvaClient.getDebug()) System.out.println("PvaClientMultiMonitorDouble::destroy()");
        if(isDestroyed) return;
        isDestroyed = true;
        pvaClientChannelArray = null;
    }
    /**
     * Create a channel monitor for each channel.
     */
    public void connect()
    {
        boolean[] isConnected = pvaClientMultiChannel.getIsConnected();
        String request = "value";
        for(int i=0; i=waitForEvent) break;
        }
        return false;
    }
    /**
     * get the data.
     *  @return The double[] where each element is the value field of the corresponding channel.
     */
    public double[] get()
    {
        return doubleValue;
    }

    private PvaClientMultiMonitorDouble(
            PvaClientMultiChannel pvaClientMultiChannel,
            PvaClientChannel[] pvaClientChannelArray)
    {
        if(PvaClient.getDebug()) System.out.println("PvaClientMultiMonitorDouble::PvaClientMultiMonitorDouble()");
        this.pvaClientMultiChannel = pvaClientMultiChannel;
        this.pvaClientChannelArray = pvaClientChannelArray;
        nchannel = pvaClientChannelArray.length;
        doubleValue = new double[nchannel];
        pvaClientMonitor = new PvaClientMonitor[nchannel];
        for(int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy