class VoltWatcher A class for watching volts
A VoltWatcher object is designed to read real-time data from an LHO online power-monitoring channel and periodically produce calculations. It obtains data via its static Dacc (Data Access) member and processes the data using a two-buffer system. A VoltWatcher contains two TSeries buffers - an "even" buffer and an "odd" one. A buffer is either "passive" or "active". "Active" means it is in the process of being filled with data, and "passive" means it is not. While the active buffer is being filled, calculations can be performed on the passive buffer. Once the active buffer is full, it becomes passive, and the other buffer is cleared and becomes active. <p> A VoltWatcher sends its calculations to a VoltBase object (if one has been assigned) and does not output its results any other way. A VoltWriter (or another object derived from VoltBase) should always accompany a VoltWatcher so that the results can be printed to the screen, saved to a file, etc. <p> CAUTION: Although the internal timing of the VoltWatcher object is automatic, its member functions must be carefully implemented externally in order for it to work properly. A simple example program for monitoring one channel is vwatch.cc; a more complicated program for monitoring several channels at once is multivw.cc. <p> NOTE: VoltWatchers get their configurations from config.vw - if the sampling rate specified is less than 2048 Hz or not a power of 2, it will be rejected.Source code: VoltWriter.hh, VoltWriter.cc and VWMath.cc
VoltWatcher(char* channel, float offset, float scale, int ID, u_short bufSize=10)
offset - The DC offset in ADC units
scale - The ratio of ADC units to volts
ID - The channel ID in config.vw
bufSize - Number of seconds in a filled buffer
void AppendBuffers()
int Analyze()
void Watch(const u_short duration=0, const u_short delay=61)
delay - GPS seconds field to wait for before beginning
fComplex GetCoef(const float freq) const
float ApproxMaxF(const float freq, const bool YNPrint=NOPRINT) const
YNPrint - If PRINT is specified, the amplitude of the
frequency found will be written to the screen
float Harmonics(const float freq)
YNPrint - If PRINT is specified, all amplitudes and phases
will be written to the screen
int GetID() const
char* GetChannelName() const
void Reset()
void GetConfiguration(Dacc& In, const char* configfile)
void VoltWatcher::TestChannel(Dacc& In, const int decim8)
void ErrMsg(const char* message)
const int _ID
char* _chanName
VoltBase* _VWrite
const u_short _bufSize
u_long n
float dt
Hanning window
float _offset
float _scale
TSeries* TS
TSeries tVolt_even
TSeries tVolt_odd
fComplex* S
bool _bufStat
u_short _bufCount
bool _errStat
alphabetic index hierarchy of classes
generated by doc++