• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

include/roc/Board.h (r4864/r4162)

Go to the documentation of this file.
00001 #ifndef ROC_BOARD_H
00002 #define ROC_BOARD_H
00003 
00004 #include "base/commons.h"
00005 
00006 #include "roc/Message.h"
00007 
00008 #include "base/Board.h"
00009 
00010 
00011 namespace roc {
00012 
00014   enum ClientRole {
00015      roleNone      = base::roleNone,               
00016      roleObserver  = base::roleObserver,           
00017      roleControl   = base::roleControl,            
00018      roleDAQ       = base::roleDAQ                 
00019    };
00020 
00021    // symbolic names for ROC-related configuration parameters
00022    extern const char* xmlRocPool;
00023    extern const char* xmlTransportWindow;
00024    extern const char* xmlTransportKind;
00025    extern const char* xmlBoardAddr;
00026    extern const char* xmlRole;
00027    extern const char* xmlRocNumber;
00028    extern const char* xmlLowWater;
00029    extern const char* xmlHighWater;
00030    extern const char* xmlMsgFormat;
00031    extern const char* xmlFlushTime;
00032 
00033    extern const char* typeUdpDevice;
00034    extern const char* typeAbbDevice;
00035 
00036    enum ERocBufferTypes {
00037       rbt_RawRocData     = 234
00038    };
00039    
00040    enum ETransportKinds {
00041       kind_UDP = base::kind_UDP,
00042       kind_ABB = base::kind_ABB,
00043       kind_File = base::kind_File
00044    };
00045 
00046    enum EFrontendKinds {
00047       kind_nXYTER = 1,  // normal nXYTER
00048       kind_oldFEET = 2, // old GET4, keep for historical reasons
00049       kind_FEET = 3,    // new GET4 v1.0,
00050       kind_newNX = 4    // new readout for nXYTER with SysCore3
00051    };
00052 
00053    enum EBackendKinds {
00054       kind_Optic    = 1,  // normal Optic readout - CBMNet v1
00055       kind_FX20     = 2,
00056       kind_FX40     = 3,
00057       kind_FX60     = 4,
00058       kind_newOptic = 5  // new optic readout - CBMNet v2
00059    };
00060 
00061 
00062    class Board : public base::Board {
00063 
00064       protected:
00065          Board();
00066          virtual ~Board();
00067 
00068       public:
00069 
00070          // --------------------------------------------------------------------
00071          // methods for controlling ROC and components
00072          // --------------------------------------------------------------------
00073 
00074          static uint32_t getRoclibVersion();
00075          uint32_t getRocFpgaType();
00076          uint32_t getRocSvnRev();
00077          uint32_t getRocBuildTime();
00078 
00079          uint32_t getRocHardwareVersion();
00080          uint32_t getRocHardwareType();
00081 
00083          uint32_t getRocFrontendKind() { return getRocHardwareType() >> 16; }
00084 
00086          uint32_t getRocBackendKind() { return getRocHardwareType() & 0xffff; }
00087 
00089          virtual uint32_t getRocBackendVersion() { return 0; }
00090 
00091 
00093          uint32_t rocNumber() const { return boardNumber(); }
00094 
00096          uint32_t getRocNumber() { return getBoardNumber(); }
00097          void setRocNumber(uint32_t num) { setBoardNumber(num); }
00098 
00099          int uploadCommandsList(unsigned num, const base::OperList& lst, double tmout = 0.);
00100 
00101          int downloadCommandsList(unsigned num, base::OperList& lst, double tmout = 0.);
00102 
00103          int invokeCommandsList(unsigned num, double tmout = 0.);
00104 
00105          int uploadStartDaqCmdList(bool reset_frontend = false, bool reset_fifo = true);
00106 
00107          int uploadStopDaqCmdList();
00108 
00109          virtual int invokeDLM(unsigned num, double tmout = 0.) { return 0; }
00110 
00111          void clearRocFifo();
00112          void restartRoc();
00113 
00114          virtual bool restartBoard() { restartRoc(); return true; }
00115 
00116 
00117          int getRocThrottleState(uint32_t& val);
00118 
00119          virtual unsigned GetBoardId() const { return rocNumber(); }
00120 
00121 
00122          // DAQ functions
00123 
00125 
00136          // virtual bool startDaq() = 0;
00137 
00139 
00144          // virtual bool suspendDaq() = 0;
00145 
00147 
00151          // virtual bool stopDaq() = 0;
00152 
00153 
00155 
00164          //virtual bool getNextBuffer(void* &buf, unsigned& len, double tmout = 1.) = 0;
00165 
00167 
00170          // virtual int getMsgFormat() const = 0;
00171 
00173 
00179          //virtual void setFlushTimeout(double tmout) {}
00180 
00181 
00183 
00186          virtual int setToDefault();
00187 
00189 
00197          virtual bool enableCalibration(double period = 10., double calibr = 0.1, int cnt = -1) { return false; }
00198 
00199          virtual bool disableCalibration() { return enableCalibration(-1., -1., 0); }
00200 
00201 
00202          static bool IsUdpAddress(const char* name);
00203          static bool IsOpticAddress(const char* name);
00204          static bool IsLmdFileAddress(const char* name);
00205 
00206          static Board* Connect(const char* name, ClientRole role = roleDAQ);
00207          static bool Close(Board* brd);
00208    };
00209 
00210 }
00211 
00212 #endif

Generated on Tue Dec 10 2013 04:52:22 for ROCsoft by  doxygen 1.7.1