CARMA C++
MonitorUpdater.h
Go to the documentation of this file.
1 
10 #ifndef CARMA_ANTENNA_BIMA_MONITORUPDATER_H
11 #define CARMA_ANTENNA_BIMA_MONITORUPDATER_H
12 
13 #define MAXGAP 0.0001736111
14 // two frames in MJD
15 #define MAXFASTGAP 0.00001574074
16 #define MAXSLOWGAP 0.00003148148
17 
18 // C++ Standard library includes
19 #include <iostream>
20 #include <ostream>
21 
22 // C includes
23 #include <time.h>
24 #include <stdlib.h>
25 #include <unistd.h>
26 
27 // CARMA includes
28 #include "carma/util/Program.h"
29 #include "carma/util/PthreadMutex.h"
30 #include "carma/util/Trace.h"
31 #include "carma/util/FrameAlignedTimer.h"
33 #include "carma/util/IPQreader.h"
34 #include "carma/services/Units.h"
35 #include "carma/services/Global.h"
37 #include "carma/monitor/AntennaCommon.h"
38 #include "carma/monitor/BimaSubsystem.h"
40 #include "carma/antenna/bima/LO.h"
41 #include "carma/antenna/bima/IF.h"
42 #include "carma/antenna/bima/Rx.h"
48 
49 
56 #define FLATTENCASEENUM( A, B, C ) \
57  case A: \
58  C = B; \
59  break;
60 
64 namespace carma
65 {
66  namespace antenna
67  {
68  namespace bima
69  {
70 
71 
75  {
76  public:
77 
81  MonitorUpdater( Configuration &config,
82  log4cpp::Category &logger,
83  double autoWriteDelayInS );
84 
88  virtual ~MonitorUpdater();
89 
90 
91  void run( void );
92  static void *startThread( void *arg );
93  void monitorThread( void );
94 
95  void deadManOk()
96  { _mutex.Lock(); _ok = true; _mutex.Unlock();};
97  bool deadManCheck()
98  { _mutex.Lock(); bool status = _ok; _ok = false; _mutex.Unlock(); return status; };
99 
100  private:
101 
102  // Copy and assignment not permitted for this class.
103  MonitorUpdater( const MonitorUpdater & );
104  MonitorUpdater &operator=( const MonitorUpdater & );
105 
106  void setAntCommonLoMonitorPoints(
107  carma::monitor::AntennaCommon::LO & antComLO,
108  carma::antenna::bima::Rx & rx,
109  carma::antenna::bima::LO & lo,
110  carma::monitor::AntennaCommon::YigStateMonitorPointEnum::YIGSTATE & yigState,
111  carma::monitor::AntennaCommon::LoStateMonitorPointEnum::LOSTATE & loState,
112  const carma::monitor::VaractorModule & varactor,
113  const int strobe );
114 
115  void setAntCommonRxMonitorPoints(
116  carma::monitor::AntennaCommon::Receivers & antComRx,
117  carma::antenna::bima::Rx & rx,
118  carma::monitor::AntennaCommon::RxStateMonitorPointEnum::RXSTATE & rxGoodmpe,
119  const carma::monitor::AntennaCommon::YigStateMonitorPointEnum::YIGSTATE & yigState,
120  const carma::monitor::AntennaCommon::LoStateMonitorPointEnum::LOSTATE & loState );
121 
122  carma::monitor::BimaSubsystem *_monPnts;
123  carma::monitor::BimaSubsystem *_readMonPnts;
124  Rx *_rx;
125  DewarRegulation *_dewarReg;
126  CalWheel *_calwheel;
127  Secondary *_secondary;
128  Polarizer *_polarizer;
129  LO *_lo;
130  IF *_if;
131  Drives *_drives;
132  int _apcCount;
133  int _epcCount;
134 
135  Configuration &_config;
136  log4cpp::Category &_logger;
137  bool _emulate;
138  bool _ok;
140  };
141 
142  } // Namespace bima
143  } // Namespace antenna
144 } // Namespace carma
145 
146 
147 #endif // CARMA_ANTENNA_BIMA_MONITORUPDATER_H
Exception class for errors.
Class definition for Stepper Motors for BIMA systems.
Class definition for Stepper Motors for BIMA systems.
Server stub for MonitorUpdater Documentation for the.
virtual ~MonitorUpdater()
Destructor.
Class definition for Stepper Motors for BIMA systems.
Interface file for the carma::util::Trace class and related macros.
Common parameters used CARMA-wide, both typedefs and constants such as number of antennas.
MonitorUpdater(Configuration &config, log4cpp::Category &logger, double autoWriteDelayInS)
Constructor.
Class definition for SharedMemory on the BIMA antennas.
Class definition for Stepper Motors for BIMA systems.
void Lock()
Obtain a lock on the instance for the caller&#39;s thread.
Definition: PthreadMutex.h:233
Class definition for Stepper Motors for BIMA systems.
Class definition for Stepper Motors for BIMA systems.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
Definition: PthreadMutex.h:41
Class definition for Stepper Motors for BIMA systems.
void Unlock()
Release a lock that is held on the instance by the caller&#39;s thread.
Definition: PthreadMutex.h:247