ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsC24.hpp
Go to the documentation of this file.
1
8#ifndef ngcdcsC24_H
9#define ngcdcsC24_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 ngcdcsC24_ERR_PROTECTION 0x1
22
27 int enable; //< Enable/disable
28 double limit; //< Slew rate limit
29
32 enable = 0;
33 limit = 0.0; // no limit
34 }
35};
36
41 int enable; //< Enable/disable
42 int source; //< Logical bank source (0 or 1)
43
46 enable = 0;
47 source = 0;
48 }
49};
50
55 double re_limit; //< Rising edge slew rate limit
56 double fe_limit; //< Falling edge slew rate limit
57
60 re_limit = 0.0; // no limit
61 fe_limit = 0.0; // no limit
62 }
63};
64
68class ngcdcsC24: public ngcdcsCLDC
69{
70public:
73
76
79
80 // Logical slow clocks configuration
82
84 ngcdcsC24(const ngcb_route_t &r);
85
87 ngcdcsC24(ngcbIFC *ifc, const ngcb_route_t &r);
88
90 virtual ~ngcdcsC24();
91
93 int Enable(int check = 1);
94
96 int Disable();
97
99 void ClkMap(ngcdcs_clk_t *cv);
100
102 void DcMap(ngcdcs_dc_t *dv);
103
105 void DefaultSetup(const char *keyWord = NULL);
106
108 int VStatus(int *s);
109
111 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
112
114 int VoltageDC(int num, double volt, int rangeCheck = 1);
115
117 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
118 USE(num); USE(value); USE(rangeCheck);
119 strcpy(ErrMsg(), "function not available");
120 return (ngcbMOD_ERR);
121 }
122
124 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
125 USE(num); USE(l); USE(value); USE(rangeCheck);
126 strcpy(ErrMsg(), "function not available");
127 return (ngcbMOD_ERR);
128 }
129
131 int OutputEnable();
132
134 int OutputDisable();
135
137 char *VStatusString() {return statStr_;}
138
140 int Monitor(int num, int clkChan);
141
143 int OffsetClk(double volt) {
144 USE(volt);
145 return (Success());
146 }
147
149 int OffsetDC(double volt) {
150 USE(volt);
151 return (Success());
152 }
153
155 int PreampOffset(double volt);
156
158 int VideoOffset(double * volt) {
159 USE(volt);
160 return (Success());
161 }
162
164 int DiodeBias(double volt) {
165 USE(volt);
166 return (Success());
167 }
168
170 double OffsetClk() {return (0.0);}
171
173 double OffsetDC() {return (0.0);}
174
176 int TelIntern(int sel = -1);
177
179 double TelCurrent(int chan);
180
182 int TelChan(int chan, double *volt);
183
185 int TelDC(int num, double *volt);
186
188 int TelClk(int num, int l, double *volt);
189
191 int TelClk(int num, ngcdcs_clkv_t *cv) {
192 int j;
193 for (j=0;j<ngcdcsCLDC_DCLK;j++)
194 {
195 double volt;
196 if (TelClk(num, j, &volt) != Success())
197 {
198 return (ngcbMOD_ERR);
199 }
200 else
201 {
202 cv->volt[j] = volt;
203 }
204 }
205 return (Success());
206 }
207
209 int Snapshot();
210
212 int Protection(int flag) {
213 protectionOn = flag;
214 return (Success());
215 }
216
218 int Zero();
219
221 int Calibrate(int noSetup = 0) {
222 USE(noSetup);
223 return (Success());
224 }
225
228
230 int Calibrated() {return (1);}
231
233 int SetFastBankLimit(int idx, double limit);
234
236 int SetSlowBankSource(int idx, int source);
237
239 int SetSlowClockLimitRE(int idx, double limit);
240
242 int SetSlowClockLimitFE(int idx, double limit);
243
245 int SetMon(int idx, ngcdcs_fpm_t port);
246
248 int GetMon(int idx, ngcdcs_fpm_t *port);
249
251 int SetupKey(const char *key, const int *idx, const char *value,
252 int *status = NULL);
253
255 int StatusKey(const char *key, const int *idx, char *value,
256 int *status = NULL);
257
258protected:
259
260private:
262 char statStr_[32];
263
265 double dcSave_[ngcbCLDC_MAX_DC];
266
268 double *current_;
269
271 void Init_();
272};
273
274#endif
275
Definition ngcbIFC.hpp:760
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:68
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:66
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsC24.hpp:143
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsC24.hpp:124
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsC24.cpp:790
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsC24.hpp:158
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsC24.cpp:1249
int Calibrated()
Check if calibration has been done.
Definition ngcdcsC24.hpp:230
int PreampOffset(double volt)
Preamplifier offset/supply.
Definition ngcdcsC24.cpp:946
int SetSlowClockLimitFE(int idx, double limit)
Set slow clock falling edge slew rate limit.
Definition ngcdcsC24.cpp:1089
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsC24.hpp:173
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsC24.hpp:191
int Disable()
Disable call back.
Definition ngcdcsC24.cpp:314
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsC24.cpp:181
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsC24.cpp:471
int GetMon(int idx, ngcdcs_fpm_t *port)
Get front panel monitor.
Definition ngcdcsC24.cpp:1186
double TelCurrent(int chan)
Return value of last current-telemetry.
Definition ngcdcsC24.cpp:809
int SetMon(int idx, ngcdcs_fpm_t port)
Set front panel monitor.
Definition ngcdcsC24.cpp:1140
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsC24.cpp:778
int OutputDisable()
Disable output.
Definition ngcdcsC24.cpp:432
ngcdcs_c24_fbank_t fbank[4]
Fast clock banks.
Definition ngcdcsC24.hpp:75
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsC24.hpp:149
int SetSlowClockLimitRE(int idx, double limit)
Set slow clock rising edge slew rate limit.
Definition ngcdcsC24.cpp:1038
int OutputEnable()
Enable output.
Definition ngcdcsC24.cpp:329
int SetSlowBankSource(int idx, int source)
Set slow clock bank source.
Definition ngcdcsC24.cpp:1000
ngcdcs_c24_pbank_t pbank[4]
Physical slow clock banks.
Definition ngcdcsC24.hpp:78
ngcdcsC24(const ngcb_route_t &r)
Constructor with route and number of biases.
Definition ngcdcsC24.cpp:30
ngcdcs_c24_clk_t sclk[8]
Definition ngcdcsC24.hpp:81
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsC24.cpp:662
void ClearCalibration()
Clear calibration.
Definition ngcdcsC24.hpp:227
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsC24.cpp:477
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsC24.hpp:164
virtual ~ngcdcsC24()
Destructor.
Definition ngcdcsC24.cpp:45
int SetFastBankLimit(int idx, double limit)
Set fast clock bank slew rate limit.
Definition ngcdcsC24.cpp:952
char * VStatusString()
Get voltage status string.
Definition ngcdcsC24.hpp:137
ngcdcs_fpm_t monitor[4]
Front panel monitors.
Definition ngcdcsC24.hpp:72
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsC24.cpp:1429
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsC24.cpp:501
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsC24.hpp:117
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsC24.hpp:212
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsC24.hpp:221
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsC24.cpp:821
double OffsetClk()
Return offset for clocks.
Definition ngcdcsC24.hpp:170
int Snapshot()
Telemetry snapshot.
Definition ngcdcsC24.cpp:858
int Zero()
Set all voltages to zero.
Definition ngcdcsC24.cpp:466
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsC24.cpp:656
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsC24.cpp:531
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsC24.cpp:669
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 ngcdcsC24.hpp:54
double fe_limit
Definition ngcdcsC24.hpp:56
double re_limit
Definition ngcdcsC24.hpp:55
ngcdcs_c24_clk_t()
Constructor.
Definition ngcdcsC24.hpp:59
Definition ngcdcsC24.hpp:26
int enable
Definition ngcdcsC24.hpp:27
double limit
Definition ngcdcsC24.hpp:28
ngcdcs_c24_fbank_t()
Constructor.
Definition ngcdcsC24.hpp:31
Definition ngcdcsC24.hpp:40
int source
Definition ngcdcsC24.hpp:42
ngcdcs_c24_pbank_t()
Constructor.
Definition ngcdcsC24.hpp:45
int enable
Definition ngcdcsC24.hpp:41
Definition ngcdcsCLDC.hpp:104
Definition ngcdcsCLDC.hpp:115
double volt[ngcdcsCLDC_DCLK]
Definition ngcdcsCLDC.hpp:116
Definition ngcdcsCLDC.hpp:64
Definition ngcdcsTypes.hpp:57