#ifndef PREAMP_H #define PREAMP_H #include #include // Asyn Port Driver parameters // Port 1 to 4, pre and post attenuator values #define p_port1PreAttnString "P1_PRE_ATTN" /* asynInt32, r/w */ #define p_port1PosAttnString "P1_POS_ATTN" /* asynInt32, r/w */ #define p_port2PreAttnString "P2_PRE_ATTN" /* asynInt32, r/w */ #define p_port2PosAttnString "P2_POS_ATTN" /* asynInt32, r/w */ #define p_port3PreAttnString "P3_PRE_ATTN" /* asynInt32, r/w */ #define p_port3PosAttnString "P3_POS_ATTN" /* asynInt32, r/w */ #define p_port4PreAttnString "P4_PRE_ATTN" /* asynInt32, r/w */ #define p_port4PosAttnString "P4_POS_ATTN" /* asynInt32, r/w */ class PreAmp: asynPortDriver { private: // Singleton design pattern: here is the pointer for the only instance of // this class. static PreAmp* instance; // Private constructor for Singleton design pattern PreAmp(const char* drvName); // Private copy constructor and copy assignment operator, to avoid someone // to clone the object (we want only one instance) PreAmp(const PreAmp&); PreAmp& operator=(const PreAmp&); // CPSW parameters ScalVal _port1PreAttn; ScalVal _port1PosAttn; ScalVal _port2PreAttn; ScalVal _port2PosAttn; ScalVal _port3PreAttn; ScalVal _port3PosAttn; ScalVal _port4PreAttn; ScalVal _port4PosAttn; // Readback values for all attenuators ScalVal_RO _attnRBV[8]; protected: // Asyn Port Driver parameters // Port 1 to 4, pre and post attenuator values int p_port1PreAttn; int p_port1PosAttn; int p_port2PreAttn; int p_port2PosAttn; int p_port3PreAttn; int p_port3PosAttn; int p_port4PreAttn; int p_port4PosAttn; public: // Singleton method to retrieve pointer to the only object that can be // instantiated from this class. static PreAmp* getInstance(const char* drvName); asynStatus writeInt32(asynUser* pasynUser, epicsInt32 value); asynStatus readInt32(asynUser* pasynUser, epicsInt32* value); }; #endif /* PREAMP_H */