CARMA C++
OvroMaster.h
Go to the documentation of this file.
1 
9 #ifndef CARMA_ANTENNA_OVRO_OVROMASTER_H
10 #define CARMA_ANTENNA_OVRO_OVROMASTER_H
11 
12 // Carma includes
13 #include "carma/antenna/common/CMReceiver.h"
28 #include "carma/antenna/ovro/canbus/SharedOpticsSeqNo.h"
31 #include "carma/canbus/Master.h"
32 #include "carma/util/PthreadCond.h"
33 #include "carma/util/PthreadMutex.h"
34 
35 // STL includes
36 #include <map>
37 #include <memory>
38 
39 namespace log4cpp {
40  // Forward declaration.
41  class Category;
42 } // End namespace log4cpp
43 
44 namespace carma {
45 
46 namespace monitor {
47  // Forward declaration.
48  class OvroSubsystem;
49 } // End namespace monitor
50 
51 namespace antenna {
52 namespace ovro {
53 
60 public:
61 
68  explicit OvroMaster( unsigned short antNo,
69  bool simOfflineNodes,
70  carma::monitor::OvroSubsystem & ovroSubsystem );
71 
94  explicit OvroMaster(
95  int board,
96  unsigned short antNo,
97  bool simOfflineNodes,
98  bool reset,
99  bool terminate,
100  carma::monitor::OvroSubsystem & ovroSubsystem );
101 
125  explicit OvroMaster(
126  int board,
127  int bus,
128  unsigned short antNo,
129  bool simOfflineNodes,
130  bool reset,
131  bool terminate,
132  carma::monitor::OvroSubsystem & ovroSubsystem );
133 
137  virtual ~OvroMaster();
138 
145  void start();
146 
153  void stop();
154 
155  enum AntennaIFType {
156  IF1,
157  IF2
158  };
159 
164  AntennaIF& getAntennaIF( enum AntennaIFType ifType );
165 
171 
177 
182 
188 
194 
199  Optics& getOptics();
200 
206 
211  YigPll& getYigPll();
212 
218  RxTemperatures& getRxTemperatureController();
219 
223  enum SisRxType {
224  SIS_RX1MM,
225  SIS_RX3MM
226  };
227 
228  enum SisRxPolType {
229  SINGLE, // Single Pol, doesn't matter which kind of polarization.
230  LEFT_CIRCULAR,
231  RIGHT_CIRCULAR
232  };
233 
238  getSisReceiver( enum SisRxType rx,
239  enum SisRxPolType pol );
240 
244  carma::antenna::common::CMReceiver &
245  getCMReceiver( );
246 
250  enum GunnType {
251  LO1CM,
252  LO1MM,
253  LO3MM,
254  LOANY
255  };
256 
261  GunnPll& getGunn(enum GunnType gunn);
262 
268 
274 
279  void reset();
280 
284  void setInitialization( bool state );
285 
286 protected:
287 
296 
305  void updateStatus();
306 
311  void softReset();
312 
313 private:
314 
315  // Disallow assignment and copy construction.
316  OvroMaster(const OvroMaster &);
317  OvroMaster &operator=(const OvroMaster &);
318 
319  // Run thread entry point.
320  static void *runThreadEntry(void *arg);
321 
322  // Redefine run such that it is private.
323  void run();
324 
325  // Initialize helper routine to perform common creation tasks
326  // (i.e. those common among all three constructors).
327  void initialize(unsigned short antNo);
328 
329  log4cpp::Category& log_;
330 
331  // Keep id around so that we can destroy it when need be.
332  pthread_t runThreadId_;
333  bool isRunning_;
334  carma::util::PthreadMutex isRunningGuard_;
335  carma::util::PthreadCond isRunningCond_;
336 
337  // Define the devices that will exist on this network.
338  // Also, since these aren't CORBA servants, they don't need to be
339  // allocated on the heap. This is a bit different than in the past
340  // and it avoids the mismanagement of the memory...
341  SharedOpticsSeqNo sharedOpticsSeqNo_;
342  CryoCompressor compressor_;
343  CryoTemperatures dewar_;
344  EnvironmentalMonitor enviro_;
345  AntennaIF ifLeftPol_;
346  AntennaIF ifRightPol_;
348  Optics optics_;
349  RxTemperatures rxtemp_;
350  SecondaryMirror secondary_;
351  Tiltmeter tiltmeter_;
352  YigPll yig_;
353  GunnPll gunn1mm_;
354  GunnPll gunn3mm_;
359  carma::antenna::common::CMReceiver rx1cm_;
360 
361  // WARNING: the following are initialization order dependent on each other.
362  Drive drive_;
363  Encoder azEncoder_;
364  Encoder elEncoder_;
365  DriveEngine driveEngine_;
366  // Initialization order dependent
367 
368  // Monitor system reference
369  carma::monitor::OvroSubsystem & mon_;
370 
371  const ::std::string hostname_;
372  bool initialized_;
373 
374 }; // End class OvroMaster
375 }}} // End namespace carma::antenna::ovro
376 #endif
OvroMaster(unsigned short antNo, bool simOfflineNodes, carma::monitor::OvroSubsystem &ovroSubsystem)
Constructor for emulation only.
10-m Secondary Mirror CAN device class.
AntennaIF & getAntennaIF(enum AntennaIFType ifType)
Retrieve a reference to underlying AntennaIF CAN device.
CAN Device class declaration for the Bias-Tuned Gunn PLL (API 16).
CAN Device implementation for 10-m Antenna Drive Module.
GunnPll & getGunn(enum GunnType gunn)
Retrieve a reference to the specified Bias Tuned Gunn CAN device.
CAN Device class declaration for the Varactor-Tuned Gunn PLL (API 48).
YIG PLL CAN module device class.
Definition: YigPll.h:33
carma::antenna::common::LOReferenceMonitor & getLOReferenceMonitor()
Retrieve a reference to the underlying LO Reference CAN device.
Optics & getOptics()
Retrieve a pointer to the underlying Optics CAN device.
Tiltmeter device class.
Definition: Tiltmeter.h:34
10m &amp; 6m SIS Receiver Control CAN module device class.
Definition: SisReceiver.h:45
carma::antenna::ovro::EnvironmentalMonitor class definition.
RxTemperatures & getRxTemperatureController()
Retrieve a reference to the underlying Rx Electronics Temperature Controller device.
SisRxType
Sis Receiver types.
Definition: OvroMaster.h:223
CAN Device implementation for 10-m Antenna Encoder Module.
10-m Antenna Encoder Module CAN Implementation (API No.
Definition: Encoder.h:36
Cryo Compressor device class.
Declaration of carma::canbus::Master class.
carma::canbus::MsgBriefMap getControls() const
Get a map of controls provided by the OvroMaster Master controls correspond to global CAN Message Ids...
A simple wrapper class that makes use of ::pthread_cond_t easier in a C++ world.
Definition: PthreadCond.h:43
EnvironmentalMonitor & getEnvironmentalMonitor()
Retrieve a pointer to the underlying EnvironmentalMonitor CAN device.
CAN Device implementation for CARMA CANbus API No.
CAN Device implementation for CARMA CANbus API No.
10-m Antenna Optics CAN device class.
Definition: Optics.h:37
CAN Device class implementation for LO Reference Monitor Module.
void softReset()
Reset ALL modules on CAN via RESET CAN msg.
Cryo Temperature device class.
CAN Device implementation for CARMA CANbus API No.
void start()
Start the CAN Master This routine does not block! It is responsible for kicking off a new thread whic...
carma::antenna::common::LOReferenceMonitor class declaration.
carma::antenna::common::Varactor & getVaractor()
Retrieve a reference to the varactor module.
CAN Device implementation for 10-m Secondary Mirror.
SecondaryMirror & getSecondary()
Retrieve a pointer to the underlying SecondaryMirror CAN device.
carma::antenna::common::SisReceiver & getSisReceiver(enum SisRxType rx, enum SisRxPolType pol)
Retrieve a reference to underlying Sis Receiver module.
carma::antenna::ovro::DriveEngine class declaration.
CAN Device implementation for Antenna IF Module.
::std::map< ::carma::canbus::msgType,::std::string > MsgBriefMap
Alias for message descriptions keyed by message id.
Definition: Types.h:74
CAN Device implementation for YIG PLL.
void reset()
Reset ALL modules on CAN via DIO.
DriveEngine & getDriveEngine()
Get a reference to the drive engine.
Antenna IF CAN module device class.
Definition: AntennaIF.h:42
Carma Canbus Master class.
Definition: Master.h:110
void stop()
Stop the CAN Master This routine terminates the main run thread in the CAN Master.
Tiltmeter & getTiltmeter()
Retrieve pointer to underlying Tiltmeter CAN device.
10-m Antenna Drive Module CAN Implementation (API No.
Definition: Drive.h:33
CAN Device declaration for 10m &amp; 6m SIS Receiver Control.
GunnPll CAN device class.
Definition: GunnPll.h:36
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
Definition: PthreadMutex.h:41
CryoTemperatures & getCryoTemperatures()
Retrieve pointer to underlying CryoTemperatures CAN device (dewar).
Ovro Antenna canbus Master class.
Definition: OvroMaster.h:59
CAN Device implementation for 10-m Antenna Optics.
YigPll & getYigPll()
Retrieve reference to the underlying YigPll CAN device.
void setInitialization(bool state)
Set state of antenna initialization.
Responsible for storing and maintaining drive parameters, calculating drive rate updates and regularl...
Definition: DriveEngine.h:51
Declaration of 10-m Electronics Temperature Controller class.
CAN Device class implementation for 10-m sidecab environmental monitor.
CryoCompressor & getCryoCompressor()
Retrieve pointer to underlying CryoCompressor CAN device.
carma::antenna::common::CMReceiver & getCMReceiver()
Retrieve a reference to underlying CM Receiver module.
void updateStatus()
Update the status of the Antenna CAN Master.
virtual ~OvroMaster()
Destructor.
Varactor CAN device class.
Definition: Varactor.h:30