1 #ifndef SZA_UTIL_MONITOR_H
2 #define SZA_UTIL_MONITOR_H
15 #include "carma/szaarrayutils/monitor_stream.h"
31 Monitor(std::string arcDir, std::string calFile, std::string host,
32 std::string start,
bool startWasSet,
33 std::string stop,
bool stopWasSet,
39 Monitor(std::string arcDir, std::string calFile,
40 std::string startMjd, std::string stopMjd);
45 Monitor(std::string host, std::string calFile);
55 void addRegister(std::string regmapName,
56 std::string boardName,
58 RegAspect aspect=REG_PLAIN,
59 MonitorDataType::FormatType=MonitorDataType::FM_UNKNOWN,
61 MonitorDataType::FormatType=MonitorDataType::FM_UNKNOWN,
67 void addRegister(std::string regSpec);
72 sza::array::MsReadState readNextFrame();
78 void getRegister(std::string regmapName, std::string boardName,
80 unsigned* data, CoordRange* range);
82 void getRegister(std::string regmapName, std::string boardName,
84 int* data, CoordRange* range);
86 void getRegister(std::string regmapName, std::string boardName,
88 unsigned long* data, CoordRange* range);
90 void getRegister(std::string regmapName, std::string boardName,
92 long* data, CoordRange* range);
94 void getRegister(std::string regmapName, std::string boardName,
96 float* data, CoordRange* range);
98 void getRegister(std::string regmapName, std::string boardName,
100 double* data, CoordRange* range);
102 void printDoubleRegs();
103 void printUnsignedIntRegs();
111 unsigned countFrames();
117 std::vector<std::vector<double> > readRegsAsDoubles();
118 std::vector<std::vector<std::vector<MonitorDataType> > > readRegsAsDataTypes();
131 std::vector<double> getRegsAsDoubles();
132 std::vector<std::vector<MonitorDataType> > getRegsAsDataTypes();
134 std::vector<sza::util::RegDescription> selectedRegs() {
135 return selectedRegs_;
138 std::vector<sza::util::MonitorDataType::FormatType> selectedFormats() {
139 return selectedFormats_;
142 std::vector<sza::util::MonitorDataType::FormatType> nativeFormats() {
143 return nativeFormats_;
149 double getRegAsDouble(MonitorDataType val,
162 double* getCalSlotPtr(
unsigned iSlot=0);
179 static Keyword keywords[];
184 MonitorDataType::FormatType type;
187 static Monitor::Format formats[];
193 MS_BOTH = MS_FILE | MS_NET
196 Monitor::StreamType type_;
198 OutputStream* outputStream_;
199 char fmtString_[100];
201 sza::array::MonitorStream* ms_;
203 std::map<std::string, std::map<std::string, std::map<std::string, RegDescription* > > > regMap_;
205 std::map<std::string, std::map<std::string, std::map<std::string, MonitorDataType::FormatType > > > regSelFormat_;
207 std::map<std::string, std::map<std::string, std::map<std::string, MonitorDataType::FormatType > > > regNatFormat_;
209 std::map<std::string, std::map<std::string, std::map<std::string, RegAspect > > > regAspect_;
211 std::vector<RegDescription> selectedRegs_;
212 std::vector<RegAxisRange> regAxisRanges_;
213 std::vector<RegAspect> aspects_;
214 std::vector<MonitorDataType::FormatType> selectedFormats_;
215 std::vector<MonitorDataType::FormatType> nativeFormats_;
216 std::vector<MonitorSelection> selections_;
217 std::vector<std::string> formatStrings_;
218 std::vector<bool> hasFormatString_;
220 std::string calFile_;
222 std::string regFile_;
223 bool readRegSpecFromFile_;
232 void privateConstructor(std::string arcDir, std::string calFile,
234 std::string start,
bool startWasSet,
235 std::string stop,
bool stopWasSet,
236 std::string regFile);
238 void setMonitoringInterval(
unsigned interval);
240 void sendMonitoringInterval();
242 void sendRegisterSelection();
246 void changeMonitorStream();
251 double parseDateAndTime(std::string utc);
256 KeywordType readKeyword(InputStream* stream);
261 MonitorDataType::FormatType readFormat(InputStream* stream);
262 char* readFormatString(InputStream* stream);
267 void skipToNextLine(InputStream* stream);
273 void addRegister(RegDescription& desc, MonitorDataType::FormatType format,
279 void addRegisters(std::vector<RegDescription>& regs,
280 MonitorDataType::FormatType format,
287 void addRegister(InputStream* stream);
289 void getRegister(RegDescription* desc,
290 MonitorDataType* data, CoordRange* range);
292 void getSingleRegisterVal(RegDescription* desc,
293 MonitorDataType* data, CoordRange* range);
298 void getRegisterVals(std::vector<MonitorDataType>& data,
299 RegDescription* desc,
300 MonitorDataType* val,
301 RegAxisRange& regAxisRange);
304 static MonitorDataType::FormatType
305 formatOf(RegDescription& reg,
306 MonitorDataType::FormatType format=MonitorDataType::FM_UNKNOWN);
310 std::string formatStringOf(MonitorDataType::FormatType format,
313 void outputReg(MonitorDataType val, RegAspect aspect,
char* formatPtr);
314 MonitorDataType formatReg(MonitorDataType val, RegAspect aspect, std::string& formatStr);
319 void formatRegs(std::vector<MonitorDataType>& vals,
320 MonitorDataType& val,
321 RegAspect aspect, std::string& formatStr);
326 void convertDateToType(MonitorDataType& val);
331 void convertComplexFloatToType(MonitorDataType& val, RegAspect aspect);
333 void doubleToType(
double dVal, MonitorDataType& val);
342 #endif // End #ifndef SZA_UTIL_MONITOR_H
Tagged: Tue Jun 22 22:32:16 UTC 2004.
Tagged: Tue Oct 12 09:13:47 PDT 2004.
Tagged: Thu Mar 31 00:12:30 PST 2005.
Tagged: Mon Sep 27 21:37:46 UTC 2004.