QDigitizer.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __QDIGITIZER_HH_
00011 #define __QDIGITIZER_HH_
00012
00013 #include <map>
00014 #include <string>
00015
00016 #include "QCuore.hh"
00017 #include "QId.hh"
00018 #include "QNamed.hh"
00019 #include "QCrateReceiverBuffer.hh"
00020
00021 class QCrate;
00022
00023 class QDigitizer : public QId, public QNamed {
00024 public:
00025
00026 enum QClockSource_t
00027 {
00028 External_s,
00029 Board_s,
00030 Crate_s
00031 };
00032
00033
00034
00035
00036 QDigitizer();
00037
00038
00039 QDigitizer(QCrate* c, int slot, unsigned long base, int nch, std::string n);
00040
00041
00042 virtual ~QDigitizer();
00043
00048 virtual int GetData();
00049
00055 virtual void RegisterChannel(int lg, int physChan, bool SaveFile);
00056
00058 virtual void RegisterDigitalChannel(int lg, bool SaveFile);
00059
00060
00061 inline unsigned long Base() const { return m_base; }
00062
00063
00064 inline int NumRegChannels() const {return fNumRegChannels;}
00065
00066
00067 inline int NumChannels() const {return fNumChannels;}
00068
00069
00070 inline int Lg(int n) {return fLgChan[n];}
00071
00072
00073 inline QCrateReceiverBuffer& GetBuffer(int ch)
00074 { return *(fPhysActiveShm[ch]); }
00075
00076
00077 virtual void Dump() const;
00078
00079 virtual void SetStatusReady() {}
00080
00081 virtual void SetStatusRunning(bool) {}
00082
00083 virtual bool WaitForStartSignal(const char* const) { return true; }
00084
00085 virtual void GetStartSignal(char*) {}
00086
00087 virtual bool SetMuLineStatus(bool status) { return false; }
00088
00089
00090 virtual bool SetClockSource(QClockSource_t source) {return true; }
00091
00092 const std::map<int, int>& GetPhysChannelMap() const { return fPhysChan; }
00093
00094 protected:
00095
00096 QCrate *p_Crate;
00097
00098
00099 unsigned long m_base;
00100
00101 int fNumRegChannels;
00102 bool fDigChannel;
00103 int fDigChanLg;
00105
00106 const int fNumChannels;
00107
00108
00109
00110
00111 std::map<int,int> fLgChan;
00112 std::map<int,int> fPhysChan;
00113 std::map<int, QCrateReceiverBuffer*> fPhysActiveShm;
00115 QCrateReceiverBuffer* fDigChanShm;
00116 };
00117
00118 #endif