ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsC20B20.hpp
Go to the documentation of this file.
1
8#ifndef ngcdcsC20B20_H
9#define ngcdcsC20B20_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 ngcdcsC20B20_ERR_PROTECTION 0x1
22
27{
28public:
30 ngcdcsC20B20(const ngcb_route_t &r, int nc, int nb);
31
33 ngcdcsC20B20(ngcbIFC *ifc, const ngcb_route_t &r, int nc, int nb);
34
36 virtual ~ngcdcsC20B20();
37
39 int Enable(int check = 1);
40
42 int Disable();
43
45 void ClkMap(ngcdcs_clk_t *cv);
46
48 void DcMap(ngcdcs_dc_t *dv);
49
51 void DefaultSetup(const char *keyWord = NULL);
52
54 int VStatus(int *s);
55
57 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
58
60 int VoltageDC(int num, double volt, int rangeCheck = 1);
61
63 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
64 USE(num); USE(value); USE(rangeCheck);
65 strcpy(ErrMsg(), "function not available");
66 return (ngcbMOD_ERR);
67 }
68
70 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
71 USE(num); USE(l); USE(value); USE(rangeCheck);
72 strcpy(ErrMsg(), "function not available");
73 return (ngcbMOD_ERR);
74 }
75
77 int OutputEnable();
78
80 int OutputDisable();
81
83 char *VStatusString() {return statStr_;}
84
86 int Monitor(int num, int clkChan);
87
89 int OffsetClk(double volt) {
90 USE(volt);
91 return (Success());
92 }
93
95 int OffsetDC(double volt) {
96 USE(volt);
97 return (Success());
98 }
99
101 int PreampOffset(double volt);
102
104 int VideoOffset(double * volt) {
105 USE(volt);
106 return (Success());
107 }
108
110 int DiodeBias(double volt) {
111 USE(volt);
112 return (Success());
113 }
114
116 double OffsetClk() {return (0.0);}
117
119 double OffsetDC() {return (0.0);}
120
122 int TelIntern(int sel = -1);
123
125 double TelCurrent(int chan);
126
128 int TelChan(int chan, double *volt);
129
131 int TelDC(int num, double *volt);
132
134 int TelClk(int num, int l, double *volt);
135
137 int TelClk(int num, ngcdcs_clkv_t *cv) {
138 int j;
139 for (j=0;j<ngcdcsCLDC_DCLK;j++)
140 {
141 double volt;
142 if (TelClk(num, j, &volt) != Success())
143 {
144 return (ngcbMOD_ERR);
145 }
146 else
147 {
148 cv->volt[j] = volt;
149 }
150 }
151 return (Success());
152 }
153
155 int Snapshot();
156
158 int Protection(int flag) {
159 protectionOn = flag;
160 return (Success());
161 }
162
164 int Zero();
165
167 int Calibrate(int noSetup = 0) {
168 USE(noSetup);
169 return (Success());
170 }
171
174
176 int Calibrated() {return (1);}
177
179 int SetupKey(const char *key, const int *idx, const char *value,
180 int *status = NULL);
181
183 int StatusKey(const char *key, const int *idx, char *value,
184 int *status = NULL);
185
186protected:
187
188private:
190 char statStr_[32];
191
193 double dcSave_[ngcbCLDC_MAX_DC];
194
196 double *current_;
197
199 void Init_();
200
202 int ChanV_(int idx);
203
205 int ChanC_(int idx);
206};
207
208#endif
209
Definition ngcbIFC.hpp:760
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:68
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:66
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsC20B20.hpp:119
int Calibrated()
Check if calibration has been done.
Definition ngcdcsC20B20.hpp:176
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsC20B20.cpp:685
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsC20B20.hpp:137
int Disable()
Disable call back.
Definition ngcdcsC20B20.cpp:197
int OutputEnable()
Enable output.
Definition ngcdcsC20B20.cpp:212
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsC20B20.cpp:410
int PreampOffset(double volt)
Preamplifier offset/supply.
Definition ngcdcsC20B20.cpp:854
char * VStatusString()
Get voltage status string.
Definition ngcdcsC20B20.hpp:83
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsC20B20.cpp:361
int OutputDisable()
Disable output.
Definition ngcdcsC20B20.cpp:311
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsC20B20.hpp:104
int Snapshot()
Telemetry snapshot.
Definition ngcdcsC20B20.cpp:759
double TelCurrent(int chan)
Return value of last current-telemetry.
Definition ngcdcsC20B20.cpp:710
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsC20B20.cpp:697
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsC20B20.hpp:70
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsC20B20.hpp:158
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsC20B20.cpp:99
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsC20B20.hpp:167
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsC20B20.cpp:566
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsC20B20.hpp:63
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsC20B20.hpp:89
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsC20B20.cpp:722
void ClearCalibration()
Clear calibration.
Definition ngcdcsC20B20.hpp:173
int Zero()
Set all voltages to zero.
Definition ngcdcsC20B20.cpp:351
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsC20B20.cpp:875
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsC20B20.cpp:572
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsC20B20.cpp:386
ngcdcsC20B20(const ngcb_route_t &r, int nc, int nb)
Constructor with route and number of biases.
Definition ngcdcsC20B20.cpp:30
double OffsetClk()
Return offset for clocks.
Definition ngcdcsC20B20.hpp:116
virtual ~ngcdcsC20B20()
Destructor.
Definition ngcdcsC20B20.cpp:45
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsC20B20.cpp:547
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsC20B20.cpp:859
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsC20B20.cpp:440
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsC20B20.hpp:95
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsC20B20.hpp:110
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 ngcdcsCLDC.hpp:104
Definition ngcdcsCLDC.hpp:115
double volt[ngcdcsCLDC_DCLK]
Definition ngcdcsCLDC.hpp:116
Definition ngcdcsCLDC.hpp:64