#include <SlowControlEntry.hh>
Collaboration diagram for SlowControlEntry:
Public Member Functions | |
SlowControlEntry () | |
~SlowControlEntry () | |
SlowControlEntry (const SlowControlEntry &aSce) | |
SlowControlEntry & | operator= (const SlowControlEntry &aSce) |
const BoardSlowControl & | getBoard (const ui32 chamberId, const ui32 dif_id, const ui32 id) const |
const PMSlowControl & | getPM (const ui32 id) const |
void | setBoardParams (ui32 chamberId, ui32 difId, ui32 boardId, BoardSlowControl &boardSC) |
void | setPmParams (const ui32 id, PMSlowControl &pmSC) |
void | setTimeStamp (double value) |
void | setPressure (float value) |
void | setOverPressure (float value) |
void | setTemperature (float value) |
double | getTimeStamp (void) const |
float | getPressure (void) const |
float | getOverPressure (void) const |
float | getTemperature (void) const |
Private Attributes | |
double | timeStamp |
float | pressure |
float | overPressure |
float | temperature |
std::map< ui32, std::map< ui32, std::map< ui32, BoardSlowControl > * > * > | boardMap |
std::map< ui32, PMSlowControl > | pmMap |
Friends | |
std::ostream & | operator<< (std::ostream &out, const SlowControlEntry &x) |
Definition at line 18 of file SlowControlEntry.hh.
SlowControlEntry::SlowControlEntry | ( | ) |
Definition at line 22 of file SlowControlEntry.cpp.
00023 { 00024 timeStamp = 0;; 00025 pressure = 0; 00026 overPressure = 0; 00027 temperature = 0; 00028 }
SlowControlEntry::~SlowControlEntry | ( | ) |
Definition at line 32 of file SlowControlEntry.cpp.
00033 { 00034 for ( map<ui32, map<ui32, map<ui32, BoardSlowControl>* >* >::iterator iter = boardMap.begin(); iter!= boardMap.end(); iter++) 00035 { 00036 map<ui32, map<ui32, BoardSlowControl>* >* difContainer = iter->second; 00037 for ( map<ui32, map<ui32, BoardSlowControl>* >::iterator boardIter = difContainer->begin(); boardIter!= difContainer->end(); boardIter++) 00038 { 00039 delete boardIter->second; 00040 } 00041 delete difContainer; 00042 } 00043 }
SlowControlEntry::SlowControlEntry | ( | const SlowControlEntry & | aSce | ) |
SlowControlEntry & SlowControlEntry::operator= | ( | const SlowControlEntry & | aSce | ) |
Definition at line 51 of file SlowControlEntry.cpp.
00052 { 00053 timeStamp = aSce.timeStamp; 00054 pressure = aSce.pressure; 00055 overPressure = aSce.overPressure; 00056 temperature = aSce.temperature; 00057 00058 for ( map<ui32, map<ui32, map<ui32, BoardSlowControl>* >* >::const_iterator difIter = aSce.boardMap.begin(); difIter!= aSce.boardMap.end(); difIter++) 00059 { 00060 map<ui32, map<ui32, BoardSlowControl>* >* difContainer = difIter->second; 00061 for ( map<ui32, map<ui32, BoardSlowControl>* >::const_iterator boardIter = difContainer->begin(); boardIter!= difContainer->end(); boardIter++) 00062 { 00063 //delete boardIter->second; 00064 map<ui32, BoardSlowControl>* boardContainer = boardIter->second; 00065 for ( map<ui32, BoardSlowControl>::const_iterator scIter = boardContainer->begin(); scIter!= boardContainer->end(); scIter++) 00066 { 00067 BoardSlowControl newBsc = scIter->second; 00068 ui32 chamberId = difIter->first; 00069 ui32 boardId = scIter->first; 00070 ui32 difId = boardIter->first; 00071 this->setBoardParams( chamberId,difId,boardId, newBsc); 00072 } 00073 } 00074 } 00075 00076 pmMap = aSce.pmMap; // a map element by PM ( ref by PM id ) 00077 00078 }
const BoardSlowControl & SlowControlEntry::getBoard | ( | const ui32 | chamberId, | |
const ui32 | dif_id, | |||
const ui32 | id | |||
) | const |
Definition at line 80 of file SlowControlEntry.cpp.
Referenced by SlowControlManager::getBoard(), Event::getBoardDriftVolt(), Event::getBoardMeshVolt(), and Event::getBoardSlowControl().
00081 { 00082 if ( boardMap.find(chamberId) != boardMap.end()) 00083 { 00084 map<ui32, map<ui32, BoardSlowControl>* >* difContainer = boardMap.find(chamberId)->second; 00085 00086 if (difContainer->find(difId) != difContainer->end()) 00087 { 00088 map<ui32 , BoardSlowControl>* boardContainer = difContainer->find(difId)->second; 00089 if (boardContainer->find(boardId) != boardContainer->end()) 00090 { 00091 return (boardContainer->find(boardId)->second); 00092 } 00093 else 00094 { 00095 throw MicroException("SlowControlEntry.getBoard : no board found"); 00096 } 00097 } 00098 else 00099 { 00100 throw MicroException("SlowControlEntry.getBoard : no board found"); 00101 } 00102 } 00103 else 00104 { 00105 throw MicroException("SlowControlEntry.getBoard : no board found"); 00106 } 00107 00108 }
const PMSlowControl & SlowControlEntry::getPM | ( | const ui32 | id | ) | const |
Definition at line 111 of file SlowControlEntry.cpp.
00111 { 00112 if (pmMap.find(id) != pmMap.end()) 00113 { 00114 return pmMap.find(id)->second; 00115 } 00116 else 00117 { 00118 throw MicroException("SlowControlEntry.getPM : no PM found"); 00119 } 00120 }
void SlowControlEntry::setBoardParams | ( | ui32 | chamberId, | |
ui32 | difId, | |||
ui32 | boardId, | |||
BoardSlowControl & | boardSC | |||
) |
Definition at line 123 of file SlowControlEntry.cpp.
00124 { 00125 00126 // Search or create difs container for this chamber id 00127 if ( boardMap.find(chamberId) != boardMap.end()) 00128 { // difs list already exit for this chamber 00129 } 00130 else 00131 { // does not exit create it 00132 map<ui32 , map<ui32, BoardSlowControl>* >* difContainer = new map<ui32, map<ui32, BoardSlowControl>* >(); 00133 boardMap.insert(make_pair(chamberId,difContainer)); 00134 } 00135 00136 // Now we are sure that container for this chamber Id exist 00137 map<ui32, map<ui32, BoardSlowControl>* >* difContainer = boardMap.find(chamberId)->second; 00138 // Search or create boards container for this Difs 00139 if ( difContainer->find(difId) != difContainer->end()) 00140 { // board list already exit for this dif 00141 } 00142 else 00143 { 00144 map<ui32, BoardSlowControl>* boardContainer = new map<ui32, BoardSlowControl>(); 00145 difContainer->insert(make_pair(difId,boardContainer)); 00146 } 00147 00148 // Now we are sure that container for this chamber Id and DifId exist 00149 map<ui32, BoardSlowControl>* boardContainer = difContainer->find(difId)->second; 00150 boardContainer->insert(make_pair(boardId,boardSC)); 00151 }
void SlowControlEntry::setPmParams | ( | const ui32 | id, | |
PMSlowControl & | pmSC | |||
) |
void SlowControlEntry::setTimeStamp | ( | double | value | ) | [inline] |
void SlowControlEntry::setPressure | ( | float | value | ) | [inline] |
void SlowControlEntry::setOverPressure | ( | float | value | ) | [inline] |
void SlowControlEntry::setTemperature | ( | float | value | ) | [inline] |
double SlowControlEntry::getTimeStamp | ( | void | ) | const [inline] |
Definition at line 41 of file SlowControlEntry.hh.
Referenced by main(), and scSorter::operator()().
00041 { return timeStamp;};
float SlowControlEntry::getPressure | ( | void | ) | const [inline] |
Definition at line 42 of file SlowControlEntry.hh.
Referenced by Event::getPressure(), and Event::setSlowControlParam().
00042 { return pressure;};
float SlowControlEntry::getOverPressure | ( | void | ) | const [inline] |
Definition at line 43 of file SlowControlEntry.hh.
Referenced by Event::setSlowControlParam().
00043 { return overPressure;};
float SlowControlEntry::getTemperature | ( | void | ) | const [inline] |
Definition at line 44 of file SlowControlEntry.hh.
Referenced by Event::getTemperature(), and Event::setSlowControlParam().
00044 { return temperature;};
std::ostream& operator<< | ( | std::ostream & | out, | |
const SlowControlEntry & | x | |||
) | [friend] |
Definition at line 17 of file SlowControlEntry.cpp.
00017 { 00018 return(out << "ts=" << fixed << setprecision(3) << x.timeStamp << ", t=" << setprecision(3) << x.temperature << ", p=" << x.pressure); 00019 }
double SlowControlEntry::timeStamp [private] |
Definition at line 44 of file SlowControlEntry.hh.
Referenced by getTimeStamp(), operator<<(), operator=(), setTimeStamp(), and SlowControlEntry().
float SlowControlEntry::pressure [private] |
Definition at line 51 of file SlowControlEntry.hh.
Referenced by getPressure(), operator<<(), operator=(), setPressure(), and SlowControlEntry().
float SlowControlEntry::overPressure [private] |
Definition at line 52 of file SlowControlEntry.hh.
Referenced by getOverPressure(), operator=(), setOverPressure(), and SlowControlEntry().
float SlowControlEntry::temperature [private] |
Definition at line 53 of file SlowControlEntry.hh.
Referenced by operator<<(), operator=(), setTemperature(), and SlowControlEntry().
std::map<ui32, std::map<ui32, std::map<ui32, BoardSlowControl>* >* > SlowControlEntry::boardMap [private] |
Definition at line 54 of file SlowControlEntry.hh.
Referenced by getBoard(), operator=(), setBoardParams(), and ~SlowControlEntry().
std::map<ui32, PMSlowControl> SlowControlEntry::pmMap [private] |
Definition at line 55 of file SlowControlEntry.hh.
Referenced by getPM(), operator=(), and setPmParams().