#include <SlowControlManager.hh>
Collaboration diagram for SlowControlManager:
Public Member Functions | |
SlowControlManager () | |
~SlowControlManager () | |
i32 | readDB (const std::string fileName) |
void | build (const SteerDesc &sd) |
const SlowControlEntry * | getEntry (const double timeStamp) const |
std::set< SlowControlEntry >::const_iterator | begin () |
std::set< SlowControlEntry >::const_iterator | end () |
const ui32 | getNbEntries () |
Private Member Functions | |
void | addSteer (const ui32 scId, const std::string type, const ui32 chamberId, const ui32 difId, const ui32 boardId, const ui32 pmId, const std::string name) |
void | addEntry (const SlowControlEntry &entry) |
const BoardSlowControl & | getBoard (const double timeStamp, const ui32 chamberId, const ui32 difId, const ui32 boardId) const |
const PMSlowControl & | getPM (const double timeStamp, const ui32 id) const |
Private Attributes | |
std::set< SlowControlEntry, scSorter > | genList |
std::list< SCSteerParams > | stList |
Definition at line 41 of file SlowControlManager.hh.
SlowControlManager::SlowControlManager | ( | ) |
SlowControlManager::~SlowControlManager | ( | ) |
i32 SlowControlManager::readDB | ( | const std::string | fileName | ) |
Referenced by main().
void SlowControlManager::build | ( | const SteerDesc & | sd | ) |
Definition at line 45 of file SlowControlManager.cpp.
Referenced by main().
00045 { 00046 for (int paramNum = 0 ; paramNum < sd.slowControls.size(); paramNum++) { 00047 const SlowControl_t& p = sd.slowControls[paramNum]; 00048 addSteer(p.scId, p.type, p.chamberId,p.difId,p.boardId,p.pmId, p.name); 00049 00050 } 00051 }
const SlowControlEntry * SlowControlManager::getEntry | ( | const double | timeStamp | ) | const |
Definition at line 60 of file SlowControlManager.cpp.
Referenced by getBoard(), and main().
00060 { 00061 00062 // if searched timestamp > at first elelement 20000 ms ( the bigger one ) -> return 00063 00064 std::set<SlowControlEntry>::const_iterator p = genList.begin(); 00065 if ( aTimeStamp > p->getTimeStamp() + 20000 ) 00066 { 00067 FILE_LOG(logWARNING) << " p->getTimeStamp() + 20000: " << fixed << p->getTimeStamp() + 20000 << endl; 00068 FILE_LOG(logWARNING) << " aTimeStamp: " << fixed << aTimeStamp << endl; 00069 throw MicroException("SlowControlManager : timestamp upper than max timestamp + 20000 ms:"); 00070 } 00071 00072 int index = 0; 00073 for (p = genList.begin(); p != genList.end() ; p++) 00074 { 00075 00076 index++; 00077 00078 //cout << setprecision(20) << "p->getTimeStamp()[" << p->getTimeStamp() << "]" << endl; 00079 if (aTimeStamp >= p->getTimeStamp() && p != genList.begin() ) // la valeur recherche doit etre plus grande que la valeur du slowcontrol mais il ne faut pas que se sot la premiere valeur du slowcontrol 00080 { 00081 return(&(*p)); 00082 } 00083 } 00084 //cout << "aTimeStamp[" << setprecision(20) << aTimeStamp << "]" << endl; 00085 throw MicroException("SlowControlManager : timestamp not found:"); 00086 }
std::set<SlowControlEntry>::const_iterator SlowControlManager::begin | ( | ) | [inline] |
Definition at line 52 of file SlowControlManager.hh.
Referenced by main().
00052 { return genList.begin(); };
std::set<SlowControlEntry>::const_iterator SlowControlManager::end | ( | ) | [inline] |
Definition at line 53 of file SlowControlManager.hh.
Referenced by main().
00053 { return genList.end(); };
const ui32 SlowControlManager::getNbEntries | ( | ) | [inline] |
Definition at line 54 of file SlowControlManager.hh.
Referenced by main().
00054 { return genList.size(); }
void SlowControlManager::addSteer | ( | const ui32 | scId, | |
const std::string | type, | |||
const ui32 | chamberId, | |||
const ui32 | difId, | |||
const ui32 | boardId, | |||
const ui32 | pmId, | |||
const std::string | name | |||
) | [private] |
Definition at line 195 of file SlowControlManager.cpp.
Referenced by build().
00196 { stList.push_back(SCSteerParams(scId, type, chamberId, difId, boardId, pmId, name)); };
void SlowControlManager::addEntry | ( | const SlowControlEntry & | entry | ) | [private] |
Definition at line 54 of file SlowControlManager.cpp.
00054 { 00055 00056 genList.insert(entry); 00057 }
const BoardSlowControl & SlowControlManager::getBoard | ( | const double | timeStamp, | |
const ui32 | chamberId, | |||
const ui32 | difId, | |||
const ui32 | boardId | |||
) | const [private] |
Definition at line 90 of file SlowControlManager.cpp.
00090 { 00091 try 00092 { 00093 return this->getEntry(timeStamp)->getBoard(chamberId, difId, boardId); 00094 } 00095 catch (MicroException e) 00096 { 00097 throw MicroException("SlowControlManager : timestamp not found:"); 00098 } 00099 00100 }
const PMSlowControl& SlowControlManager::getPM | ( | const double | timeStamp, | |
const ui32 | id | |||
) | const [private] |
std::set<SlowControlEntry,scSorter> SlowControlManager::genList [private] |
Definition at line 70 of file SlowControlManager.hh.
Referenced by addEntry(), begin(), end(), getEntry(), and getNbEntries().
std::list<SCSteerParams> SlowControlManager::stList [private] |