ICP  1
environment_card.h
Go to the documentation of this file.
1 #ifndef ENVIRONMENT_CARD_H
2 #define ENVIRONMENT_CARD_H
3 
4 #include "dae2_card.h"
5 
7 {
8 public:
9  virtual int startRun(DAEstatus& status) = 0;
10  virtual int stopRun(DAEstatus& status) = 0;
11  virtual int ClearFramesAndPPP(DAEstatus& status) = 0;
12  virtual int setFrameSync(FrameSync fs, DAEstatus& status) = 0;
13  virtual bool isRunning(DAEstatus& status) = 0;
14  virtual void printStatus(std::ostream& os, DAEstatus& status) = 0;
15  virtual int resetRunController(DAEstatus& status) = 0;
16 // int getRawFramesLower(isisU16_t* value, DAEstatus& status);
17 // int getRawFramesUpper(isisU16_t* value, DAEstatus& status);
18  virtual int getRawFrames(isisU32_t* value, DAEstatus& status) = 0;
19 // int getGoodFramesLower(isisU16_t* value, DAEstatus& status);
20 // int getGoodFramesUpper(isisU16_t* value, DAEstatus& status);
21  virtual int getGoodFrames(isisU32_t* value, DAEstatus& status) = 0;
22  virtual int getRawPPPLower(isisU32_t* value, DAEstatus& status) = 0;
23  virtual int getRawPPPUpper(isisU32_t* value, DAEstatus& status) = 0;
24  virtual int getRawPPP(isisU64_t* value, DAEstatus& status) = 0;
25  virtual int getGoodPPPLower(isisU32_t* value, DAEstatus& status) = 0;
26  virtual int getGoodPPPUpper(isisU32_t* value, DAEstatus& status) = 0;
27  virtual int getGoodPPP(isisU64_t* value, DAEstatus& status) = 0;
28  virtual int enableSMPVeto(DAEstatus& status) = 0;
29  virtual int enableTS2PulseVeto(DAEstatus& status) = 0;
30  virtual int enableISIS50HzVeto(DAEstatus& status) = 0;
31  virtual int enableExternalVeto(int veto_number, DAEstatus& status) = 0;
32  virtual int enableInternalVeto(DAEstatus& status) = 0;
33  virtual int enableFIFOVeto(DAEstatus& status) = 0;
34  virtual int enableHardwarePeriods(DAEstatus& status) = 0;
35  virtual int disableHardwarePeriods(DAEstatus& status) = 0;
36  virtual int disableSMPVeto(DAEstatus& status) = 0;
37  virtual int disableExternalVeto(int veto_number, DAEstatus& status) = 0;
38  virtual int disableInternalVeto(DAEstatus& status) = 0;
39  virtual int disableFIFOVeto(DAEstatus& status) = 0;
40  virtual int disableTS2PulseVeto(DAEstatus& status) = 0;
41  virtual int disableISIS50HzVeto(DAEstatus& status) = 0;
42  virtual int getSMPVetoedFrames(isisU32_t* value, DAEstatus& status) = 0;
43  virtual int getExternalVetoedFrames(int veto_number, isisU32_t* value, DAEstatus& status) = 0;
44  virtual int getFIFOVetoedFrames(isisU32_t* value, DAEstatus& status) = 0;
45  virtual int getTS2PulseVetoedFrames(isisU32_t* value, DAEstatus& status) = 0;
46  virtual int getISIS50HzVetoedFrames(isisU32_t* value, DAEstatus& status) = 0;
47  virtual int clearSMPVetoedFrames(DAEstatus& status) = 0;
48  virtual int clearExternalVetoedFrames(DAEstatus& status) = 0;
49  virtual int clearFIFOVetoedFrames(DAEstatus& status) = 0;
50  virtual int setFrameSyncDelay(isisU32_t value, DAEstatus& status) = 0; // in us
51  virtual int getFrameSyncDelay(isisU32_t* value, DAEstatus& status) = 0; // in us
52  virtual float getRawUAmpHours(DAEstatus& status) = 0;
53  virtual float getGoodUAmpHours(DAEstatus& status) = 0;
54  virtual bool usingHardwarePeriods(DAEstatus& status) = 0;
56  virtual ~EnvironmentCardIntf() { }
57 
58  virtual int getFChopperVetoedFrames(int chopper_number, isisU32_t* value, DAEstatus& status) = 0;
59  virtual int enableFChopperVeto(int chopper_number, int delay, int width, DAEstatus& status) = 0; // in 20ns units
60  virtual int disableFChopperVeto(int chopper_number, DAEstatus& status) = 0;
61  virtual int printVetoDetails(std::ostream& os, DAEstatus& status) = 0;
62  virtual int whichVeto(std::ostream& os, DAEstatus& status) = 0;
63 
64  virtual int resetCardState(DAEstatus& status) = 0;
65 
66 };
67 
68 template <class EnvPeriodPolicy>
69 class EnvironmentCard : public DAE2Card<EnvPeriodPolicy>, public EnvironmentCardIntf
70 {
71 
72 public:
73  int startRun(DAEstatus& status);
74  int stopRun(DAEstatus& status);
75  int ClearFramesAndPPP(DAEstatus& status);
76  int setFrameSync(FrameSync fs, DAEstatus& status);
77  bool isRunning(DAEstatus& status);
78  void printStatus(std::ostream& os, DAEstatus& status);
79  int resetRunController(DAEstatus& status);
80 // int getRawFramesLower(isisU16_t* value, DAEstatus& status);
81 // int getRawFramesUpper(isisU16_t* value, DAEstatus& status);
82  int getRawFrames(isisU32_t* value, DAEstatus& status);
83 // int getGoodFramesLower(isisU16_t* value, DAEstatus& status);
84 // int getGoodFramesUpper(isisU16_t* value, DAEstatus& status);
85  int getGoodFrames(isisU32_t* value, DAEstatus& status);
86  int getRawPPPLower(isisU32_t* value, DAEstatus& status);
87  int getRawPPPUpper(isisU32_t* value, DAEstatus& status);
88  int getRawPPP(isisU64_t* value, DAEstatus& status);
89  int getGoodPPPLower(isisU32_t* value, DAEstatus& status);
90  int getGoodPPPUpper(isisU32_t* value, DAEstatus& status);
91  int getGoodPPP(isisU64_t* value, DAEstatus& status);
92  int enableSMPVeto(DAEstatus& status);
93  int enableTS2PulseVeto(DAEstatus& status);
94  int enableISIS50HzVeto(DAEstatus& status);
95  int enableExternalVeto(int veto_number, DAEstatus& status);
96  int enableInternalVeto(DAEstatus& status);
97  int enableFIFOVeto(DAEstatus& status);
98  int enableHardwarePeriods(DAEstatus& status);
99  int disableHardwarePeriods(DAEstatus& status);
100  int disableSMPVeto(DAEstatus& status);
101  int disableExternalVeto(int veto_number, DAEstatus& status);
102  int disableInternalVeto(DAEstatus& status);
103  int disableFIFOVeto(DAEstatus& status);
104  int disableTS2PulseVeto(DAEstatus& status);
105  int disableISIS50HzVeto(DAEstatus& status);
106  int getSMPVetoedFrames(isisU32_t* value, DAEstatus& status);
107  int getExternalVetoedFrames(int veto_number, isisU32_t* value, DAEstatus& status);
108  int getFIFOVetoedFrames(isisU32_t* value, DAEstatus& status);
109  int getTS2PulseVetoedFrames(isisU32_t* value, DAEstatus& status);
110  int getISIS50HzVetoedFrames(isisU32_t* value, DAEstatus& status);
111  int clearSMPVetoedFrames(DAEstatus& status);
113  int clearFIFOVetoedFrames(DAEstatus& status);
114  int setFrameSyncDelay(isisU32_t value, DAEstatus& status); // in us
115  int getFrameSyncDelay(isisU32_t* value, DAEstatus& status); // in us
116  float getRawUAmpHours(DAEstatus& status);
117  float getGoodUAmpHours(DAEstatus& status);
118  bool usingHardwarePeriods(DAEstatus& status);
119  EnvironmentCard(int position, ISISVME* vme, DAEstatus& status);
120 
121  int getFChopperVetoedFrames(int chopper_number, isisU32_t* value, DAEstatus& status);
122  int enableFChopperVeto(int chopper_number, int delay, int width, DAEstatus& status); // in 20ns units
123  int disableFChopperVeto(int chopper_number, DAEstatus& status);
124  int printVetoDetails(std::ostream& os, DAEstatus& status);
125  int whichVeto(std::ostream& os, DAEstatus& status);
126 
127  virtual int resetCardState(DAEstatus& status);
128 
129  virtual int position() const { return DAE2Card<EnvPeriodPolicy>::position(); }
130  virtual std::string daeDevice() const { return DAE2Card<EnvPeriodPolicy>::daeDevice(); }
131 
132 protected:
135 
136  int setVetoRegisterBits(isisU32_t mask, bool preserve, DAEstatus& status);
137  int clearVetoRegisterBits(isisU32_t mask, DAEstatus& status);
138 
139  int setRunControlBits(isisU32_t mask, bool preserve, DAEstatus& status);
140  int clearRunControlBits(isisU32_t mask, DAEstatus& status);
141  int setAndClearRunControlBits(isisU32_t mask, bool preserve, DAEstatus& status);
142  int clearPPP(DAEstatus& status);
143 };
144 
145 #endif /* ENVIRONMENT_CARD_H */
virtual int resetRunController(DAEstatus &status)=0
virtual int getGoodPPP(isisU64_t *value, DAEstatus &status)=0
int ClearFramesAndPPP(DAEstatus &status)
int getISIS50HzVetoedFrames(isisU32_t *value, DAEstatus &status)
virtual int clearSMPVetoedFrames(DAEstatus &status)=0
int clearSMPVetoedFrames(DAEstatus &status)
float getGoodUAmpHours(DAEstatus &status)
virtual float getRawUAmpHours(DAEstatus &status)=0
int clearPPP(DAEstatus &status)
int getFIFOVetoedFrames(isisU32_t *value, DAEstatus &status)
virtual int ClearFramesAndPPP(DAEstatus &status)=0
float getRawUAmpHours(DAEstatus &status)
int clearRunControlBits(isisU32_t mask, DAEstatus &status)
int disableISIS50HzVeto(DAEstatus &status)
int enableInternalVeto(DAEstatus &status)
virtual void printStatus(std::ostream &os, DAEstatus &status)=0
virtual int getISIS50HzVetoedFrames(isisU32_t *value, DAEstatus &status)=0
virtual int getGoodPPPUpper(isisU32_t *value, DAEstatus &status)=0
int getTS2PulseVetoedFrames(isisU32_t *value, DAEstatus &status)
EnvironmentCard(int position, ISISVME *vme, DAEstatus &status)
bool isRunning(DAEstatus &status)
int getGoodFrames(isisU32_t *value, DAEstatus &status)
int disableSMPVeto(DAEstatus &status)
virtual int resetCardState(DAEstatus &status)=0
int setRunControlBits(isisU32_t mask, bool preserve, DAEstatus &status)
virtual int getRawPPPLower(isisU32_t *value, DAEstatus &status)=0
virtual int getRawPPPUpper(isisU32_t *value, DAEstatus &status)=0
int enableFIFOVeto(DAEstatus &status)
unsigned long isisU32_t
Definition: isisvme_types.h:8
int setAndClearRunControlBits(isisU32_t mask, bool preserve, DAEstatus &status)
bool usingHardwarePeriods(DAEstatus &status)
int getGoodPPP(isisU64_t *value, DAEstatus &status)
int getFChopperVetoedFrames(int chopper_number, isisU32_t *value, DAEstatus &status)
virtual int getSMPVetoedFrames(isisU32_t *value, DAEstatus &status)=0
virtual int setFrameSyncDelay(isisU32_t value, DAEstatus &status)=0
virtual int getGoodFrames(isisU32_t *value, DAEstatus &status)=0
int getRawFrames(isisU32_t *value, DAEstatus &status)
virtual int getRawPPP(isisU64_t *value, DAEstatus &status)=0
virtual int disableFChopperVeto(int chopper_number, DAEstatus &status)=0
virtual int getRawFrames(isisU32_t *value, DAEstatus &status)=0
virtual int printVetoDetails(std::ostream &os, DAEstatus &status)=0
int disableTS2PulseVeto(DAEstatus &status)
int clearExternalVetoedFrames(DAEstatus &status)
int CardOptions
Definition: dae2_card.h:25
virtual int getFIFOVetoedFrames(isisU32_t *value, DAEstatus &status)=0
virtual int enableInternalVeto(DAEstatus &status)=0
virtual int clearFIFOVetoedFrames(DAEstatus &status)=0
CardOptions m_options
virtual int disableExternalVeto(int veto_number, DAEstatus &status)=0
int getRawPPPUpper(isisU32_t *value, DAEstatus &status)
virtual int getGoodPPPLower(isisU32_t *value, DAEstatus &status)=0
int disableExternalVeto(int veto_number, DAEstatus &status)
int disableFIFOVeto(DAEstatus &status)
int whichVeto(std::ostream &os, DAEstatus &status)
virtual int getFrameSyncDelay(isisU32_t *value, DAEstatus &status)=0
virtual ~EnvironmentCardIntf()
virtual int disableFIFOVeto(DAEstatus &status)=0
int startRun(DAEstatus &status)
virtual int position() const
int clearVetoRegisterBits(isisU32_t mask, DAEstatus &status)
virtual bool isRunning(DAEstatus &status)=0
virtual int resetCardState(DAEstatus &status)
void printStatus(std::ostream &os, DAEstatus &status)
virtual int enableHardwarePeriods(DAEstatus &status)=0
int setVetoRegisterBits(isisU32_t mask, bool preserve, DAEstatus &status)
int enableSMPVeto(DAEstatus &status)
FrameSync
Definition: isiscrpt_types.h:5
virtual int disableSMPVeto(DAEstatus &status)=0
int printVetoDetails(std::ostream &os, DAEstatus &status)
virtual int setFrameSync(FrameSync fs, DAEstatus &status)=0
virtual int disableInternalVeto(DAEstatus &status)=0
int disableFChopperVeto(int chopper_number, DAEstatus &status)
virtual int enableSMPVeto(DAEstatus &status)=0
int getSMPVetoedFrames(isisU32_t *value, DAEstatus &status)
int getGoodPPPUpper(isisU32_t *value, DAEstatus &status)
virtual std::string daeDevice() const
int setFrameSync(FrameSync fs, DAEstatus &status)
int disableInternalVeto(DAEstatus &status)
virtual int getFChopperVetoedFrames(int chopper_number, isisU32_t *value, DAEstatus &status)=0
int getGoodPPPLower(isisU32_t *value, DAEstatus &status)
virtual int getTS2PulseVetoedFrames(isisU32_t *value, DAEstatus &status)=0
std::string daeDevice() const
Definition: dae2_card.cpp:13
virtual int enableISIS50HzVeto(DAEstatus &status)=0
ULONG64 isisU64_t
Definition: isisvme_types.h:10
int enableISIS50HzVeto(DAEstatus &status)
int clearFIFOVetoedFrames(DAEstatus &status)
int resetRunController(DAEstatus &status)
virtual int stopRun(DAEstatus &status)=0
virtual int whichVeto(std::ostream &os, DAEstatus &status)=0
int position() const
Definition: dae2_card.h:72
virtual bool usingHardwarePeriods(DAEstatus &status)=0
int getExternalVetoedFrames(int veto_number, isisU32_t *value, DAEstatus &status)
int getRawPPPLower(isisU32_t *value, DAEstatus &status)
virtual float getGoodUAmpHours(DAEstatus &status)=0
int getFrameSyncDelay(isisU32_t *value, DAEstatus &status)
int enableFChopperVeto(int chopper_number, int delay, int width, DAEstatus &status)
virtual int clearExternalVetoedFrames(DAEstatus &status)=0
int enableExternalVeto(int veto_number, DAEstatus &status)
virtual int getExternalVetoedFrames(int veto_number, isisU32_t *value, DAEstatus &status)=0
int disableHardwarePeriods(DAEstatus &status)
virtual int disableISIS50HzVeto(DAEstatus &status)=0
int setFrameSyncDelay(isisU32_t value, DAEstatus &status)
int enableTS2PulseVeto(DAEstatus &status)
int stopRun(DAEstatus &status)
virtual int enableTS2PulseVeto(DAEstatus &status)=0
virtual int disableTS2PulseVeto(DAEstatus &status)=0
virtual int startRun(DAEstatus &status)=0
int enableHardwarePeriods(DAEstatus &status)
int getRawPPP(isisU64_t *value, DAEstatus &status)
virtual int disableHardwarePeriods(DAEstatus &status)=0
virtual int enableExternalVeto(int veto_number, DAEstatus &status)=0
virtual int enableFIFOVeto(DAEstatus &status)=0
virtual int enableFChopperVeto(int chopper_number, int delay, int width, DAEstatus &status)=0