12 #ifndef FAULT_TRANSPORT_H
13 #define FAULT_TRANSPORT_H
19 #include <boost/shared_ptr.hpp>
22 using namespace carma::monitor;
25 using namespace carma::util;
27 #include <carma/fault/Constants.h>
28 #include <carma/fault/DagMLNode.h>
29 #include <carma/fault/AlarmFaultAccumulator.h>
31 typedef std::list<std::string> StringList;
39 typedef std::list<struct InputFault> InputFaultList;
42 static const uint32_t kMaxTransportedTagIds = 64;
43 static const int kNumBands = NUM_ASTROBANDS;
44 static const int kNumInputs = NUM_ASTROINPUTS;
50 struct LocalElementInput {
80 uint32_t numComplexFaults;
81 struct LocalElementInput complexFaultList[kMaxTransportedTagIds];
84 uint32_t numSimpleFaults;
85 tagIDType simpleFaultList[kMaxTransportedTagIds];
86 uint32_t simpleFaultCount[kMaxTransportedTagIds];
89 struct LocalElementHistory
92 uint32_t first_frame_bad;
93 uint32_t last_frame_bad;
102 struct LocalElement {
103 uint64_t faultSystemCycle;
104 int32_t inputCmsFrame;
107 struct LocalElementBF blankInfo[kNumBands];
111 uint32_t alarmPrefix[kMaxTransportedTagIds];
112 tagIDType alarmList[kMaxTransportedTagIds];
113 uint8_t alarmSilent[kMaxTransportedTagIds];
116 uint32_t numDisabled;
117 uint32_t disabledPrefix[kMaxTransportedTagIds];
118 tagIDType disabledList[kMaxTransportedTagIds];
119 uint8_t disabledSilent[kMaxTransportedTagIds];
123 struct LocalElementHistory history[kMaxTransportedTagIds];
126 explicit CommonIPQ(LocalElement & localElement);
130 CommonIPQ(
const CommonIPQ & rhs);
131 CommonIPQ& operator=(
const CommonIPQ & rhs);
138 class FaultTransportWriter
141 FaultTransportWriter();
144 void setCmsFrameNumber(
const int frame);
147 void setFaultCycleNumber(
const uint64_t cycle);
156 void addInputFaults(
const int band,
const int input,
const DagMLNodeList &faults);
159 void setAlarmFaults(
const DagMLNodeList &faults);
160 void setAlarmDisabled(
const DagMLNodeList &disabled);
161 void setAlarmHistory(
const AccumulatorList &history);
164 void setConfigFaults(
const std::list<carma::monitor::tagIDType> &ids);
167 CommonIPQ::LocalElement localElement_;
168 boost::shared_ptr<CommonIPQ> ipq_;
170 typedef std::map<tagIDType, uint32_t> SimpleFaultMap;
171 std::vector<SimpleFaultMap> maps_;
173 struct LocalElementBF* getBandPtr(
int band);
174 void populateSimpleFaultList();
181 class FaultTransportReader
184 FaultTransportReader();
193 int getCmsFrameNumber()
const;
196 uint64_t getFaultCycleNumber()
const;
199 void getSimpleInputFaults(
const int band, uint32_t &number, StringList &names);
200 void getComplexInputFaults(
const int band, uint32_t &number, InputFaultList &faults);
201 void getComplexInputFaults(
const int band, uint32_t &number, StringList &names);
203 void getAlarmFaults(uint32_t &number, StringList &names);
204 void getAlarmDisabled(uint32_t &number, StringList &names);
205 void getAlarmHistory(uint32_t &number, StringList &names);
208 CommonIPQ::LocalElement localElement_;
209 boost::shared_ptr<CommonIPQ> ipq_;
211 struct LocalElementBF* getBandPtr(
const int band);
212 void convert_tagid_string(
const tagIDType
id, std::string &name)
const;
213 void convert_prefix_string(
const uint32_t
id, std::string &prefix)
const;
216 #endif // FAULT_TRANSPORT_H
IPQ (InterProcessQueue) provides a generic way for information to be shared between processes or thre...
Shared memory storage mechanism for an IPQ buffer.
type definitions for monitor system