ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsLISABIAS.hpp
Go to the documentation of this file.
1
8#ifndef ngcdcsLISABIAS_H
9#define ngcdcsLISABIAS_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 ngcdcsLISABIAS_ERR_PROTECTION 0x1
22
27{
28public:
30 ngcdcsLISABIAS(const ngcb_route_t &r, int nb);
31
33 ngcdcsLISABIAS(ngcbIFC *ifc, const ngcb_route_t &r, int nb);
34
36 virtual ~ngcdcsLISABIAS();
37
39 void ClkMap(ngcdcs_clk_t *cv);
40
42 void DcMap(ngcdcs_dc_t *dv);
43
45 int AtOnline();
46
48 int VStatus(int *s);
49
51 void DefaultSetup(const char *keyWord = NULL);
52
54 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
55
57 int VoltageDC(int num, double volt, int rangeCheck = 1);
58
60 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
61 USE(num); USE(value); USE(rangeCheck);
62 strcpy(ErrMsg(), "function not available");
63 return (ngcbMOD_ERR);
64 }
65
67 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
68 USE(num); USE(l); USE(value); USE(rangeCheck);
69 strcpy(ErrMsg(), "function not available");
70 return (ngcbMOD_ERR);
71 }
72
76 strcpy(statStr_, "enabled");
77 return (Success());
78 }
79
83 strcpy(statStr_, "disabled");
84 return (Success());
85 }
86
88 char *VStatusString() {return statStr_;}
89
91 int Monitor(int num, int clkChan) {
92 USE(num); USE(clkChan);
93 return (Success());
94 }
95
97 int OffsetClk(double volt) {
98 USE(volt);
99 return (Success());
100 }
101
103 int OffsetDC(double volt) {
104 USE(volt);
105 return (Success());
106 }
107
109 int PreampOffset(double volt) {
110 USE(volt);
111 return (Success());
112 }
113
115 int VideoOffset(double * volt) {
116 USE(volt);
117 return (Success());
118 }
119
121 int DiodeBias(double volt) {
122 USE(volt);
123 return (Success());
124 }
125
127 double OffsetClk() {return (0.0);}
128
130 double OffsetDC() {return (0.0);}
131
133 int TelIntern(int sel = -1) {USE(sel); return (Success());}
134
136 int TelChan(int num, double *volt);
137
139 int TelDC(int num, double *volt);
140
142 int TelClk(int num, int l, double *volt) {
143 if ((num < 0) || (num >= numClk))
144 {
145 sprintf(ErrMsg(), "clock channel number out of range");
146 return (ngcbMOD_ERR);
147 }
148 *volt = clk[num].level[l].volt;
149 clkTel[num].volt[l] = *volt;
150 return (Success());
151 }
152
154 int TelClk(int num, ngcdcs_clkv_t *cv) {
155 int j;
156 for (j=0;j<ngcdcsCLDC_DCLK;j++)
157 {
158 double volt;
159 if (TelClk(num, j, &volt) != Success())
160 {
161 return (ngcbMOD_ERR);
162 }
163 else
164 {
165 cv->volt[j] = volt;
166 }
167 }
168 return (Success());
169 }
170
172 int Protection(int flag) {
173 protectionOn = flag;
174 return (Success());
175 }
176
178 int Zero() {return (Success());}
179
181 int Calibrate(int noSetup = 0) {
182 USE(noSetup);
183 return (Success());
184 }
185
188
190 int Calibrated() {return (1);}
191
193 int SetupKey(const char *key, const int *idx, const char *value,
194 int *status = NULL);
195
197 int StatusKey(const char *key, const int *idx, char *value,
198 int *status = NULL);
199
200protected:
201
202private:
204 void Init_();
205
207 int Chan2_(int chan);
208
210 int DacData_(int chan);
211
213 int DacCtrl_(int chan);
214
216 double dcSave_[ngcbCLDC_MAX_DC];
217
219 char statStr_[32];
220};
221
222#endif
Definition ngcbIFC.hpp:760
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:68
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:66
int vstat
Soft-status (enabled, disabled)
Definition ngcdcsCLDC.hpp:132
ngcdcs_clkv_t * clkTel
Saved clock voltages telemetry values.
Definition ngcdcsCLDC.hpp:171
int numClk
Number of clock voltages.
Definition ngcdcsCLDC.hpp:162
int protectionOn
Flag indicating whether protection is enabled.
Definition ngcdcsCLDC.hpp:150
ngcdcs_clk_t * clk
Clock voltages.
Definition ngcdcsCLDC.hpp:159
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
char * VStatusString()
Get voltage status string.
Definition ngcdcsLISABIAS.hpp:88
void ClearCalibration()
Clear calibration.
Definition ngcdcsLISABIAS.hpp:187
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsLISABIAS.cpp:429
double OffsetClk()
Return offset for clocks.
Definition ngcdcsLISABIAS.hpp:127
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsLISABIAS.hpp:67
int AtOnline()
At online hook.
Definition ngcdcsLISABIAS.cpp:78
int PreampOffset(double volt)
Preamplifier offset dummy function.
Definition ngcdcsLISABIAS.hpp:109
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsLISABIAS.hpp:91
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsLISABIAS.hpp:115
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsLISABIAS.cpp:153
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsLISABIAS.hpp:172
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsLISABIAS.hpp:154
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsLISABIAS.cpp:123
virtual ~ngcdcsLISABIAS()
Destructor.
Definition ngcdcsLISABIAS.cpp:45
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsLISABIAS.hpp:103
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsLISABIAS.hpp:97
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsLISABIAS.hpp:121
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsLISABIAS.hpp:142
int OutputEnable()
Enable output.
Definition ngcdcsLISABIAS.hpp:74
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsLISABIAS.cpp:177
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsLISABIAS.hpp:133
ngcdcsLISABIAS(const ngcb_route_t &r, int nb)
Constructor with route and number of biases.
Definition ngcdcsLISABIAS.cpp:30
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsLISABIAS.cpp:501
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsLISABIAS.cpp:435
int Zero()
Set all voltages to zero.
Definition ngcdcsLISABIAS.hpp:178
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsLISABIAS.cpp:662
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsLISABIAS.cpp:117
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsLISABIAS.hpp:130
int Calibrated()
Check if calibration has been done.
Definition ngcdcsLISABIAS.hpp:190
int OutputDisable()
Disable output.
Definition ngcdcsLISABIAS.hpp:81
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsLISABIAS.hpp:181
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsLISABIAS.hpp:60
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsLISABIAS.cpp:514
#define ngcbCLDC_MAX_DC
Definition ngcbAddr.h:334
#define ngcbCLDC_STAT_ENABLED
Definition ngcbAddr.h:328
#define ngcbCLDC_STAT_DISABLED
Definition ngcbAddr.h:327
#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