3 #ifndef CARMA_UI_RTD_MONITORCELLSCALED_H
4 #define CARMA_UI_RTD_MONITORCELLSCALED_H
25 #include <boost/shared_ptr.hpp>
27 #define MP_PACK_FN(fn) std::string (fn)(MonitorCellScaled* cell)
47 class MonitorCellScaled :
public MonitorCell {
57 Operator freqOperator_;
58 sza::util::Frequency freqNormalization_;
61 freqOperator_ = OPER_NONE;
66 freqOperator_ = OPER_NONE;
69 Delta(
double val, Operator oper, sza::util::Frequency freqNormalization) {
72 freqNormalization_ = freqNormalization;
76 double getValue(AntennaMapper::Antenna* antenna) {
77 return MonitorCellScaled::getFrequencyScaledValue(val_, antenna, freqOperator_, freqNormalization_);
89 monitor::MonitorPoint* mp_;
91 monitor::MonitorPoint* mp2_;
97 ScaledMp(monitor::MonitorPoint* mp,
double multiplier=1.0,
double offset=0.0,
int sampleNo=0) {
99 multiplier_ = multiplier;
101 sampleNo_ = sampleNo;
102 mpOperator_ = OPER_NONE;
105 ScaledMp(monitor::MonitorPoint* mp, Operator oper, monitor::MonitorPoint* mp2,
double multiplier=1.0,
double offset=0.0,
int sampleNo=0,
int sampleNo2=0) {
108 multiplier_ = multiplier;
110 sampleNo_ = sampleNo;
111 sampleNo2_ = sampleNo2;
115 double getNativeValAsDouble() {
116 return MonitorCellScaled::getNativeValAsDouble(mp_, sampleNo_, mpOperator_, mp2_, sampleNo2_);
124 MonitorCellScaled(
int cellWidth,
126 monitor::MonitorPoint& monitorPoint,
128 double multiplier=1.0,
130 short int precision=3);
132 MonitorCellScaled(
int cellWidth,
133 monitor::MonitorPoint& monitorPoint,
134 double multiplier=1.0,
136 short int precision=3);
138 MonitorCellScaled(
const int cellWidth,
139 const bool setMpWidth,
140 monitor::MonitorPoint & mp1,
143 monitor::MonitorPoint & mp2,
145 double multiplier=1.0,
147 short int precision=3);
149 static MonitorCellPtr makeCell(
const int cellWidth,
150 monitor::MonitorPoint& mp,
151 double multiplier=1.0,
153 short int precision=3);
155 static MonitorCellPtr makeCell(
const int cellWidth,
156 monitor::MonitorPoint & mp1,
158 monitor::MonitorPoint & mp2,
159 double multiplier=1.0,
161 short int precision=3);
166 virtual ~MonitorCellScaled();
168 virtual ::std::string computeText();
180 double getScaledValAsDouble(monitor::MonitorPoint* mp,
double multiplier,
double offset,
int sampleNo);
181 double getScaledValAsDouble(monitor::MonitorPoint* mp1,
int sampleNo1, Operator oper, monitor::MonitorPoint* mp2,
int sampleNo2,
182 double multiplier,
double offset);
184 static double getNativeValAsDouble(monitor::MonitorPoint* mp,
int sampleNo);
185 static double getNativeValAsDouble(monitor::MonitorPoint* mp1,
int sampleNo1, Operator oper, monitor::MonitorPoint* mp2,
int sampleNo2);
187 void scaleVal(
double& dval,
double multiplier,
double offset);
196 void errorOnAbsDeviationFromMean(std::vector<ScaledMp>& mpVec, Delta permittedDelta,
197 Grouping group=GROUP_EXACT);
207 void errorOnAbsDeviationFromVal(
double val, Delta permittedDelta);
208 bool deviatesFromVal();
217 void scaleByFrequency(Operator oper, sza::util::Frequency normalization);
222 static const double eps_;
225 short int precision_;
226 MP_PACK_FN(*packFn_);
228 static double getFrequencyScaledValue(
double dval, AntennaMapper::Antenna* antenna, Operator oper, sza::util::Frequency& freqNorm);
232 std::vector<ScaledMp> outlierVec_;
235 bool checkDeviationFromVal_;
239 Operator freqOperator_;
240 sza::util::Frequency freqNormalization_;
242 monitor::MonitorPoint& mp2_;
244 Operator mpOperator_;
250 void privateConstructor(monitor::MonitorPoint& mp,
251 double multiplier,
double offset,
short int precision);
253 void privateConstructor(Operator oper,
double multiplier,
double offset,
short int precision);
256 static MP_PACK_FN(packShort);
257 static MP_PACK_FN(packInt);
258 static MP_PACK_FN(packUint);
259 static MP_PACK_FN(packFloat);
260 static MP_PACK_FN(packDouble);
261 static MP_PACK_FN(packExpr);
263 virtual std::string formatValue(
double dval);
267 typedef boost::shared_ptr<MonitorCellScaled> MonitorCellScaledPtr;
275 #endif // End #ifndef CARMA_MONITOR_UI_RTD_MONITORCELLSCALED_H
Tagged: Tue Jun 22 22:32:16 UTC 2004.
Abstract base class for all monitor points.
Exception class for errors.
Tagged: Sun Oct 24 17:05:09 PDT 2004.
Cell that takes a MonitorPoint and displays its current value.
Tagged: Tue Sep 24 14:08:19 PDT 2013.
enum carma::ui::rtd::CellColorEnum CellColor
Cell color choices.