CARMA C++
ColorVisitor.h
1 #ifndef CARMA_UI_RTD_COLOR_VISITOR_H
2 #define CARMA_UI_RTD_COLOR_VISITOR_H
3 
4 #include <set>
5 #include <string>
6 
7 #include "carma/ui/rtd/common/MonitorTableVisitor.h"
9 #include "carma/ui/rtd/common/RtDisplay.h"
10 
11 
12 namespace carma {
13 namespace ui {
14 namespace rtd {
15 
16 
19 class ColorVisitor : public MonitorTableVisitor {
20  public:
21  explicit ColorVisitor( CellColor goodColor,
22  CellColor warnColor = YELLOW_CELL_COLOR,
23  CellColor errorColor = RED_CELL_COLOR);
24 
25  virtual ~ColorVisitor( );
26 
27  void addToEffectedSet( const monitor::MonitorPoint & mp );
28 
29  void postprocessMonitorCell(
30  const monitor::MonitorPoint & mp,
31  MonitorCell & monitorCell ) const;
32 
33  private:
34  ::std::set< ::std::string > effected_;
35  CellColor goodColor_;
36  CellColor warnColor_;
37  CellColor errorColor_;
38 };
39 
40 
41 } // namespace carma::ui::rtd
42 } // namespace carma::ui
43 } // namespace carma
44 
45 #endif
Cell that takes a MonitorPoint and displays its current value.
Abstract base class for a monitor point.
Definition: MonitorPoint.h:68
A Cell that displays the current value of a MonitorPoint, with the background color gotten from a sec...
Definition: MonitorCell.h:55
enum carma::ui::rtd::CellColorEnum CellColor
Cell color choices.
Visitor that post processes a set of MonitorCell to have good and bad colors set to something other t...
Definition: ColorVisitor.h:19