/* * CaenHVChannel.hh * * Created on: Aug 23, 2016 * Author: Hovanes Egiyan */ #ifndef CAENHVCHANNEL_HH_ #define CAENHVCHANNEL_HH_ #include #include #include #include #include #include #include #include "dbSubsystem.hh" #include "epicsChannel.hh" class CaenHVChannel: public epicsChannel { protected: // Define function object to calculate the macro name class MacroDefault: public BaseMacro4DB { public: MacroDefault() { } virtual std::string operator()( std::string detPrefix, std::string iocPrefix, baseEpicsChannel* chanPtr ) { cout << "Uses its own name" << endl; stringstream macroString; macroString << std::string( "DETch=" ) << detPrefix << chanPtr->getFullName() << ",PREF=" << iocPrefix << ",PSNAME=" << chanPtr->getCrateName() << string( ",SLOT=" ) << chanPtr->getSlotNumber() << string( ",CHANNUM=" ) << chanPtr->getChanNum(); return macroString.str(); } }; MacroDefault macroDefault; // Map for keeping the function objects for calculating macro names // for each DB files that needs to be loaded by detectors. map > macroFunctor; string chanName; std::map > excludedDetctorsMap; public: CaenHVChannel( std::string uri, std::string name, dbSubsystem* subsystemPtr, int chID = 0 ); virtual ~CaenHVChannel() { } virtual void loadRecords( std::string detectorPrefix, std::string iocPrefix = "" ); virtual void initBoardFileName(); virtual std::string getName() const { return chanName; } static std::string getCAENChannelName( int slot, int chan ); }; #endif /* CAENHVCHANNEL_HH_ */