#ifndef FWS_BSA_DRIVER_H #define FWS_BSA_DRIVER_H #include #include #include #include #include #include #include #include #include #include #include #include #include "bsaStreamDataType.h" class fwsBsaAsynDriver:asynPortDriver { public: fwsBsaAsynDriver(const char *portName, const char *bsaStream, const char *named_root, const char *pmt0, const char *posn0, const char *posn1, const char *pmt1, const char *posn2, const char *posn3); ~fwsBsaAsynDriver(); asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value); asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value); void createStream(void); void pollStream(void); void pushBsa(void); void pushPVs(void); void report(int interest); private: Path p_root; char *named_root; char *port; char *bsa_stream; char *pmt[2]; char *posn[4]; Stream _stream; unsigned rdCnt; unsigned rdSize; unsigned streamSize; epicsTimeStamp time; stream_t *p_buf; double position[4]; unsigned raw_position[4]; unsigned raw_cnt[4]; unsigned cnt_perEgu[4]; double pmtCharge[2]; int pulseid; BsaChannel BsaChn_position[4]; BsaChannel BsaChn_pmtCharge[2]; void parameterSetup(void); protected: #if (ASYN_VERSION <<8 | ASYN_REVISION) < (4<<8 | 32) int firstFwsBsaParam; #define FIRST_FWSBSA_PARAM firstFwsBsaParam #endif /* ASYN version check under 4.32 */ int p_position[4]; int p_raw_cnt[4]; int p_cntPerEgu[4]; int p_pmtCharge[2]; int p_pulseid; #if (ASYN_VERSION <<8 | ASYN_REVISION) < (4<<8 | 32) int lastFwsBsaParam; #define LAST_FWSBSA_PARAM lastFwBsaParam #endif /* ASYN version check under 4.32 */ }; #if (ASYN_VERSION <<8 | ASYN_REVISION) < (4<<8 | 32) #define NUM_FWSBSA_DET_PARAMS ((int)(&LAST_FWSBSA_ARAM - &FIRST_FWSBSA_ARAM -1)) #endif /* ASYN version check under 4.32 */ /* BSA data */ #define POSITION_STR "position_%d" #define RAWCNT_STR "rawCnt_%d" #define CNTPEREGU_STR "cntPerEgu_%d" #define PMTCHARGE_STR "pmtCharge_%d" /* Stream Information */ #define PULSEID_STR "pulseid" #endif /* FSW_BSA_DRIVER_H */