Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PlexPinDiodeToLed Class Reference

#include <PlexPinDiodeToLed.h>

Inheritance diagram for PlexPinDiodeToLed:

DbiTableRow List of all members.

Public Member Functions

 PlexPinDiodeToLed ()
 PlexPinDiodeToLed (Detector::Detector_t det, ElecType::Elec_t elec, Char_t eastwest, Char_t racklevel, Int_t rackbay, Int_t inrack, Int_t inbox, Int_t gain, Int_t pulserBox, Int_t ledInBox)
virtual ~PlexPinDiodeToLed ()
virtual Int_t GetAggregateNo () const
PlexPinDiodeId GetPlexPinDiodeId () const
PlexLedId GetPlexLedId () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const

Static Public Member Functions

void SetDefensiveUnpkg (Bool_t defensive)
Bool_t GetDefensiveUnpkg ()

Private Member Functions

 PlexPinDiodeToLed (const PlexPinDiodeToLed &from)

Private Attributes

Int_t fAggregate
PlexPinDiodeId fPlexPinDiodeId
PlexLedId fPlexLedId

Static Private Attributes

Bool_t fgDefensiveUnpkg = kFALSE

Constructor & Destructor Documentation

PlexPinDiodeToLed::PlexPinDiodeToLed  )  [inline]
 

Definition at line 32 of file PlexPinDiodeToLed.h.

00032 { LEA_CTOR; }

PlexPinDiodeToLed::PlexPinDiodeToLed Detector::Detector_t  det,
ElecType::Elec_t  elec,
Char_t  eastwest,
Char_t  racklevel,
Int_t  rackbay,
Int_t  inrack,
Int_t  inbox,
Int_t  gain,
Int_t  pulserBox,
Int_t  ledInBox
[inline]
 

Definition at line 33 of file PlexPinDiodeToLed.h.

References det, fPlexLedId, and fPlexPinDiodeId.

00038                                                       :
00039      fPlexPinDiodeId(det,elec,eastwest,racklevel,rackbay,inrack,inbox,gain),
00040      fPlexLedId(det,pulserBox,ledInBox) { LEA_CTOR; };
   virtual ~PlexPinDiodeToLed(){ LEA_DTOR; };

virtual PlexPinDiodeToLed::~PlexPinDiodeToLed  )  [inline, virtual]
 

Definition at line 41 of file PlexPinDiodeToLed.h.

00041 { LEA_DTOR; };

PlexPinDiodeToLed::PlexPinDiodeToLed const PlexPinDiodeToLed from  )  [inline, private]
 

Definition at line 66 of file PlexPinDiodeToLed.h.

00067      : DbiTableRow(from) { LEA_CTOR; *this = from; }


Member Function Documentation

virtual DbiTableRow* PlexPinDiodeToLed::CreateTableRow  )  const [inline, virtual]
 

Implements DbiTableRow.

Definition at line 49 of file PlexPinDiodeToLed.h.

00049 { return new PlexPinDiodeToLed; }

void PlexPinDiodeToLed::Fill DbiResultSet rs,
const DbiValidityRec vrec
[virtual]
 

Implements DbiTableRow.

Definition at line 45 of file PlexPinDiodeToLed.cxx.

References ElecType::CharToEnum(), det, and MSG.

00046                                                                   {
00047 //
00048 //
00049 //  Purpose:  Fill object from Result Set
00050 //
00051 //  Arguments: 
00052 //    rs           in    Result Set used to fill object
00053 //    vrec         in    Associated validity record (or 0 if filling
00054 //                                                    DbiValidityRec)
00055 //
00056 //  Return:    
00057 //
00058 //  Contact:   R. Hatcher
00059 //
00060 //  Specification:-
00061 //  =============
00062 //
00063 //  o Fill object from current row of Result Set.
00064 
00065 //  Program Notes:-
00066 //  =============
00067 
00068 //  None.
00069 
00070    Detector::Detector_t det =
00071       (Detector::Detector_t) 
00072       ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00073 
00074    char   elecName = '?';
00075    char   elecType = ElecType::kUnknown;
00076    char   rackEastWest='?', rackLevel='?';
00077    int    rackBay=0, muxboxInRack=0;
00078    int    diodeinbox=0, gain=0;
00079    int    pulserbox=0, ledinbox=0;
00080 
00081    if (fgDefensiveUnpkg) {
00082 
00083       // unpack allowing for various column names and ordering
00084 
00085       Int_t numCol = rs.NumCols();
00086       //  The first column (SeqNo) has already been processed.
00087       for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00088          string colName = rs.CurColName();
00089          if (      colName == "AGGREGATENO" ) rs >> fAggregate;
00090          else if ( colName == "ELECNAME"    ) rs >> elecName;
00091          else if ( colName == "RACKEASTWEST") rs >> rackEastWest;
00092          else if ( colName == "RACKLEVEL"   ) rs >> rackLevel;
00093          else if ( colName == "RACKBAY"     ) rs >> rackBay;
00094          else if ( colName == "MUXBOXINRACK") rs >> muxboxInRack;
00095          else if ( colName == "DIODEINBOX"  ) rs >> diodeinbox;
00096          else if ( colName == "GAIN"        ) rs >> gain;
00097          else if ( colName == "PULSERBOX"   ) rs >> pulserbox;
00098          else if ( colName == "LEDINBOX"    ) rs >> ledinbox;
00099          else {
00100             static int nmsg = 25;
00101             if (nmsg-- > 0) MSG("Plex",Msg::kWarning) 
00102                << "Ignoring column " << rs.CurColNum() 
00103                << " (of " << rs.NumCols() << ")"
00104                << " \""<< colName << "\"; not part of "
00105                << ClassName() << endl;
00106             rs.IncrementCurCol();
00107          }
00108       }
00109    } // end defensive unpacking
00110    else {
00111 //       SeqNo         int,
00112 //       AggregateNo   int,
00113 //       ElecName      tinytext,
00114 //       RackEastWest  char(1),
00115 //       RackLevel     char(1),
00116 //       RackBay       tinyint,
00117 //       MuxBoxInRack  tinyint,
00118 //       DiodeInBox    tinyint,
00119 //       Gain          tinyint,
00120 //       PulserBox     tinyint,
00121 //       LedInBox      tinyint
00122 
00123       rs >> fAggregate
00124          >> elecName
00125          >> rackEastWest
00126          >> rackLevel
00127          >> rackBay
00128          >> muxboxInRack
00129          >> diodeinbox
00130          >> gain
00131          >> pulserbox
00132          >> ledinbox;
00133 
00134    }
00135 
00136    ElecType::Elec_t elec = ElecType::CharToEnum(elecName);
00137    if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00138 
00139    fPlexPinDiodeId = PlexPinDiodeId(det,elec,rackEastWest,rackLevel,
00140                                     rackBay,muxboxInRack,diodeinbox,gain);
00141    fPlexLedId      = PlexLedId(det,pulserbox,ledinbox);
00142 
00143 }

virtual Int_t PlexPinDiodeToLed::GetAggregateNo  )  const [inline, virtual]
 

Reimplemented from DbiTableRow.

Definition at line 45 of file PlexPinDiodeToLed.h.

00045 { return fAggregate; }

Bool_t PlexPinDiodeToLed::GetDefensiveUnpkg  )  [inline, static]
 

Definition at line 60 of file PlexPinDiodeToLed.h.

00060 { return fgDefensiveUnpkg; }

PlexLedId PlexPinDiodeToLed::GetPlexLedId  )  const [inline]
 

Definition at line 47 of file PlexPinDiodeToLed.h.

Referenced by Plexus::BuildLedMaps(), and LedIdList::Reset().

00047 { return fPlexLedId; }

PlexPinDiodeId PlexPinDiodeToLed::GetPlexPinDiodeId  )  const [inline]
 

Definition at line 46 of file PlexPinDiodeToLed.h.

Referenced by Plexus::BuildLedMaps().

00046 { return fPlexPinDiodeId; }

void PlexPinDiodeToLed::SetDefensiveUnpkg Bool_t  defensive  )  [inline, static]
 

Definition at line 58 of file PlexPinDiodeToLed.h.

References fgDefensiveUnpkg.

00059       { fgDefensiveUnpkg = defensive; }

void PlexPinDiodeToLed::Store DbiOutRowStream ors,
const DbiValidityRec vrec
const [virtual]
 

Reimplemented from DbiTableRow.

Definition at line 146 of file PlexPinDiodeToLed.cxx.

References ElecType::AsString(), fAggregate, fPlexLedId, fPlexPinDiodeId, PlexMuxBoxId::GetEastWest(), PlexMuxBoxId::GetElecType(), PlexPinDiodeId::GetGain(), PlexPinDiodeId::GetInBox(), PlexMuxBoxId::GetInRack(), PlexLedId::GetLedInBox(), PlexLedId::GetPulserBox(), PlexMuxBoxId::GetRackBay(), and PlexMuxBoxId::GetRackLevel().

00147                                                                       {
00148 //
00149 //
00150 //  Purpose:  Stream object to output row stream
00151 //
00152 //  Arguments: 
00153 //    ors          in     Output row stream.
00154 //    vrec         in     Associated validity record (or 0 if filling
00155 //                                                    DbiValidityRec)
00156 //
00157 //  Return:    
00158 //
00159 //  Contact:   R. Hatcher
00160 //
00161 //  Specification:-
00162 //  =============
00163 //
00164 //  o  Stream object to output row stream.
00165 
00166 //  Program Notes:-
00167 //  =============
00168 
00169 //  None.
00170 
00171    ElecType::Elec_t elec = fPlexPinDiodeId.GetElecType();
00172    //   int  numeric      = fPlexPinDiodeId.GetNumericMuxBox();
00173    char rackEastWest = fPlexPinDiodeId.GetEastWest();
00174    char rackLevel    = fPlexPinDiodeId.GetRackLevel();
00175    int  rackBay      = fPlexPinDiodeId.GetRackBay();
00176    int  muxInRack    = fPlexPinDiodeId.GetInRack();
00177 
00178 
00179    ors << fAggregate
00180        << ElecType::AsString(elec)
00181        << rackEastWest
00182        << rackLevel
00183        << rackBay
00184        << muxInRack
00185        << fPlexPinDiodeId.GetInBox()
00186        << fPlexPinDiodeId.GetGain()
00187        << fPlexLedId.GetPulserBox()
00188        << fPlexLedId.GetLedInBox();
00189 }


Member Data Documentation

Int_t PlexPinDiodeToLed::fAggregate [private]
 

Definition at line 71 of file PlexPinDiodeToLed.h.

Referenced by Store().

Bool_t PlexPinDiodeToLed::fgDefensiveUnpkg = kFALSE [static, private]
 

Definition at line 28 of file PlexPinDiodeToLed.cxx.

Referenced by SetDefensiveUnpkg().

PlexLedId PlexPinDiodeToLed::fPlexLedId [private]
 

Definition at line 73 of file PlexPinDiodeToLed.h.

Referenced by PlexPinDiodeToLed(), and Store().

PlexPinDiodeId PlexPinDiodeToLed::fPlexPinDiodeId [private]
 

Definition at line 72 of file PlexPinDiodeToLed.h.

Referenced by PlexPinDiodeToLed(), and Store().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:03 2010 for loon by  doxygen 1.3.9.1