CARMA C++
RtAzelPlot.h
1 #ifndef CARMA_UI_RTD_RTAZELPLOT_H
2 #define CARMA_UI_RTD_RTAZELPLOT_H
3 
4 
5 /*
6  * @file
7  *
8  * Graphical display of current and requested azimuth and elevation, wind speed
9  * and direction.
10  *
11  * @author Steve Scott
12  *
13  * $CarmaCopyright$
14  *
15  */
16 
17 
18 #include <string>
19 #include <vector>
20 
21 #include <carma/ui/rtd/common/RtDisplay.h>
22 
23 #include <boost/shared_ptr.hpp>
24 
25 
26 namespace carma {
27 namespace ui {
28 namespace rtd {
29 
30 
31 class RtAzelPlot : public RtObject {
32  public:
33  typedef enum {
34  AZEL_SOURCE_TYPE,
35  RADEC_SOURCE_TYPE
36  } SourceType;
37 
46  RtAzelPlot( ::size_t maxAntennas,
47  SourceType & sourceType,
48  double windSpeed,
49  double windDir );
62  void addAnt( const bool * legit, const bool * online,
63  const double * reqAz, const double * reqEl,
64  const double * actAz, const double * actEl);
65 
67  virtual void update();
69  virtual void serialize(bool initialize, int fontSize, ::rtdproto::RtObject *rtobj);
70 
75  void setWindSpeed(double windSpeed);
80  void setWindDirection(double windDirection);
81 
82  private:
89  void formSourcePosition();
90 
91  class AntInfo {
92  public:
93  AntInfo( const bool * legit, const bool * online,
94  const double * reqAz, const double * reqEl,
95  const double * actAz, const double * actEl );
96 
97  bool legit( ) const;
98  bool online( ) const;
99 
100  double reqAz( ) const;
101  double reqEl( ) const;
102 
103  double actAz( ) const;
104  double actEl( ) const;
105 
106  private:
107  const bool * legit_;
108  const bool * online_;
109  const double * reqAz_;
110  const double * reqEl_;
111  const double * actAz_;
112  const double * actEl_;
113  };
114 
115  const ::size_t maxNumAnts_;
116 
118  const int fieldWidth_;
119 
121  char legitSourcePositionCode_;
122 
124  double sourceAz_;
125 
127  double sourceEl_;
128 
130  const SourceType & sourceType_;
131 
133  double windSpeed_;
134 
136  double windDir_;
137 
139  ::std::string output_;
140 
142  ::std::ostringstream scratchOSS_;
143 
144  ::std::vector< AntInfo > actualAntInfos_;
145 
147  int debugCount_;
148 };
149 
150 typedef boost::shared_ptr<RtAzelPlot> RtAzelPlotPtr;
151 
152 } // namespace carma::ui::rtd
153 } // namespace carma::ui
154 } // namespace carma
155 
156 
157 #endif