CARMA C++
PhysicalDevice.h
Go to the documentation of this file.
1 
2 #ifndef CARMA_MONITOR_PHYSICALDEVICE_H
3 #define CARMA_MONITOR_PHYSICALDEVICE_H
4 
5 
6 
20 #include <string>
21 #include <vector>
22 
23 namespace carma {
24  namespace monitor {
25 
26 
35 public:
36 
40  enum LOCATION {
41  NOLOCATION,
42  BIMA1,
43  BIMA2,
44  BIMA3,
45  BIMA4,
46  BIMA5,
47  BIMA6,
48  BIMA7,
49  BIMA8,
50  BIMA9,
51  OVRO1,
52  OVRO2,
53  OVRO3,
54  OVRO4,
55  OVRO5,
56  OVRO6,
57  SZA1,
58  SZA2,
59  SZA3,
60  SZA4,
61  SZA5,
62  SZA6,
63  SZA7,
64  SZA8,
65  WBDC_HOST,
66  SL_CORREL_BAND1,
67  SL_CORREL_BAND2,
68  SL_CORREL_BAND3,
69  SL_CORREL_BAND4,
70  SL_CORREL_BAND5,
71  SL_CORREL_BAND6,
72  SL_CORREL_BAND7,
73  SL_CORREL_BAND8,
74  SLDC_HOST,
75  LOBEROTATOR_CONTROLLER,
76  WB_CORREL_BAND1,
77  WB_CORREL_BAND2,
78  WB_CORREL_BAND3,
79  WB_CORREL_BAND4,
80  WB_CORREL_BAND5,
81  WB_CORREL_BAND6,
82  WB_CORREL_BAND7,
83  WB_CORREL_BAND8,
84  WB_CORREL_BAND9,
85  WB_CORREL_BAND10,
86  WB_CORREL_BAND11,
87  WB_CORREL_BAND12,
88  WB_CORREL_BAND13,
89  WB_CORREL_BAND14,
90  WB_CORREL_BAND15,
91  WB_CORREL_BAND16,
92  // Useful for testing
93  LAB,
94  PHASEMONITOR,
95 
96  // Always last!!
97  NUM_LOCATIONS
98  };
99 
103  enum DEVICE {
104  NODEVICE,
105  WB_DOWNCONVERTER1, // A wideband downconverter module
106  WB_DOWNCONVERTER2, // The first eight are needed to keep the auto
107  WB_DOWNCONVERTER3, // generated code happy
108  WB_DOWNCONVERTER4,
109  WB_DOWNCONVERTER5,
110  WB_DOWNCONVERTER6,
111  WB_DOWNCONVERTER7,
112  WB_DOWNCONVERTER8,
113  WB_DOWNCONVERTER128 = WB_DOWNCONVERTER1 +127, // last one
114  SL_DOWNCONVERTER1, // A spectral line downconverter module
115  SL_DOWNCONVERTER2, // The first 15 are needed to keep the auto
116  SL_DOWNCONVERTER3, // generated code happy
117  SL_DOWNCONVERTER4,
118  SL_DOWNCONVERTER5,
119  SL_DOWNCONVERTER6,
120  SL_DOWNCONVERTER7,
121  SL_DOWNCONVERTER8,
122  SL_DOWNCONVERTER9,
123  SL_DOWNCONVERTER10,
124  SL_DOWNCONVERTER11,
125  SL_DOWNCONVERTER12,
126  SL_DOWNCONVERTER13,
127  SL_DOWNCONVERTER14,
128  SL_DOWNCONVERTER15,
129  SL_DOWNCONVERTER120 = SL_DOWNCONVERTER1 +119, // last one
130  WB_QUADMOD1, // Quadrature modulator for downconverter noise
131  WB_QUADMOD2,
132  WB_QUADMOD3,
133  WB_QUADMOD4,
134  WB_QUADMOD5,
135  WB_QUADMOD6,
136  WB_QUADMOD7,
137  WB_QUADMOD8,
138  SL_QUADMOD1,
139  SL_QUADMOD2,
140  SL_QUADMOD3,
141  SL_QUADMOD4,
142  SL_QUADMOD5,
143  SL_QUADMOD6,
144  SL_QUADMOD7,
145  SL_QUADMOD8,
146  SL_QUADMOD9,
147  SL_QUADMOD10,
148  SL_QUADMOD11,
149  SL_QUADMOD12,
150  SL_QUADMOD13,
151  SL_QUADMOD14,
152  SL_QUADMOD15,
153  WB_NOISE_SOURCE,
154  SL_NOISE_SOURCE,
155  WB_LO_MONITOR,
156  SL_LO_MONITOR,
157  LR_CHAN1,
158  LR_CHAN2,
159  LR_CHAN3,
160  LR_CHAN4,
161  LR_CHAN5,
162  LR_CHAN6,
163  LR_CHAN7,
164  LR_CHAN8,
165  LR_CHAN9,
166  LR_CHAN10,
167  LR_CHAN11,
168  LR_CHAN12,
169  LR_CHAN13,
170  LR_CHAN14,
171  LR_CHAN15,
172  LR_CHAN16,
173  LR_CHAN17,
174  LR_CHAN18,
175  LR_CHAN19,
176  LR_CHAN20,
177  LR_CHAN21,
178  LR_CHAN22,
179  LR_CHAN23,
180  LR_BOARD1,
181  LR_BOARD2,
182  LR_BOARD3,
183  LR_BOARD4,
184  LR_BOARD5,
185  LR_BOARD6,
186  WB_DIGITIZER1,
187  WB_DIGITIZER2,
188  WB_DIGITIZER3,
189  WB_DIGITIZER4,
190  WB_CORRELATOR1,
191  WB_CORRELATOR2,
192  WB_CORRELATOR3,
193  // Antenna devices
194  YIG,
195  GUNN1CM,
196  GUNN3MM,
197  GUNN1MM,
198  IFBOX,
199  CRYO_COMPRESSOR,
200  CRYO_DEWAR,
201  CALIBRATOR,
202  DRIVE,
203  MIXER_3MM,
204  // Dummy devices for testing
205  WIDGET1,
206  WIDGET2,
207  WIDGET3,
208  WIDGET4,
209  WIDGET5,
210  WIDGET6,
211  WIDGET7,
212  WIDGET8,
213  WIDGET9,
214  WIDGET10,
215  BIG_WIDGET,
216  //
217  // master clock
218  MASTER_CLOCK,
219  //
220  TILTMETER,
221  SECONDARY, // 10-m Secondary Mirror
222  OVRO_OPTICS, // 10-m Antenna Optics
223  ENVIRONMENTAL_MONITOR, // 10-m Sidecab Environmental Monitor
224 
225  LOREF_SYNTHESIZER1, // LO Reference Synthesizer 1
226  LOREF_SYNTHESIZER2, // LO Reference Synthesizer 2
227  LOREF_SYNTHESIZER3, // LO Reference Synthesizer 3
228  LOREF_DISTRIBUTION_BOX1, // LO Reference Distribution Box 1
229  LOREF_DISTRIBUTION_BOX2, // LO Reference Distribution Box 2
230  LOREF_DISTRIBUTION_BOX3, // LO Reference Distribution Box 3
231 
232  LOREF_MONITOR, // LO Reference Monitor Module (all antennas)
233 
234  LL_OPTICAL_RXTX_BOX1, // Line Length Optical Tranceiver Box 1
235  LL_OPTICAL_RXTX_BOX2, // Line Length Optical Tranceiver Box 2
236  LL_OPTICAL_RXTX_BOX3, // Line Length Optical Tranceiver Box 3
237 
238  WEATHER_STATION, // probably weather + dewpoint sensor
239 
240  RX_TEMPERATURE_CONTROL, // More antenna devices
241  MIXER_1MM, // 1MM Mixer
242 
243  SL_LO_CONTROL, // Spectral downconverter LO control
244 
245  BLOCK_DOWNCONVERTER1, // Block Downconverter 1
246  BLOCK_DOWNCONVERTER2, // Block Downconverter 2
247  BLOCK_DOWNCONVERTER3, // Block Downconverter 3
248  BLOCK_DOWNCONVERTER4, // Block Downconverter 4
249  BLOCK_DOWNCONVERTER5, // Block Downconverter 5
250  BLOCK_DOWNCONVERTER6, // Block Downconverter 6
251  BLOCK_DOWNCONVERTER7, // Block Downconverter 7
252  BLOCK_DOWNCONVERTER8, // Block Downconverter 8
253  BLOCK_DOWNCONVERTER9, // Block Downconverter 9
254  BLOCK_DOWNCONVERTER10, // Block Downconverter 10
255  BLOCK_DOWNCONVERTER11, // Block Downconverter 11
256  BLOCK_DOWNCONVERTER12, // Block Downconverter 12
257  BLOCK_DOWNCONVERTER13, // Block Downconverter 13
258  BLOCK_DOWNCONVERTER14, // Block Downconverter 14
259  BLOCK_DOWNCONVERTER15, // Block Downconverter 15
260 
261  NUM_DEVICES // Always last!!
262 
263  };
264 
265 
269  PhysicalDevice();
270 
276  PhysicalDevice(LOCATION locationID, DEVICE deviceID);
277 
281  ~PhysicalDevice();
282 
286  std::string getLocationString() const ;
287 
292  std::string getLocationString(LOCATION location) const ;
293 
297  std::string getDeviceString() const ;
298 
303  std::string getDeviceString(DEVICE device) const ;
304 
308  std::string toString() const ;
309 
314  void setDevice(DEVICE deviceID);
315 
320  DEVICE getDevice() const ;
321 
326  void setLocation(LOCATION locationID);
327 
332  LOCATION getLocation() const ;
333 
339  static LOCATION getBimaAntenna(int antennaNo);
340 
346  static LOCATION getOvroAntenna(int antennaNo);
347 
353  static LOCATION getSzaAntenna(int antennaNo) ;
354 
361  static DEVICE getWbdcModule(int bandIndex, int inputIndex);
362 
369  static DEVICE getSldcModule(int bandIndex, int inputIndex);
370 
374  static std::string toStringAll();
375 
376  class Strings {
377  public:
378  Strings();
379  std::string getLocationString(LOCATION locationID) const;
380  std::string getDeviceString(DEVICE deviceID) const;
381  std::string toString() const;
382  private:
383  std::string deviceString_[NUM_DEVICES];
384  std::string locationString_[NUM_LOCATIONS];
385  };
386 
387 private:
388  DEVICE deviceID_;
389  LOCATION locationID_;
390  static const Strings& strings();
391 };
392 
393 } } // End namespace carma::monitor
394 
395 
396 #endif // CARMA_MONITOR_PHYSICALDEVICE_H
397 
398 
399 
400 
401 
402 
403 
404 
405 
static LOCATION getOvroAntenna(int antennaNo)
Get the locationID for an Ovro antenna.
std::string getLocationString() const
Get a location string for this physical device.
std::string getDeviceString() const
Get a device string for this physical device.
static DEVICE getWbdcModule(int bandIndex, int inputIndex)
Get the deviceID for a wideband downconverter module.
DEVICE getDevice() const
Get the deviceID for this device.
static std::string toStringAll()
Get all the location and device strings - for debugging.
void setDevice(DEVICE deviceID)
Set the deviceID for this device.
static DEVICE getSldcModule(int bandIndex, int inputIndex)
Get the deviceID for a spectral line downconverter module.
std::string toString() const
Get the location.device string for this device.
void setLocation(LOCATION locationID)
Set the locationID for this device.
static LOCATION getSzaAntenna(int antennaNo)
Get the locationID for an Sza antenna.
A monitor system physical device, used in the construction of monitor points and containers that are ...
static LOCATION getBimaAntenna(int antennaNo)
Get the locationID for a Bima antenna.
LOCATION getLocation() const
Get the locationID for this device.