CARMA C++
SzaShareCorba.h
Go to the documentation of this file.
1 // $Id: SzaShareCorba.h,v 1.4 2011/08/31 04:50:32 eml Exp $
2 
3 #ifndef SZA_ANTENNA_CORBA_SZASHARECORBA_H
4 #define SZA_ANTENNA_CORBA_SZASHARECORBA_H
5 
16 
17 #include "carma/szautil/Angle.h"
19 #include "carma/szautil/DataType.h"
20 #include "carma/szautil/Directives.h"
21 #include "carma/szautil/Rx.h"
22 #include "carma/szautil/Temperature.h"
23 
24 #include "carma/antenna/sza/antenna/corba/Corba.h"
25 
27 #include "carma/antenna/common/DriveControl.h"
28 
29 namespace sza {
30  namespace antenna {
31  namespace corba {
32 
33  class AntennaCorba;
34  class CarmaMonitorPointHandler;
35 
36  class SzaShareCorba : public sza::antenna::control::SzaShare {
37  public:
38 
39  enum Position {
40  NONE, // No position has been requested
41  AZEL, // A generic AZEL position command
42  EQUAT, // Equatorial tracking
43  SERVICE, // Service position
44  STOW, // stow position
45  SNOW, // snow track position
46  };
47 
51  SzaShareCorba(std::string host);
52 
56  virtual ~SzaShareCorba();
57 
58  void initialize(AntennaCorba* antCorba);
59 
60  double getLst(double utc);
61 
62  void setSite(double longitude, double latitude, double altitude);
63 
64  //------------------------------------------------------------
65  // Methods to handle current receiver logic
66  //------------------------------------------------------------
67 
68  void setRx(sza::util::Rx::Id rxId);
69  void getRx(sza::util::Rx::Id& rxId);
70  sza::util::Rx::Id getRx();
71 
72  //------------------------------------------------------------
73  // Methods to handle tuning logic
74  //------------------------------------------------------------
75 
76  void setTuningPending(bool pending);
77  bool getTuningPending();
78 
79  //------------------------------------------------------------
80  // Methods to handle current requested position logic
81  //------------------------------------------------------------
82 
83  void setPosition(Position position);
84  void getPosition(Position& position, unsigned& nFrame, bool& pending);
85 
86  void incrementFrame(bool acquired);
87  void setPending(bool pending);
88 
89  void setAmbientTemperature(sza::util::Temperature temp);
90  sza::util::Temperature getAmbientTemperature();
91 
92  void setCarmaAzOffset(sza::util::Angle azOff);
93  void setCarmaElOffset(sza::util::Angle elOff);
94 
95  sza::util::Angle getCarmaAzOffset();
96  sza::util::Angle getCarmaElOffset();
97  double getLastMjdCoefficientsChanged();
98 
99  void setCarmaMountAzOffset(sza::util::Angle azOff);
100  void setCarmaMountElOffset(sza::util::Angle elOff);
101 
102  sza::util::Angle getCarmaMountAzOffset();
103  sza::util::Angle getCarmaMountElOffset();
104 
105  void setCarmaApertureAzOffset(sza::util::Rx::Id rxId, sza::util::Angle azOff);
106  void setCarmaApertureElOffset(sza::util::Rx::Id rxId, sza::util::Angle elOff);
107  void setCarmaApertureFlexure(sza::util::Rx::Id rxId, sza::util::Angle flexureSin, sza::util::Angle flexureCos);
108 
109  sza::util::Angle getCarmaApertureAzOffset(sza::util::Rx::Id rxId);
110  sza::util::Angle getCarmaApertureElOffset(sza::util::Rx::Id rxId);
111  void getCarmaApertureFlexure(sza::util::Rx::Id rxId, sza::util::Angle& flexureSin, sza::util::Angle& flexureCos);
112 
113  void getFlexure(sza::util::Angle& flexureSin, sza::util::Angle& flexureCos);
114 
115  sza::util::Angle getTotalXCollimationOffset();
116  sza::util::Angle getTotalYCollimationOffset();
117 
118  void setInitialized(bool initialized);
119  void getInitialized(bool& initialized);
120 
121  private:
122 
123  friend class CarmaMonitorPointHandler;
124 
125  CarmaMonitorPointHandler* monitorPointHandler_;
126 
127  carma::services::AstroTime astroTime_;
128 
129  Position lastRequestedPosition_;
130  sza::util::Mutex positionGuard_;
131  unsigned nSinceLastRequest_;
132  bool positionPending_;
133 
134  sza::util::Rx::Id rxId_;
135  sza::util::Mutex rxGuard_;
136 
137  bool initialized_;
138  sza::util::Mutex initGuard_;
139 
140  bool tuningPending_;
141  sza::util::Mutex tuningPendingGuard_;
142 
143  sza::util::Temperature ambientTemperature_;
144  sza::util::Mutex tempGuard_;
145 
146  // Offsets as CARMA defines them
147 
148  sza::util::Angle azOffset_;
149  sza::util::Angle elOffset_;
150 
151  sza::util::Angle mountAzOffset_;
152  sza::util::Angle mountElOffset_;
153 
154  sza::util::Angle rx30GHzApertureAzOffset_;
155  sza::util::Angle rx30GHzApertureElOffset_;
156 
157  sza::util::Angle rx90GHzApertureAzOffset_;
158  sza::util::Angle rx90GHzApertureElOffset_;
159 
160  sza::util::Angle rx30GHzApertureFlexureSin_;
161  sza::util::Angle rx30GHzApertureFlexureCos_;
162 
163  sza::util::Angle rx90GHzApertureFlexureSin_;
164  sza::util::Angle rx90GHzApertureFlexureCos_;
165 
166  sza::util::TimeVal lastTimeCoefficientsChanged_;
167  sza::util::Mutex offsetGuard_;
168 
169  // Overloaded methods of RegMapDataFrameManager to pack data
170  // of an arbitrary type into the underlying frame.
171  //
172  // These will allow us to pack the data into CARMA monitor
173  // points under the hood at the same time that they are packed
174  // into the SZA data frame
175 
176  void packData(RegMapBlock* blk, void* data, sza::util::CoordRange* range,
177  sza::util::DataType::Type type, bool lock=true);
178 
179  void packData(std::string board, std::string block, void* data,
180  sza::util::CoordRange* range, sza::util::DataType::Type type, bool lock=true);
181 
182  void packValue(RegMapBlock* blk, void* data, sza::util::CoordRange* range,
183  sza::util::DataType::Type type, bool lock=true);
184 
185  void packValue(std::string board, std::string block, void* data,
186  sza::util::CoordRange* range, sza::util::DataType::Type type, bool lock=true);
187 
188  }; // End class SzaShareCorba
189 
190  } // End namespace corba
191  } // End namespace antenna
192 } // End namespace sza
193 
194 
195 
196 #endif // End #ifndef SZA_ANTENNA_CORBA_SZASHARECORBA_H
Tagged: Tue Jun 22 22:32:16 UTC 2004.
A class for managing timeval/timespec structs.
Definition: TimeVal.h:53
This class implements various astronomical time computation routines.
Definition: AstroTime.h:32
Tagged: Thu Nov 13 16:53:54 UTC 2003.
Astronomical Time routines.
An instance of this class is created by AntennaMaster and passed to the constructors of other tasks...
Definition: Share.h:38
Tagged: Fri Sep 17 15:51:07 PDT 2004.