CARMA C++
AngleCell.h
Go to the documentation of this file.
1 #ifndef CARMA_UI_RTD_COORDINATECELL_H
2 #define CARMA_UI_RTD_COORDINATECELL_H
3 
13 
14 
17 
18 #include <boost/shared_ptr.hpp>
19 
20 #include <string>
21 #include <map>
22 
23 namespace carma {
24 namespace ui {
25 namespace rtd {
26 
27 
29  typedef enum angleFormatTypeEnum
30  {
31  // If you add more types here, be sure to
32  // add also to body of computeText() !
33 
36 
39 
42 
45 
48 
49  } angleFormatType ;
50 
52  typedef enum modulusTypeEnum {
55 
58 
61  } modulusType;
62 
63 class AngleCell;
64 typedef boost::shared_ptr<AngleCell> AngleCellPtr;
65 
69 class AngleCell : public MonitorCell {
70  public:
71  static AngleCellPtr makeCell( int cellWidth,
72  monitor::MonitorPointDouble & monitorPoint );
73 
74  static AngleCellPtr makeCell( int cellWidth,
75  monitor::MonitorPointDouble & monitorPoint,
76  int sampleNo );
77 
79  virtual ~AngleCell( );
80 
81  // Overrides MonitorCell
82  virtual ::std::string computeText( );
83 
97  void setAngleFormat(angleFormatType angleFormat );
98 
106  void setModulus( modulusType modulus );
107 
108  static std::string formatValue(double mpValue, std::string mpUnits, angleFormatType format, int width, modulusType modulus);
109 
110  protected:
120  AngleCell( int cellWidth,
121  bool setMpWidth,
122  monitor::MonitorPointDouble & monitorPoint,
123  int sampleNo );
124 
125  private:
126  static AngleCellPtr makeCell( int cellWidth,
127  bool setMpWidth,
128  monitor::MonitorPointDouble & monitorPoint,
129  int sampleNo );
130  // No copying
131  AngleCell( const AngleCell & rhs );
132  AngleCell& operator=( const AngleCell & rhs );
133 
134  // display format
135  angleFormatType angleFormat_;
136 
137  // modulus format
138  modulusType modulus_;
139 
140  monitor::MonitorPointDouble * mpReal_;
141 
142 };
143 
144 
145 } // namespace carma::ui::rtd
146 } // namespace carma::ui
147 } // namespace carma
148 
149 
150 #endif
Classes that provide the pecializations of monitor points and sense poiints for different datatypes...
Display in sexagesimal HH:MM:SS.S.
Definition: AngleCell.h:35
Display in sexagesimal DD:MM:SS.S.
Definition: AngleCell.h:38
virtual ~AngleCell()
destructor
Cell that takes a MonitorPoint and displays its current value.
@ brief A Cell that displays the current value of a MonitorPoint that represents an angle ...
Definition: AngleCell.h:69
Display in decimal hours.
Definition: AngleCell.h:41
void setModulus(modulusType modulus)
The modulus in which to display the value.
void setAngleFormat(angleFormatType angleFormat)
Set the display format type for the AngleCell.
Modulus 0 to 2PI.
Definition: AngleCell.h:54
Display in decimal degrees.
Definition: AngleCell.h:44
Display in radians.
Definition: AngleCell.h:47
A Cell that displays the current value of a MonitorPoint, with the background color gotten from a sec...
Definition: MonitorCell.h:55
AngleCell(int cellWidth, bool setMpWidth, monitor::MonitorPointDouble &monitorPoint, int sampleNo)
Constructor.
Modulus -PI to PI.
Definition: AngleCell.h:57