CARMA C++
LoMonitor.h
Go to the documentation of this file.
1 
10 #ifndef CARMA_DOWNCONVERTER_LOMONITOR_H
11 #define CARMA_DOWNCONVERTER_LOMONITOR_H
12 
13 // C++ Standard library include
14 #include <map>
15 #include <string>
16 #include <vector>
17 
18 // Carma includes
20 
21 namespace log4cpp {
22  // Forward declaration
23  class Category;
24 } // End namespace log4cpp
25 
26 namespace carma {
27 
28 namespace monitor {
29  class LoMonitor;
30  class StateMonitorPointEnum;
31  class Xac;
32 } // End namespace monitor
33 
34 namespace downconverter {
35 
42  public:
43 
50  LoMonitor(
53  carma::monitor::StateMonitorPointEnum & state,
54  carma::monitor::LoMonitor & lomon,
55  carma::monitor::Xac & xac,
56  bool wideband = false );
57 
61  virtual ~LoMonitor();
62 
70  std::map<carma::canbus::msgType, std::string>
71  getHalfSecMonitors() const;
72 
80  std::map<carma::canbus::msgType, std::string> getSlowMonitors() const;
81 
90  std::vector<carma::canbus::byteType> &data, bool sim);
91 
106 
114 
120  void updateFrameData();
121 
122  // Corba control commands
123  void initializePowerMeter();
124 
125  private:
126 
127  // Member variables
128 
129  carma::monitor::StateMonitorPointEnum * state_;
130  carma::monitor::LoMonitor *mon_;
131  carma::monitor::Xac *xacMon_;
132  log4cpp::Category &log_; // Reference to logger
133 
134  // Member functions
135 
136  // Copy and assignment not permitted for this class.
137  LoMonitor(const LoMonitor &);
138  LoMonitor &operator=(const LoMonitor &);
139 
140  // Process Message routines for individual CAN messages.
141  // Blanking Frames 1 & 2 are unique but for the remaining 16 packets
142  // every other one is identical except for the band it refers to.
143  void processBlankingFramePacket1(
144  std::vector<carma::canbus::byteType> &data);
145  void processBlankingFramePacket2(
146  std::vector<carma::canbus::byteType> &data);
147  void processLoFrequencyPacket(
148  std::vector<carma::canbus::byteType> &data, int loId);
149  void processLoStatusPacket(
150  std::vector<carma::canbus::byteType> &data, int loId);
151 
152  // Methods to produce simulated CAN messages. These routines are
153  // called by simulateMsg and then placed in the CAN message queue
154  // where they will eventually be processed by processMsg above.
155  carma::canbus::Message simBlankingFramePacket1();
156  carma::canbus::Message simBlankingFramePacket2();
157  carma::canbus::Message simLoFrequencyPacket(int loId);
158  carma::canbus::Message simLoStatusPacket(int loId);
159 
160  const bool wideband_;
161 
162  };
163 } // End Namespace downconverter
164 } // End namespace carma
165 #endif
LoMonitor Device class implementation.
Definition: LoMonitor.h:41
Class to encapsulate a CAN message.
Definition: Message.h:21
std::map< carma::canbus::msgType, std::string > getHalfSecMonitors() const
Retrieve a map of this devices half second monitor points.
LoMonitor(carma::canbus::nodeType node, carma::canbus::CanOutput &io, carma::monitor::StateMonitorPointEnum &state, carma::monitor::LoMonitor &lomon, carma::monitor::Xac &xac, bool wideband=false)
Constructor Creates an LoMonitor device with the given node id.
XacDevice canbus::device class implementation.
Definition: XacDevice.h:37
unsigned short apiType
Carma API id type.
Definition: Types.h:64
std::map< carma::canbus::msgType, std::string > getSlowMonitors() const
Retrieve a map of this devices slow monitor points.
unsigned short nodeType
Carma Node Type id type.
Definition: Types.h:66
static carma::canbus::apiType getApiId()
Staticly retrieve the API Id.
void processMsg(carma::canbus::msgType mid, std::vector< carma::canbus::byteType > &data, bool sim)
Process a CAN message.
void updateFrameData()
Update data on a frame time scale This routine is called automatically by carma::canbus::Master every...
carma::canbus::devices::XacDevice class declaration.
virtual ~LoMonitor()
Destructor.
carma::canbus::Message simulateMsg(carma::canbus::msgType mid)
Produce a simulated CAN message for a given msgType.
unsigned short msgType
Carma Message id type.
Definition: Types.h:69
CanOutput interface.
Definition: CanOutput.h:26