WIDAR Classes

ca.nrc.widar.mccc.crm
Class CrmQuadrant

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

public class CrmQuadrant
extends java.lang.Object

WIDAR/EVLA - CRM: CrmQuadrant Class

A class extending the CrmBoard class designed to handle the specifics pertaining to a station defined within the WIDAR correlator system.

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
           
static java.lang.Integer NUM_BB
          An instance of a CRM JAXB unmarshaller
static java.lang.Integer NUM_DP
          An instance of a CRM JAXB unmarshaller
static java.lang.Integer NUM_SB
          An instance of a CRM JAXB unmarshaller
static java.lang.Integer NUM_STB
          An instance of a CRM JAXB unmarshaller
static java.lang.Integer NUM_STN
          An instance of a CRM JAXB unmarshaller
static java.lang.Integer NUM_W
          An instance of a CRM JAXB unmarshaller
 
Constructor Summary
CrmQuadrant(java.lang.Integer idValue)
          The constructor.
 
Method Summary
 int addBaselineBoard(int sbId, CrmBaselineBoard board)
          If all conditions are met, the supplied CrmBaselineBoard object is added to the HashMap for this instance of CrmQuadrant.
 java.lang.Integer getBasebandId(int stn, int sb, int dp)
          Returns the baseband ID reported at the Rxp Input within this quadrant corresponding to the supplied station ID, subband and datapath values
 java.util.HashMap getBaselineBoards()
          Returns the current HashMap containing all valid references to the BlBs that comprise this 'Quadrant'
 java.lang.Integer getId()
          Returns the Station ID
 java.lang.String getQuadrantStatusCommand()
           
 ca.nrc.widar.jaxb.crm.RxpInputs getRxpInputsXml(int sb)
          Queries the BlB Pair at the specified subband ID for the RxpInputs XML element.
 java.util.ArrayList<ca.nrc.widar.jaxb.crm.RxpInputs> getRxpInputsXmlList(DataReadyListener drl)
          Queries all of the BlB Pairs in this quadrant for the RxpInputs XML elements and returns an ArrayList of those objects.
 java.util.Set<java.lang.Integer> getSubbandList()
          Returns a Set of integers representing the subband IDs of subbands defined or configured within this quadrant.
 boolean isOutputPresent(int stn, int sb)
          Returns an indication of whether there is output reported at the RxpInputs of the specified subband within the quadrant from the supplied station ID
 void refreshQuadrantStatus()
          For each associated BlB pair within the quadrant, this method clears any currently stored RXP Inputs configuration information, retrieves the current RxpInputs XML from the BlB pairs, and populates the qSb array with the values unmarshalled from the RxpInputs XML.
 int removeBaselineBoard(int sbId)
          Removes the association to the supplied StB from this Station
 void sendClearErrors(DataReadyListener drl)
          Send a ClearErrors command to all Baseline Boards in this quadrant.
 void sendClearErrors(int sb, DataReadyListener drl)
          Send a ClearErrors command to all Baseline Boards in this quadrant for a specified subband ID
 void sendRecircStateRequest(DataReadyListener drl)
          Sends a request for Recirculator chip state to all Baseline Board in this quadrant.
 void sendRecircStateRequest(int sb, DataReadyListener drl)
          Sends a request for Recirculator chip state to all Baseline Board in this quadrant for a specified subband ID.
 void sendRecircStateRequest(java.lang.String ord, int id, DataReadyListener drl)
          Sends a request for Recirculator chip state to all Baseline Board in this quadrant.
 void sendRecircStateRequest(java.lang.String ord, int id, int sb, DataReadyListener drl)
          Sends a request for Recirculator chip state to all Baseline Board in this quadrant for a specified subband ID.
 void sendTimeCodeSourceChange(int source, DataReadyListener drl)
          Sends a TimeCodeSource change command to all Baseline Boards in this quadrant.
 void sendTimeCodeSourceChange(int source, int sb, DataReadyListener drl)
          Sends a TimeCodeSource change command to all Baseline Board in this quadrant for a specified subband ID.
 void sendTimeCodeSourceChange(java.lang.String ord, int id, int source, int sb, DataReadyListener drl)
          Sends a TimeCodeSource change command to all Baseline Board in this quadrant for a specified subband ID.
 void simulateQuadrantStatus(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
          A method that is run during safeMode operation which performs the same function as refreshQuadrantStatus() without probing the physical system for information, rather generating simulated data to achieve the same result
 ca.nrc.widar.jaxb.crm.RxpInputs simulateRxpInputsXml(ca.nrc.widar.jaxb.crm.CsdModeType mode, int modeId, int sb, ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
          Method used to generate raw RxpInputs XML, and modify them to suit a test operation.
 java.util.ArrayList<ca.nrc.widar.jaxb.crm.RxpInputs> simulateRxpInputsXmlList(ca.nrc.widar.jaxb.crm.CsdModeType type, int mode, ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
          A method used to generate simulated RxpInputs for testing purposes, this is invoked in the place of getRxpInputs when safe mode is activated.
 
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

NUM_STN

public static final java.lang.Integer NUM_STN
An instance of a CRM JAXB unmarshaller


NUM_W

public static final java.lang.Integer NUM_W
An instance of a CRM JAXB unmarshaller


NUM_STB

public static final java.lang.Integer NUM_STB
An instance of a CRM JAXB unmarshaller


NUM_BB

public static final java.lang.Integer NUM_BB
An instance of a CRM JAXB unmarshaller


NUM_SB

public static final java.lang.Integer NUM_SB
An instance of a CRM JAXB unmarshaller


NUM_DP

public static final java.lang.Integer NUM_DP
An instance of a CRM JAXB unmarshaller

Constructor Detail

CrmQuadrant

public CrmQuadrant(java.lang.Integer idValue)
The constructor.

Parameters:
idValue - The quadrant ID.
Method Detail

addBaselineBoard

public int addBaselineBoard(int sbId,
                            CrmBaselineBoard board)
If all conditions are met, the supplied CrmBaselineBoard object is added to the HashMap for this instance of CrmQuadrant.

Parameters:
sbId - The Sub Band ID to add this baseline board to
CrmBaselineBoard - A CrmBaselineBoard object that is to be added to this Quadrant
Returns:
An integer indicating success of the addition operation, returns 1 if the CrmBaselineBoard was added successfully, -1 if not

removeBaselineBoard

public int removeBaselineBoard(int sbId)
Removes the association to the supplied StB from this Station

Parameters:
String - The serial number String of the Station Board to be removed.
Returns:
An integer indicating success of the removal. Returns 1 on success, or -1 if no board was removed.

getBaselineBoards

public java.util.HashMap getBaselineBoards()
Returns the current HashMap containing all valid references to the BlBs that comprise this 'Quadrant'

Returns:
A HashMap of CrmBaselineBoard objects keyed by Sub Band ID

getSubbandList

public java.util.Set<java.lang.Integer> getSubbandList()
Returns a Set of integers representing the subband IDs of subbands defined or configured within this quadrant.

Returns:
A Set of Integer Subband IDs

sendTimeCodeSourceChange

public void sendTimeCodeSourceChange(java.lang.String ord,
                                     int id,
                                     int source,
                                     int sb,
                                     DataReadyListener drl)
Sends a TimeCodeSource change command to all Baseline Board in this quadrant for a specified subband ID. The command is sent to a specific Recirculator chip.

Parameters:
ord - The Recirculator Chip ordinal (X/Y)
id - The Recirculator Chip ID (0-7)
source - The numerical portion of the TimeCodeSource enumeration (0-3)
sb - The subband ID within the quadrant to which the command is to be sent (represents 2 baseline boards)
drl - A DataReadyListener to which the response is sent (can be null)

sendTimeCodeSourceChange

public void sendTimeCodeSourceChange(int source,
                                     int sb,
                                     DataReadyListener drl)
Sends a TimeCodeSource change command to all Baseline Board in this quadrant for a specified subband ID. The command is sent to ALL Recirculator chips.

Parameters:
source - The numerical portion of the TimeCodeSource enumeration (0-3)
sb - The subband ID within the quadrant to which the command is to be sent (represents 2 baseline boards)
drl - A DataReadyListener to which the response is sent (can be null)

sendTimeCodeSourceChange

public void sendTimeCodeSourceChange(int source,
                                     DataReadyListener drl)
Sends a TimeCodeSource change command to all Baseline Boards in this quadrant. The command is sent to ALL Recirculator chips.

Parameters:
source - The numerical portion of the TimeCodeSource enumeration (0-3)
drl - A DataReadyListener to which the response is sent (can be null)

sendClearErrors

public void sendClearErrors(int sb,
                            DataReadyListener drl)
Send a ClearErrors command to all Baseline Boards in this quadrant for a specified subband ID

Parameters:
sb - The subband ID within the quadrant to which the command is to be sent (represents 2 baseline boards)
drl - A DataReadyListener to which the response is sent (can be null)

sendClearErrors

public void sendClearErrors(DataReadyListener drl)
Send a ClearErrors command to all Baseline Boards in this quadrant.

Parameters:
drl - A DataReadyListener to which the response is sent (can be null)

sendRecircStateRequest

public void sendRecircStateRequest(java.lang.String ord,
                                   int id,
                                   int sb,
                                   DataReadyListener drl)
                            throws java.lang.Exception
Sends a request for Recirculator chip state to all Baseline Board in this quadrant for a specified subband ID. The command is sent requesting information for a specific Recirculator chip.

Throws:
java.lang.Exception
Parameters:
ord - The Recirculator Chip ordinal (X/Y)
id - The Recirculator Chip ID (0-7)
sb - The subband ID within the quadrant to which the request is to be sent (represents 2 baseline boards)
drl - A DataReadyListener to which the response is sent (can be null)

sendRecircStateRequest

public void sendRecircStateRequest(int sb,
                                   DataReadyListener drl)
                            throws java.lang.Exception
Sends a request for Recirculator chip state to all Baseline Board in this quadrant for a specified subband ID. The command is sent requesting information for ALL Recirculator chips.

Throws:
java.lang.Exception
Parameters:
sb - The subband ID within the quadrant to which the request is to be sent (represents 2 baseline boards)
drl - A DataReadyListener to which the response is sent (can be null)

sendRecircStateRequest

public void sendRecircStateRequest(java.lang.String ord,
                                   int id,
                                   DataReadyListener drl)
                            throws java.lang.Exception
Sends a request for Recirculator chip state to all Baseline Board in this quadrant. The command is sent requesting information for a specific Recirculator chip.

Throws:
java.lang.Exception
Parameters:
ord - The Recirculator Chip ordinal (X/Y)
id - The Recirculator Chip ID (0-7)
drl - A DataReadyListener to which the response is sent (can be null)

sendRecircStateRequest

public void sendRecircStateRequest(DataReadyListener drl)
                            throws java.lang.Exception
Sends a request for Recirculator chip state to all Baseline Board in this quadrant. The command is sent requesting information for ALL Recirculator chips.

Throws:
java.lang.Exception
Parameters:
drl - A DataReadyListener to which the response is sent (can be null)

getRxpInputsXml

public ca.nrc.widar.jaxb.crm.RxpInputs getRxpInputsXml(int sb)
                                                throws java.lang.Exception
Queries the BlB Pair at the specified subband ID for the RxpInputs XML element. The RxpInputs element describes the input configuration of the RXP chip on the input BlB of the BlB pair.

Throws:
java.lang.Exception
Parameters:
sb - The subband ID
Returns:
A JAXB RxpInputs Object as defined in the crm.xsd schema

getRxpInputsXmlList

public java.util.ArrayList<ca.nrc.widar.jaxb.crm.RxpInputs> getRxpInputsXmlList(DataReadyListener drl)
Queries all of the BlB Pairs in this quadrant for the RxpInputs XML elements and returns an ArrayList of those objects.

Parameters:
drl - A DataReadyListener object in the case that an error occurs, this is where the error message will be processed
Returns:
An ArrayList of RxpInputs Objects

simulateRxpInputsXml

public ca.nrc.widar.jaxb.crm.RxpInputs simulateRxpInputsXml(ca.nrc.widar.jaxb.crm.CsdModeType mode,
                                                            int modeId,
                                                            int sb,
                                                            ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
                                                     throws java.lang.Exception
Method used to generate raw RxpInputs XML, and modify them to suit a test operation. Note that simulateion conditions are hard-wired into this method.

Throws:
java.lang.Exception
Parameters:
type - The CsdModeType for which simulated RxpInputs are required
mode - The 'Mode Id' of the CsdModeType requested (0-3)
sb - The subband ID of the RxpInputs
Returns:
A simulated RxpInputs XML object

simulateRxpInputsXmlList

public java.util.ArrayList<ca.nrc.widar.jaxb.crm.RxpInputs> simulateRxpInputsXmlList(ca.nrc.widar.jaxb.crm.CsdModeType type,
                                                                                     int mode,
                                                                                     ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
A method used to generate simulated RxpInputs for testing purposes, this is invoked in the place of getRxpInputs when safe mode is activated.

Parameters:
type - The CsdModeType required
mode - The 'Mode ID' of the specified CsdModeType (0-3)
Returns:
An ArrayList of RxpInputs simulated for the entire quadrant

getId

public java.lang.Integer getId()
Returns the Station ID

Returns:
The station ID

getQuadrantStatusCommand

public java.lang.String getQuadrantStatusCommand()

refreshQuadrantStatus

public void refreshQuadrantStatus()
For each associated BlB pair within the quadrant, this method clears any currently stored RXP Inputs configuration information, retrieves the current RxpInputs XML from the BlB pairs, and populates the qSb array with the values unmarshalled from the RxpInputs XML.


simulateQuadrantStatus

public void simulateQuadrantStatus(ca.nrc.widar.jaxb.crm.ObjectFactory crmOF)
A method that is run during safeMode operation which performs the same function as refreshQuadrantStatus() without probing the physical system for information, rather generating simulated data to achieve the same result


getBasebandId

public java.lang.Integer getBasebandId(int stn,
                                       int sb,
                                       int dp)
Returns the baseband ID reported at the Rxp Input within this quadrant corresponding to the supplied station ID, subband and datapath values

Parameters:
stn - The station ID (valid station ID required)
sb - The subband ID (0-15)
dp - The data path ID (0/1)
Returns:
The baseband ID reported at the specified input wafer, if it is not configured, returns -1

isOutputPresent

public boolean isOutputPresent(int stn,
                               int sb)
Returns an indication of whether there is output reported at the RxpInputs of the specified subband within the quadrant from the supplied station ID

Parameters:
stn - The station ID
sb - The subband ID
Returns:
True if output from the specified station is detected on the specified subband, False otherwise

NRAO/DRAO

National Radio Astronomy Observatory