ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcdcsLISABIAS.hpp
Go to the documentation of this file.
1
7#ifndef ngcdcsLISABIAS_H
8#define ngcdcsLISABIAS_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 ngcdcsLISABIAS_ERR_PROTECTION 0x1
21
26{
27public:
29 ngcdcsLISABIAS(const ngcb_route_t &r, int nb);
30
32 ngcdcsLISABIAS(ngcbIFC *ifc, const ngcb_route_t &r, int nb);
33
35 virtual ~ngcdcsLISABIAS();
36
38 void ClkMap(ngcdcs_clk_t *cv);
39
41 void DcMap(ngcdcs_dc_t *dv);
42
44 int AtOnline();
45
47 int VStatus(int *s);
48
50 void DefaultSetup(const char *keyWord = NULL);
51
53 int VoltageClk(int num, int l, double volt, int rangeCheck = 1);
54
56 int VoltageDC(int num, double volt, int rangeCheck = 1);
57
59 int VoltageRegDC(int num, int value, int rangeCheck = 1) {
60 USE(num); USE(value); USE(rangeCheck);
61 strcpy(ErrMsg(), "function not available");
62 return (ngcbMOD_ERR);
63 }
64
66 int VoltageRegClk(int num, int l, int value, int rangeCheck = 1) {
67 USE(num); USE(l); USE(value); USE(rangeCheck);
68 strcpy(ErrMsg(), "function not available");
69 return (ngcbMOD_ERR);
70 }
71
75 strcpy(statStr_, "enabled");
76 return (Success());
77 }
78
82 strcpy(statStr_, "disabled");
83 return (Success());
84 }
85
87 char *VStatusString() {return statStr_;}
88
90 int Monitor(int num, int clkChan) {
91 USE(num); USE(clkChan);
92 return (Success());
93 }
94
96 int OffsetClk(double volt) {
97 USE(volt);
98 return (Success());
99 }
100
102 int OffsetDC(double volt) {
103 USE(volt);
104 return (Success());
105 }
106
108 int PreampOffset(double volt) {
109 USE(volt);
110 return (Success());
111 }
112
114 int VideoOffset(double * volt) {
115 USE(volt);
116 return (Success());
117 }
118
120 int DiodeBias(double volt) {
121 USE(volt);
122 return (Success());
123 }
124
126 double OffsetClk() {return (0.0);}
127
129 double OffsetDC() {return (0.0);}
130
132 int TelIntern(int sel = -1) {USE(sel); return (Success());}
133
135 int TelChan(int num, double *volt);
136
138 int TelDC(int num, double *volt);
139
141 int TelClk(int num, int l, double *volt) {
142 if ((num < 0) || (num >= numClk))
143 {
144 sprintf(ErrMsg(), "clock channel number out of range");
145 return (ngcbMOD_ERR);
146 }
147 *volt = clk[num].level[l].volt;
148 clkTel[num].volt[l] = *volt;
149 return (Success());
150 }
151
153 int TelClk(int num, ngcdcs_clkv_t *cv) {
154 int j;
155 for (j=0;j<ngcdcsCLDC_DCLK;j++)
156 {
157 double volt;
158 if (TelClk(num, j, &volt) != Success())
159 {
160 return (ngcbMOD_ERR);
161 }
162 else
163 {
164 cv->volt[j] = volt;
165 }
166 }
167 return (Success());
168 }
169
171 int Protection(int flag) {
172 protectionOn = flag;
173 return (Success());
174 }
175
177 int Zero() {return (Success());}
178
180 int Calibrate(int noSetup = 0) {
181 USE(noSetup);
182 return (Success());
183 }
184
187
189 int Calibrated() {return (1);}
190
192 int SetupKey(const char *key, const int *idx, const char *value,
193 int *status = NULL);
194
196 int StatusKey(const char *key, const int *idx, char *value,
197 int *status = NULL);
198
199protected:
200
201private:
203 void Init_();
204
206 int Chan2_(int chan);
207
209 int DacData_(int chan);
210
212 int DacCtrl_(int chan);
213
215 double dcSave_[ngcbCLDC_MAX_DC];
216
218 char statStr_[32];
219};
220
221#endif
Definition ngcbIFC.hpp:754
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:67
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:65
int vstat
Soft-status (enabled, disabled)
Definition ngcdcsCLDC.hpp:131
ngcdcs_clkv_t * clkTel
Saved clock voltages telemetry values.
Definition ngcdcsCLDC.hpp:170
int numClk
Number of clock voltages.
Definition ngcdcsCLDC.hpp:161
int protectionOn
Flag indicating whether protection is enabled.
Definition ngcdcsCLDC.hpp:149
ngcdcs_clk_t * clk
Clock voltages.
Definition ngcdcsCLDC.hpp:158
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
char * VStatusString()
Get voltage status string.
Definition ngcdcsLISABIAS.hpp:87
void ClearCalibration()
Clear calibration.
Definition ngcdcsLISABIAS.hpp:186
int VoltageClk(int num, int l, double volt, int rangeCheck=1)
Clock setup.
Definition ngcdcsLISABIAS.cpp:428
double OffsetClk()
Return offset for clocks.
Definition ngcdcsLISABIAS.hpp:126
int VoltageRegClk(int num, int l, int value, int rangeCheck=1)
Direct clock register setup (not applicable)
Definition ngcdcsLISABIAS.hpp:66
int AtOnline()
At online hook.
Definition ngcdcsLISABIAS.cpp:77
int PreampOffset(double volt)
Preamplifier offset dummy function.
Definition ngcdcsLISABIAS.hpp:108
int Monitor(int num, int clkChan)
Clock-monitor dummy function.
Definition ngcdcsLISABIAS.hpp:90
int VideoOffset(double *volt)
Video offset dummy function.
Definition ngcdcsLISABIAS.hpp:114
void ClkMap(ngcdcs_clk_t *cv)
Clock channel mapping.
Definition ngcdcsLISABIAS.cpp:152
int Protection(int flag)
Enable/disable protection circuit.
Definition ngcdcsLISABIAS.hpp:171
int TelClk(int num, ngcdcs_clkv_t *cv)
Telemetry for clock (dummy, all levels)
Definition ngcdcsLISABIAS.hpp:153
void DcMap(ngcdcs_dc_t *dv)
Bias channel mapping.
Definition ngcdcsLISABIAS.cpp:122
virtual ~ngcdcsLISABIAS()
Destructor.
Definition ngcdcsLISABIAS.cpp:44
int OffsetDC(double volt)
Bias offset dummy function.
Definition ngcdcsLISABIAS.hpp:102
int OffsetClk(double volt)
Clock offset dummy function.
Definition ngcdcsLISABIAS.hpp:96
int DiodeBias(double volt)
Diode bias dummy function.
Definition ngcdcsLISABIAS.hpp:120
int TelClk(int num, int l, double *volt)
Telemetry for clock level (dummy)
Definition ngcdcsLISABIAS.hpp:141
int OutputEnable()
Enable output.
Definition ngcdcsLISABIAS.hpp:73
void DefaultSetup(const char *keyWord=NULL)
Default setup.
Definition ngcdcsLISABIAS.cpp:176
int TelIntern(int sel=-1)
Update internal telemetry.
Definition ngcdcsLISABIAS.hpp:132
ngcdcsLISABIAS(const ngcb_route_t &r, int nb)
Constructor with route and number of biases.
Definition ngcdcsLISABIAS.cpp:29
int SetupKey(const char *key, const int *idx, const char *value, int *status=NULL)
Setup.
Definition ngcdcsLISABIAS.cpp:500
int VoltageDC(int num, double volt, int rangeCheck=1)
Bias setup.
Definition ngcdcsLISABIAS.cpp:434
int Zero()
Set all voltages to zero.
Definition ngcdcsLISABIAS.hpp:177
int TelDC(int num, double *volt)
Telemetry for DC-bias.
Definition ngcdcsLISABIAS.cpp:661
int VStatus(int *s)
Get voltage HW-status.
Definition ngcdcsLISABIAS.cpp:116
double OffsetDC()
Return offset for DC-biases.
Definition ngcdcsLISABIAS.hpp:129
int Calibrated()
Check if calibration has been done.
Definition ngcdcsLISABIAS.hpp:189
int OutputDisable()
Disable output.
Definition ngcdcsLISABIAS.hpp:80
int Calibrate(int noSetup=0)
Calibrate.
Definition ngcdcsLISABIAS.hpp:180
int VoltageRegDC(int num, int value, int rangeCheck=1)
Direct bias register setup (not applicable)
Definition ngcdcsLISABIAS.hpp:59
int StatusKey(const char *key, const int *idx, char *value, int *status=NULL)
Status.
Definition ngcdcsLISABIAS.cpp:513
#define ngcbCLDC_MAX_DC
Definition ngcbAddr.h:333
#define ngcbCLDC_STAT_ENABLED
Definition ngcbAddr.h:327
#define ngcbCLDC_STAT_DISABLED
Definition ngcbAddr.h:326
#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