ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcdcsAPD.hpp
Go to the documentation of this file.
1
7#ifndef ngcdcsAPD_H
8#define ngcdcsAPD_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
16
20#define ngcdcsAPD_ERR_PROTECTION 0x1
21
26 int enabled; //< Enabled status
27 int feedback; //< Interlock feedback status
28 int fault; //< Interlock fault status
29
32};
33
37class ngcdcsAPD: public ngcdcsCLDC
38{
39public:
42
44 ngcdcsAPD(const ngcb_route_t &r, int nb);
45
47 ngcdcsAPD(ngcbIFC *ifc, const ngcb_route_t &r, int nb);
48
50 virtual ~ngcdcsAPD();
51
53 int Enable(int check = 1);
54
56 int Disable();
57
59 void ClkMap(ngcdcs_clk_t *cv);
60
62 void DcMap(ngcdcs_dc_t *dv);
63
65 void DefaultSetup(const char *keyWord = NULL);
66
68 int VStatus(int *s);
69
71 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
72
74 int VoltageDC(int num, double volt, int rangeCheck = 1);
75
77 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
78 USE(num); USE(value); USE(rangeCheck);
79 strcpy(ErrMsg(), "function not available");
80 return (ngcbMOD_ERR);
81 }
82
84 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
85 USE(num); USE(l); USE(value); USE(rangeCheck);
86 strcpy(ErrMsg(), "function not available");
87 return (ngcbMOD_ERR);
88 }
89
91 int OutputEnable();
92
94 int OutputDisable();
95
97 char *VStatusString() {return statStr_;}
98
100 int Monitor(int num, int clkChan);
101
103 int OffsetClk(double volt) {
104 USE(volt);
105 return (Success());
106 }
107
109 int OffsetDC(double volt) {
110 USE(volt);
111 return (Success());
112 }
113
115 int PreampOffset(double volt);
116
118 int VideoOffset(double * volt) {
119 USE(volt);
120 return (Success());
121 }
122
124 int DiodeBias(double volt) {
125 USE(volt);
126 return (Success());
127 }
128
130 double OffsetClk() {return (0.0);}
131
133 double OffsetDC() {return (0.0);}
134
136 int TelIntern(int sel = -1);
137
139 double TelCurrent(int chan);
140
142 int TelChan(int chan, double *volt);
143
145 int TelDC(int num, double *volt);
146
148 int TelClk(int num, int l, double *volt);
149
151 int TelClk(int num, ngcdcs_clkv_t *cv) {
152 int j;
153 for (j=0;j<ngcdcsCLDC_DCLK;j++)
154 {
155 double volt;
156 if (TelClk(num, j, &volt) != Success())
157 {
158 return (ngcbMOD_ERR);
159 }
160 else
161 {
162 cv->volt[j] = volt;
163 }
164 }
165 return (Success());
166 }
167
169 int Snapshot();
170
172 int Protection(int flag) {
173 protectionOn = flag;
174 return (Success());
175 }
176
178 int Zero();
179
181 int Calibrate(int noSetup = 0) {
182 USE(noSetup);
183 return (Success());
184 }
185
188
190 int Calibrated() {return (1);}
191
193 int SetupKey(const char *key, const int *idx, const char *value,
194 int *status = NULL);
195
197 int StatusKey(const char *key, const int *idx, char *value,
198 int *status = NULL);
199
200protected:
201
202private:
204 char statStr_[32];
205
207 double dcSave_[ngcbCLDC_MAX_DC];
208
210 double *current_;
211
213 void Init_();
214};
215
216#endif
217
Definition ngcbIFC.hpp:754
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:67
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:65
int Snapshot()
Telemetry snapshot.
Definition ngcdcsAPD.cpp:912
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsAPD.cpp:557
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsAPD.cpp:581
virtual ~ngcdcsAPD()
Destructor.
Definition ngcdcsAPD.cpp:44
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsAPD.hpp:124
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsAPD.hpp:109
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsAPD.cpp:611
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsAPD.hpp:151
double OffsetClk()
Return offset for clocks.
Definition ngcdcsAPD.hpp:130
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsAPD.cpp:696
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsAPD.hpp:118
void ClearCalibration()
Clear calibration.
Definition ngcdcsAPD.hpp:187
char * VStatusString()
Get voltage status string.
Definition ngcdcsAPD.hpp:97
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsAPD.cpp:371
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsAPD.hpp:172
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsAPD.cpp:94
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsAPD.cpp:875
ngcdcsAPD(const ngcb_route_t &r, int nb)
Constructor with route and number of biases.
Definition ngcdcsAPD.cpp:29
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsAPD.hpp:133
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsAPD.cpp:850
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsAPD.cpp:1021
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsAPD.hpp:181
int Zero()
Set all voltages to zero.
Definition ngcdcsAPD.cpp:361
int OutputDisable()
Disable output.
Definition ngcdcsAPD.cpp:321
ngcdcs_apd_t chan[2]
APD channels.
Definition ngcdcsAPD.hpp:41
double TelCurrent(int chan)
Return value of last current-telemetry.
Definition ngcdcsAPD.cpp:863
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsAPD.hpp:77
int OutputEnable()
Enable output.
Definition ngcdcsAPD.cpp:215
int Calibrated()
Check if calibration has been done.
Definition ngcdcsAPD.hpp:190
int PreampOffset(double volt)
Preamplifier offset/supply.
Definition ngcdcsAPD.cpp:1016
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsAPD.cpp:838
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsAPD.hpp:84
int Disable()
Disable call back.
Definition ngcdcsAPD.cpp:200
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsAPD.cpp:715
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsAPD.cpp:721
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsAPD.cpp:1037
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsAPD.hpp:103
int protectionOn
Flag indicating whether protection is enabled.
Definition ngcdcsCLDC.hpp:149
int TelChan()
Return actual telemetry channel.
Definition ngcdcsCldcTel.cpp:80
ngcdcsCLDC(const ngcb_route_t &r, int nc, int nb)
Constructor with route, number of clocks and number of biases.
Definition ngcdcsCLDC.cpp:28
#define ngcbCLDC_MAX_DC
Definition ngcbAddr.h:333
#define ngcbMOD_ERR
Definition ngcbOBJ.hpp:22
#define USE(x)
Definition ngcb.h:28
#define ngcdcsCLDC_DCLK
Definition ngcdcsCLDC.hpp:38
Definition ngcbIFC.hpp:72
Definition ngcdcsAPD.hpp:25
int feedback
Definition ngcdcsAPD.hpp:27
ngcdcs_apd_t()
Constructor.
Definition ngcdcsAPD.hpp:31
int fault
Definition ngcdcsAPD.hpp:28
int enabled
Definition ngcdcsAPD.hpp:26
Definition ngcdcsCLDC.hpp:103
Definition ngcdcsCLDC.hpp:114
double volt[ngcdcsCLDC_DCLK]
Definition ngcdcsCLDC.hpp:115
Definition ngcdcsCLDC.hpp:63