|
LRAUV
revA
|
Defines a LogWriter that can perform lossy decimation on a stream of DataEntries, by outputting values that can be reconstructed via linear interpolation. More...
#include <LinearApproxLogWriter.h>


Classes | |
| class | VarData |
Public Member Functions | |
| LinearApproxLogWriter (LogWriter &outputTo, const Str &varName, DataValue *approxErrorValue, bool makeDirEntries, Logger &logger) | |
| virtual | ~LinearApproxLogWriter () |
| virtual unsigned int | write (const LogEntry *entry, const Unit *unit=NULL) |
| Write an entry to the text log. More... | |
| virtual unsigned int | writeHeader () |
| Write the log header, if any. More... | |
| virtual void | endCycle () |
| Do what needs to be done at the end of the cycle. More... | |
| virtual void | config (Logger &logger) |
| Configure from a config file. More... | |
| virtual unsigned int | writeFooter () |
| Write the log footer, if any. More... | |
| virtual void | setParameter (DataValue *approxError, Logger &logger) |
| virtual unsigned int | flush () |
Public Member Functions inherited from DecimationLogWriter | |
| DecimationLogWriter (LogWriter &outputTo, DecimationType decimationType) | |
| Constructor. More... | |
| virtual | ~DecimationLogWriter () |
| Destructor. More... | |
| DecimationType | getDecimationType () const |
Public Member Functions inherited from LogWriter | |
| virtual | ~LogWriter () |
| Destructor. More... | |
| virtual void | setOutStream (OutStream &outStream) |
| Sets the OutStream. More... | |
| virtual bool | isValid () |
| Return true if logStream_ is available. More... | |
| virtual void | resetInputs () |
| Reset cached input settings. More... | |
| void | addParent () |
| void | removeParent () |
| int | getParentCount () |
| virtual void | activate () |
| virtual void | deactivate () |
| virtual bool | isActive () |
| virtual void | lockWrites () |
| virtual void | unlockWrites () |
Private Member Functions | |
| LinearApproxLogWriter (const LinearApproxLogWriter &old) | |
| unsigned int | sendOutput (DataEntry *dataEntry) |
Private Attributes | |
| const Str | varName_ |
| DataValue * | approxErrorValue_ |
| LinearApproxLogWriter::VarData * | varData_ |
| EventEntry | cycleStartEntry_ |
| Timestamp | lastTime_ |
Friends | |
| class | Supervisor |
Additional Inherited Members | |
Public Types inherited from DecimationLogWriter | |
| enum | DecimationType { UNDEFINED_DECIMATION = -1, NO_DECIMATION, ALL_DATA, LINEAR_APPROXIMATION, MOST_RECENT, DECIMATION_COUNT, DECIMATION_MULTI } |
Public Types inherited from LogWriter | |
| enum | ServiceType { NO_SERVICE = -1, SERVICE_COURIER, SERVICE_EXPRESS, SERVICE_PRIORITY, SERVICE_NORMAL, SERVICE_BULK, SERVICE_COUNT, SERVICE_MULTI } |
Static Public Member Functions inherited from DecimationLogWriter | |
| static const char * | DecimationType2Str (DecimationLogWriter::DecimationType decimationType) |
| static DecimationType | Str2DecimationType (const char *const typeStr, int len=-1) |
Static Public Member Functions inherited from LogWriter | |
| static ServiceType | Str2ServiceType (const char *const serviceTypeStr, int len=-1) |
| static const char * | ServiceType2Str (LogWriter::ServiceType serviceType) |
| static size_t | ServiceType2Strlen (LogWriter::ServiceType serviceType) |
Static Public Attributes inherited from DecimationLogWriter | |
| static const char *const | DECIMATION_TYPE_STRS [DECIMATION_COUNT] |
| static const size_t | DECIMATION_TYPE_STRLEN [DECIMATION_COUNT] |
Static Public Attributes inherited from LogWriter | |
| static const char *const | SERVICE_TYPE_STRS [SERVICE_COUNT] |
| static size_t const | SERVICE_TYPE_STRLEN [SERVICE_COUNT] |
Protected Member Functions inherited from LogWriter | |
| LogWriter () | |
| Protected constructor for pure virtual class. More... | |
| LogWriter (OutStream &outStream) | |
| Protected constructor for pure virtual class. More... | |
Protected Attributes inherited from DecimationLogWriter | |
| LogWriter & | outputTo_ |
| Stores an LogWriter. More... | |
| DecimationType | decimationType_ |
| Stores the decimationType. More... | |
Protected Attributes inherited from LogWriter | |
| OutStream * | logStream_ |
| Stores an OutStream. More... | |
| bool | wroteHeader_ |
| bool | wroteFooter_ |
| Mutex | writeMutex_ |
| int | parentCount_ |
| bool | active_ |
Defines a LogWriter that can perform lossy decimation on a stream of DataEntries, by outputting values that can be reconstructed via linear interpolation.
The resulting output will have no more error than the specified error limits (using the DataValue's absDiff() function to calculate differences – important in the case of Location values). See:
K. Konstantinides and B. K. Natarajan, "An architecture for lossy
compression of waveforms using piecewise linear approximation," IEEE Trans. Signal Processing, vol. 42, no. 9, pp. 2449-2454, Sept. 1994. (http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=317866)
See TextLogWriter for conversion to text See FileLogWriter for output to the filesystem.
| LinearApproxLogWriter::LinearApproxLogWriter | ( | LogWriter & | outputTo, |
| const Str & | varName, | ||
| DataValue * | approxErrorValue, | ||
| bool | makeDirEntries, | ||
| Logger & | logger | ||
| ) |
References approxErrorValue_, Syslog::FAULT, and Logger::syslog().
|
virtual |
References approxErrorValue_, varData_, writeFooter(), and LogWriter::wroteFooter_.
|
private |
|
inlinevirtual |
Configure from a config file.
Reimplemented from LogWriter.
References LogWriter::config(), and DecimationLogWriter::outputTo_.
|
inlinevirtual |
Do what needs to be done at the end of the cycle.
Reimplemented from LogWriter.
References LogWriter::endCycle(), and DecimationLogWriter::outputTo_.
|
virtual |
Reimplemented from DecimationLogWriter.
References LinearApproxLogWriter::VarData::advance(), LinearApproxLogWriter::VarData::flushed(), LinearApproxLogWriter::VarData::getDataEntry(), sendOutput(), and varData_.
Referenced by writeFooter().
|
private |
References DecimationLogWriter::outputTo_, and LogWriter::write().
Reimplemented from DecimationLogWriter.
References approxErrorValue_, Syslog::FAULT, DataValue::getBaseUnit(), DataValue::setFrom(), and Logger::syslog().
|
virtual |
Write an entry to the text log.
Implements LogWriter.
References LinearApproxLogWriter::VarData::advance(), approxErrorValue_, LinearApproxLogWriter::VarData::checkNextEntry(), DataValue::copyTo(), LogEntry::DATA_LOG_ENTRY, DataValue::getBaseUnit(), LinearApproxLogWriter::VarData::getDataEntry(), LogEntry::getType(), sendOutput(), varData_, and LinearApproxLogWriter::VarData::wasNaN().
|
virtual |
Write the log footer, if any.
Reimplemented from LogWriter.
References flush().
Referenced by ~LinearApproxLogWriter().
|
virtual |
Write the log header, if any.
Reimplemented from LogWriter.
References DecimationLogWriter::outputTo_, and LogWriter::writeHeader().
|
friend |
|
private |
Referenced by LinearApproxLogWriter(), setParameter(), write(), and ~LinearApproxLogWriter().
|
private |
|
private |
|
private |
Referenced by flush(), write(), and ~LinearApproxLogWriter().
|
private |