QPulserConverter.hh

Go to the documentation of this file.
00001 
00002 #ifndef _QPULSER_CONVERTER_HH_
00003 #define _QPULSER_CONVERTER_HH_
00004 
00005 class QDaqChannel;
00006 #include <map>
00007 #include <string>
00008 
00016 class QPulserConverter
00017 {
00018 public:
00019    
00021    static QPulserConverter& GetInstance();
00022 
00024    virtual ~QPulserConverter();
00025 
00031    void Load(const std::map<unsigned int, QDaqChannel>& channels);
00032 
00038    unsigned int GetPulseId(unsigned int boardId, unsigned int hwCh) const;
00039 
00044    int GetBoard(unsigned int pulseId) const;
00045 
00050    int GetHwCh(unsigned int pulseId) const;
00051 
00053    int get_mem1(float);
00054    
00056    int get_mem2(int, float);
00057  
00059    int HeaterName2Board(const std::string& name) const;
00060 
00061 private:
00063    QPulserConverter();
00064 
00070    class QPulserAddress
00071    {
00072    public:
00073       QPulserAddress(): fBoard(0), fHwCh(0) {}
00074       ~QPulserAddress() {}
00075       bool operator==(const QPulserAddress& other) const
00076       { return (other.fBoard == fBoard && other.fHwCh == fHwCh); }
00078       bool operator<(const QPulserAddress& other) const
00079       { 
00080          if(fBoard != other.fBoard)
00081             return (fBoard < other.fBoard);
00082          else
00083             return (fHwCh > other.fHwCh); 
00084       }
00085       unsigned int fBoard;
00086       unsigned int fHwCh;
00087    };
00088 
00090    std::map<QPulserAddress, unsigned int> fMapping;
00091 
00092 };
00093 #endif

Generated on Tue Nov 16 10:49:55 2010 for CUORE Software by  doxygen 1.5.6