WIDAR Classes

ca.nrc.widar.mccc.crm
Class CrmStbHSDiagnostic

java.lang.Object
  extended by java.lang.Thread
      extended by ca.nrc.widar.mccc.crm.CrmDiagnostic
          extended by ca.nrc.widar.mccc.crm.CrmStbHSDiagnostic
All Implemented Interfaces:
DataReadyListener, java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener

public class CrmStbHSDiagnostic
extends CrmDiagnostic
implements java.lang.Runnable, java.awt.event.ActionListener

WIDAR/EVLA - CRM: CrmStbHSDiagnostic Class

The CRM Station Board Hardware Self Test class.

A class which facilitates the running of diagnostic tests directly on a Station Board within the EVLA Widar correlator

This test will serve to reconfire a Station Board component, collect a pre-determined amount of output data onto local disk or memory, and then analyze the data according to pre-determined methods and practises in order to determine whether the station board and it sub-components are behaving properly and as predicted.

Note that the HS test does not require that the correlator be completely committed to performing this test.

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)
 

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.Integer BW_INPUT
           
static java.lang.Integer[] BW_OUTPUT
           
static java.lang.String CLASSNAME
           
static java.lang.Integer CONFIG_PAUSE
           
static int DEFAULT_STAGE1_SUBBAND
           
static int INSTATE
           
static int N_DP
           
static int N_F
           
static int N_SB
           
static int N_STAGES
           
static int N_STREAMS
           
static int POWER
           
static int QSTATE
           
static java.lang.String[] STREAM
           
static java.lang.String[] STREAM_TITLE
           
static java.lang.Integer[] SW_PWR_INTEG
           
static java.lang.String[] TAG
           
static java.lang.String TEST_DESCRIPTION
           
static java.lang.String TEST_ID
           
static int TYPE
           
 
Fields inherited from class ca.nrc.widar.mccc.crm.CrmDiagnostic
analyze, cleanup, client, complete, crmM, crmOF, crmU, diagXml, id, safeMode, test
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CrmStbHSDiagnostic(ca.nrc.widar.jaxb.crm.Diagnostic diagnostic)
          Constructor for this diagnostic class.
 
Method Summary
 void abort()
          A method overriding the CrmDiagnostic abort method.
 void actionPerformed(java.awt.event.ActionEvent event)
          Receives an ActionEvent, determines the source and performs instructions accordingly.
 void cleanup()
          The overriding method for cleanup upon completion or abortion of the diagnostic
 void execute()
          Executes the Station Board hardware Self-Test
static java.lang.String[] getDataSource(ca.nrc.widar.jaxb.crm.StbHstDpModeType mode, ca.nrc.widar.jaxb.crm.StbHstDataType type)
          Returns a 2-slement String array (one for each data path) which contains the string value of input data source for each data path (the array is indexed by the 0-based data path id).
protected  ca.nrc.widar.jaxb.crm.Result getDiagResultXml()
          Generate and returns a Result XML element describing the entire result set from this diagnostic
static java.lang.Integer getFilterConfigCf(int stage, int subband, int stage1Subband)
          Determines and returns an Integer value for Center Frequency based upon the configuration of the current diagnostic.
static ca.nrc.widar.jaxb.crm.Input getInputConfig(ca.nrc.widar.jaxb.crm.ObjectFactory OF, ca.nrc.widar.jaxb.crm.StbHstDpModeType mode)
          Generates and returns an Input XML element which is used to fine tune the configuration of the Input chip used in the required configuration.
static java.lang.String getInputGenSeed(int dp, ca.nrc.widar.jaxb.crm.StbHstDpModeType mode)
          Determines and returns the input generation seed for the wideband test signal generator based on the mode and the data path.
static ca.nrc.widar.jaxb.crm.StationBoard getStbDefaultVci(ca.nrc.widar.jaxb.crm.ObjectFactory OF, java.lang.Integer stationId, java.lang.Integer[] bbid)
          Generates and returns a StationBoard XML element which contains the VCI XML element necessary to configure the Station Board to a 'Default' configuration.
static ca.nrc.widar.jaxb.crm.StationBoard getStbInput(ca.nrc.widar.jaxb.crm.ObjectFactory OF, ca.nrc.widar.jaxb.crm.StbHstDpModeType mode)
          Generates and returns a StationBoard XML element which contains an Input element only, used to configure the Input Chip on a Station Board CMIB
static ca.nrc.widar.jaxb.crm.StationBoard getStbVci(ca.nrc.widar.jaxb.crm.ObjectFactory OF, java.lang.String sn, ca.nrc.widar.jaxb.crm.StbHstDpModeType mode, ca.nrc.widar.jaxb.crm.StbHstDataType source, java.lang.Integer stage, java.lang.Integer subband)
          Generates and returns a StationBoard XML element which contains the properly constructed VCI XML element used to configure the station board to the required state for diagnostic purposes.
static ca.nrc.widar.jaxb.crm.StationBoard getStbVci(ca.nrc.widar.jaxb.crm.ObjectFactory OF, java.lang.String sn, ca.nrc.widar.jaxb.crm.StbHstDpModeType mode, ca.nrc.widar.jaxb.crm.StbHstDataType source, java.lang.Integer stage, java.lang.Integer subband, java.lang.Integer stage1Subband)
          Generates and returns a StationBoard XML element which contains the properly constructed VCI XML element used to configure the station board to the required state for diagnostic purposes.
static ca.nrc.widar.jaxb.crm.VciConfiguration.DataPath getVciDataPath(ca.nrc.widar.jaxb.crm.ObjectFactory OF, java.lang.Integer dp, java.lang.String[] source, java.lang.Integer stage, java.lang.Integer subband, java.lang.Integer stage1Subband)
          Generates and returns a VCI DataPath XML element used to configure a data path to the requested configuration.
static ca.nrc.widar.jaxb.crm.VciConfiguration.DataPath.FilterConfig getVciDataPathFilterConfig(ca.nrc.widar.jaxb.crm.ObjectFactory OF, java.lang.Integer dp, java.lang.Integer f, java.lang.Integer stage, java.lang.Integer subband, java.lang.Integer stage1Subband)
          Generates and returns a FilterConfig child for the VCI/DataPath XML element which will serve to configure a filter chip to the desired configuration.
static ca.nrc.widar.jaxb.crm.VciConfiguration.DataPath.InputConfig getVciDataPathInputConfig(ca.nrc.widar.jaxb.crm.ObjectFactory OF, java.lang.String source)
          Generates and returns an InputConfig child for the VCI/DataPath element.
static void main(java.lang.String[] args)
          Main method for testing purposes
 
Methods inherited from class ca.nrc.widar.mccc.crm.CrmDiagnostic
addActionListener, addError, addError, addMessage, addRecircCrcError, addRxpCrcError, checkForInterrupt, completeBlfFile, completeBlfFile, completeDiagnostic, dataIsReady, finish, fireActionEvent, fireActionEvent, getBlb, getBlfDirectory, getCcErrorThreshold, getClient, getCondition, getCurrentConfigName, getDiag, getDiagId, getDiagState, getDiagTest, getDiagTestString, getDiagType, getErrorCount, getErrorList, getFDiff, getIpAddress, getMessage, getMessageBrief, getMessageCount, getMessageList, getProgMax, getProgMin, getProgress, getRecircCrcErrorCount, getRecircCrcErrorList, getRxpCrcErrorCount, getRxpCrcErrorList, getStartTime, getXmlString, isActive, isSetIpAddress, registerBlfFile, removeActionListener, run, sendMonitorXml, setActive, setBlbHstAbsPeakDiffMax, setCompleteTime, setStartTime, setStop, updateCondition, updateMessage, updateProgress, updateProgress, updateProgress, updateQueueStatus, updateResult, updateState, updateStatus, updateStatus, updateStatus, wasInterrupted, wasInterrupted
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

CLASSNAME

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

TEST_ID

public static final java.lang.String TEST_ID
See Also:
Constant Field Values

TEST_DESCRIPTION

public static final java.lang.String TEST_DESCRIPTION
See Also:
Constant Field Values

STREAM

public static final java.lang.String[] STREAM

TAG

public static final java.lang.String[] TAG

STREAM_TITLE

public static final java.lang.String[] STREAM_TITLE

TYPE

public static final int TYPE
See Also:
Constant Field Values

N_STREAMS

public static final int N_STREAMS
See Also:
Constant Field Values

INSTATE

public static final int INSTATE
See Also:
Constant Field Values

QSTATE

public static final int QSTATE
See Also:
Constant Field Values

POWER

public static final int POWER
See Also:
Constant Field Values

N_SB

public static final int N_SB
See Also:
Constant Field Values

N_DP

public static final int N_DP
See Also:
Constant Field Values

N_F

public static final int N_F
See Also:
Constant Field Values

DEFAULT_STAGE1_SUBBAND

public static final int DEFAULT_STAGE1_SUBBAND
See Also:
Constant Field Values

N_STAGES

public static final int N_STAGES
See Also:
Constant Field Values

CONFIG_PAUSE

public static final java.lang.Integer CONFIG_PAUSE

BW_INPUT

public static final java.lang.Integer BW_INPUT

BW_OUTPUT

public static final java.lang.Integer[] BW_OUTPUT

SW_PWR_INTEG

public static final java.lang.Integer[] SW_PWR_INTEG
Constructor Detail

CrmStbHSDiagnostic

public CrmStbHSDiagnostic(ca.nrc.widar.jaxb.crm.Diagnostic diagnostic)
Constructor for this diagnostic class. This method obtains a reference to the station board that is the subject of the test, sets any parameters from the supplied diagnostic XML. The test itself is triggered remotely (from the Diagnostic Queue) by invoking the 'start' method.

Parameters:
diagnostic - An XML element (defined within crm.xsd) describing the particulars of this diagnostic
Method Detail

execute

public void execute()
Executes the Station Board hardware Self-Test

Overrides:
execute in class CrmDiagnostic

abort

public void abort()
           throws java.lang.InterruptedException
A method overriding the CrmDiagnostic abort method. This is done because in the case of the STB-HST diagnostic, the stream readers require to be deactivated prior to continuing the abort sequence in the CrmDiagnostic class

Overrides:
abort in class CrmDiagnostic
Throws:
java.lang.InterruptedException

cleanup

public void cleanup()
The overriding method for cleanup upon completion or abortion of the diagnostic

Overrides:
cleanup in class CrmDiagnostic

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Receives an ActionEvent, determines the source and performs instructions accordingly. This is the action event handling method.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class CrmDiagnostic
Parameters:
event - The incoming action event.

getDiagResultXml

protected ca.nrc.widar.jaxb.crm.Result getDiagResultXml()
Generate and returns a Result XML element describing the entire result set from this diagnostic

Overrides:
getDiagResultXml in class CrmDiagnostic
Returns:
A fully populated Result XML object for an StbHst Diagnostic

getInputGenSeed

public static java.lang.String getInputGenSeed(int dp,
                                               ca.nrc.widar.jaxb.crm.StbHstDpModeType mode)
Determines and returns the input generation seed for the wideband test signal generator based on the mode and the data path. For ACROSS mode, the 2 data paths must be accepting the same signal and so it doesn't really matter which seed is used as only test0 signal is fed to both data paths for WITHIN mode, the 2 data paths need not be identical.

Parameters:
dp - The integer data path (0,1)
mode - The StbHstDpModeType describing the mode (ACROSS/WITHIN)
Returns:
A string representation of a hexadecimal seed number for random seeding of the CMIB Input Chip WideBand Data Generator

getInputConfig

public static ca.nrc.widar.jaxb.crm.Input getInputConfig(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                         ca.nrc.widar.jaxb.crm.StbHstDpModeType mode)
Generates and returns an Input XML element which is used to fine tune the configuration of the Input chip used in the required configuration. Input chip config depends on the mode being requested.

Parameters:
OF - A Crm ObjectFactory (this is a static method)
mode - The StbHstDpModeType describing the mode (ACROSS/WITHIN)
Returns:
An Input XML element to be sent to configure the Input Chip on A Station Board

getStbInput

public static ca.nrc.widar.jaxb.crm.StationBoard getStbInput(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                             ca.nrc.widar.jaxb.crm.StbHstDpModeType mode)
Generates and returns a StationBoard XML element which contains an Input element only, used to configure the Input Chip on a Station Board CMIB

Parameters:
OF - A Crm ObjectFactory (this is a static method)
mode - The StbHstDpModeType describing the mode (ACROSS/WITHIN)

getDataSource

public static java.lang.String[] getDataSource(ca.nrc.widar.jaxb.crm.StbHstDpModeType mode,
                                               ca.nrc.widar.jaxb.crm.StbHstDataType type)
Returns a 2-slement String array (one for each data path) which contains the string value of input data source for each data path (the array is indexed by the 0-based data path id).

Parameters:
mode - The StbHstDpModeType describing the mode (ACROSS/WITHIN)
type - The StbHstDataType used for input type (TEST/FORM)
Returns:
A 2-element string array, indexed by data path id (0/1) containing the configuration designation for input source for each data path

getVciDataPathInputConfig

public static ca.nrc.widar.jaxb.crm.VciConfiguration.DataPath.InputConfig getVciDataPathInputConfig(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                                                                    java.lang.String source)
Generates and returns an InputConfig child for the VCI/DataPath element. The configuration of the InputConfig element is based on the data source which is provided.

Parameters:
OF - A Crm ObjectFactory (this is a static method)
source - The string to be used as the data source for this InputConfig XML element
Returns:
A VciConfiguration/DataPath/InputConfig XML element

getFilterConfigCf

public static java.lang.Integer getFilterConfigCf(int stage,
                                                  int subband,
                                                  int stage1Subband)
Determines and returns an Integer value for Center Frequency based upon the configuration of the current diagnostic. Most importantly, what phase is configured, and what subband is desired. The idea is to use a frequency for a given subband which has a decent frequency response so that gain levels need not be adjusted in the extreme, and adequate signal is present in order to facilitate a comparison. The calculation of values is dependent upon what stage is currently configured and what subband is required.

Parameters:
stage - The integer stage for Filter config (1-4)
subband - The integer subband id for Filter config (0-7)
stage1Subband - The integer subband to use for stage 1 when configuring stages 2 through 4
Returns:
The Integer value for Centre Frequency

getVciDataPathFilterConfig

public static ca.nrc.widar.jaxb.crm.VciConfiguration.DataPath.FilterConfig getVciDataPathFilterConfig(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                                                                      java.lang.Integer dp,
                                                                                                      java.lang.Integer f,
                                                                                                      java.lang.Integer stage,
                                                                                                      java.lang.Integer subband,
                                                                                                      java.lang.Integer stage1Subband)
Generates and returns a FilterConfig child for the VCI/DataPath XML element which will serve to configure a filter chip to the desired configuration. This will depend on the data path, filter chip id and the required stage.

Parameters:
OF - A Crm ObjectFactory (this is a static method)
dp - The integer data path ( 0/1 )
f - The integer filter chip id ( 0-17 )
stage - The integer filter stage id ( 1-4 )
subband - The integer subband id ( 0-7 )
stage1Subband - The integer subband ID for stage 1 when configuring stages 2-4
Returns:
A VciConfiguration/DataPath/FilterConfig XML element

getVciDataPath

public static ca.nrc.widar.jaxb.crm.VciConfiguration.DataPath getVciDataPath(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                                             java.lang.Integer dp,
                                                                             java.lang.String[] source,
                                                                             java.lang.Integer stage,
                                                                             java.lang.Integer subband,
                                                                             java.lang.Integer stage1Subband)
Generates and returns a VCI DataPath XML element used to configure a data path to the requested configuration.

Parameters:
OF - A Crm ObjectFactory (this is a static method)
dp - The integer data path ( 0/1 )
source - A 2-element String array containing the data source identifier for each data path
stage - The integer filter stage id ( 1-4 )
subband - The integer subband id ( 0-7 )
stage1Subband - The integer subband ID for stage 1 when configuring stages 2-4
Returns:
A VciConfiguration/DataPath XML element

getStbVci

public static ca.nrc.widar.jaxb.crm.StationBoard getStbVci(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                           java.lang.String sn,
                                                           ca.nrc.widar.jaxb.crm.StbHstDpModeType mode,
                                                           ca.nrc.widar.jaxb.crm.StbHstDataType source,
                                                           java.lang.Integer stage,
                                                           java.lang.Integer subband)
Generates and returns a StationBoard XML element which contains the properly constructed VCI XML element used to configure the station board to the required state for diagnostic purposes.

Parameters:
OF - A Crm ObjectFactory (this is a static method)
sn - The serial number identifier for the Station Board
mode - The StbHstDpModeType describing the mode (ACROSS/WITHIN)
source - The StbHstDataType describing the input signal source (TEST/FORM)
stage - The integer filter stage id ( 1-4 )
subband - The integer subband id ( 0-7 )
Returns:
A VciConfiguration XML element

getStbVci

public static ca.nrc.widar.jaxb.crm.StationBoard getStbVci(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                           java.lang.String sn,
                                                           ca.nrc.widar.jaxb.crm.StbHstDpModeType mode,
                                                           ca.nrc.widar.jaxb.crm.StbHstDataType source,
                                                           java.lang.Integer stage,
                                                           java.lang.Integer subband,
                                                           java.lang.Integer stage1Subband)
Generates and returns a StationBoard XML element which contains the properly constructed VCI XML element used to configure the station board to the required state for diagnostic purposes.

Parameters:
OF - A Crm ObjectFactory (this is a static method)
sn - The serial number identifier for the Station Board
mode - The StbHstDpModeType describing the mode (ACROSS/WITHIN)
source - The StbHstDataType describing the input signal source (TEST/FORM)
stage - The integer filter stage id ( 1-4 )
subband - The integer subband id ( 0-7 )
stage1Subband - The integer subband ID for stage 1 when configuring stages 2-4
Returns:
A VciConfiguration XML element

getStbDefaultVci

public static ca.nrc.widar.jaxb.crm.StationBoard getStbDefaultVci(ca.nrc.widar.jaxb.crm.ObjectFactory OF,
                                                                  java.lang.Integer stationId,
                                                                  java.lang.Integer[] bbid)
Generates and returns a StationBoard XML element which contains the VCI XML element necessary to configure the Station Board to a 'Default' configuration. This is used upon completion of a diagnostic to return the board to a 'nominal' state.

Parameters:
OF - A Crm ObjectFactory (this is a static method)
stationId - The integer station ID for this station board
bbid - A 2-element Integer array containing the BBID for each data path
Returns:
A VciConfiguration XML element

main

public static void main(java.lang.String[] args)
Main method for testing purposes


NRAO/DRAO

National Radio Astronomy Observatory