/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Calibration/calibUtil/calibUtil-00-00-43/calibUtil/StripSrv.h

Go to the documentation of this file.
00001 // $Header: /bes/bes/BossCvs/Calibration/calibUtil/calibUtil/StripSrv.h,v 1.1.1.1 2005/10/17 06:12:26 maqm Exp $ 
00002 #ifndef CALIBUTIL_STRIPSRV_H
00003 #define CALIBUTIL_STRIPSRV_H
00004 
00005 #include <string>
00006 #include <iostream>
00007 #include <vector>
00008 #include <xercesc/dom/DOMElement.hpp>
00009 
00010 namespace calibUtil {
00011 
00012   class GenericSrv;
00013 
00022   enum eVisitorRet {CONT, USER_DONE, ERROR, DONE};
00023 
00024   typedef std::vector<unsigned short int> StripCol;
00025 
00029   class ClientObject {
00030   public:    
00038     virtual eVisitorRet badTower(unsigned int row, unsigned int col, 
00039                                  int badness)=0;
00040 
00051     virtual eVisitorRet badPlane(unsigned int row, unsigned int col, 
00052                                  unsigned int tray, bool top,
00053                                  int badness, bool allBad,
00054                                  const StripCol& strips)=0;
00055 
00056   };    // end pure virtual visitor class definition
00057 
00058 
00059   class StripSrv {
00060 
00061 
00062   public:
00063 
00064     enum eBadType  {UNKNOWN_BADTYPE, DEAD, HOT};
00066 
00067     typedef struct stowerRC { 
00068       unsigned short int row; 
00069       unsigned short int col;
00070     } towerRC;
00071     typedef std::vector<unsigned short int> StripCol; 
00072 
00075     StripSrv(std::string xmlFileName);
00076 
00078     StripSrv(eBadType badType, const GenericSrv& gen);
00079 
00081     ~StripSrv();
00082   
00084     eBadType getBadType() const;
00085 
00087     void getBadTowers(std::vector<towerRC>& towerIds) const;
00088 
00089     
00090     
00092 
00094     std::string getInst() const;
00095     
00097     std::string getTimestamp() const;
00098 
00100     std::string getCalType() const;
00101     
00103     std::string getFmtVer() const;
00104 
00106     //maqm fix
00107      //eVisitorRet StripSrv::traverseInfo(ClientObject *client) const;
00108      eVisitorRet traverseInfo(ClientObject *client) const;
00109 
00110     eVisitorRet writeXml(std::ostream* out);
00111 
00112   private:
00113 
00114     // A tower just has a collection of uniplanes, 
00115     // each identified by tray number, top or bottom, and badness
00116     //
00117 
00118     typedef struct sUniplane {
00119       bool m_allBad;                 // if true, StripCol may be ignored
00120       int  m_howBad;
00121       int  m_tray;
00122       bool m_top;
00123       StripCol m_strips;
00124     }  Uniplane;
00125 
00126     typedef struct sTower {
00127       //      towerRC id;
00128       unsigned short m_row;
00129       unsigned short m_col;
00130       bool    m_allBad;         // if true, uniplanes may be ignored
00131       int     m_howBad;
00132       std::vector<Uniplane> m_uniplanes;
00133     } Tower;
00134    
00135     std::vector<Tower> m_towers;
00136     eBadType m_badType;
00137 
00138     enum eState {
00139       FROM_PERS,       // read in from persistent form; read-only
00140       BUILDING,        // in process of building the list
00141       WRITTEN };       // built and written to persistent form (read-only)
00142 
00143     eState m_state;
00144 
00145     // object to store generic data
00146     GenericSrv *m_genSrv;   
00147 
00148     
00151     void strToNum(std::string strips, std::vector<unsigned short int> &v);
00152 
00155     //    void fillUni(const DOM_Element& uniElt, Unilayer* uni);
00156     void fillUni(const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* uniElt, 
00157                  Uniplane* uni);
00158 
00159     void fillStrips(const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* badElt, 
00160                     StripCol& list);
00161     
00163     Tower* findTower(towerRC& towerId);
00165     const Tower* findTower(const towerRC& towerId) const;
00166 
00167   };
00168 
00169 }// end of namespace calibUtil
00170 
00171 #endif
00172 
00173 
00174 
00175 
00176 
00177 
00178 
00179 
00180 
00181 
00182 

Generated on Tue Nov 29 22:57:55 2016 for BOSS_7.0.2 by  doxygen 1.4.7