QPSChannel.hh

00001 /*
00002  * APOLLO: A complete DAQ and Online Data Analysis Framework for Cuore
00003  * 
00004  * A.G. created 28/6/6
00005  *
00006  * $Id: QPSChannel.hh 404 2006-11-10 23:40:40Z giacher $
00007  * $Revision: 404 $
00008  *
00009  * Class QPSChannel: Pulser Channel class
00010  *
00011  */
00012 
00013 #ifndef _QPS_CHANNEL_HH_
00014 #define _QPS_CHANNEL_HH_
00015 
00016 
00017 //C/C++ Includes
00018 #include <sstream>
00019 
00020 
00021 // Apollo Includes
00022 #include "QCuore.hh"
00023 #include "QNamed.hh"
00024 #include "QId.hh"
00025 
00026 // Hardware Includes
00027 #include "QEleChannel.hh"
00028 #include "QEleBaseInterface.hh"
00029 
00030 
00031 class QPSChannel : public QId, public QNamed, public QEleChannel
00032 {
00033 
00034 public:
00035   
00036    // ctors 
00037    QPSChannel(QEleBaseInterface* IFace, size_t Id, const std::string& Name, 
00038               size_t Ctrl, size_t Slot, size_t Board, size_t Ch);
00039     
00040    // dtor
00041    virtual ~QPSChannel() {}
00042 
00043   
00044    // FIXME: All Get/Set Methods return "false" if no error occurred,
00045    //        "true" otherwise.
00046 
00047   
00048    // Set/Get entire register
00049    bool SetRegister(size_t Reg, char  Value);
00050    bool GetRegister(size_t Reg, char& Value);
00051 
00052 
00053    // Setter/Getter
00054    // Mem_0
00055    bool SetWidth(size_t  Width);
00056    bool GetWidth(size_t& Width);
00057   
00058    // Mem_3
00059    bool SetAttenuation(size_t  Atten);
00060    bool GetAttenuation(size_t& Atten);
00061   
00062    // Mem_1/Mem_2
00063    bool SetAmplitude(size_t  Ampli);
00064    bool GetAmplitude(size_t& Ampli);
00065 
00066    // Start Pulse
00067    bool Fire();
00068   
00069 
00070    // Get Used Interface
00071    inline QEleBaseInterface* GetInterface() {return fFace;}
00072 
00073 protected:
00074 
00075    // Write Register
00076    virtual bool WriteRegister(size_t Reg, char  Value);
00077    virtual bool ReWriteRegister(size_t Reg);
00078 
00079    // Read Register
00080    virtual bool ReadRegister(size_t Reg, char& Value);
00081 
00082    
00083 private:
00084 
00085    // Pointer to the Interface
00086    QEleBaseInterface* fFace;
00087 
00088    // String Stream for perfome message
00089    std::ostringstream fMsgString;
00090 
00091 };
00092 
00093 #endif // _QPS_CHANNEL_HH_
00094 

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