ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcdcsC20B20.hpp
Go to the documentation of this file.
1
7#ifndef ngcdcsC20B20_H
8#define ngcdcsC20B20_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 ngcdcsC20B20_ERR_PROTECTION 0x1
21
26{
27public:
29 ngcdcsC20B20(const ngcb_route_t &r, int nc, int nb);
30
32 ngcdcsC20B20(ngcbIFC *ifc, const ngcb_route_t &r, int nc, int nb);
33
35 virtual ~ngcdcsC20B20();
36
38 int Enable(int check = 1);
39
41 int Disable();
42
44 void ClkMap(ngcdcs_clk_t *cv);
45
47 void DcMap(ngcdcs_dc_t *dv);
48
50 void DefaultSetup(const char *keyWord = NULL);
51
53 int VStatus(int *s);
54
56 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
57
59 int VoltageDC(int num, double volt, int rangeCheck = 1);
60
62 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
63 USE(num); USE(value); USE(rangeCheck);
64 strcpy(ErrMsg(), "function not available");
65 return (ngcbMOD_ERR);
66 }
67
69 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
70 USE(num); USE(l); USE(value); USE(rangeCheck);
71 strcpy(ErrMsg(), "function not available");
72 return (ngcbMOD_ERR);
73 }
74
76 int OutputEnable();
77
79 int OutputDisable();
80
82 char *VStatusString() {return statStr_;}
83
85 int Monitor(int num, int clkChan);
86
88 int OffsetClk(double volt) {
89 USE(volt);
90 return (Success());
91 }
92
94 int OffsetDC(double volt) {
95 USE(volt);
96 return (Success());
97 }
98
100 int PreampOffset(double volt);
101
103 int VideoOffset(double * volt) {
104 USE(volt);
105 return (Success());
106 }
107
109 int DiodeBias(double volt) {
110 USE(volt);
111 return (Success());
112 }
113
115 double OffsetClk() {return (0.0);}
116
118 double OffsetDC() {return (0.0);}
119
121 int TelIntern(int sel = -1);
122
124 double TelCurrent(int chan);
125
127 int TelChan(int chan, double *volt);
128
130 int TelDC(int num, double *volt);
131
133 int TelClk(int num, int l, double *volt);
134
136 int TelClk(int num, ngcdcs_clkv_t *cv) {
137 int j;
138 for (j=0;j<ngcdcsCLDC_DCLK;j++)
139 {
140 double volt;
141 if (TelClk(num, j, &volt) != Success())
142 {
143 return (ngcbMOD_ERR);
144 }
145 else
146 {
147 cv->volt[j] = volt;
148 }
149 }
150 return (Success());
151 }
152
154 int Snapshot();
155
157 int Protection(int flag) {
158 protectionOn = flag;
159 return (Success());
160 }
161
163 int Zero();
164
166 int Calibrate(int noSetup = 0) {
167 USE(noSetup);
168 return (Success());
169 }
170
173
175 int Calibrated() {return (1);}
176
178 int SetupKey(const char *key, const int *idx, const char *value,
179 int *status = NULL);
180
182 int StatusKey(const char *key, const int *idx, char *value,
183 int *status = NULL);
184
185protected:
186
187private:
189 char statStr_[32];
190
192 double dcSave_[ngcbCLDC_MAX_DC];
193
195 double *current_;
196
198 void Init_();
199
201 int ChanV_(int idx);
202
204 int ChanC_(int idx);
205};
206
207#endif
208
Definition ngcbIFC.hpp:754
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:67
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:65
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsC20B20.hpp:118
int Calibrated()
Check if calibration has been done.
Definition ngcdcsC20B20.hpp:175
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsC20B20.cpp:642
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsC20B20.hpp:136
int Disable()
Disable call back.
Definition ngcdcsC20B20.cpp:196
int OutputEnable()
Enable output.
Definition ngcdcsC20B20.cpp:211
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsC20B20.cpp:367
int PreampOffset(double volt)
Preamplifier offset/supply.
Definition ngcdcsC20B20.cpp:811
char * VStatusString()
Get voltage status string.
Definition ngcdcsC20B20.hpp:82
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsC20B20.cpp:337
int OutputDisable()
Disable output.
Definition ngcdcsC20B20.cpp:298
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsC20B20.hpp:103
int Snapshot()
Telemetry snapshot.
Definition ngcdcsC20B20.cpp:716
double TelCurrent(int chan)
Return value of last current-telemetry.
Definition ngcdcsC20B20.cpp:667
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsC20B20.cpp:654
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsC20B20.hpp:69
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsC20B20.hpp:157
int Enable(int check=1)
Call-back at transition to operational state.
Definition ngcdcsC20B20.cpp:98
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsC20B20.hpp:166
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsC20B20.cpp:523
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsC20B20.hpp:62
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsC20B20.hpp:88
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsC20B20.cpp:679
void ClearCalibration()
Clear calibration.
Definition ngcdcsC20B20.hpp:172
int Zero()
Set all voltages to zero.
Definition ngcdcsC20B20.cpp:327
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsC20B20.cpp:832
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsC20B20.cpp:529
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsC20B20.cpp:343
ngcdcsC20B20(const ngcb_route_t &r, int nc, int nb)
Constructor with route and number of biases.
Definition ngcdcsC20B20.cpp:29
double OffsetClk()
Return offset for clocks.
Definition ngcdcsC20B20.hpp:115
virtual ~ngcdcsC20B20()
Destructor.
Definition ngcdcsC20B20.cpp:44
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsC20B20.cpp:504
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsC20B20.cpp:816
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsC20B20.cpp:397
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsC20B20.hpp:94
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsC20B20.hpp:109
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 ngcdcsCLDC.hpp:103
Definition ngcdcsCLDC.hpp:114
double volt[ngcdcsCLDC_DCLK]
Definition ngcdcsCLDC.hpp:115
Definition ngcdcsCLDC.hpp:63