Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-VB/ActiveX | API-Java | Examples | Downloads

chart.Acop Class Reference

Advanced Component Oriented Programming ACOP offers a powerful interface for both data acquisition and data rendition in a common bean. More...

List of all members.

Public Member Functions

int Execute (Object Data, int ArraySize, Object DataEx, int ArraySizeEx)
 Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

int Execute (Object Data, Object DataEx)
 Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

int Execute (Object Data)
 Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

int Execute (Object Data, int ArraySize)
 Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

int AttachLink (Object Data, int ArraySize, Object DataEx, int ArraySizeEx)
 Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data objects passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int AttachLink (Object Data, int ArraySize, Object DataEx, int ArraySizeEx, int identifier)
 Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data objects passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int AttachLink (Object Data, Object DataEx)
 Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data objects passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int AttachLink (Object Data)
 Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data object passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int AttachLink (Object Data, int ArraySize)
 Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data object passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int AttachLink (Object Data, int ArraySize, int identifier)
 Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data object passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int setLinkIdentifier (int currentLinkIdentifier, int linkIdentifier)
 Sets the link identifier to the value specified. Establishing a data link by using either AttachLink() or OpenLink() will assign a link identifier to the associated link when successful. This link identifier (or link 'handle') will be set prior to event notification via the Receive() event. One can set the link identifier to a desired value either in the original call to AttachLink() or OpenLink() or at a later time by calling this method.

int OpenLink (Object Data, int ArraySize, Object DataEx, int ArraySizeEx)
 Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data objects passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int OpenLink (Object Data, int ArraySize, Object DataEx, int ArraySizeEx, int identifier)
 Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data objects passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int OpenLink (Object Data, Object DataEx)
 Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data objects passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int OpenLink (Object Data)
 Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data object passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int OpenLink (Object Data, int ArraySize)
 Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data object passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int OpenLink (Object Data, int ArraySize, int identifier)
 Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data object passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

int CloseLink (int identifier)
 Closes an existing de.desy.acop.chart data link. Using CloseLink() with a '-1' input parameter will close all data links associated with the de.desy.acop.chart bean.

int GetData (Object Data, Object DataEx, int identifier)
 Retrieves the data associated with the given link handle into the data objects passed. This method is frequently used in conjunction with the OpenLink() method of establishing a data link, in which case the incoming data is not bound to a data object.

int GetDataSize (int[] DataSize, int[] DataSizeEx, int identifier)
 Gives the current data size of the data objects associated with the given link handle. This method provides an analogy with the equivalent method in the ACOP ActiveX control, where the arguments are explicitly passed by reference. In the ACOP java bean, the overloaded methods GetDataSize(int identifier) and GetDataSizeEx(int identifier) are preferred.

int GetDataSize (int identifier)
 Returns the current data size of the primary data object associated with the given link handle.

int GetDataSize ()
 Returns the current data size of the primary data object.

int GetDataSizeEx (int identifier)
 Returns the current data size of the extended data object associated with the given link handle.

int GetDataSizeEx ()
 Returns the current data size of the extended data object.

Date getTimeStamp ()
 The current data time stamp as a Date object.

java.lang.String getStatus ()
 The current data status string.

void setGrouped (boolean Grouped)
 Sets the grouped flag.

boolean getGrouped ()
 The grouped flag.

String[] getDeviceContexts ()
 Queries for the available device contexts according to current setting of the AccessProtocol.

String[] getDeviceGroups (String deviceContext, String deviceGroup, String deviceName, String deviceProperty)
 Queries for the available device groups according to current setting of the AccessProtocol.

String[] getDeviceGroups ()
 Queries for the available device groups according to current setting of the AccessProtocol and Device parameters.

String[] getDeviceNames (String deviceContext, String deviceGroup, String deviceName, String deviceProperty)
 Queries for the available device names according to current setting of the AccessProtocol.

String[] getDeviceNames ()
 Queries for the available device names according to current setting of the AccessProtocol and Device parameters.

String[] getDeviceProperties (String deviceContext, String deviceGroup, String deviceName, String deviceProperty)
 Queries for the available device properties according to current setting of the AccessProtocol.

String[] getDeviceProperties ()
 Queries for the available device properties according to current setting of the AccessProtocol and Device parameters.

int acquireDisplayProperties (String deviceContext, String deviceGroup, String deviceName, String deviceProperty)
 Queries for the available display setting according to current setting of the AccessProtocol This method uses the query mechanisms of the underlying transport to ascertain the maximum and minimum display settings and axis labels. The resulting 'Y' axis label will be the units associated with the queried property. The maximum and minimum settings for the 'Y' axis will be the range associated with the queried property. The resulting 'X' axis label will be the description associated with the queried property. The maximum and minimum settings for the 'X' axis will be 0 to the array size of the property queried, if the property corresponds to a multi-channel display.

int acquireDisplayProperties ()
 Queries for the available display setting according to current setting of the AccessProtocol and display parameters. This method uses the query mechanisms of the underlying transport to ascertain the maximum and minimum display settings and axis labels. The resulting 'Y' axis label will be the units associated with the queried property. The maximum and minimum settings for the 'Y' axis will be the range associated with the queried property. The resulting 'X' axis label will be the description associated with the queried property. The maximum and minimum settings for the 'X' axis will be 0 to the array size of the property queried, if the property corresponds to a multi-channel display.


Detailed Description

Advanced Component Oriented Programming ACOP offers a powerful interface for both data acquisition and data rendition in a common bean.


Member Function Documentation

int chart.Acop.acquireDisplayProperties  ) 
 

Queries for the available display setting according to current setting of the AccessProtocol and display parameters. This method uses the query mechanisms of the underlying transport to ascertain the maximum and minimum display settings and axis labels. The resulting 'Y' axis label will be the units associated with the queried property. The maximum and minimum settings for the 'Y' axis will be the range associated with the queried property. The resulting 'X' axis label will be the description associated with the queried property. The maximum and minimum settings for the 'X' axis will be 0 to the array size of the property queried, if the property corresponds to a multi-channel display.

Returns:
0 if successful otherwise -1.

int chart.Acop.acquireDisplayProperties String  deviceContext,
String  deviceGroup,
String  deviceName,
String  deviceProperty
 

Queries for the available display setting according to current setting of the AccessProtocol This method uses the query mechanisms of the underlying transport to ascertain the maximum and minimum display settings and axis labels. The resulting 'Y' axis label will be the units associated with the queried property. The maximum and minimum settings for the 'Y' axis will be the range associated with the queried property. The resulting 'X' axis label will be the description associated with the queried property. The maximum and minimum settings for the 'X' axis will be 0 to the array size of the property queried, if the property corresponds to a multi-channel display.

Parameters:
deviceContext is the device context for which the device properties are desired
deviceGroup is the device group for which the device properties are desired.
deviceName is the device name for which the device properties are desired.
deviceProperty is the device property (sub-string + wildcards) for which the device properties are desired. 'null' is equivalent to "*".
Returns:
0 if successful otherwise -1.

int chart.Acop.AttachLink Object  Data,
int  ArraySize,
int  identifier
 

Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data object passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
identifier is a user-specified integer identifier which is used to identify the link to the calling application. Following a receive() event, the application can call getLinkId() to retrieve this number. Other forms of AttachLink() will use the returned link handle as and identifier.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element! Example:
  private int appendHistoryChannel(String devContext, String devServer, String devName, String devProperty)
  {
    int cc = 0;
    spectrumHist.setDeviceContext(devContext);
    spectrumHist.setDeviceName(devName);
    spectrumHist.setAccessProtocol("TINE");
    spectrumHist.setAccessMode("READ");
    spectrumHist.setAccessRate("1000");
    spectrumHist.setDeviceGroup(devServer);
    spectrumHist.setDeviceProperty(devProperty + ".HIST");
    spectrumHist.setCaption(spectrumLive.getCaption() + " histories");
    spectrumHist.setYAxisLabel(spectrumLive.getYAxisLabel());
    spectrumHist.setYMax(spectrumLive.getYMax());
    spectrumHist.setYMin(spectrumLive.getYMin());
    histArraySize = histTrendDepth;
    histRange[1] = (int)(System.currentTimeMillis() / 1000) - 1;
    histRange[0] = histRange[1] - histTrendDepth;
    histArrayBuffer = new FLTINT[histArraySize];
    if ((cc=spectrumHist.Execute(histArrayBuffer, histArraySize, histRange, 2)) == 0)
    {
      Channel hc = Channel.getChannel(devContext, devServer, devName, devProperty);
      int n = hHistChannels;
      hc.setIndex(n);              // set to table entry index !
      int sz = spectrumHist.GetDataSize();
      spectrumHist.setXMax(histArrayBuffer[sz-1].ival);
      spectrumHist.setXMin(spectrumHist.getXMax() - histTrendDepth);
      spectrumHist.setForeground(channelColors[n%10]);
      hc.setDisplayHandle( spectrumHist.Draw(histArrayBuffer,histArrayBuffer) );
      // n + 1 because of the table header ...
      histTableColumnData[n+1][0] = devName;
      histTableColumnData[n+1][2] = "" + histArrayBuffer[sz-1].fval;
      jTable.repaint();
      if (hc.getLinkHandle() == -1)
      { 
        spectrumHist.setDeviceProperty(devProperty);
        spectrumHist.setAccessMode("POLL");
        // make sure the link identifier is the nth table entry ...
        hc.setLinkHandle( spectrumHist.AttachLink(hc.histUpdateBuffer,1,n) );
        //
        nHistChannels++; 
      }
    }
    else
    {
      System.out.println("Append History" + spectrumHist.getStatus());
    }
    return cc;
  }
  // callback routine ...
  private void spectrumHistCb(int id, int cc)
  {
    if (cc != 0) return;
    int[] t = new int[1];
    float[] d = new float[1];
    t[0] = (int)(spectrumHist.getTimeStamp().getTime()/1000);
    Channel hc = Channel.getChannel(id);
    if (hc == null) return;
    spectrumHist.AppendScreen(hc.histUpdateBuffer,hc.getDisplayHandle(),t);
    // id will point right into the table (id + 1 because of the table header columns)
    histTableColumnData[id+1][2] = "" + hc.histUpdateBuffer[0];
    jTable.repaint();
  }
  // initializer ...
  private acop.Acop getSpectrumHist() 
  {
    if(spectrumHist == null) 
    {
      spectrumHist = new acop.Acop();
      spectrumHist.setSize(520, 220);
      spectrumHist.setFrameLeftOffset(10);
      spectrumHist.setFrameRightOffset(-20);
      spectrumHist.setFrameBottomOffset(20);
      spectrumHist.setGraphStyle(4);
      spectrumHist.setName("spectrumHist");
      spectrumHist.setLocation(10, 240);
      spectrumHist.setCaptionLocation(1);
      spectrumHist.setleftTimeLabel(false);
      spectrumHist.setFont(new java.awt.Font("Comic Sans MS", java.awt.Font.BOLD, 12));
      spectrumHist.addAcopListener(new acop.AcopListener()
      {
        public void AcopReceive(acop.AcopEvent e) 
        {           
          spectrumHistCb(e.getLinkId(), e.getLinkError()); 
        }
        public void AcopMouseMove(acop.AcopEvent e) 
        {
          spectrumHistMove(e.getHistoIndex(),e.getMousePositionX());
        } 
        public void AcopMouseClick(acop.AcopEvent e) {} 
        public void AcopMouseZoom(acop.AcopEvent e) {} 
        public void AcopMouseEnter(acop.AcopEvent e) {} 
        public void AcopMouseExit(acop.AcopEvent e) {}
        public void AcopMouseDoubleClick(AcopEvent doubleClick) {}
      }
      );
    }
    return spectrumHist;
  }

int chart.Acop.AttachLink Object  Data,
int  ArraySize
 

Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data object passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element! Example:
public class BpmPanel extends JFrame
{
  private javax.swing.JPanel jContentPane = null;

  private javax.swing.JPanel jPanel = null;
  private acop.Acop bpmX = null;
  private float[] xorbit = new float[500];
  private int nBpms;
  private String[] devnamesX;
  private int idX;
  private acop.Acop bpmY = null;
  private float[] yorbit = new float[500];
  private String[] devnamesY;
  private int idY;

  private void initialize()
  {
    this.setSize(537, 426);
    this.setContentPane(getJContentPane());
    this.setTitle("BPM Display");
    this.addWindowListener(new java.awt.event.WindowAdapter() { 
      public void windowClosing(java.awt.event.WindowEvent e) {    
        bpmX.CloseLink(-1);
        bpmY.CloseLink(-1);
        System.exit(0);
      }
    });

    devnamesX = bpmX.getDeviceNames("HERA","HEPBPM","","ORBIT.X");

    if (bpmX.acquireDisplayProperties("HERA","HEPBPM","","ORBIT.X") == 0)
    {
      nBpms = bpmX.getXMax();
    }
    else
    {
      System.out.println("Couldn't get display information -> " + bpmX.getStatus();
      System.exit(1);
    }

    bpmX.setDeviceName(devnamesX[0]);
    bpmX.setDeviceProperty("ORBIT.X",nBpms);

    bpmX.AttachLink(xorbit,nBpms);
    
    devnamesY = bpmY.getDeviceNames("HERA","HEPBPM","","ORBIT.Y");

    if (bpmY.acquireDisplayProperties("HERA","HEPBPM","","ORBIT.Y") != 0)
    {
      System.out.println("Couldn't get display information -> " + bpmY.getStatus();
      System.exit(1);
    }

    bpmY.setDeviceName(devnamesY[0]);
    bpmY.setDeviceProperty("ORBIT.Y",nBpms);

    bpmY.AttachLink(yorbit,nBpms);
  }

int chart.Acop.AttachLink Object  Data  ) 
 

Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data object passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element! The size of the array is in turn used in establishing the link when using this form of the AttachLink() method. Example:
public class BpmPanel extends JFrame
{
  private javax.swing.JPanel jContentPane = null;

  private javax.swing.JPanel jPanel = null;
  private acop.Acop bpmX = null;
  private float[] xorbit;
  private int nBpms;
  private String[] devnamesX;
  private int idX;
  private acop.Acop bpmY = null;
  private float[] yorbit;
  private String[] devnamesY;
  private int idY;

  private void initialize()
  {
    this.setSize(537, 426);
    this.setContentPane(getJContentPane());
    this.setTitle("BPM Display");
    this.addWindowListener(new java.awt.event.WindowAdapter() { 
      public void windowClosing(java.awt.event.WindowEvent e) {    
        bpmX.CloseLink(-1);
        bpmY.CloseLink(-1);
        System.exit(0);
      }
    });

    devnamesX = bpmX.getDeviceNames("HERA","HEPBPM","","ORBIT.X");

    if (bpmX.acquireDisplayProperties("HERA","HEPBPM","","ORBIT.X") == 0)
    {
      nBpms = bpmX.getXMax();
    }
    else
    {
      System.out.println("Couldn't get display information -> " + bpmX.getStatus();
      System.exit(1);
    }

    xorbit = new float[nBpms];

    bpmX.setDeviceName(devnamesX[0]);
    bpmX.setDeviceProperty("ORBIT.X");

    bpmX.AttachLink(xorbit);
    
    devnamesY = bpmY.getDeviceNames("HERA","HEPBPM","","ORBIT.Y");

    if (bpmY.acquireDisplayProperties("HERA","HEPBPM","","ORBIT.Y") != 0)
    {
      System.out.println("Couldn't get display information -> " + bpmY.getStatus();
      System.exit(1);
    }

    yorbit = new float[nBpms];

    bpmY.setDeviceName(devnamesY[0]);
    bpmY.setDeviceProperty("ORBIT.Y");

    bpmY.AttachLink(yorbit);
  }

int chart.Acop.AttachLink Object  Data,
Object  DataEx
 

Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data objects passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element! The sizes of the arrays are in turn used in establishing the link when using this form of the AttachLink() method. Example:
  int[] echoin = new int[500];
  int[] echoout = new int[500];
  public void PingServer(String cnt,String srv)
  {

    png.setAccessProtocol("TINE");
    png.setDeviceContext(cnt);
    png.setDeviceGroup(srv);
    png.setDeviceName("#0");
    png.setDeviceProperty("ECHO");
    png.setAccessMode("POLL");
    png.setAccessRate("1000");

    if (png.AttachLink(echoout,echoin) < 0)
    {
      System.out.println("Ping " + srv + " : " + png.getStatus());
      System.exit(1);
    }
    // handle the ping results in the receive event handler ....
  }

int chart.Acop.AttachLink Object  Data,
int  ArraySize,
Object  DataEx,
int  ArraySizeEx,
int  identifier
 

Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data objects passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
ArraySizeEx is the data array size associated with the DataEx object. This may be smaller than the actual size of the DataEx object, but NOT bigger.
identifier is a user-specified integer identifier which is used to identify the link to the calling application. Following a receive() event, the application can call getLinkId() to retrieve this number. Other forms of AttachLink() will use the returned link handle as and identifier.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element! Example:
  private int appendHistoryChannel(String devContext, String devServer, String devName, String devProperty)
  {
    int cc = 0;
    spectrumHist.setDeviceContext(devContext);
    spectrumHist.setDeviceName(devName);
    spectrumHist.setAccessProtocol("TINE");
    spectrumHist.setAccessMode("READ");
    spectrumHist.setAccessRate("1000");
    spectrumHist.setDeviceGroup(devServer);
    spectrumHist.setDeviceProperty(devProperty + ".HIST");
    spectrumHist.setCaption(spectrumLive.getCaption() + " histories");
    spectrumHist.setYAxisLabel(spectrumLive.getYAxisLabel());
    spectrumHist.setYMax(spectrumLive.getYMax());
    spectrumHist.setYMin(spectrumLive.getYMin());
    histArraySize = histTrendDepth;
    histRange[1] = (int)(System.currentTimeMillis() / 1000) - 1;
    histRange[0] = histRange[1] - histTrendDepth;
    histArrayBuffer = new FLTINT[histArraySize];
    if ((cc=spectrumHist.Execute(histArrayBuffer, histArraySize, histRange, 2)) == 0)
    {
      Channel hc = Channel.getChannel(devContext, devServer, devName, devProperty);
      int n = hHistChannels;
      hc.setIndex(n);              // set to table entry index !
      int sz = spectrumHist.GetDataSize();
      spectrumHist.setXMax(histArrayBuffer[sz-1].ival);
      spectrumHist.setXMin(spectrumHist.getXMax() - histTrendDepth);
      spectrumHist.setForeground(channelColors[n%10]);
      hc.setDisplayHandle( spectrumHist.Draw(histArrayBuffer,histArrayBuffer) );
      // n + 1 because of the table header ...
      histTableColumnData[n+1][0] = devName;
      histTableColumnData[n+1][2] = "" + histArrayBuffer[sz-1].fval;
      jTable.repaint();
      if (hc.getLinkHandle() == -1)
      { 
        spectrumHist.setDeviceProperty(devProperty);
        spectrumHist.setAccessMode("POLL");
        // make sure the link identifier is the nth table entry ...
        hc.setLinkHandle( spectrumHist.AttachLink(hc.histUpdateBuffer,1,null,0,n) );
        //
        nHistChannels++; 
      }
    }
    else
    {
      System.out.println("Append History" + spectrumHist.getStatus());
    }
    return cc;
  }
  // callback routine ...
  private void spectrumHistCb(int id, int cc)
  {
    if (cc != 0) return;
    int[] t = new int[1];
    float[] d = new float[1];
    t[0] = (int)(spectrumHist.getTimeStamp().getTime()/1000);
    Channel hc = Channel.getChannel(id);
    if (hc == null) return;
    spectrumHist.AppendScreen(hc.histUpdateBuffer,hc.getDisplayHandle(),t);
    // id will point right into the table (id + 1 because of the table header columns)
    histTableColumnData[id+1][2] = "" + hc.histUpdateBuffer[0];
    jTable.repaint();
  }
  // initializer ...
  private acop.Acop getSpectrumHist() 
  {
    if(spectrumHist == null) 
    {
      spectrumHist = new acop.Acop();
      spectrumHist.setSize(520, 220);
      spectrumHist.setFrameLeftOffset(10);
      spectrumHist.setFrameRightOffset(-20);
      spectrumHist.setFrameBottomOffset(20);
      spectrumHist.setGraphStyle(4);
      spectrumHist.setName("spectrumHist");
      spectrumHist.setLocation(10, 240);
      spectrumHist.setCaptionLocation(1);
      spectrumHist.setleftTimeLabel(false);
      spectrumHist.setFont(new java.awt.Font("Comic Sans MS", java.awt.Font.BOLD, 12));
      spectrumHist.addAcopListener(new acop.AcopListener()
      {
        public void AcopReceive(acop.AcopEvent e) 
        {           
          spectrumHistCb(e.getLinkId(), e.getLinkError()); 
        }
        public void AcopMouseMove(acop.AcopEvent e) 
        {
          spectrumHistMove(e.getHistoIndex(),e.getMousePositionX());
        } 
        public void AcopMouseClick(acop.AcopEvent e) {} 
        public void AcopMouseZoom(acop.AcopEvent e) {} 
        public void AcopMouseEnter(acop.AcopEvent e) {} 
        public void AcopMouseExit(acop.AcopEvent e) {}
        public void AcopMouseDoubleClick(AcopEvent doubleClick) {}
      }
      );
    }
    return spectrumHist;
  }

int chart.Acop.AttachLink Object  Data,
int  ArraySize,
Object  DataEx,
int  ArraySizeEx
 

Establishes an asynchronous data link using the Device Properties assigned to the control and Attaches the data objects passed. Use AttachLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link and attach the returning data to the Data object passed. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
ArraySizeEx is the data array size associated with the DataEx object. This may be smaller than the actual size of the DataEx object, but NOT bigger.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element! Example:
public class BpmPanel extends JFrame
{
  private javax.swing.JPanel jContentPane = null;

  private javax.swing.JPanel jPanel = null;
  private acop.Acop bpmX = null;
  private float[] xorbit = new float[500];
  private int nBpms;
  private String[] devnamesX;
  private int idX;
  private acop.Acop bpmY = null;
  private float[] yorbit = new float[500];
  private String[] devnamesY;
  private int idY;

  private void initialize()
  {
    this.setSize(537, 426);
    this.setContentPane(getJContentPane());
    this.setTitle("BPM Display");
    this.addWindowListener(new java.awt.event.WindowAdapter() { 
      public void windowClosing(java.awt.event.WindowEvent e) {    
        bpmX.CloseLink(-1);
        bpmY.CloseLink(-1);
        System.exit(0);
      }
    });

    devnamesX = bpmX.getDeviceNames("HERA","HEPBPM","","ORBIT.X");

    if (bpmX.acquireDisplayProperties("HERA","HEPBPM","","ORBIT.X") == 0)
    {
      nBpms = bpmX.getXMax();
    }
    else
    {
      System.out.println("Couldn't get display information -> " + bpmX.getStatus();
      System.exit(1);
    }

    bpmX.setDeviceName(devnamesX[0]);
    bpmX.setDeviceProperty("ORBIT.X");

    bpmX.AttachLink(xorbit,nBpms,null,0);
    
    devnamesY = bpmY.getDeviceNames("HERA","HEPBPM","","ORBIT.Y");

    if (bpmY.acquireDisplayProperties("HERA","HEPBPM","","ORBIT.Y") != 0)
    {
      System.out.println("Couldn't get display information -> " + bpmY.getStatus();
      System.exit(1);
    }

    bpmY.setDeviceName(devnamesY[0]);
    bpmY.setDeviceProperty("ORBIT.Y");

    bpmY.AttachLink(yorbit,nBpms,null,0);
  }

int chart.Acop.CloseLink int  identifier  ) 
 

Closes an existing de.desy.acop.chart data link. Using CloseLink() with a '-1' input parameter will close all data links associated with the de.desy.acop.chart bean.

Parameters:
identifier is the link handle of the de.desy.acop.chart data link which is to be terminated. If identifier == -1 then all associated links will be terminated.
Returns:
0 if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure. Example:
  private void initialize()
  {
    this.setSize(537, 426);
    this.setContentPane(getJContentPane());
    this.setTitle("BPM Display");
    this.addWindowListener(new java.awt.event.WindowAdapter() { 
      public void windowClosing(java.awt.event.WindowEvent e) {    
        bpmX.CloseLink(-1);
        bpmY.CloseLink(-1);
        System.exit(0);
      }
    });

    // ...
  }

int chart.Acop.Execute Object  Data,
int  ArraySize
 

Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element!

The only allowed values of 'AccessMode' are "READ" and "WRITE" when using the Execute() method. Example:

  private int appendHistoryChannel(String devContext, String devServer, String devName, String devProperty)
  {
    spectrumHist.setDeviceContext(devContext);
    spectrumHist.setDeviceName(devName);
    spectrumHist.setAccessProtocol("TINE");
    spectrumHist.setAccessMode("READ");
    spectrumHist.setAccessRate("1000");
    spectrumHist.setDeviceGroup(devServer);
    spectrumHist.setDeviceProperty(devProperty + ".HIST");
    spectrumHist.setCaption(spectrumLive.getCaption() + " histories");
    spectrumHist.setYAxisLabel(spectrumLive.getYAxisLabel());
    spectrumHist.setYMax(spectrumLive.getYMax());
    spectrumHist.setYMin(spectrumLive.getYMin());
    histArraySize = 600;
    histArrayBuffer = new FLTINT[histArraySize];

    int cc = spectrumHist.Execute(histArrayBuffer, histArraySize);

    if (cc == 0)
    {
      int sz = spectrumHist.GetDataSize(-1);
      float[] f = new float[sz];
      int[] t = new int[sz];
      int n = nHistChannels;
      for (int i=0; i<sz; i++)
      {
        f[i] = histArrayBuffer[i].fval;
        t[i] = histArrayBuffer[i].ival;
      }
      spectrumHist.setXMax(t[sz-1]);
      spectrumHist.setXMin(spectrumHist.getXMax()-600);
      spectrumHist.setForeground(channelColors[n%10]);
      histDisplayHandle[n] = spectrumHist.Draw(f,t,null,null,sz,600);
      spectrumHist.setDeviceProperty(devProperty);
      spectrumHist.setAccessMode("POLL");
      int id = spectrumHist.AttachLink(histUpdateBuffer[n],1,null,0);
      histTableColumnData[n+1][0] = devName;
      histTableColumnData[n+1][2] = "" +f[sz-1];
      jTable.repaint(); 
      nHistChannels++; 
    }
    else
    {
      System.out.println("Append History" + spectrumHist.getStatus());
    }
    return cc;
  }

int chart.Acop.Execute Object  Data  ) 
 

Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element! The size of the array is in turn used in establishing the link when using this form of the Execute() method.

The only allowed values of 'AccessMode' are "READ" and "WRITE" when using the Execute() method. Example:

  private float getCurrent(String dev)
  {
    psc.setDeviceContext("HERA");
    psc.setDeviceGroup("MAGNETS");
    psc.setDeviceName(dev);
    psc.setAccessProtocol("TINE");
    psc.setAccessMode("READ");
    psc.setAccessRate("200");
    psc.setDeviceProperty("CURRENT");
  
    float[] rbVal = new float[1];

    int cc = psc.Execute(rbVal);

    if (cc == 0)
    {
      return rbVal[0];
    }
    else
    {
      System.out.println(dev + " set Current " + psc.getStatus());
      return -999;
    }
  }

int chart.Acop.Execute Object  Data,
Object  DataEx
 

Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element! The sizes of the arrays are in turn used in establishing the link when using this form of the Execute() method.

The only allowed values of 'AccessMode' are "READ" and "WRITE" when using the Execute() method. Example:

  private int setCurrent(String dev,float val)
  {
    psc.setDeviceContext("HERA");
    psc.setDeviceGroup("MAGNETS");
    psc.setDeviceName(dev);
    psc.setAccessProtocol("TINE");
    psc.setAccessMode("WRITE");
    psc.setAccessRate("200");
    psc.setDeviceProperty("CURRENT");
  
    float[] rbVal = new float[1];
    float[] wrVal = new float[1];
    wrVal[0] = val;

    int cc = psc.Execute(rbVal,wrVal);

    if (cc == 0)
    {
      System.out.println(dev + "set current to " + wrVal[0] + " : read back " + rbVal[0]);
    }
    else
    {
      System.out.println(dev + " set Current " + psc.getStatus());
    }
    return cc;
  }

int chart.Acop.Execute Object  Data,
int  ArraySize,
Object  DataEx,
int  ArraySizeEx
 

Establishes and executes a synchronous data link using the Device Properties assigned to the control. Use Execute for synchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. This method blocks until either the transfer is complete or a timeout has occured (given by the AccessRate setting). Asynchronous READ and WRITE calls can be effected by using the AttachLink() method and handling the results inside the corresonding receive event.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
ArraySizeEx is the data array size associated with the DataEx object. This may be smaller than the actual size of the DataEx object, but NOT bigger.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element!

The only allowed values of 'AccessMode' are "READ" and "WRITE" when using the Execute() method. Example:

  private int appendHistoryChannel(String devContext, String devServer, String devName, String devProperty)
  {
    spectrumHist.setDeviceContext(devContext);
    spectrumHist.setDeviceName(devName);
    spectrumHist.setAccessProtocol("TINE");
    spectrumHist.setAccessMode("READ");
    spectrumHist.setAccessRate("1000");
    spectrumHist.setDeviceGroup(devServer);
    spectrumHist.setDeviceProperty(devProperty + ".HIST");
    spectrumHist.setCaption(spectrumLive.getCaption() + " histories");
    spectrumHist.setYAxisLabel(spectrumLive.getYAxisLabel());
    spectrumHist.setYMax(spectrumLive.getYMax());
    spectrumHist.setYMin(spectrumLive.getYMin());
    histArraySize = 600;
    histArrayBuffer = new FLTINT[histArraySize];

    int cc = spectrumHist.Execute(histArrayBuffer, histArraySize, null, 0);

    if (cc == 0)
    {
      int sz = spectrumHist.GetDataSize(-1);
      float[] f = new float[sz];
      int[] t = new int[sz];
      int n = nHistChannels;
      for (int i=0; i<sz; i++)
      {
        f[i] = histArrayBuffer[i].fval;
        t[i] = histArrayBuffer[i].ival;
      }
      spectrumHist.setXMax(t[sz-1]);
      spectrumHist.setXMin(spectrumHist.getXMax()-600);
      spectrumHist.setForeground(channelColors[n%10]);
      histDisplayHandle[n] = spectrumHist.Draw(f,t,null,null,sz,600);
      spectrumHist.setDeviceProperty(devProperty);
      spectrumHist.setAccessMode("POLL");
      int id = spectrumHist.AttachLink(histUpdateBuffer[n],1,null,0);
      histTableColumnData[n+1][0] = devName;
      histTableColumnData[n+1][2] = "" +f[sz-1];
      jTable.repaint(); 
      nHistChannels++; 
    }
    else
    {
      System.out.println("Append History" + spectrumHist.getStatus());
    }
    return cc;
  }

int chart.Acop.GetData Object  Data,
Object  DataEx,
int  identifier
 

Retrieves the data associated with the given link handle into the data objects passed. This method is frequently used in conjunction with the OpenLink() method of establishing a data link, in which case the incoming data is not bound to a data object.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. This must be a reference to the same type of object passed in the original call to AttachLink() or OpenLink().
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. This must be a reference to the same type of object passed in the original call to AttachLink() or OpenLink().
identifier is the link handle of the de.desy.acop.chart data link which is to be terminated. If identifier == -1 then all associated links will be terminated.
Returns:
0 if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.

int chart.Acop.GetDataSize  ) 
 

Returns the current data size of the primary data object.

Returns:
The data size of the returned data if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure. Example:
  // ...
  private int appendHistoryChannel(String devContext, String devServer, String devName, String devProperty)
  {
    int cc = 0;
    spectrumHist.setDeviceContext(devContext);
    spectrumHist.setDeviceName(devName);
    spectrumHist.setAccessProtocol("TINE");
    spectrumHist.setAccessMode("READ");
    spectrumHist.setAccessRate("1000");
    spectrumHist.setDeviceGroup(devServer);
    spectrumHist.setDeviceProperty(devProperty + ".HIST");
    spectrumHist.setCaption(spectrumLive.getCaption() + " histories");
    spectrumHist.setYAxisLabel(spectrumLive.getYAxisLabel());
    spectrumHist.setYMax(spectrumLive.getYMax());
    spectrumHist.setYMin(spectrumLive.getYMin());
    histArraySize = histTrendDepth;
    histRange[1] = (int)(System.currentTimeMillis() / 1000) - 1;
    histRange[0] = histRange[1] - histTrendDepth;
    histArrayBuffer = new FLTINT[histArraySize];
    if ((cc=spectrumHist.Execute(histArrayBuffer, histArraySize, histRange, 2)) == 0)
    {
      Channel hc = Channel.getChannel(devContext, devServer, devName, devProperty);
      int n = hHistChannels;
      hc.setIndex(n);              
      // find out how much came back ...
      int sz = spectrumHist.GetDataSize();
      //
      spectrumHist.setXMax(histArrayBuffer[sz-1].ival);
      spectrumHist.setXMin(spectrumHist.getXMax() - histTrendDepth);
      spectrumHist.setForeground(channelColors[n%10]);
      hc.setDisplayHandle( spectrumHist.Draw(histArrayBuffer,histArrayBuffer) );
      histTableColumnData[n+1][0] = devName;
      histTableColumnData[n+1][2] = "" + histArrayBuffer[sz-1].fval;
      jTable.repaint();
      if (hc.getLinkHandle() == -1)
      { 
        spectrumHist.setDeviceProperty(devProperty);
        spectrumHist.setAccessMode("POLL");
        hc.setLinkHandle( spectrumHist.AttachLink(hc.histUpdateBuffer,1,n) );
        nHistChannels++; 
      }
    }
    else
    {
      System.out.println("Append History" + spectrumHist.getStatus());
    }
    return cc;
  }

int chart.Acop.GetDataSize int  identifier  ) 
 

Returns the current data size of the primary data object associated with the given link handle.

Parameters:
identifier is the link handle of the de.desy.acop.chart data link for which the current data sizes are desired.
Returns:
The data size of the returned data if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure. Example:
  // ...
  private int appendHistoryChannel(String devContext, String devServer, String devName, String devProperty)
  {
    int cc = 0;
    spectrumHist.setDeviceContext(devContext);
    spectrumHist.setDeviceName(devName);
    spectrumHist.setAccessProtocol("TINE");
    spectrumHist.setAccessMode("READ");
    spectrumHist.setAccessRate("1000");
    spectrumHist.setDeviceGroup(devServer);
    spectrumHist.setDeviceProperty(devProperty + ".HIST");
    spectrumHist.setCaption(spectrumLive.getCaption() + " histories");
    spectrumHist.setYAxisLabel(spectrumLive.getYAxisLabel());
    spectrumHist.setYMax(spectrumLive.getYMax());
    spectrumHist.setYMin(spectrumLive.getYMin());
    histArraySize = histTrendDepth;
    histRange[1] = (int)(System.currentTimeMillis() / 1000) - 1;
    histRange[0] = histRange[1] - histTrendDepth;
    histArrayBuffer = new FLTINT[histArraySize];
    if ((cc=spectrumHist.Execute(histArrayBuffer, histArraySize, histRange, 2)) == 0)
    {
      Channel hc = Channel.getChannel(devContext, devServer, devName, devProperty);
      int n = hHistChannels;
      hc.setIndex(n);              
      // find out how much came back ...
      int sz = spectrumHist.GetDataSize(-1);
      //
      spectrumHist.setXMax(histArrayBuffer[sz-1].ival);
      spectrumHist.setXMin(spectrumHist.getXMax() - histTrendDepth);
      spectrumHist.setForeground(channelColors[n%10]);
      hc.setDisplayHandle( spectrumHist.Draw(histArrayBuffer,histArrayBuffer) );
      histTableColumnData[n+1][0] = devName;
      histTableColumnData[n+1][2] = "" + histArrayBuffer[sz-1].fval;
      jTable.repaint();
      if (hc.getLinkHandle() == -1)
      { 
        spectrumHist.setDeviceProperty(devProperty);
        spectrumHist.setAccessMode("POLL");
        hc.setLinkHandle( spectrumHist.AttachLink(hc.histUpdateBuffer,1,n) );
        nHistChannels++; 
      }
    }
    else
    {
      System.out.println("Append History" + spectrumHist.getStatus());
    }
    return cc;
  }

int chart.Acop.GetDataSize int  DataSize[],
int  DataSizeEx[],
int  identifier
 

Gives the current data size of the data objects associated with the given link handle. This method provides an analogy with the equivalent method in the ACOP ActiveX control, where the arguments are explicitly passed by reference. In the ACOP java bean, the overloaded methods GetDataSize(int identifier) and GetDataSizeEx(int identifier) are preferred.

Parameters:
DataSize is a reference to the current data size of primary Data object attached to the data link. As this is passed by reference, this must be an array of 1 integer. A 'null' can be passed if you are not interested in this value.
DataSizeEx is a reference to the current data size of extended Data object attached to the data link. As this is passed by reference, this must be an array of 1 integer. A 'null' can be passed if you are not interested in this value.
identifier is the link handle of the de.desy.acop.chart data link for which the current data sizes are desired.
Returns:
0 if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure. Example:
    // ...

  private void spectrumLiveCb(int id)
  {
    int[] sz = new int[1];

    int rc = spectrumLive.GetDataSize(sz,null,id);

    if (liveDisplayHandle < 0)
    {
      liveDisplayHandle = spectrumLive.Draw(liveArrayBuffer,null,null,channelNames,liveArraySize,liveArraySize);
    }
    else
    {
      spectrumLive.RefreshScreen(liveArrayBuffer,liveDisplayHandle,sz,0,null);
    }
  }

int chart.Acop.GetDataSizeEx  ) 
 

Returns the current data size of the extended data object.

Returns:
The data size of the sent data if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.

int chart.Acop.GetDataSizeEx int  identifier  ) 
 

Returns the current data size of the extended data object associated with the given link handle.

Parameters:
identifier is the link handle of the de.desy.acop.chart data link for which the current data sizes are desired.
Returns:
The data size of the sent data if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.

String [] chart.Acop.getDeviceContexts  ) 
 

Queries for the available device contexts according to current setting of the AccessProtocol.

Returns:
A string array containing the device contexts

String [] chart.Acop.getDeviceGroups  ) 
 

Queries for the available device groups according to current setting of the AccessProtocol and Device parameters.

Returns:
A string array containing the device groups

String [] chart.Acop.getDeviceGroups String  deviceContext,
String  deviceGroup,
String  deviceName,
String  deviceProperty
 

Queries for the available device groups according to current setting of the AccessProtocol.

Parameters:
deviceContext is the device context for which the device groups are desired
deviceGroup is the device group (sub-string + wildcards) for which the device groups are desired. 'null' is equivalent to "*".
deviceName is the device name for which the device groups are desired. This parameter should typically passed as 'null'.
deviceProperty is the device property for which the device groups are desired. This parameter should typically passed as 'null'.
Returns:
A string array containing the device groups

String [] chart.Acop.getDeviceNames  ) 
 

Queries for the available device names according to current setting of the AccessProtocol and Device parameters.

Returns:
A string array containing the device names

String [] chart.Acop.getDeviceNames String  deviceContext,
String  deviceGroup,
String  deviceName,
String  deviceProperty
 

Queries for the available device names according to current setting of the AccessProtocol.

Parameters:
deviceContext is the device context for which the device names are desired
deviceGroup is the device group for which the device names are desired.
deviceName is the device name (sub-string + wildcards) for which the device names are desired. 'null' is equivalent to "*".
deviceProperty is the device property for which the device names are desired.
Returns:
A string array containing the device names

String [] chart.Acop.getDeviceProperties  ) 
 

Queries for the available device properties according to current setting of the AccessProtocol and Device parameters.

Returns:
A string array containing the device properties

String [] chart.Acop.getDeviceProperties String  deviceContext,
String  deviceGroup,
String  deviceName,
String  deviceProperty
 

Queries for the available device properties according to current setting of the AccessProtocol.

Parameters:
deviceContext is the device context for which the device properties are desired
deviceGroup is the device group for which the device properties are desired.
deviceName is the device name for which the device properties are desired.
deviceProperty is the device property (sub-string + wildcards) for which the device properties are desired. 'null' is equivalent to "*".
Returns:
A string array containing the device properties

boolean chart.Acop.getGrouped  ) 
 

The grouped flag.

Returns:
the isGrouped state of this de.desy.acop.chart

java.lang.String chart.Acop.getStatus  ) 
 

The current data status string.

Returns:
The current data status string

Date chart.Acop.getTimeStamp  ) 
 

The current data time stamp as a Date object.

Returns:
The current data time stamp as a Date object

int chart.Acop.OpenLink Object  Data,
int  ArraySize,
int  identifier
 

Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data object passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
identifier is a user-specified integer identifier which is used to identify the link to the calling application. Following a receive() event, the application can call getLinkId() to retrieve this number. Other forms of AttachLink() will use the returned link handle as and identifier.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element!

int chart.Acop.OpenLink Object  Data,
int  ArraySize
 

Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data object passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element!

int chart.Acop.OpenLink Object  Data  ) 
 

Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data object passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data object above must refer to an array of data types (which is passed by reference) and not a single value (which is passed by value). So even if passing a single value, it must be declared as an array of 1 element! The size of the array is in turn used in establishing the link when using this form of the OpenLink() method.

int chart.Acop.OpenLink Object  Data,
Object  DataEx
 

Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data objects passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element! The size of the array is in turn used in establishing the link when using this form of the OpenLink() method.

int chart.Acop.OpenLink Object  Data,
int  ArraySize,
Object  DataEx,
int  ArraySizeEx,
int  identifier
 

Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data objects passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
ArraySizeEx is the data array size associated with the DataEx object. This may be smaller than the actual size of the DataEx object, but NOT bigger.
identifier is a user-specified integer identifier which is used to identify the link to the calling application. Following a receive() event, the application can call getLinkId() to retrieve this number. Other forms of AttachLink() will use the returned link handle as and identifier.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element!

int chart.Acop.OpenLink Object  Data,
int  ArraySize,
Object  DataEx,
int  ArraySizeEx
 

Establishes an asynchronous data link using the Device Properties assigned to the control, but does not Attach the data objects passed. Use OpenLink for asynchronous data acquisition. Fill in the DeviceContext DeviceGroup, DeviceName, and DeviceProperty bean property parameters, along with the accessProtocol, accessMode, and accessRate bean property parameters. Call this method to establish the asynchronous data tranfer link. The data returned from a server is not bound to the Data object passed in the call and must be obtained by an independent call to the GetData() method. When new data arrive or the link status has changed, the de.desy.acop.chart receive event will be fired.

Parameters:
Data is the primary data object and refers to the data object to hold the output data returned from a server. Pass 'null' if no return data is desired.
ArraySize is the data array size associated with the Data object. This may be smaller than the actual size of the Data object, but NOT bigger.
DataEx is the extended data object and refers to the data object to which holds the input data to be sent to a server. Pass 'null' if no return data is desired.
ArraySizeEx is the data array size associated with the DataEx object. This may be smaller than the actual size of the DataEx object, but NOT bigger.
Returns:
A positive link handle if successful otherwise -1, in which case the getStatus() method can be queried to determine the cause of failure.
Note:
The Data and DataEx objects above must refer to arrays of data types (which are passed by reference) and not single values (which are passed by value). So even if passing a single value, it must be declared as an array of 1 element!

void chart.Acop.setGrouped boolean  Grouped  ) 
 

Sets the grouped flag.

Parameters:
isGrouped determines whether all data links associated with this de.desy.acop.chart are to fire one single event (isGrouped = true) when all link states have changed or not (isGrouped = false)

int chart.Acop.setLinkIdentifier int  currentLinkIdentifier,
int  linkIdentifier
 

Sets the link identifier to the value specified. Establishing a data link by using either AttachLink() or OpenLink() will assign a link identifier to the associated link when successful. This link identifier (or link 'handle') will be set prior to event notification via the Receive() event. One can set the link identifier to a desired value either in the original call to AttachLink() or OpenLink() or at a later time by calling this method.

Parameters:
currentLinkIdentifier is the current link identifier of the data link to which the new link identifier is to be assigned. If not originally set by the initial call, it is the value returned by the initial call to AttachLink() or OpenLink().
linkIdentifier is the desired link identifier to be associated with the data link defined by linkHandle.
Returns:
The link identifier associated with the data link. If de.desy.acop.chart is unable to set the link identifier to the new value, it remains unchanged. If successful, the new link handle will be set to the assigned link identifier. Example:
  public void removeEntry()
  {
    int r = jTable.getSelectedRow();
    if (r > 0) 
    {
      int cid = r - 1;  // channel id is one less than the row number
      Channel hc=Channel.getChannel(cid);
      if (hc != null)
      {
        // close the data link ...
        spectrumHist.CloseLink(hc.getLinkHandle());
        Channel.rmvChannel(cid);
        spectrumHist.ClearScreen(hc.getDisplayHandle());
        for (int i=cid; i<nHistChannels; i++) 
        {
          if ((hc=Channel.getChannel(i)) == null) continue;
          // re-assign the link identifiers to the modified table row numbers ...
          spectrumHist.setLinkIdentifier(hc.getLinkHandle(), i-1); 
          hc.setIndex(i-1);
          //
          histTableColumnData[i][0] = histTableColumnData[i+1][0];  // row is channel + 1
          histTableColumnData[i][1] = histTableColumnData[i+1][1];
          histTableColumnData[i][2] = histTableColumnData[i+1][2];
        }
        histTableColumnData[nHistChannels][0] = "";
        histTableColumnData[nHistChannels][1] = "";
        histTableColumnData[nHistChannels][2] = "";
        nHistChannels--;
      }
    } 
  }


The documentation for this class was generated from the following file:
Generated on Mon Feb 20 09:43:17 2006 for ACOP Java API by doxygen 1.3.2