ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcdcsC24.hpp
Go to the documentation of this file.
1
7#ifndef ngcdcsC24_H
8#define ngcdcsC24_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 ngcdcsC24_ERR_PROTECTION 0x1
21
26 int enable; //< Enable/disable
27 double limit; //< Slew rate limit
28
31 enable = 0;
32 limit = 0.0; // no limit
33 }
34};
35
40 int enable; //< Enable/disable
41 int source; //< Logical bank source (0 or 1)
42
45 enable = 0;
46 source = 0;
47 }
48};
49
54 double re_limit; //< Rising edge slew rate limit
55 double fe_limit; //< Falling edge slew rate limit
56
59 re_limit = 0.0; // no limit
60 fe_limit = 0.0; // no limit
61 }
62};
63
67class ngcdcsC24: public ngcdcsCLDC
68{
69public:
72
75
78
79 // Logical slow clocks configuration
81
83 ngcdcsC24(const ngcb_route_t &r);
84
86 ngcdcsC24(ngcbIFC *ifc, const ngcb_route_t &r);
87
89 virtual ~ngcdcsC24();
90
92 int Enable(int check = 1);
93
95 int Disable();
96
98 void ClkMap(ngcdcs_clk_t *cv);
99
101 void DcMap(ngcdcs_dc_t *dv);
102
104 void DefaultSetup(const char *keyWord = NULL);
105
107 int VStatus(int *s);
108
110 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
111
113 int VoltageDC(int num, double volt, int rangeCheck = 1);
114
116 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
117 USE(num); USE(value); USE(rangeCheck);
118 strcpy(ErrMsg(), "function not available");
119 return (ngcbMOD_ERR);
120 }
121
123 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
124 USE(num); USE(l); USE(value); USE(rangeCheck);
125 strcpy(ErrMsg(), "function not available");
126 return (ngcbMOD_ERR);
127 }
128
130 int OutputEnable();
131
133 int OutputDisable();
134
136 char *VStatusString() {return statStr_;}
137
139 int Monitor(int num, int clkChan);
140
142 int OffsetClk(double volt) {
143 USE(volt);
144 return (Success());
145 }
146
148 int OffsetDC(double volt) {
149 USE(volt);
150 return (Success());
151 }
152
154 int PreampOffset(double volt);
155
157 int VideoOffset(double * volt) {
158 USE(volt);
159 return (Success());
160 }
161
163 int DiodeBias(double volt) {
164 USE(volt);
165 return (Success());
166 }
167
169 double OffsetClk() {return (0.0);}
170
172 double OffsetDC() {return (0.0);}
173
175 int TelIntern(int sel = -1);
176
178 double TelCurrent(int chan);
179
181 int TelChan(int chan, double *volt);
182
184 int TelDC(int num, double *volt);
185
187 int TelClk(int num, int l, double *volt);
188
190 int TelClk(int num, ngcdcs_clkv_t *cv) {
191 int j;
192 for (j=0;j<ngcdcsCLDC_DCLK;j++)
193 {
194 double volt;
195 if (TelClk(num, j, &volt) != Success())
196 {
197 return (ngcbMOD_ERR);
198 }
199 else
200 {
201 cv->volt[j] = volt;
202 }
203 }
204 return (Success());
205 }
206
208 int Snapshot();
209
211 int Protection(int flag) {
212 protectionOn = flag;
213 return (Success());
214 }
215
217 int Zero();
218
220 int Calibrate(int noSetup = 0) {
221 USE(noSetup);
222 return (Success());
223 }
224
227
229 int Calibrated() {return (1);}
230
232 int SetFastBankLimit(int idx, double limit);
233
235 int SetSlowBankSource(int idx, int source);
236
238 int SetSlowClockLimitRE(int idx, double limit);
239
241 int SetSlowClockLimitFE(int idx, double limit);
242
244 int SetMon(int idx, ngcdcs_fpm_t port);
245
247 int GetMon(int idx, ngcdcs_fpm_t *port);
248
250 int SetupKey(const char *key, const int *idx, const char *value,
251 int *status = NULL);
252
254 int StatusKey(const char *key, const int *idx, char *value,
255 int *status = NULL);
256
257protected:
258
259private:
261 char statStr_[32];
262
264 double dcSave_[ngcbCLDC_MAX_DC];
265
267 double *current_;
268
270 void Init_();
271};
272
273#endif
274
Definition ngcbIFC.hpp:754
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:67
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:65
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsC24.hpp:142
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsC24.hpp:123
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsC24.cpp:783
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsC24.hpp:157
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsC24.cpp:1242
int Calibrated()
Check if calibration has been done.
Definition ngcdcsC24.hpp:229
int PreampOffset(double volt)
Preamplifier offset/supply.
Definition ngcdcsC24.cpp:939
int SetSlowClockLimitFE(int idx, double limit)
Set slow clock falling edge slew rate limit.
Definition ngcdcsC24.cpp:1082
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsC24.hpp:172
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsC24.hpp:190
int Disable()
Disable call back.
Definition ngcdcsC24.cpp:313
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsC24.cpp:180
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsC24.cpp:464
int GetMon(int idx, ngcdcs_fpm_t *port)
Get front panel monitor.
Definition ngcdcsC24.cpp:1179
double TelCurrent(int chan)
Return value of last current-telemetry.
Definition ngcdcsC24.cpp:802
int SetMon(int idx, ngcdcs_fpm_t port)
Set front panel monitor.
Definition ngcdcsC24.cpp:1133
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsC24.cpp:771
int OutputDisable()
Disable output.
Definition ngcdcsC24.cpp:434
ngcdcs_c24_fbank_t fbank[4]
Fast clock banks.
Definition ngcdcsC24.hpp:74
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsC24.hpp:148
int SetSlowClockLimitRE(int idx, double limit)
Set slow clock rising edge slew rate limit.
Definition ngcdcsC24.cpp:1031
int OutputEnable()
Enable output.
Definition ngcdcsC24.cpp:328
int SetSlowBankSource(int idx, int source)
Set slow clock bank source.
Definition ngcdcsC24.cpp:993
ngcdcs_c24_pbank_t pbank[4]
Physical slow clock banks.
Definition ngcdcsC24.hpp:77
ngcdcsC24(const ngcb_route_t &r)
Constructor with route and number of biases.
Definition ngcdcsC24.cpp:29
ngcdcs_c24_clk_t sclk[8]
Definition ngcdcsC24.hpp:80
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsC24.cpp:655
void ClearCalibration()
Clear calibration.
Definition ngcdcsC24.hpp:226
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsC24.cpp:470
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsC24.hpp:163
virtual ~ngcdcsC24()
Destructor.
Definition ngcdcsC24.cpp:44
int SetFastBankLimit(int idx, double limit)
Set fast clock bank slew rate limit.
Definition ngcdcsC24.cpp:945
char * VStatusString()
Get voltage status string.
Definition ngcdcsC24.hpp:136
ngcdcs_fpm_t monitor[4]
Front panel monitors.
Definition ngcdcsC24.hpp:71
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsC24.cpp:1422
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsC24.cpp:494
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsC24.hpp:116
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsC24.hpp:211
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsC24.hpp:220
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsC24.cpp:814
double OffsetClk()
Return offset for clocks.
Definition ngcdcsC24.hpp:169
int Snapshot()
Telemetry snapshot.
Definition ngcdcsC24.cpp:851
int Zero()
Set all voltages to zero.
Definition ngcdcsC24.cpp:459
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsC24.cpp:649
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsC24.cpp:524
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsC24.cpp:662
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 ngcdcsC24.hpp:53
double fe_limit
Definition ngcdcsC24.hpp:55
double re_limit
Definition ngcdcsC24.hpp:54
ngcdcs_c24_clk_t()
Constructor.
Definition ngcdcsC24.hpp:58
Definition ngcdcsC24.hpp:25
int enable
Definition ngcdcsC24.hpp:26
double limit
Definition ngcdcsC24.hpp:27
ngcdcs_c24_fbank_t()
Constructor.
Definition ngcdcsC24.hpp:30
Definition ngcdcsC24.hpp:39
int source
Definition ngcdcsC24.hpp:41
ngcdcs_c24_pbank_t()
Constructor.
Definition ngcdcsC24.hpp:44
int enable
Definition ngcdcsC24.hpp:40
Definition ngcdcsCLDC.hpp:103
Definition ngcdcsCLDC.hpp:114
double volt[ngcdcsCLDC_DCLK]
Definition ngcdcsCLDC.hpp:115
Definition ngcdcsCLDC.hpp:63
Definition ngcdcsTypes.hpp:56