All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CDF.Crate

java.lang.Object
   |
   +----CDF.CrateVme.CrateClient
           |
           +----CDF.Crate

public class Crate
extends CrateClient
Class which encapsulates all knowledge of a VME crate, including the server id and the boards present. Contains the code to read in this configuration from a file and save it.


Variable Index

 o baseAddr
Matrix of Base Addresses, indexed by (type) x (ith occurance).
 o board
Array of Boards, indexed by Slot
 o commandGroup
 o config
Matrix of cfgFiles, indexed by (type) x (ith occurance).
 o crateClass
 o crateNum
Crate Number
 o id
Matrix of ID strings, indexed by (type) x (ith occurance).
 o idServer
MVME Parameter
 o location
MVME Parameter
 o n
Array of numbers of modules, indexed by module type
 o pinger
 o serverName
MVME Parameter
 o slot
Matrix of Slot numbers, indexed by (type) x (ith occurance).

Constructor Index

 o Crate()
Null Constructor for EditConfig
 o Crate(int)
Constructor for running w/o connection to any Crates
 o Crate(int, String)
Crate Constructor with connections to VME

Method Index

 o baseAddr()
Returns the base Address array
 o baseAddr(int, int)
Return the base address of a given board in the crate
Ex.
 o commandGroup()
 o configFile()
Return the config file array for this crate
 o configFile(int, int)
Return the config file of a given board in the crate
Ex.
 o crateClass()
 o createBoards(boolean)
Creates Board Objects and fills board[] array.
 o createCrate(int, String, String)
 o getCrateClass(String)
Reads the server name from a crate file
 o getDir(String)
 o getNext(int, int)
Return the next slot number of a given board in the crate
 o getPrev(int, int)
Return the previous slot number of a given board in the crate
 o getServerName(String)
Reads the server name from a crate file
 o id()
Returns the id Array for this crate
 o id(int, int)
Return the id of a given board in the crate.
 o idServer()
Get the server ID
 o init(int)
Opens the crate
 o n()
Get the number of boards array
 o n(int)
Get the number of a given type of modules in the crate.
 o ping()
 o readCrateConfig(String)
Read the Crate configuration from a file.
 o serverLocation()
Get the server location
 o serverName()
Get the server name
 o setBaseAddr(int[][])
Sets the baseAddr[][] array (Not Recommended!)
 o setCommandGroup(int)
 o setConfigFile(String[][])
Sets the configFile array (Not recommended!)
 o setCrateClass(String)
 o setID(String[][])
Copies the input into the id array.
 o setIDServer(String)
 o setN(int[])
Sets the number array - Not recommended!
 o setPingerVisible(boolean)
 o setServerLocation(String)
Sets the server Location (Not recommended!)
 o setServerName(String)
Sets the serverName (Not recommended!)
 o setSlot(int[][])
Sets the slot Array -- Not recommended!
 o slot()
Return the slot numbner array
 o slot(int, int)
Return the slot number of a given board in the crate.
 o timerPing()
 o toString()
 o updateServer2Crate(int, String)
Fills in the CDFcfg.server2crate Hashtable
 o writeCrateConfig(String)
Write the Crate configuration to a file

Variables

 o location
 protected String location
MVME Parameter

 o serverName
 protected String serverName
MVME Parameter

 o idServer
 protected String idServer
MVME Parameter

 o n
 protected int n[]
Array of numbers of modules, indexed by module type

See Also:
n, n
 o slot
 protected int slot[][]
Matrix of Slot numbers, indexed by (type) x (ith occurance).

See Also:
slot, slot
 o id
 protected String id[][]
Matrix of ID strings, indexed by (type) x (ith occurance).

See Also:
id, id
 o config
 protected String config[][]
Matrix of cfgFiles, indexed by (type) x (ith occurance).

See Also:
configFile, configFile
 o baseAddr
 protected int baseAddr[][]
Matrix of Base Addresses, indexed by (type) x (ith occurance).

See Also:
baseAddr, baseAddr
 o board
 public Board board[]
Array of Boards, indexed by Slot

 o crateClass
 protected String crateClass
 o commandGroup
 protected int commandGroup
 o crateNum
 protected int crateNum
Crate Number

 o pinger
 protected static Crate. CratePinger pinger

Constructors

 o Crate
 public Crate()
Null Constructor for EditConfig

 o Crate
 public Crate(int crNum)
Constructor for running w/o connection to any Crates

Parameters:
crNum - The crate number
 o Crate
 public Crate(int crNum,
              String sName) throws InvalidName
Crate Constructor with connections to VME

Parameters:
crNum - The crate number in the system
sName - The IP name of the crate CPU

Methods

 o updateServer2Crate
 public void updateServer2Crate(int cr,
                                String name)
Fills in the CDFcfg.server2crate Hashtable

Parameters:
cr - Crate Number
name - Server Name
 o getServerName
 public static String getServerName(String filename)
Reads the server name from a crate file

Parameters:
filename - The file to read
 o getCrateClass
 public static String getCrateClass(String filename)
Reads the server name from a crate file

Parameters:
filename - The file to read
 o readCrateConfig
 public boolean readCrateConfig(String filename)
Read the Crate configuration from a file.

Parameters:
filename - The name of the file to read from
 o init
 public void init(int cnum)
Opens the crate

 o createCrate
 public static Crate createCrate(int iCrate,
                                 String className,
                                 String serverName)
 o createBoards
 public void createBoards(boolean openConnection)
Creates Board Objects and fills board[] array.
Calls Board Constructors by Reflection with different arguements:
VME : (String ConfigFile, int CrateNum, int SlotNum, int BaseAddr)
JAVA ONLY: (String ConfigFile, int CrateNum, int SlotNum)

Parameters:
openConnection - ==true -> Make connections to VME.
 o writeCrateConfig
 public boolean writeCrateConfig(String filename)
Write the Crate configuration to a file

Parameters:
filename - The name of the file to write
Returns:
== true -> written OK
 o n
 public int[] n()
Get the number of boards array

Returns:
Array of board type counters
 o n
 public int n(int type)
Get the number of a given type of modules in the crate.
Ex. # of Vrbs = crate.n[Vrb.type];

Parameters:
type - The type of board to count
Returns:
number of Boards of type type in this crate
 o setN
 public void setN(int nVar[])
Sets the number array - Not recommended!

Parameters:
nVar - values for the board counter array
 o slot
 public int[][] slot()
Return the slot numbner array

Returns:
Slot array for this crate
 o slot
 public int slot(int type,
                 int idx)
Return the slot number of a given board in the crate.
Ex. Crate.slot[Vrb.type][2]; returns the slot of the 3rd Vrb board

Parameters:
type - The type of board
idx - The index (not id) of the board in the crate
Returns:
Slot of requested board
 o setSlot
 public void setSlot(int slotVar[][])
Sets the slot Array -- Not recommended!

Parameters:
slotVar - Double index array to set Slot array to
 o id
 public String[][] id()
Returns the id Array for this crate

Returns:
id array
 o id
 public String id(int type,
                  int idx)
Return the id of a given board in the crate.
Ex. Crate.id[Vrb.type][2]; returns the id of the 3rd Vrb board

Parameters:
type - The type of board
idx - The index (not id) of the board in the crate
Returns:
String id of the board (not the identifier()...)
 o setID
 public void setID(String idVar[][])
Copies the input into the id array.

Parameters:
idVar - values for the id array Not Recommended, doesn;t look like it works...
 o configFile
 public String[][] configFile()
Return the config file array for this crate

Returns:
configFile[][] array
 o configFile
 public String configFile(int type,
                          int idx)
Return the config file of a given board in the crate
Ex. Crate.configFile[Vrb.type][2]; returns the config file of the 3rd Vrb board

Parameters:
type - The type of board
idx - The index (not id) of the board in the crate
Returns:
configFile of requested board
 o setConfigFile
 public void setConfigFile(String configVar[][])
Sets the configFile array (Not recommended!)

Parameters:
configVar - Values for the configFile Array
 o baseAddr
 public int[][] baseAddr()
Returns the base Address array

Returns:
baseAddr[][] array
 o baseAddr
 public int baseAddr(int type,
                     int idx)
Return the base address of a given board in the crate
Ex. Crate.baseAddr[Vrb.type][2]; returns the base address of the 3rd Vrb board

Parameters:
type - The type of board
idx - The index (not id) of the board in the crate
Returns:
BaseAddr
 o setBaseAddr
 public void setBaseAddr(int baseAddrVar[][])
Sets the baseAddr[][] array (Not Recommended!)

Parameters:
baseAddrVar - values to set the array to
 o serverLocation
 public String serverLocation()
Get the server location

Returns:
s the Location of the server
 o setServerLocation
 public void setServerLocation(String loc)
Sets the server Location (Not recommended!)

Parameters:
loc - value for the location
 o serverName
 public String serverName()
Get the server name

Returns:
s the serverName for this crate
 o setServerName
 public void setServerName(String sName)
Sets the serverName (Not recommended!)

Parameters:
sName - value for the Server name
 o idServer
 public String idServer()
Get the server ID

 o setIDServer
 public void setIDServer(String idSer)
 o crateClass
 public String crateClass()
 o commandGroup
 public int commandGroup()
 o setCrateClass
 public void setCrateClass(String ccls)
 o setCommandGroup
 public void setCommandGroup(int cmdGrp)
 o getNext
 public int getNext(int type,
                    int slotNow)
Return the next slot number of a given board in the crate

Parameters:
type - The type of board
idx - The index (not id) of the board in the crate
Returns:
slot number of next Board in crate
 o getPrev
 public int getPrev(int type,
                    int slotNow)
Return the previous slot number of a given board in the crate

Parameters:
type - The type of board
idx - The index (not id) of the board in the crate
Returns:
slot number of next Board in crate
 o getDir
 public String[] getDir(String dirName)
 o ping
 public void ping()
Overrides:
ping in class CrateClient
 o timerPing
 public long timerPing()
 o toString
 public String toString()
Overrides:
toString in class Object
 o setPingerVisible
 public void setPingerVisible(boolean vis)

All Packages  Class Hierarchy  This Package  Previous  Next  Index