WIDAR Classes

ca.nrc.widar.mccc.crm
Class CrmStbHSComparable

java.lang.Object
  extended by ca.nrc.widar.mccc.crm.CrmStbHSComparable

public class CrmStbHSComparable
extends java.lang.Object

WIDAR/EVLA - CRM: CrmStbHSComparable Class

The CRM Station Board Hardware Self Test Comparable class.

This class will handle one comparable for the Station Board Hardware Self Test. It will supply all storage and analysis functionality for a comparable used within the STBHS Diagnostic.

Copyright: National Research Council of Canada and Associated Universities Inc., 2010, 2011, 2012

Since:
1.0
Author:
Dave Del Rizzo (Dave.DelRizzo@nrc.gc.ca)
 

Field Summary
static java.lang.String CLASSNAME
           
 
Constructor Summary
CrmStbHSComparable(java.lang.String loc, java.lang.String titleValue, ca.nrc.widar.jaxb.crm.StbHstDpModeType modeValue, int thresholdValue)
          Convenience constructor for the CrmStbHSComparable class, allows the caller to omit the dimensions d1 and d2, which are taken to be default as d1=Number of Data Paths (2) and d2=Number of Filter Chips (18)
CrmStbHSComparable(java.lang.String loc, java.lang.String titleValue, ca.nrc.widar.jaxb.crm.StbHstDpModeType modeValue, int stageValue, int subbandValue, int dim1, int dim2, int thresholdExponentValue)
          Constructor for the CrmStbHSComparable class which returns a class that handles the comparisons and statistics gathering for one 'comparable' within the CrmStbHSDiagnostic
 
Method Summary
 void addRecord(int i, int j, java.lang.Integer newVal)
          Adds a new record of type Integer to this comparable class.
 void addRecord(int i, int j, java.lang.Long newVal)
          Adds a new record of type Long to this comparable class, incrementing the appropriate counters as required
 void analyzeAcross()
          Method that enacts a comparison when the diagnostic is operating in 'ACROSS' mode.
 void analyzeWithin(int dp)
          Method called from the Diagnostic that supplies a code for datapath 0=DP0, 1=DP2, 2=both data paths
 void analyzeWithinDp(int dp)
          Method that calls the comparison within a data path being processed
 void analyzeWithinFilters(int dp, int f1, int f2)
          Enacts the comparison when the diagnostic is in WITHIN compare mode for this comparable.
 int getCount(int i, int j)
           
 int getError(int i, int j)
           
 java.util.ArrayList<ca.nrc.widar.jaxb.crm.FilterComp> getFilterCompList()
           
 java.util.ArrayList<ca.nrc.widar.jaxb.crm.FilterComp> getFilterCompXml(int dp, int f)
          Returns an ArrayList of FilterComp XML elements that correspond to the supplied data path and filter chip id, from the list that is stored within this comparable which was accumulated during the analysis
 ca.nrc.widar.jaxb.crm.FilterComp getFilterCompXml(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF, int dp, int f)
          Generates and returns a FilterComp XML element based on the input parameters.
 java.util.ArrayList<ca.nrc.widar.jaxb.crm.FilterSummary> getFilterSummaryXml(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF, int dp)
          Generates and returns an ArrayList of FilterSummary XML elements for this comparable.
 ca.nrc.widar.jaxb.crm.StbHstDpModeType getMode()
           
 int getStage()
           
 int getSubband()
           
 java.lang.String getTitle()
           
 int getTotalCount()
           
 int getTotalError()
           
 int getTotalZeroCount()
           
 void init()
          Initializes all major counters and lists
 boolean isSetStage()
           
 boolean isSetSubband()
           
 void reset()
          Calls methods to zero out all values and counters
 void resetParams(int stageVal, int subbandVal, ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
          The reset signal from the diagnostic sets new values for stage and subband along with resetting all storage arrays for a new round of data collection in a new configuration
 void setMode(ca.nrc.widar.jaxb.crm.StbHstDpModeType value)
           
 void setStage(int value)
          Sets the new stage value
 void setSubband(int value)
          Sets the new subband value
 void setThresholdExponent(int thresholdValue)
           
 void setTitle(java.lang.String value)
           
 void storeFilterCompXml(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
          This method is called from the diagnostic when data collection in a given configuration is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
See Also:
Constant Field Values
Constructor Detail

CrmStbHSComparable

public CrmStbHSComparable(java.lang.String loc,
                          java.lang.String titleValue,
                          ca.nrc.widar.jaxb.crm.StbHstDpModeType modeValue,
                          int thresholdValue)
Convenience constructor for the CrmStbHSComparable class, allows the caller to omit the dimensions d1 and d2, which are taken to be default as d1=Number of Data Paths (2) and d2=Number of Filter Chips (18)

Parameters:
titleValue - The String title of this comparable
modeValue - THe StbHstDpModeType for the diagnostic
thresholdValue - The exponent used to determine the threshold for comparison for this value

CrmStbHSComparable

public CrmStbHSComparable(java.lang.String loc,
                          java.lang.String titleValue,
                          ca.nrc.widar.jaxb.crm.StbHstDpModeType modeValue,
                          int stageValue,
                          int subbandValue,
                          int dim1,
                          int dim2,
                          int thresholdExponentValue)
Constructor for the CrmStbHSComparable class which returns a class that handles the comparisons and statistics gathering for one 'comparable' within the CrmStbHSDiagnostic

Parameters:
titleValue - The String title of this comparable
modeValue - THe StbHstDpModeType for the diagnostic
stageValue - THe Stage ID (1-4)
subbandValue - The subband ID (0-7)
dim1 - An Integer dimension for the dataPath (usually 2)
dim2 - An Integer dimension for the filter ID (Usually 18)
thresholdValue - The exponent used to determine the threshold for comparison for this value
Method Detail

init

public void init()
Initializes all major counters and lists


reset

public void reset()
Calls methods to zero out all values and counters


addRecord

public void addRecord(int i,
                      int j,
                      java.lang.Integer newVal)
Adds a new record of type Integer to this comparable class. This method basically converts the value to Long and calls the method

Parameters:
i - The integer index corresponding to dimension 1
j - The integer index corresponding to dimension 2
newVal - The new Integer value

addRecord

public void addRecord(int i,
                      int j,
                      java.lang.Long newVal)
Adds a new record of type Long to this comparable class, incrementing the appropriate counters as required

Parameters:
i - The integer index corresponding to dimension 1
j - The integer index corresponding to dimension 2
newVal - The new Long value

analyzeWithinFilters

public void analyzeWithinFilters(int dp,
                                 int f1,
                                 int f2)
Enacts the comparison when the diagnostic is in WITHIN compare mode for this comparable. Essentially, the heart of the comparison in this mode is that values for adjacent filters are compared. So, in this method, some logic is introduced to deal with end effects (for filter ID 0, the comparison is made with filter ID 17).

Parameters:
dp - The data path to compare (0-d1)
f1 - The first filter in the comparison (0-d2)
f2 - The second filter in the comparison (0-d2)

analyzeWithinDp

public void analyzeWithinDp(int dp)
Method that calls the comparison within a data path being processed

Parameters:
dp - The data path id (0/1)

analyzeWithin

public void analyzeWithin(int dp)
Method called from the Diagnostic that supplies a code for datapath 0=DP0, 1=DP2, 2=both data paths

Parameters:
dp - The datapath 'code' (0=DP0,1=DP1,2=both)

analyzeAcross

public void analyzeAcross()
Method that enacts a comparison when the diagnostic is operating in 'ACROSS' mode. Essentially, in this case, the comparison is made between 2 corresponding filter chips, one from each data path.


storeFilterCompXml

public void storeFilterCompXml(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
                        throws java.lang.Exception
This method is called from the diagnostic when data collection in a given configuration is complete. The totals are summed and gathered into a FilterComp XML element which is stored within a list until the end of the diagnostic. This must happen prior to the diagnostic changing the stage and subband values

Throws:
java.lang.Exception
Parameters:
stageVal - THe current integer stage index ( 1-4 )
subbandVal - The current integer subband index ( 0-7 )
crmOF - A CRM Object Factory

resetParams

public void resetParams(int stageVal,
                        int subbandVal,
                        ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
                 throws java.lang.Exception
The reset signal from the diagnostic sets new values for stage and subband along with resetting all storage arrays for a new round of data collection in a new configuration

Throws:
java.lang.Exception
Parameters:
stageVal - The new stage index (1-4)
subbandVal - The new subband index (0-7)
crmOF - A CRM ObjectFactory

getTotalError

public int getTotalError()
Returns:
The total number of failed comparisons (int)

getTotalCount

public int getTotalCount()
Returns:
The total number of comparisons performed (int)

getTotalZeroCount

public int getTotalZeroCount()
Returns:
The total number of zero values encountered (int)

setStage

public void setStage(int value)
Sets the new stage value

Parameters:
value - The new stage Value (1-4)

getStage

public int getStage()
Returns:
the Current stage value (int)

isSetStage

public boolean isSetStage()
Returns:
A boolean indicating whether the stage is set (true) or not (false)

setSubband

public void setSubband(int value)
Sets the new subband value

Parameters:
value - The new subband value (0-7)

getSubband

public int getSubband()
Returns:
the current subband value (int)

isSetSubband

public boolean isSetSubband()
Returns:
A boolean indicating whether the subband id is set (true) or not (false)

getError

public int getError(int i,
                    int j)
Parameters:
i - The data path index (0/1)
j - The filter Id indes (0-17)
Returns:
The number of failed comparisons for the supplied indicies

getCount

public int getCount(int i,
                    int j)
Parameters:
i - The data path index (0/1)
j - The filter Id indes (0-17)
Returns:
The number of comparisons for the supplied indicies

getTitle

public java.lang.String getTitle()
Returns:
The title of this comparable

setTitle

public void setTitle(java.lang.String value)
Parameters:
value - The new String title of this comparable

getMode

public ca.nrc.widar.jaxb.crm.StbHstDpModeType getMode()
Returns:
The StbHstDpModeType describing the current mode of this comparable (WITHIN/ACROSS)

setMode

public void setMode(ca.nrc.widar.jaxb.crm.StbHstDpModeType value)
Parameters:
value - The new StbHstDpModeType for this comparable

setThresholdExponent

public void setThresholdExponent(int thresholdValue)
Parameters:
thresholdValue - The new value for threshold exponent

getFilterSummaryXml

public java.util.ArrayList<ca.nrc.widar.jaxb.crm.FilterSummary> getFilterSummaryXml(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF,
                                                                                    int dp)
Generates and returns an ArrayList of FilterSummary XML elements for this comparable.

Parameters:
crmOF - A CRM ObjectFactory
dp - The data path ID (0/1)
Returns:
An Arraylist of FilterSummary XML elements

getFilterCompList

public java.util.ArrayList<ca.nrc.widar.jaxb.crm.FilterComp> getFilterCompList()
Returns:
The entire ArrayList of FilterComp XML elements

getFilterCompXml

public java.util.ArrayList<ca.nrc.widar.jaxb.crm.FilterComp> getFilterCompXml(int dp,
                                                                              int f)
Returns an ArrayList of FilterComp XML elements that correspond to the supplied data path and filter chip id, from the list that is stored within this comparable which was accumulated during the analysis

Parameters:
dp - The data path id (0/1)
f - The filter chip id (0-17)
Returns:
An ArrayList of FilterComp XML elements

getFilterCompXml

public ca.nrc.widar.jaxb.crm.FilterComp getFilterCompXml(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF,
                                                         int dp,
                                                         int f)
Generates and returns a FilterComp XML element based on the input parameters. The FilterComp XML element contains information about data comparisons for this comparable, for a given set of chips

Parameters:
crmOF - A CRM Object Factory
dp - The data path index (0/1)
f - The filter chip ID (0-17)

NRAO/DRAO

National Radio Astronomy Observatory