WIDAR Classes

ca.nrc.widar.vciMapper
Class CorrModel

java.lang.Object
  extended by ca.nrc.widar.vciMapper.CorrModel
All Implemented Interfaces:
java.io.Serializable

public class CorrModel
extends java.lang.Object
implements java.io.Serializable

Software model of the WIDAR correlator. An instance of the class CorrModel implements all the configurable parameters and components of the WIDAR correlator; as well as the status parameters that may infulence the mapping of the VCI request into hardware configuration.

CorrModel has the following data fields:

Activation time - Time when the configuration should be activated.

Activation ID(s) - Activation IDs from the Activation Trigger(s). Note: Configuration Mapper can receive more than one Activation Trigger with the same Activation Time, but VCI Configuration Mapper should have only one instance of the class CorrModel for a specific Activation Time. More than one Activation ID can be assigned to the same Activation Time, and the same instance of the class CorrModel.

List of messages - All the XML messages used to modify the configuration are saved, so that the "mapping" can be performed again, if necessary. List of messages can be implemented as a ArrayList so that messages "activated" by different Activation Triggers are kept separately.

Valid - It is TBD whether this indicator is needed. The model could be distroyed (removed from the from list) when it becomes invalid (e.g. due to changes in configuration on which the model is based). The only reason for not distroying an invalid model immediately is to preserve VCI messages (requests), so that the "mapping" can be performed again; e.g. in the case when configuration requests are not received in the same order in which they should be activated.

When an Activation Trigger is received, if the CorrModel with the specified activation time already exists in the activation queue, ConfigMapper creates a copy of the existing CorrModel and updates the copy with the newly received configuration. If an error is detected and the last received configuration must be discarded, the ConfigMapper discards the copy and keeps the "original" CorrModel. If the new configuration is acceptable, the "original" CorrModel in the activation queue is replaced with the updated copy.

Note: Interface clonable is not implemented. For practical reason, CM creates a copy, not a clone.

Author:
Sonja.Vrcic@nrc.gc.ca

$Rev:: 6170 $: Revision of the last commit

$Author:: svrcic $: Author of the last commit

$Date:: 2012-12-18 14:07:04 -07#$: Date of the last commit

See Also:
Serialized Form
 

Nested Class Summary
static class CorrModel.CorrModelCfgStatus
          Used to report (display) configuration status, otherwise not necessary.
 
Field Summary
static int EVLA_NUM_BL_RACKS
           
static int EVLA_NUM_ST_RACKS
           
static int HTML_BOARD_STATUS_PAGE
           
static int HTML_HOME_PAGE
           
static int HTML_SUBBAND_PAGE
           
static int MAX_BLB_PAIR_ID
           
static int MAX_EVLA_BL_RACK_ID
           
static int MAX_EVLA_ST_RACK_ID
           
static int MAX_QUAD_ID
           
static int MIN_BLB_PAIR_ID
           
static int MIN_EVLA_BL_RACK_ID
           
static int MIN_EVLA_ST_RACK_ID
           
static int MIN_QUAD_ID
           
static int NUM_QUADS
           
static int PAIRS_IN_QUAD
           
 
Constructor Summary
CorrModel()
          No arg-constructor.
CorrModel(long at)
          Creates a correlator model based on predefined (default) configuration.
 
Method Summary
 long activeCorrModelSince()
           
 Rack addBlRack(int aRackId)
          Create an empty Baseline rack, add it to the list blbRackList and return a reference to the newly created rack.
 void addCbeDeconfig(SubarrayDeconfig sd)
           
 StationRack addStRack(int aRackId)
          Create an empty Station Board rack, add it to the list stbRackList and return a reference to the newly created rack.
 void addToListOfActTriggers(ca.nrc.widar.jaxb.vci.ActivationTrigger actTrig)
           
 void addVciMessage(java.lang.Object msg)
           
 java.lang.String blRacksToString()
           
 void calculatePacketDelayForVdif()
           
 void carryForwardChangeToBeTransmitted(CorrModel prevConfiguration)
          This method is called just before (or after) CorrModel becomes active.
 void clearListOfActTriggers()
           
 void configChangeDeepChange(boolean newConfigChange, ca.nrc.widar.vciMapper.ConfigChangeStatus newConfigChangeStatus)
          Unconditional status change.
 java.util.List<ca.nrc.widar.jaxb.vci.ActivationTrigger> copyListOfActTriggers()
          Used when VCI messages are received for the activation time which already exists in the actQueue.
 java.util.List<java.lang.Object> copyListOfMessages()
          Create a copy of the list of mapped messages.
 void copySubarayCbeDeconfigStatus(CorrModel model, boolean sameActTime)
           
 void copySubarrayCbeConfigStatus(CorrModel model)
          This method is called when a new CorrModel is created as a copy of the previous CorrModel.
 void createAndSendCbeDeconfig(SubarrayDeconfig subDeconfig, java.util.ArrayList<java.util.logging.LogRecord> listOfLogs)
          Create and send XML message widarCbe - deconfig.
 boolean createBaselineBoards(int numBlbs)
          This method creates a specified number of Baseline Boards.
 boolean createStationBoards(int numStbs)
          Create the specified number of Station Boards.
 boolean createSubarray(ca.nrc.widar.jaxb.vci.SubArray subElem, java.util.ArrayList<java.util.logging.LogRecord> logRecords)
          Parse VCI message and configure subarray If successful, add new subarray to the list of subarrays.
 void decrementDiscardCounter()
           
 boolean deleteSubarray(java.lang.String configId)
           
 boolean deleteSubarray(Subarray sub, ca.nrc.widar.jaxb.vci.SubArray vciMessage, java.lang.String actID, boolean removeFromList, java.util.ArrayList<java.util.logging.LogRecord> logRecords)
           
 boolean discardThisModel()
           
 boolean discardVciMessageCreateSubarray(java.lang.String configId)
           
 java.lang.String displayListOfActTriggers(java.lang.String thisAlign)
          activationTrigger is displayed in the table of Mapped Messages
 java.lang.StringBuilder displayListOfStations(java.lang.String thisAlign)
           
 void displayListOfSubarraysForHomePage(java.lang.StringBuilder sBuilder, java.lang.String thisAlign)
           
 java.lang.String displayVciMessage(int index)
           
 void dispose()
           
protected  void finalize()
           
 java.util.List<ca.nrc.widar.jaxb.cbe.Map> findProductsInSubarray(Subarray subarray, java.util.List<ca.nrc.widar.jaxb.cbe.Map> productsToConfigure)
           
 boolean flushCmibQueues()
          Flush input queue for the CMIBs affected by this CorModel.
 boolean forwardConfiguration(java.util.ArrayList<java.util.logging.LogRecord> listOfLogs)
          Send configuration to Station Boards, X-Bar Switches and Baseline Boards that are affected by the configuration change (i.e.
 boolean forwardedConfiguration()
          June 2011 SV: not sure if this indicator can be used to determine whether revoke should be performed.
 java.util.ArrayList<java.lang.String> getActiveSubarrays()
           
 java.lang.String getActString()
           
 long getActTime()
           
 java.lang.String getActTimeAsDisplayString()
           
 java.lang.String getActTimeAsXmlString()
           
 BaselineBoard getBaselineBoard(int r, int c, int s)
           
 BaselineBoard getBaselineBoard(Mlid mlid)
           
 java.lang.String getBlbConfigChangeStatus()
          Check all the Baseline Boards and derive overall configuration change status.
 BaselineBoard getBlbFromQuad(int qid, int pid, int index)
           
 void getCfgStatusAndDurationReportAsHtmlTable(java.lang.StringBuilder sBuilder)
          Display 'Configuration Report' for subarray in HTML format.
 ca.nrc.widar.jaxb.cmStatus.CmStatus getCmStatusSubarrays()
           
 void getCorrModelInHtmlFormat(java.lang.StringBuilder sBuilder, int page, java.lang.String thisAlign)
          This method is used to display the list of subarrays on Home Page, HTML_BOARD_STATUS_PAGE and HTML_SUBBAND_PAGE
 void getCorrModelStrBuilder(java.lang.StringBuilder sBuf)
           
 java.lang.String getCreatedAt()
           
 void getHtmlHeaderNew(java.lang.StringBuilder sBuilder, java.lang.String page)
          Display CorrModel in HTML format
 void getHtmlHeaderWithCfgStatusTable(java.lang.StringBuilder sBuilder, java.lang.String page)
          Display CorrModel in HTML format: getHtmlHeaderWithCfgStatusTable
 long getId()
          CorrModel ID has been introduced for debuging only.
 long getLastMsgTransmittedAt()
           
 java.util.List<ca.nrc.widar.jaxb.vci.ActivationTrigger> getListOfActTriggers()
           
 java.util.ArrayList<java.lang.String> getListOfStations()
           
 java.util.List<Subarray> getListOfSubarrays()
           
 java.util.List<java.lang.Object> getListOfVciMessages()
           
static long getNextCorrModelId()
           
 Rack getRack(int inId)
           
 Station getStation(int i)
           
 StationBoard getStationBoard(int rackId, int crateId, int slotId)
           
 StationBoard getStationBoard(Mlid mlid)
           
 void getStationsAsHtmlTable(java.lang.StringBuilder sBuilder)
          Displays StationRacks/Stations as table Replaced method displayListOfStations.
 java.lang.String getStbConfigChangeStatus()
          Check all the Baseline Boards and derive overall configuration change status.
 Subarray getSubarray(java.lang.String id)
           
 java.util.List<SubarrayDeconfig> getSubarrayCbeDeconfigList()
           
 javax.xml.datatype.XMLGregorianCalendar getXmlActTime()
           
 boolean hasSubarray(java.lang.String id)
           
 boolean hasVciMessageCreateSubarray(java.lang.String configId)
           
 void htmlListOfSubarraysWithBoardStatus(java.lang.StringBuilder sBuilder, java.lang.String thisAlign)
          Display list of subarray for Corr ModelPage 2: .
 void htmlListOfSubarraysWithSubbands(java.lang.StringBuilder sBuilder)
          Display list of subarray for Corr ModelPage 2: .
 java.lang.String identifyCorrModel()
           
 java.lang.String idsAsString()
           
 boolean isActiveModel()
           
 void listOfMessagesAsHtmlTable(java.lang.StringBuilder sBuilder, java.lang.String thisAlign)
          Display list of mapped messages in HTML format.
 java.lang.StringBuilder listOfMessagesAsStrBuffer()
           
 java.lang.String listOfMessagesAsString()
           
 boolean listOfMessagesIsEmpty()
           
 boolean modifySubarray(Subarray subarray, ca.nrc.widar.jaxb.vci.SubArray vciMessage, java.util.ArrayList<java.util.logging.LogRecord> logRecords)
          Parse modify subarray.
 boolean parseStationHw(ca.nrc.widar.jaxb.vci.StationHw msg, java.util.ArrayList<java.util.logging.LogRecord> inLogList)
          Parse element stationHw

If there is no such station, create and add a new station.

 boolean parseStationIO(ca.nrc.widar.jaxb.vci.SubArray subElem, Subarray sub, java.util.ArrayList<java.util.logging.LogRecord> logRecords)
          Create subarray: Parse stationInputOutput
 java.lang.StringBuilder printAllStations(boolean complete)
           
 java.lang.String printBaselinesAndProducts()
           
 java.lang.String printBlbDataStreams()
           
 java.lang.StringBuilder printBlbInputE2e(BaselineBoard blb)
           
 java.lang.String printBlbInputE2eForAll()
           
 java.lang.String printBlbInputWafer(XBarBoardOutputWafer blbInputWafer)
           
 java.lang.String printBlbInputWafers(boolean onlyIDs)
           
 void printBoardAddresses()
           
 void printChangedComponents()
           
 void printChangeIndicators(java.lang.String s)
           
 void printCorrModel(java.lang.String s)
          Print content of the CorrModel.
 void printCorrModelShort(java.lang.String s)
           
 java.lang.String printListOfActTriggers()
           
 java.lang.StringBuilder printListOfStations()
           
 java.lang.StringBuilder printListOfSubarrays()
           
 java.lang.StringBuilder printListOfSubarraysLong()
           
 java.lang.StringBuilder printListOfSubarraysShort()
           
 java.lang.StringBuilder printQuads()
           
 java.lang.String printRevokeInfo()
           
 void printUsedComponents()
           
 boolean removeStation(int aSid, java.util.ArrayList<java.util.logging.LogRecord> logList)
           
 void reportBlbStatusInHtmlFormat(java.lang.StringBuilder stringBuilder)
           
 java.lang.StringBuilder reportConfigChangeStatus()
           
 void reportStbStatusInHtmlFormat(java.lang.StringBuilder stringBuilder)
           
 void reportXbbStatusInHtmlFormat(java.lang.StringBuilder stringBuilder)
           
 void revokeConfiguration()
          Revoke transmitted configuration: 1.
 boolean revokeTransmittedCfg()
           
 void setActive(boolean a, long aTime)
           
 void setActTime(long time)
          Activation Time is passed as an argument when a new instance is created.
 void setActTimeAsString(java.lang.String s)
           
 void setBlbFirstForward(boolean b)
           
 void setCbeRejectedCfg(java.lang.String forConfigId)
           
 void setCreatedAt(long time)
           
 boolean setDefaultXBarBoardsToBlb(StationRack rack)
          Set Station Board to Baseline Board connections from Quads.
 void setDiscardThisModel(boolean b)
           
 void setLastSendCfgCompletedAt(long time)
           
 void setListOfActTriggers(java.util.List<ca.nrc.widar.jaxb.vci.ActivationTrigger> newList)
          Used for re-mapping, when we are re-applying previously received set of messages to a new "startFrom" model
 void setListOfMessages(java.util.List<java.lang.Object> newList)
           
 void setNewCorrModelForDifferentActTime(long actTime, CorrModel previousConfiguration)
           
 void setNewCorrModelForSameActTime(long actTime, CorrModel modelToBeReplaced)
           
 void setProductDestination(ca.nrc.widar.jaxb.cbe.NodeMaps nodeMaps)
           
 void setProductDestination(ca.nrc.widar.jaxb.cbe.ProductDestinations ppDest)
           
 void setRevokeTransmittedCfg(boolean b)
           
 void setStbFirstForward(boolean b)
           
 java.lang.String stRacksToString()
           
 java.lang.String toString()
           
 java.lang.String xBarBoardsInputToString()
           
 java.lang.String xBarBoardsOutputToString()
           
 java.lang.String xBarBoardsSetupToString()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NUM_QUADS

public static final int NUM_QUADS
See Also:
Constant Field Values

MIN_QUAD_ID

public static final int MIN_QUAD_ID
See Also:
Constant Field Values

MAX_QUAD_ID

public static final int MAX_QUAD_ID
See Also:
Constant Field Values

PAIRS_IN_QUAD

public static final int PAIRS_IN_QUAD
See Also:
Constant Field Values

MIN_BLB_PAIR_ID

public static final int MIN_BLB_PAIR_ID
See Also:
Constant Field Values

MAX_BLB_PAIR_ID

public static final int MAX_BLB_PAIR_ID
See Also:
Constant Field Values

MIN_EVLA_ST_RACK_ID

public static final int MIN_EVLA_ST_RACK_ID
See Also:
Constant Field Values

MAX_EVLA_ST_RACK_ID

public static final int MAX_EVLA_ST_RACK_ID
See Also:
Constant Field Values

MIN_EVLA_BL_RACK_ID

public static final int MIN_EVLA_BL_RACK_ID
See Also:
Constant Field Values

MAX_EVLA_BL_RACK_ID

public static final int MAX_EVLA_BL_RACK_ID
See Also:
Constant Field Values

EVLA_NUM_ST_RACKS

public static final int EVLA_NUM_ST_RACKS
See Also:
Constant Field Values

EVLA_NUM_BL_RACKS

public static final int EVLA_NUM_BL_RACKS
See Also:
Constant Field Values

HTML_HOME_PAGE

public static final int HTML_HOME_PAGE
See Also:
Constant Field Values

HTML_BOARD_STATUS_PAGE

public static final int HTML_BOARD_STATUS_PAGE
See Also:
Constant Field Values

HTML_SUBBAND_PAGE

public static final int HTML_SUBBAND_PAGE
See Also:
Constant Field Values
Constructor Detail

CorrModel

public CorrModel()
No arg-constructor. Not used by VCI CM code. Provided in the case that it is used for serialization, to initialize transient fields. Old comment. Probably irrelevant. We are not generating XML schema from this class: Default constructor added so that root element can be generated from this class. This constructor is never used by VciMapper code.


CorrModel

public CorrModel(long at)
          throws java.lang.Exception
Creates a correlator model based on predefined (default) configuration. Used only to create the first instance of the CorrModel. Every other instance is created as a copy of the previously created CorrModel.

Throws:
java.lang.Exception
Parameters:
at - - activation time specified as Long (the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT.)
Method Detail

getNextCorrModelId

public static long getNextCorrModelId()

dispose

public void dispose()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setDefaultXBarBoardsToBlb

public boolean setDefaultXBarBoardsToBlb(StationRack rack)
Set Station Board to Baseline Board connections from Quads. This is a simple, but not entirely correct approach; Quadrants are abstract entities, while X-bar Board to BLB Board connections are cables. Quadrants depend on X-Bar Board to Baseline Board connections, not vice versa. However, for now, we will take a shortcat and assume the default EVLA configuration.

Parameters:
rack - - Rack ID

getId

public long getId()
CorrModel ID has been introduced for debuging only. ID is assigned when an instance is created and cannot be changed.


getActTime

public long getActTime()

getXmlActTime

public javax.xml.datatype.XMLGregorianCalendar getXmlActTime()

getActTimeAsXmlString

public java.lang.String getActTimeAsXmlString()

getActTimeAsDisplayString

public java.lang.String getActTimeAsDisplayString()

getCreatedAt

public java.lang.String getCreatedAt()

getLastMsgTransmittedAt

public long getLastMsgTransmittedAt()

listOfMessagesIsEmpty

public boolean listOfMessagesIsEmpty()

getListOfVciMessages

public java.util.List<java.lang.Object> getListOfVciMessages()

setListOfMessages

public void setListOfMessages(java.util.List<java.lang.Object> newList)

getSubarrayCbeDeconfigList

public java.util.List<SubarrayDeconfig> getSubarrayCbeDeconfigList()

addCbeDeconfig

public void addCbeDeconfig(SubarrayDeconfig sd)

copyListOfMessages

public java.util.List<java.lang.Object> copyListOfMessages()
Create a copy of the list of mapped messages. Used when a CorrModel with the same activation time already exists in the activation queue. CM creates a copy of the existing CorrModel and applies new message(s) to the copy. Must create a new instance of the list, so that the list that belongs to the 'old' model is not altered. If the mapping for additional messages fails, new CorrModel can be discarded while 'old' model stays in the actQueue. If the mapping fails, 'old' CorrModel should not be affected.


addVciMessage

public void addVciMessage(java.lang.Object msg)

discardVciMessageCreateSubarray

public boolean discardVciMessageCreateSubarray(java.lang.String configId)

hasVciMessageCreateSubarray

public boolean hasVciMessageCreateSubarray(java.lang.String configId)

forwardedConfiguration

public boolean forwardedConfiguration()
June 2011 SV: not sure if this indicator can be used to determine whether revoke should be performed.


discardThisModel

public boolean discardThisModel()

setDiscardThisModel

public void setDiscardThisModel(boolean b)

revokeTransmittedCfg

public boolean revokeTransmittedCfg()

setRevokeTransmittedCfg

public void setRevokeTransmittedCfg(boolean b)

decrementDiscardCounter

public void decrementDiscardCounter()

isActiveModel

public boolean isActiveModel()

activeCorrModelSince

public long activeCorrModelSince()

getActString

public java.lang.String getActString()

setActive

public void setActive(boolean a,
                      long aTime)

getStation

public Station getStation(int i)

getSubarray

public Subarray getSubarray(java.lang.String id)

hasSubarray

public boolean hasSubarray(java.lang.String id)

getListOfSubarrays

public java.util.List<Subarray> getListOfSubarrays()

getRack

public Rack getRack(int inId)

getStationBoard

public StationBoard getStationBoard(Mlid mlid)
                             throws ca.nrc.widar.vciMapper.VciMapperException
Throws:
ca.nrc.widar.vciMapper.VciMapperException

getStationBoard

public StationBoard getStationBoard(int rackId,
                                    int crateId,
                                    int slotId)
                             throws ca.nrc.widar.vciMapper.VciMapperException
Throws:
ca.nrc.widar.vciMapper.VciMapperException

getBaselineBoard

public BaselineBoard getBaselineBoard(Mlid mlid)
                               throws ca.nrc.widar.vciMapper.VciMapperException
Throws:
ca.nrc.widar.vciMapper.VciMapperException

getBlbFromQuad

public BaselineBoard getBlbFromQuad(int qid,
                                    int pid,
                                    int index)
                             throws ca.nrc.widar.vciMapper.VciMapperException
Throws:
ca.nrc.widar.vciMapper.VciMapperException

getBaselineBoard

public BaselineBoard getBaselineBoard(int r,
                                      int c,
                                      int s)
                               throws ca.nrc.widar.vciMapper.VciMapperException
Throws:
ca.nrc.widar.vciMapper.VciMapperException

setActTime

public void setActTime(long time)
Activation Time is passed as an argument when a new instance is created. If activation Time is not specified, use the current system time (rounded up to next second) as activation time.

This method should be used only when a new instance of a CorrModel is created as a copy. (It is still to be determined whether user will be able to change the activation time after the mapping has been performed. Probably not!)

Activation time change would require the following:

-create a new instance of the CorrModel, based on the model which will be active at new activation time.

-starting from the beginning of the list, remove from the list of messages all the messages with the same activation ID and add them to the new CorrModel

-add CorrModel with the new activation time to the activation queue.

-if the list of configuration messages in the old model is not empty, create a new instance of the CorrModel, based on the CorrModel which will be active at activation time, and, starting from the beginning of the list, remove one by one the configuration messages and add them to the new instance.

-in the activation queue, replace the old CorrModel with the new one.

Parameters:
time - - long (the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT.)

setActTimeAsString

public void setActTimeAsString(java.lang.String s)

setCreatedAt

public void setCreatedAt(long time)

setLastSendCfgCompletedAt

public void setLastSendCfgCompletedAt(long time)

setStbFirstForward

public void setStbFirstForward(boolean b)
Parameters:
boolean - - if true, next time when an attempt is made to forward (send) configuration to CMIBs act as if this is the first time to make such attempt. That's done when:

a) CorrModel becomes the first element in the Activation Queue

b) CorrModel becomes the active configuration.


setBlbFirstForward

public void setBlbFirstForward(boolean b)

addToListOfActTriggers

public void addToListOfActTriggers(ca.nrc.widar.jaxb.vci.ActivationTrigger actTrig)

getListOfActTriggers

public java.util.List<ca.nrc.widar.jaxb.vci.ActivationTrigger> getListOfActTriggers()

copyListOfActTriggers

public java.util.List<ca.nrc.widar.jaxb.vci.ActivationTrigger> copyListOfActTriggers()
Used when VCI messages are received for the activation time which already exists in the actQueue. If that is the case CM creates a copy of the existing CorrModel, applies the mapping to the copy and only if configuration is accepted replaces old version of CorrModel with the new one. That way, if mapping for the new messages fails, previously received configuration is not affected.


clearListOfActTriggers

public void clearListOfActTriggers()

setListOfActTriggers

public void setListOfActTriggers(java.util.List<ca.nrc.widar.jaxb.vci.ActivationTrigger> newList)
Used for re-mapping, when we are re-applying previously received set of messages to a new "startFrom" model


printListOfActTriggers

public java.lang.String printListOfActTriggers()

idsAsString

public java.lang.String idsAsString()

copySubarrayCbeConfigStatus

public void copySubarrayCbeConfigStatus(CorrModel model)
This method is called when a new CorrModel is created as a copy of the previous CorrModel. New model should 'point' to the same SubarrayCbeConfig, so that it has access to changes. (status can change after model is created and before it becomes active).

Parameters:
model - - CorrModel. This instance of the CorrModel was created as a copy of the 'model'.

copySubarayCbeDeconfigStatus

public void copySubarayCbeDeconfigStatus(CorrModel model,
                                         boolean sameActTime)

parseStationHw

public boolean parseStationHw(ca.nrc.widar.jaxb.vci.StationHw msg,
                              java.util.ArrayList<java.util.logging.LogRecord> inLogList)
                       throws ca.nrc.widar.vciMapper.VciMapperException
Parse element stationHw

If there is no such station, create and add a new station.

If a station with the specified ID already exists, does it belong to a subarray:

- if yes, can not change configuration, generate vciNack

- if not, update the configuration.

When adding a new Station Board to the station, verify that the Station Board does not alredy belong to another station.

Throws:
VciMapperException - - if station can not be configured as specified.
Parameters:
msg - - JAXB generated class StationHw
Returns:
boolean - Returns true if statioHw was successfully parsed and added to the CorrModel. vciAck should be sent back to the originator. Returns FALSE if the station can not be added to the CorrModel as specified.

createSubarray

public boolean createSubarray(ca.nrc.widar.jaxb.vci.SubArray subElem,
                              java.util.ArrayList<java.util.logging.LogRecord> logRecords)
Parse VCI message and configure subarray If successful, add new subarray to the list of subarrays.


parseStationIO

public boolean parseStationIO(ca.nrc.widar.jaxb.vci.SubArray subElem,
                              Subarray sub,
                              java.util.ArrayList<java.util.logging.LogRecord> logRecords)
Create subarray: Parse stationInputOutput


setProductDestination

public void setProductDestination(ca.nrc.widar.jaxb.cbe.NodeMaps nodeMaps)

setProductDestination

public void setProductDestination(ca.nrc.widar.jaxb.cbe.ProductDestinations ppDest)

setCbeRejectedCfg

public void setCbeRejectedCfg(java.lang.String forConfigId)

findProductsInSubarray

public java.util.List<ca.nrc.widar.jaxb.cbe.Map> findProductsInSubarray(Subarray subarray,
                                                                        java.util.List<ca.nrc.widar.jaxb.cbe.Map> productsToConfigure)

calculatePacketDelayForVdif

public void calculatePacketDelayForVdif()
Since:
2012-05-29 Calculate VDIF packet delay for active VDIF streams. Algorithm uses VDIF counter to generate different delay for each stream. VDIF delay may be specified in VCI message, if that is the case use the value specified by the user.

modifySubarray

public boolean modifySubarray(Subarray subarray,
                              ca.nrc.widar.jaxb.vci.SubArray vciMessage,
                              java.util.ArrayList<java.util.logging.LogRecord> logRecords)
Parse modify subarray.


deleteSubarray

public boolean deleteSubarray(Subarray sub,
                              ca.nrc.widar.jaxb.vci.SubArray vciMessage,
                              java.lang.String actID,
                              boolean removeFromList,
                              java.util.ArrayList<java.util.logging.LogRecord> logRecords)

forwardConfiguration

public boolean forwardConfiguration(java.util.ArrayList<java.util.logging.LogRecord> listOfLogs)
Send configuration to Station Boards, X-Bar Switches and Baseline Boards that are affected by the configuration change (i.e. where configChange=Change). 'block frames in LTA' when CBE configuration/deconfiguration fails. This method could still be simplified and cleaned, esp. boolean indicators that are not used could be removed.

Parameters:
listOfLogs - - Logrecords generated here are added to the list.
Returns:
boolean - true if a report should be generated and transmitted to a well-known multicast address

deleteSubarray

public boolean deleteSubarray(java.lang.String configId)

createAndSendCbeDeconfig

public void createAndSendCbeDeconfig(SubarrayDeconfig subDeconfig,
                                     java.util.ArrayList<java.util.logging.LogRecord> listOfLogs)
Create and send XML message widarCbe - deconfig.


revokeConfiguration

public void revokeConfiguration()
Revoke transmitted configuration: 1. Send de-config to CBE (with the same activation time as previously transmitted config). 2. Remove configuration from CMIB queue (Station Boards and Baseline Boards). 3. Set this.discardThisModel = true;


createStationBoards

public boolean createStationBoards(int numStbs)
                            throws ca.nrc.widar.vciMapper.VciMapperException,
                                   java.io.IOException
Create the specified number of Station Boards. This method creates the specified number of Station Boards. Station Boards are "placed" in racks starting from the Rack 001, Crate 0, Slot 0. In the normal operational mode this method will not be used.

Throws:
ca.nrc.widar.vciMapper.VciMapperException
java.io.IOException
Parameters:
numStbs - - Number of Station Boards in the correlator

createBaselineBoards

public boolean createBaselineBoards(int numBlbs)
                             throws ca.nrc.widar.vciMapper.VciMapperException
This method creates a specified number of Baseline Boards. Station Boards are "placed" in racks starting from the Rack 101, Crate 0, Slot 0.

Throws:
ca.nrc.widar.vciMapper.VciMapperException
Parameters:
numBlbs - - Number of Baseline Boards in the correlator

addStRack

public StationRack addStRack(int aRackId)
                      throws ca.nrc.widar.vciMapper.VciMapperException,
                             java.io.IOException
Create an empty Station Board rack, add it to the list stbRackList and return a reference to the newly created rack.

Throws:
ca.nrc.widar.vciMapper.VciMapperException
java.io.IOException

addBlRack

public Rack addBlRack(int aRackId)
               throws ca.nrc.widar.vciMapper.VciMapperException
Create an empty Baseline rack, add it to the list blbRackList and return a reference to the newly created rack.

Throws:
ca.nrc.widar.vciMapper.VciMapperException

removeStation

public boolean removeStation(int aSid,
                             java.util.ArrayList<java.util.logging.LogRecord> logList)

reportConfigChangeStatus

public java.lang.StringBuilder reportConfigChangeStatus()

reportStbStatusInHtmlFormat

public void reportStbStatusInHtmlFormat(java.lang.StringBuilder stringBuilder)

reportBlbStatusInHtmlFormat

public void reportBlbStatusInHtmlFormat(java.lang.StringBuilder stringBuilder)

reportXbbStatusInHtmlFormat

public void reportXbbStatusInHtmlFormat(java.lang.StringBuilder stringBuilder)

getStbConfigChangeStatus

public java.lang.String getStbConfigChangeStatus()
Check all the Baseline Boards and derive overall configuration change status.


getBlbConfigChangeStatus

public java.lang.String getBlbConfigChangeStatus()
Check all the Baseline Boards and derive overall configuration change status.


flushCmibQueues

public boolean flushCmibQueues()
Flush input queue for the CMIBs affected by this CorModel. This method is called when deleting (discarding) the CorrModel when the configuration was already forwarded to CMIBs. Station Boards: check if there is configuration change and if it was transmitted and flush the CMIB queue. Baseline Boards: check if there is configuration change and if it was transmitted and flush the CMIB queue. Cross-Bar board configuration is sent via Station Board, flush STB queue will discard x-bar switch configuration. Notice: Cross-Bar board configuration should be transmitted only via Station Board which is already affected by the configuration change ! See method StationRack.sendCfgToXBarSwitchesAsOne() SV 21/06/2010 This method is NOT complete !!!! It should: Flush CBE queue Return report (see sBuilder).


printChangedComponents

public void printChangedComponents()

printUsedComponents

public void printUsedComponents()

printBoardAddresses

public void printBoardAddresses()

identifyCorrModel

public java.lang.String identifyCorrModel()

printRevokeInfo

public java.lang.String printRevokeInfo()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

printCorrModel

public void printCorrModel(java.lang.String s)
Print content of the CorrModel.


printCorrModelShort

public void printCorrModelShort(java.lang.String s)

getHtmlHeaderNew

public void getHtmlHeaderNew(java.lang.StringBuilder sBuilder,
                             java.lang.String page)
Display CorrModel in HTML format


getHtmlHeaderWithCfgStatusTable

public void getHtmlHeaderWithCfgStatusTable(java.lang.StringBuilder sBuilder,
                                            java.lang.String page)
Display CorrModel in HTML format: getHtmlHeaderWithCfgStatusTable


getCfgStatusAndDurationReportAsHtmlTable

public void getCfgStatusAndDurationReportAsHtmlTable(java.lang.StringBuilder sBuilder)
Display 'Configuration Report' for subarray in HTML format.


getCorrModelInHtmlFormat

public void getCorrModelInHtmlFormat(java.lang.StringBuilder sBuilder,
                                     int page,
                                     java.lang.String thisAlign)
This method is used to display the list of subarrays on Home Page, HTML_BOARD_STATUS_PAGE and HTML_SUBBAND_PAGE


displayListOfStations

public java.lang.StringBuilder displayListOfStations(java.lang.String thisAlign)

getStationsAsHtmlTable

public void getStationsAsHtmlTable(java.lang.StringBuilder sBuilder)
Displays StationRacks/Stations as table Replaced method displayListOfStations. Created by: Sonja.Vrcic@nrc.gc.ca


displayListOfSubarraysForHomePage

public void displayListOfSubarraysForHomePage(java.lang.StringBuilder sBuilder,
                                              java.lang.String thisAlign)

htmlListOfSubarraysWithBoardStatus

public void htmlListOfSubarraysWithBoardStatus(java.lang.StringBuilder sBuilder,
                                               java.lang.String thisAlign)
Display list of subarray for Corr ModelPage 2: . - stations as table - statons - list of Station Boards - BLBs as table - Basebands/subbands with list of used BLBs.


htmlListOfSubarraysWithSubbands

public void htmlListOfSubarraysWithSubbands(java.lang.StringBuilder sBuilder)
Display list of subarray for Corr ModelPage 2: . - stations as table - statons - list of Station Boards - BLBs as table - Basebands/subbands with list of used BLBs.


listOfMessagesAsHtmlTable

public void listOfMessagesAsHtmlTable(java.lang.StringBuilder sBuilder,
                                      java.lang.String thisAlign)
Display list of mapped messages in HTML format. Formated as table.


displayListOfActTriggers

public java.lang.String displayListOfActTriggers(java.lang.String thisAlign)
activationTrigger is displayed in the table of Mapped Messages


displayVciMessage

public java.lang.String displayVciMessage(int index)

getCorrModelStrBuilder

public void getCorrModelStrBuilder(java.lang.StringBuilder sBuf)

getListOfStations

public java.util.ArrayList<java.lang.String> getListOfStations()

printListOfStations

public java.lang.StringBuilder printListOfStations()

printAllStations

public java.lang.StringBuilder printAllStations(boolean complete)

getActiveSubarrays

public java.util.ArrayList<java.lang.String> getActiveSubarrays()

printListOfSubarraysShort

public java.lang.StringBuilder printListOfSubarraysShort()

printListOfSubarrays

public java.lang.StringBuilder printListOfSubarrays()

printListOfSubarraysLong

public java.lang.StringBuilder printListOfSubarraysLong()

listOfMessagesAsString

public java.lang.String listOfMessagesAsString()

listOfMessagesAsStrBuffer

public java.lang.StringBuilder listOfMessagesAsStrBuffer()

printQuads

public java.lang.StringBuilder printQuads()

xBarBoardsOutputToString

public java.lang.String xBarBoardsOutputToString()

xBarBoardsInputToString

public java.lang.String xBarBoardsInputToString()

xBarBoardsSetupToString

public java.lang.String xBarBoardsSetupToString()

stRacksToString

public java.lang.String stRacksToString()

blRacksToString

public java.lang.String blRacksToString()

printBlbInputWafers

public java.lang.String printBlbInputWafers(boolean onlyIDs)

printBlbDataStreams

public java.lang.String printBlbDataStreams()

printBlbInputE2e

public java.lang.StringBuilder printBlbInputE2e(BaselineBoard blb)

printBlbInputE2eForAll

public java.lang.String printBlbInputE2eForAll()

printBlbInputWafer

public java.lang.String printBlbInputWafer(XBarBoardOutputWafer blbInputWafer)

printBaselinesAndProducts

public java.lang.String printBaselinesAndProducts()

setNewCorrModelForDifferentActTime

public void setNewCorrModelForDifferentActTime(long actTime,
                                               CorrModel previousConfiguration)

setNewCorrModelForSameActTime

public void setNewCorrModelForSameActTime(long actTime,
                                          CorrModel modelToBeReplaced)

configChangeDeepChange

public void configChangeDeepChange(boolean newConfigChange,
                                   ca.nrc.widar.vciMapper.ConfigChangeStatus newConfigChangeStatus)
Unconditional status change. Change configChange for all the objects owned by the CorrModel. Used when creating a new CorrModel from the previous CorrModel.

Parameters:
newConfigChange - - new value for configChange: true or false
newConfigChangeStatus - - new value for configChangeStatus

carryForwardChangeToBeTransmitted

public void carryForwardChangeToBeTransmitted(CorrModel prevConfiguration)
This method is called just before (or after) CorrModel becomes active. Configuration changes that were not transmitted must be 'carried forward'. If there is no change from the previous CorrModel and in the previous CorrModel there is configuration change that was not transmitted set indicators so that change gets transmitted (when transmitting configuration for this CorrModel).

Parameters:
prevConfiguration - - CorrModel for earlier activation time.

printChangeIndicators

public void printChangeIndicators(java.lang.String s)

getCmStatusSubarrays

public ca.nrc.widar.jaxb.cmStatus.CmStatus getCmStatusSubarrays()

NRAO/DRAO

National Radio Astronomy Observatory