#ifndef TPCCOMMANDCODERDBCACHE_H #define TPCCOMMANDCODERDBCACHE_H #include "RCUCommandCoder.h" #include "AltroCommandCoder.h" #include "BoardControllerCommandCoder.h" #include "RCUControlEngine.h" #include "CommandCoderBase.hpp" #include "ReadoutList.h" #include "Acl.h" #include "Afl.h" #include "../Container/RcuContainer.h" #include "../DB/FERODBFieldPositions.h" #include "../DB/DBQueryCreator.h" #include "../DB/OracleDB.h" #include "../Mapping/Mapping.h" #include "../Logger/Logger.h" #include "../CentralHeaders/TpcException.h" #include #include #include #include using namespace std; class TPCCommandCoderDBcache:public CommandCoderBase { public: TPCCommandCoderDBcache(); ~TPCCommandCoderDBcache(); uint32_t* getDataBlock(); int32_t createDataBlock(char*, int); vector& getError(); std::string& getCoCoInfo(); int32_t getWatchDogTimeOut() { return fwatchDogTimeout; }; void reset(); bool isConnected() { return fDB->isConnected(); }; void setDebugLevel(int dbl) { fLogger->setDebugLevel(dbl); }; int32_t getDebugLevel() { return fLogger->getDebugLevel(); }; private: int32_t createDataBlocks(int); int32_t strtonum(string); RcuContainer *fDataBlock[216]; // The Data to be sent to the FeeServers Afl *fAFL[216]; // The Active Frontend Lists (AFL) for each FeeServer ReadoutList *fReadoutList[216]; // The Readout Lists for each FeeServer RCUCommandCoder *fRCU; // RCU Command Coder AltroCommandCoder *fALTRO; // ALTRO Command Coder BoardControllerCommandCoder *fBC; // BC Command Coder RCUControlEngine *fRCUce; // RCU Control Engine FERODBFieldPositions *fDBfp; // OracleDB *fDB; // The DB DBQueryCreator *fDBqc; // DB Query Creator Logger *fLogger; // Logging class string fVersion; // TPC Command Coder Version string vector fError; // Error string int32_t fTarget; // Which is the target (used for the getDataBlock function int32_t fdbSystem; // Which DB system (at P2 or DcsLab or ...?) int32_t fSide; // If fOneSideOnly==true: which side we are in? int32_t fwatchDogTimeout; // Timeout in seconds for the data block created bool fConfigTCparam; // Fast configuration writes only non-zero values bool fFirstCall; // CoCo called first time? bool fFile; // Write output also to file bool fOneSideOnly; // If 2 JICLs are used for the 2 TPC sides string fDebugFileName; // Filename for debug output string fOutputFilePath; // Path for file for config output string fOutputFileNameAltro; // Filename for ALTRO config output string fOutputFileNameRcu; // Filename for RCU config output ofstream *fDbOfs; // Output File Stream for Debugging information ofstream *fOfsAltro; // Output File Stream for ALTRO Config information ofstream *fOfsRcu; // Output File Stream for RCU Config information string pdbUser; // Username for connecting to DB string pdbPassword; // Password for connecting to DB string pdbConnectString; // Connect string for connecting to DB bool fRCUon[216]; // This RCU is on (value from DB)? time_t fLastCallTime; // Time when createDataBlocks() function was last called }; extern "C" { CommandCoderBase *getCoCoInst(); } #endif // TPCCOMMANDCODERDB_H