SlowControlManager Class Reference

#include <SlowControlManager.hh>

Collaboration diagram for SlowControlManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SlowControlManager ()
 ~SlowControlManager ()
i32 readDB (const std::string fileName)
void build (const SteerDesc &sd)
const SlowControlEntrygetEntry (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 BoardSlowControlgetBoard (const double timeStamp, const ui32 chamberId, const ui32 difId, const ui32 boardId) const
const PMSlowControlgetPM (const double timeStamp, const ui32 id) const

Private Attributes

std::set< SlowControlEntry,
scSorter
genList
std::list< SCSteerParamsstList

Detailed Description

CLASS SLOWCONTROL //

Definition at line 41 of file SlowControlManager.hh.


Constructor & Destructor Documentation

SlowControlManager::SlowControlManager (  ) 

Definition at line 32 of file SlowControlManager.cpp.

00033 {
00034   //FILE_LOG(logDEBUG1) << "-SlowControlManager contructor"<< endl;
00035 
00036 }

SlowControlManager::~SlowControlManager (  ) 

Definition at line 39 of file SlowControlManager.cpp.

00040 {
00041 }


Member Function Documentation

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]


Member Data Documentation

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]

Definition at line 73 of file SlowControlManager.hh.

Referenced by addSteer().


The documentation for this class was generated from the following files:
Generated on Mon Jan 7 13:19:02 2013 for MicromegasFramework by  doxygen 1.4.7