ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsAPD.hpp
Go to the documentation of this file.
1
8#ifndef ngcdcsAPD_H
9#define ngcdcsAPD_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
17
21#define ngcdcsAPD_ERR_PROTECTION 0x1
22
27 int enabled; //< Enabled status
28 int feedback; //< Interlock feedback status
29 int fault; //< Interlock fault status
30
33};
34
38class ngcdcsAPD: public ngcdcsCLDC
39{
40public:
43
45 ngcdcsAPD(const ngcb_route_t &r, int nb);
46
48 ngcdcsAPD(ngcbIFC *ifc, const ngcb_route_t &r, int nb);
49
51 virtual ~ngcdcsAPD();
52
54 int Enable(int check = 1);
55
57 int Disable();
58
60 void ClkMap(ngcdcs_clk_t *cv);
61
63 void DcMap(ngcdcs_dc_t *dv);
64
66 void DefaultSetup(const char *keyWord = NULL);
67
69 int VStatus(int *s);
70
72 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
73
75 int VoltageDC(int num, double volt, int rangeCheck = 1);
76
78 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
79 USE(num); USE(value); USE(rangeCheck);
80 strcpy(ErrMsg(), "function not available");
81 return (ngcbMOD_ERR);
82 }
83
85 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
86 USE(num); USE(l); USE(value); USE(rangeCheck);
87 strcpy(ErrMsg(), "function not available");
88 return (ngcbMOD_ERR);
89 }
90
92 int OutputEnable();
93
95 int OutputDisable();
96
98 char *VStatusString() {return statStr_;}
99
101 int Monitor(int num, int clkChan);
102
104 int OffsetClk(double volt) {
105 USE(volt);
106 return (Success());
107 }
108
110 int OffsetDC(double volt) {
111 USE(volt);
112 return (Success());
113 }
114
116 int PreampOffset(double volt);
117
119 int VideoOffset(double * volt) {
120 USE(volt);
121 return (Success());
122 }
123
125 int DiodeBias(double volt) {
126 USE(volt);
127 return (Success());
128 }
129
131 double OffsetClk() {return (0.0);}
132
134 double OffsetDC() {return (0.0);}
135
137 int TelIntern(int sel = -1);
138
140 double TelCurrent(int chan);
141
143 int TelChan(int chan, double *volt);
144
146 int TelDC(int num, double *volt);
147
149 int TelClk(int num, int l, double *volt);
150
152 int TelClk(int num, ngcdcs_clkv_t *cv) {
153 int j;
154 for (j=0;j<ngcdcsCLDC_DCLK;j++)
155 {
156 double volt;
157 if (TelClk(num, j, &volt) != Success())
158 {
159 return (ngcbMOD_ERR);
160 }
161 else
162 {
163 cv->volt[j] = volt;
164 }
165 }
166 return (Success());
167 }
168
170 int Snapshot();
171
173 int Protection(int flag) {
174 protectionOn = flag;
175 return (Success());
176 }
177
179 int Zero();
180
182 int Calibrate(int noSetup = 0) {
183 USE(noSetup);
184 return (Success());
185 }
186
189
191 int Calibrated() {return (1);}
192
194 int SetupKey(const char *key, const int *idx, const char *value,
195 int *status = NULL);
196
198 int StatusKey(const char *key, const int *idx, char *value,
199 int *status = NULL);
200
201protected:
202
203private:
205 char statStr_[32];
206
208 double dcSave_[ngcbCLDC_MAX_DC];
209
211 double *current_;
212
214 void Init_();
215};
216
217#endif
218
Definition ngcbIFC.hpp:760
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:68
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:66
int Snapshot()
Telemetry snapshot.
Definition ngcdcsAPD.cpp:913
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsAPD.cpp:558
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsAPD.cpp:582
virtual ~ngcdcsAPD()
Destructor.
Definition ngcdcsAPD.cpp:45
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsAPD.hpp:125
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsAPD.hpp:110
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsAPD.cpp:612
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsAPD.hpp:152
double OffsetClk()
Return offset for clocks.
Definition ngcdcsAPD.hpp:131
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsAPD.cpp:697
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsAPD.hpp:119
void ClearCalibration()
Clear calibration.
Definition ngcdcsAPD.hpp:188
char * VStatusString()
Get voltage status string.
Definition ngcdcsAPD.hpp:98
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsAPD.cpp:372
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsAPD.hpp:173
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsAPD.cpp:95
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsAPD.cpp:876
ngcdcsAPD(const ngcb_route_t &r, int nb)
Constructor with route and number of biases.
Definition ngcdcsAPD.cpp:30
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsAPD.hpp:134
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsAPD.cpp:851
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsAPD.cpp:1022
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsAPD.hpp:182
int Zero()
Set all voltages to zero.
Definition ngcdcsAPD.cpp:362
int OutputDisable()
Disable output.
Definition ngcdcsAPD.cpp:322
ngcdcs_apd_t chan[2]
APD channels.
Definition ngcdcsAPD.hpp:42
double TelCurrent(int chan)
Return value of last current-telemetry.
Definition ngcdcsAPD.cpp:864
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsAPD.hpp:78
int OutputEnable()
Enable output.
Definition ngcdcsAPD.cpp:216
int Calibrated()
Check if calibration has been done.
Definition ngcdcsAPD.hpp:191
int PreampOffset(double volt)
Preamplifier offset/supply.
Definition ngcdcsAPD.cpp:1017
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsAPD.cpp:839
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsAPD.hpp:85
int Disable()
Disable call back.
Definition ngcdcsAPD.cpp:201
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsAPD.cpp:716
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsAPD.cpp:722
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsAPD.cpp:1038
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsAPD.hpp:104
int protectionOn
Flag indicating whether protection is enabled.
Definition ngcdcsCLDC.hpp:150
int TelChan()
Return actual telemetry channel.
Definition ngcdcsCldcTel.cpp:81
ngcdcsCLDC(const ngcb_route_t &r, int nc, int nb)
Constructor with route, number of clocks and number of biases.
Definition ngcdcsCLDC.cpp:29
#define ngcbCLDC_MAX_DC
Definition ngcbAddr.h:334
#define ngcbMOD_ERR
Definition ngcbOBJ.hpp:23
#define USE(x)
Definition ngcb.h:29
#define ngcdcsCLDC_DCLK
Definition ngcdcsCLDC.hpp:39
Definition ngcbIFC.hpp:78
Definition ngcdcsAPD.hpp:26
int feedback
Definition ngcdcsAPD.hpp:28
ngcdcs_apd_t()
Constructor.
Definition ngcdcsAPD.hpp:32
int fault
Definition ngcdcsAPD.hpp:29
int enabled
Definition ngcdcsAPD.hpp:27
Definition ngcdcsCLDC.hpp:104
Definition ngcdcsCLDC.hpp:115
double volt[ngcdcsCLDC_DCLK]
Definition ngcdcsCLDC.hpp:116
Definition ngcdcsCLDC.hpp:64