SpdHalfStave Class Reference

class to manage a halstave More...

#include <SpdHalfStave.h>

Inheritance diagram for SpdHalfStave:

Inheritance graph
[legend]
Collaboration diagram for SpdHalfStave:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SpdHalfStave (unsigned chNumb, VMEAccess *VME)
 constructor of the class
 ~SpdHalfStave (void)
void setChipSelected (UInt32 value)
 sets te internal ChipSelected
UInt32 getChipSelected ()
 gets the internal chip selected
double getTempBus ()
 method to read the bus temperature
double getTempMCM ()
 method to read the MCM temperature
UInt8 getChActStatus ()
 getter for the activation status of this channel
void setChActStatus (UInt8 actStatus)
 setter for the activation status of this channel
unsigned getChannelNumber ()
UInt32 LoadHSPixelAllDAC (UInt8 *DACVect=NULL)
 Sets all pixel dacs (10*44) in the hardware, if it is NULL will set the default values.
UInt32 LoadHSPixelDAC (UInt32 ChipSel, UInt8 DACn, UInt8 DACValue)
 Sets only one dac in the hardware.
UInt32 LoadHSPixelDAC (UInt32 ChipSel, UInt8 DACn, UInt8 *DACValue, bool all=false)
UInt32 ReadHSPixelDAC (UInt8 DACn, UInt32 *DACOutVect)
 Reads the pixel dacs for one channel.
UInt32 LoadHSPixelMatrix (UInt32 ChipSel, UInt32 *matrix, bool RptFirstMatrix, bool Tp)
 Sets the pixel matrix in one pixel chip.
UInt32 LoadHSPixelMatrixDefault (bool Tp=false)
 will load the matrix stored in the defaul settings class
UInt32 setAnalogPilotDAC (unsigned dacNumber, UInt8 dacValue)
UInt32 LoadHSApiDAC (UInt8 *DACVect=NULL)
UInt32 ReadHSApiDAC (UInt8 *DACVect)
 reads the analop pilot settings from the hardware
UInt32 ReadHSApiADC (UInt32 *ADCVect)
 reads the API adcs
UInt32 LoadHSDpiConfReg (UInt32 *DPIVect=NULL)
 sets the digital pilot settings, if the input array is NUUL it will set the default values
UInt32 ReadHSDpiConfReg (UInt32 *DpiVector)
 reads the digital pilot settings
UInt32 LoadHSDpiInternalReg (UInt32 *RegOutVect, UInt32 *DPIVect=NULL)
 sets the digital pilot internal settings
UInt32 LoadHSApiDACCompare (UInt8 *DACVect=NULL)
 writes the analog pilot values, reads back and comprares
UInt32 LoadHSDpiConfRegCompare (UInt32 *DPIVect=NULL)
 writes the digital pilot settings, reads back and compares
void refreshTemperatures ()
 function to refresh the temperatures of one hs
void writeDiffToDB (int id, int db_ver)
void getDiffCount (unsigned &mcmDiff, unsigned &dacDiff, unsigned &noisyDiff)
UInt32 jtagReset ()
int configureDefault (bool jtagReset=true, bool digitalPilot=true, bool analogPilot=true, bool pixdacs=true)
void resetJtagController ()

Private Member Functions

void writeDiffValueToDB (int id, int spd_ver, unsigned chip, std::string config_type, std::string data_default, std::string data_actual)
 writes one difference value into the database

Private Attributes

bool isConfigured
 member varaiable that keeps track if the detector is configured or not
spdLoggerlogger
unsigned chNumber
 Member to store the channel number.
double tempBus
 data member connected to the DIM service for the BUS temperature
double tempMcm
 data member connected to the DIM service for the MCM temperature
DimService * serviceTempBus
 DIM service for the BUS temperature.
DimService * serviceTempMcm
 DIM service for the MCM temperature.
VMEAccessVME
 VME access for the configuration,.
UInt32 chipSelect
 data member for the chip selected might be useful for compatibility with the old code
UInt8 activationStatus
 internal method to keep track of the activation status for this channel;


Detailed Description

class to manage a halstave

class to manage a halstave this class will try to implement a better aproach: it will not just have data members for the configuration but also access the vme bus to configure the halfstave


Constructor & Destructor Documentation

SpdHalfStave::SpdHalfStave ( unsigned  chNumb,
VMEAccess VME 
)

constructor of the class

SpdHalfStave::~SpdHalfStave ( void   ) 


Member Function Documentation

void SpdHalfStave::writeDiffValueToDB ( int  id,
int  spd_ver,
unsigned  chip,
std::string  config_type,
std::string  data_default,
std::string  data_actual 
) [private]

writes one difference value into the database

void SpdHalfStave::setChipSelected ( UInt32  value  )  [inline]

sets te internal ChipSelected

UInt32 SpdHalfStave::getChipSelected (  )  [inline]

gets the internal chip selected

double SpdHalfStave::getTempBus (  )  [inline]

method to read the bus temperature

double SpdHalfStave::getTempMCM (  )  [inline]

method to read the MCM temperature

UInt8 SpdHalfStave::getChActStatus (  )  [inline]

getter for the activation status of this channel

void SpdHalfStave::setChActStatus ( UInt8  actStatus  )  [inline]

setter for the activation status of this channel

unsigned SpdHalfStave::getChannelNumber (  )  [inline]

UInt32 SpdHalfStave::LoadHSPixelAllDAC ( UInt8 DACVect = NULL  ) 

Sets all pixel dacs (10*44) in the hardware, if it is NULL will set the default values.

Parameters:
dac vector 440 bytes
Returns:
status of the vme access

UInt32 SpdHalfStave::LoadHSPixelDAC ( UInt32  ChipSel,
UInt8  DACn,
UInt8  DACValue 
) [inline]

Sets only one dac in the hardware.

It will return the decoded read dac value from the jtag command in the DACOutVect if this is different from NULL

Parameters:
chip selected: 10 bit defining which chips to change, dac number: identifying the dac, DACValue: the DACValues to set, DACOutVect: the array containing the read values this needs to be a 10 UInt8 array

UInt32 SpdHalfStave::LoadHSPixelDAC ( UInt32  ChipSel,
UInt8  DACn,
UInt8 DACValue,
bool  all = false 
)

UInt32 SpdHalfStave::ReadHSPixelDAC ( UInt8  DACn,
UInt32 DACOutVect 
)

Reads the pixel dacs for one channel.

returns in DACOutVect the pixel 10 dacs values for one dac number

Parameters:
DACn - dac number to read (0..43)
DACOutVect,array were the 10 dac values will be written

UInt32 SpdHalfStave::LoadHSPixelMatrix ( UInt32  ChipSel,
UInt32 matrix,
bool  RptFirstMatrix,
bool  Tp 
)

Sets the pixel matrix in one pixel chip.

Parameters:
chip selected: 10 bit defining which chips to change, dac number: integer identifying the dac, matrix: the matrix to be set 256*32 bits (jtag format) RptFirstMatrix: boolean telling if we want to repeat the first matrix to all chips

UInt32 SpdHalfStave::LoadHSPixelMatrixDefault ( bool  Tp = false  ) 

will load the matrix stored in the defaul settings class

UInt32 SpdHalfStave::setAnalogPilotDAC ( unsigned  dacNumber,
UInt8  dacValue 
)

sets the analog pilot setting to the hardware

Parameters:
analog pilot dac vector, if null it will set the values from the default class 0: Dac Ref High 1: Dac ref mid 2: Gtl Ref A 3: gtl ref D 4: test high 5: test low

UInt32 SpdHalfStave::LoadHSApiDAC ( UInt8 DACVect = NULL  ) 

UInt32 SpdHalfStave::ReadHSApiDAC ( UInt8 DACVect  ) 

reads the analop pilot settings from the hardware

UInt32 SpdHalfStave::ReadHSApiADC ( UInt32 ADCVect  ) 

reads the API adcs

UInt32 SpdHalfStave::LoadHSDpiConfReg ( UInt32 DPIVect = NULL  ) 

sets the digital pilot settings, if the input array is NUUL it will set the default values

UInt32 SpdHalfStave::ReadHSDpiConfReg ( UInt32 DpiVector  ) 

reads the digital pilot settings

UInt32 SpdHalfStave::LoadHSDpiInternalReg ( UInt32 RegOutVect,
UInt32 DPIVect = NULL 
)

sets the digital pilot internal settings

UInt32 SpdHalfStave::LoadHSApiDACCompare ( UInt8 DACVect = NULL  ) 

writes the analog pilot values, reads back and comprares

UInt32 SpdHalfStave::LoadHSDpiConfRegCompare ( UInt32 DPIVect = NULL  ) 

writes the digital pilot settings, reads back and compares

void SpdHalfStave::refreshTemperatures (  ) 

function to refresh the temperatures of one hs

void SpdHalfStave::writeDiffToDB ( int  id,
int  db_ver 
)

function to write the differences to the database temporary table will loop through all internal containers comparing the defaul and actual values and writing them in the database

Parameters:
id : id of these differences
spd_ver : global version database the default data belongs to

void SpdHalfStave::getDiffCount ( unsigned &  mcmDiff,
unsigned &  dacDiff,
unsigned &  noisyDiff 
)

function to get the number of differences between default and actual containers will loop through all internal containers comparing the defaul and actual values and counting the number of differente settings in mcm values, dac values and noisy pixel values

Parameters:
mcmDiff,: argument by reference it will be incremented inside the funcion to contain the number of mcm differences
dacDiff,: argument by reference it will be incremented inside the funcion to contain the number of pixel dac differences
noisyDiff,: argument by reference it will be incremented inside the funcion to contain the number of noisy pixels differences

UInt32 SpdHalfStave::jtagReset (  ) 

Performs a jtag reset in the halfstave

int SpdHalfStave::configureDefault ( bool  jtagReset = true,
bool  digitalPilot = true,
bool  analogPilot = true,
bool  pixdacs = true 
)

void SpdHalfStave::resetJtagController (  ) 

Resets the JTAG controller of one channel


Member Data Documentation

bool SpdHalfStave::isConfigured [private]

member varaiable that keeps track if the detector is configured or not

this variable is set to true in the method configureDefault

spdLogger* SpdHalfStave::logger [private]

unsigned SpdHalfStave::chNumber [private]

Member to store the channel number.

double SpdHalfStave::tempBus [private]

data member connected to the DIM service for the BUS temperature

this one is updated automatically when the method read temperatre is called

double SpdHalfStave::tempMcm [private]

data member connected to the DIM service for the MCM temperature

this one is updated automatically when the method read temperatre is called

DimService* SpdHalfStave::serviceTempBus [private]

DIM service for the BUS temperature.

DimService* SpdHalfStave::serviceTempMcm [private]

DIM service for the MCM temperature.

VMEAccess* SpdHalfStave::VME [private]

VME access for the configuration,.

UInt32 SpdHalfStave::chipSelect [private]

data member for the chip selected might be useful for compatibility with the old code

UInt8 SpdHalfStave::activationStatus [private]

internal method to keep track of the activation status for this channel;

for this moment iths is not used, it implemented all over the code by an uggly class called ChToAddrDecoder


The documentation for this class was generated from the following files:
Generated on Tue Dec 1 12:09:53 2009 for SPD FED Server by  doxygen 1.5.4