backendCInterfase
Class BackendProcess

java.lang.Object
  extended by backendCInterfase.BackendProcess
Direct Known Subclasses:
AcquisitionCProcess, FftCProcess

public abstract class BackendProcess
extends java.lang.Object

Abstract class for backend processes. Functions in this class will work their was through to a set of C code running before data get into PAMGUARD, some of which will hopefully be running on a DSP.

Author:
Doug Gillespie

Field Summary
private  PamProcess parentProcess
           
 
Constructor Summary
BackendProcess(PamProcess parentProcess)
           
 
Method Summary
 java.lang.String getInputDataName()
           
 PamDataBlock getOutputDataBlock()
          Get the output data block for the process.
 java.lang.String getOutputDataName()
           
abstract  java.lang.Object getParams()
          Get params to be passed over to the JNI C code.
 java.lang.String getProcessName()
           
 java.lang.String getProcessType()
           
 boolean getReturnData()
          See whether or not it's necessary to return data for this process back across the JNI.
 boolean getReturnData(int iOutputBlock)
          See if the output data for a block needs to be returned Do this by looking at the observers of the datablock and if the observers are also sunning on the DSP and their data source is the same as this data output, then there is no need to return the data across the DSP.
 boolean getReturnData(PamDataBlock outputBlock)
          See if the output data for a block needs to be returned Do this by looking at the observers of the datablock and if the observers are also sunning on the DSP and their data source is the same as this data output, then there is no need to return the data across the DSP.
abstract  void newData(int dataType, int channelMap, short[] data, int dataLenBytes)
           
abstract  boolean prepareProcess()
          Will be called before start up so that the process can take any special actions needed to inhibit parts of the java operation.
 void setStatus(int status)
          Receive status information back across the JNI from the backend process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentProcess

private PamProcess parentProcess
Constructor Detail

BackendProcess

public BackendProcess(PamProcess parentProcess)
Method Detail

prepareProcess

public abstract boolean prepareProcess()
Will be called before start up so that the process can take any special actions needed to inhibit parts of the java operation.

Returns:
true if all Ok.

setStatus

public void setStatus(int status)
Receive status information back across the JNI from the backend process.

Parameters:
status - status flag.

newData

public abstract void newData(int dataType,
                             int channelMap,
                             short[] data,
                             int dataLenBytes)

getInputDataName

public java.lang.String getInputDataName()
Returns:
the name of the input data which will be passed over to the C code.

getOutputDataName

public java.lang.String getOutputDataName()
Returns:
the name of the Output data which will be passed over to the C code.

getOutputDataBlock

public PamDataBlock getOutputDataBlock()
Get the output data block for the process. By default this is the first output block for the parent process. If it's anything different, then override this function

Returns:
output datablock.

getProcessName

public java.lang.String getProcessName()

getProcessType

public java.lang.String getProcessType()

getReturnData

public boolean getReturnData()
See whether or not it's necessary to return data for this process back across the JNI.

The standard test for this is to examine all observers of the output datablock and 1. see if they are a pamProcess; 2. see if that process is running on the DSP. If so, then the data are not needed.

Returns:
true if it's necessary to return the data

getReturnData

public boolean getReturnData(int iOutputBlock)
See if the output data for a block needs to be returned Do this by looking at the observers of the datablock and if the observers are also sunning on the DSP and their data source is the same as this data output, then there is no need to return the data across the DSP.

Parameters:
iOutputBlock - output data block index
Returns:
true if data are required to be returned across the JNI

getReturnData

public boolean getReturnData(PamDataBlock outputBlock)
See if the output data for a block needs to be returned Do this by looking at the observers of the datablock and if the observers are also sunning on the DSP and their data source is the same as this data output, then there is no need to return the data across the DSP.

Parameters:
outputBlock - output data block
Returns:
true if data are required to be returned across the JNI

getParams

public abstract java.lang.Object getParams()
Get params to be passed over to the JNI C code.

Params should be in the form of a Java structure. Module specific C Code on the other side will unpack the Java parameters and turn it into an equivalent C structure. There must be a perfect match between the Java and the C or the program will crash

Returns:
Object containing configuration parameters for this module.