00001 00002 #include "Dcs_Mag_Near.h" 00003 #include "MessageService/MsgService.h" 00004 #include "DatabaseInterface/DbiOutRowStream.h" 00005 #include "DatabaseInterface/DbiResultSet.h" 00006 #include "DatabaseInterface/DbiValidityRec.h" 00007 00008 ClassImp(Dcs_Mag_Near) 00009 00010 // Definition of static data members 00011 // ********************************* 00012 00013 CVSID("$Id: Dcs_Mag_Near.cxx,v 1.2 2005/03/11 16:17:48 west Exp $\n CVSID_DBIRESULTPTR "); 00014 00015 // Instantiate associated Result Pointer class. 00016 // ******************************************* 00017 00018 #include "DatabaseInterface/DbiResultPtr.tpl" 00019 template class DbiResultPtr<Dcs_Mag_Near>; 00020 00021 #include "DatabaseInterface/DbiWriter.tpl" 00022 template class DbiWriter<Dcs_Mag_Near>; 00023 00024 // Definition of member functions (alphabetical order) 00025 // *************************************************** 00026 00027 00028 //..................................................................... 00029 00030 void Dcs_Mag_Near::Fill(DbiResultSet& rs, 00031 const DbiValidityRec* /* vrec */) { 00032 // 00033 // 00034 // Purpose: Fill object from Result Set 00035 // 00036 // Arguments: 00037 // rs in Result Set used to fill object 00038 // vrec in Associated validity record (or 0 if filling 00039 // DbiValidityRec) 00040 // 00041 // o Fill object from current row of Result Set. 00042 // This method demonstrates both the "dumb" fill method (just 00043 // load the data as it comes) and the smart method (check column 00044 // name and load according to column order). 00045 00046 // if ( rs.TableName() != "DCS_MAG_FAR" 00047 // && rs.TableName() != "Dcs_Mag_Near" ) { 00048 00049 // Dumb method. 00050 rs >> fCurrent >> fVoltage >> fVoltageRef >> iRawData >> b0LocalOrRemote >> b1InterLocksComplete >> b2PowerSupplyOn >> b3GroundFault >> b4OverCurrentDC >> b5OverTemperature >> b6CurrentRegulateMode >> b7ExternalReference >> b8Polarity; 00051 00052 /* } 00053 00054 // Smart method 00055 else { 00056 Int_t numCol = rs.NumCols(); 00057 // The first column (SeqNo) has already been processed. 00058 for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) { 00059 string colName = rs.CurColName(); 00060 if ( colName == "FAR_CURRENT" ) rs >> fCurrent; 00061 else if ( colName == "FAR_VOLTAGE" ) rs >> fVoltage; 00062 else if ( colName == "FAR_SUPERMODULE" ) rs >> iSupermod; 00063 else if ( colName == "FAR_THERM1" ) rs >> fTherm1; 00064 else if ( colName == "FAR_THERM2" ) rs >> fTherm2; 00065 else if ( colName == "FAR_THERM3" ) rs >> fTherm3; 00066 else if ( colName == "FAR_THERM4" ) rs >> fTherm4; 00067 else if ( colName == "FAR_THERM5" ) rs >> fTherm5; 00068 else if ( colName == "FAR_THERM6" ) rs >> fTherm6; 00069 else if ( colName == "FAR_THERM7" ) rs >> fTherm7; 00070 else if ( colName == "FAR_THERM8" ) rs >> fTherm8; 00071 else if ( colName == "FAR_THERM9" ) rs >> fTherm9; 00072 else if ( colName == "FAR_THERM10" ) rs >> fTherm10; 00073 else if ( colName == "FAR_THERM11" ) rs >> fTherm11; 00074 else if ( colName == "FAR_THERM12" ) rs >> fTherm12; 00075 else if ( colName == "FAR_THERM13" ) rs >> fTherm13; 00076 else if ( colName == "FAR_THERM14" ) rs >> fTherm14; 00077 else if ( colName == "FAR_THERM15" ) rs >> fTherm15; 00078 else if ( colName == "FAR_THERM16" ) rs >> fTherm16; 00079 else if ( colName == "FAR_THERM17" ) rs >> fTherm17; 00080 else if ( colName == "FAR_THERM18" ) rs >> fTherm18; 00081 else if ( colName == "FAR_THERM19" ) rs >> fTherm19; 00082 else if ( colName == "FAR_THERM20" ) rs >> fTherm20; 00083 else if ( colName == "FAR_THERM21" ) rs >> fTherm21; 00084 else if ( colName == "FAR_THERM22" ) rs >> fTherm22; 00085 else if ( colName == "FAR_THERM23" ) rs >> fTherm23; 00086 else if ( colName == "FAR_THERM24" ) rs >> fTherm24; 00087 else if ( colName == "FAR_THERM25" ) rs >> fTherm25; 00088 else if ( colName == "FAR_THERM26" ) rs >> fTherm26; 00089 else if ( colName == "FAR_THERM27" ) rs >> fTherm27; 00090 else if ( colName == "FAR_THERM28" ) rs >> fTherm28; 00091 else if ( colName == "FAR_THERM29" ) rs >> fTherm29; 00092 else { 00093 MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol 00094 << "(" << colName << ")" 00095 << "; not part of DcsMagNear" << endl; 00096 rs.IncrementCurCol(); 00097 } 00098 } 00099 00100 } 00101 */ 00102 } 00103 //..................................................................... 00104 00105 void Dcs_Mag_Near::Store(DbiOutRowStream& ors, 00106 const DbiValidityRec* /* vrec */) const { 00107 // Purpose: Stream object to output row stream 00108 // 00109 // Arguments: 00110 // ors in Output row stream. 00111 // vrec in Associated validity record (or 0 if filling 00112 // DbiValidityRec) 00113 // o Stream object to output row stream. 00114 00115 ors << fCurrent << fVoltage << fVoltageRef << iRawData << b0LocalOrRemote << b1InterLocksComplete << b2PowerSupplyOn << b3GroundFault << b4OverCurrentDC << b5OverTemperature << b6CurrentRegulateMode << b7ExternalReference << b8Polarity; 00116 } 00117 00118
1.3.9.1