|
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 <LinearApproximationLogWriter.h>


Classes | |
| class | VarData |
Public Member Functions | |
| LinearApproximationLogWriter (LogWriter *outputTo, int varCount, char **varList, char **unitList, float *approxErrors, bool sendAtStartCycle, bool makeDirEntries=false) | |
| virtual | ~LinearApproximationLogWriter () |
| 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... | |
| void | resetDirectoryEntries () |
| unsigned int | forceWrite (DataEntry *dataEntry) |
| unsigned int | forceWriteRow () |
Public Member Functions inherited from TableLogWriter | |
| TableLogWriter (int varCount, char **varList, char **unitList, bool interpolate) | |
| Constructor. More... | |
| TableLogWriter (LogWriter *outputTo, int varCount, char **varList, char **unitList, bool interpolate) | |
| Constructor. More... | |
| virtual | ~TableLogWriter () |
| Destructor. More... | |
| virtual unsigned int | write (const LogEntry *entry, const Unit *unit=NULL) |
| Write an entry to the text log. More... | |
| virtual unsigned int | writeAllInterpolated () |
| virtual void | resetInputs () |
| Reset cached input settings. More... | |
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... | |
| void | addParent () |
| void | removeParent () |
| int | getParentCount () |
| virtual void | activate () |
| virtual void | deactivate () |
| virtual bool | isActive () |
| virtual void | lockWrites () |
| virtual void | unlockWrites () |
Private Member Functions | |
| LinearApproximationLogWriter (const LinearApproximationLogWriter &old) | |
| void | preInitialize () |
| virtual unsigned int | writeToColumn (const DataEntry *dataEntry, const int column) |
| virtual unsigned int | writeRow () |
| virtual unsigned int | writeSyslog (const SyslogEntry *syslogEntry) |
| unsigned int | sendOutput (DataEntry *dataEntry, int varIndex) |
Private Attributes | |
| float * | approxErrors_ |
| bool | sendAtStartCycle_ |
| bool | makeDirEntries_ |
| LinearApproximationLogWriter::VarData ** | varData_ |
| FlexArray< int * > | nameWrites_ |
| FlexArray< int * > | forceWrites_ |
| DataAccess ** | dataAccesses_ |
| bool * | dataAccessHidden_ |
| bool | recentOutput_ |
| EventEntry | cycleStartEntry_ |
Friends | |
| class | Supervisor |
Additional Inherited Members | |
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 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 LogWriter | |
| static const char *const | SERVICE_TYPE_STRS [SERVICE_COUNT] |
| static size_t const | SERVICE_TYPE_STRLEN [SERVICE_COUNT] |
Protected Member Functions inherited from TableLogWriter | |
| TableLogWriter (const TableLogWriter &old) | |
| void | initializeTableLogWriter () |
| virtual void | clearRow () |
| const DataEntry ** | newDataEntryRow () |
| void | deleteDataEntryRow (const DataEntry **dataEntryRow) |
| unsigned int | writeInterpolated (const LogEntry *logEntry, const int column) |
| unsigned int | writeDataEntryRow (unsigned int row) |
| DataEntry * | interpolateDataEntry (const Timestamp ×tamp, const DataEntry *startEntry, const DataEntry *endEntry) |
| DataEntry * | nanDataEntry (const Timestamp ×tamp, const DataEntry *origEntry) |
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 TableLogWriter | |
| LogWriter * | outputTo_ |
| int | varCount_ |
| char ** | varList_ |
| char ** | unitList_ |
| const Unit ** | units_ |
| unsigned short * | uriCodes_ |
| bool * | isUniversal_ |
| int * | codeLookup_ |
| bool | interpolate_ |
| FlexArray< const DataEntry ** > | interpBuffer_ |
| FlexArray< SyslogEntry * > | interpSyslogs_ |
| FlexArray< Timestamp * > | interpTimes_ |
| FlexArray< const True * > | readerColumn_ |
| Timestamp | lastTime_ |
| bool | initializedTableLogWriter_ |
| unsigned int | slateElementURICount_ |
| bool | deleteLists_ |
Protected Attributes inherited from LogWriter | |
| OutStream * | logStream_ |
| Stores an OutStream. More... | |
| bool | wroteHeader_ |
| bool | wroteFooter_ |
| Mutex | writeMutex_ |
| int | parentCount_ |
| bool | active_ |
Static Protected Attributes inherited from TableLogWriter | |
| static True | True_ |
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.
| LinearApproximationLogWriter::LinearApproximationLogWriter | ( | LogWriter * | outputTo, |
| int | varCount, | ||
| char ** | varList, | ||
| char ** | unitList, | ||
| float * | approxErrors, | ||
| bool | sendAtStartCycle, | ||
| bool | makeDirEntries = false |
||
| ) |
References preInitialize().
|
virtual |
|
private |
|
inlinevirtual |
Configure from a config file.
Reimplemented from LogWriter.
References LogWriter::config(), and TableLogWriter::outputTo_.
|
inlinevirtual |
Do what needs to be done at the end of the cycle.
Reimplemented from LogWriter.
References LogWriter::endCycle(), and TableLogWriter::outputTo_.
| unsigned int LinearApproximationLogWriter::forceWrite | ( | DataEntry * | dataEntry | ) |
| unsigned int LinearApproximationLogWriter::forceWriteRow | ( | ) |
References LinearApproximationLogWriter::VarData::advance(), recentOutput_, sendOutput(), TableLogWriter::varCount_, varData_, and writeRow().
Referenced by Supervisor::RestartLogs(), and writeFooter().
|
private |
References dataAccesses_, dataAccessHidden_, TableLogWriter::varCount_, and varData_.
Referenced by LinearApproximationLogWriter().
| void LinearApproximationLogWriter::resetDirectoryEntries | ( | ) |
|
private |
References approxErrors_, dataAccesses_, dataAccessHidden_, Slate::FindCodedName(), DataAccess::getAccessorType(), DataAccess::getBinaryType(), CodedStr::getCode(), DataEntry::getDataAccess(), Slate::GetElementURI(), Unit::getName(), DataAccess::getTypeSize(), DataAccess::getUnit(), DataAccess::getUniversalCode(), makeDirEntries_, nameWrites_, ElementURI::NO_CODE, CodedStr::NO_CODE, TableLogWriter::outputTo_, DataEntry::setDataAccess(), DataAccess::setNoInterpFlag(), Logger::TIME_PRECISION_MILLIS, TableLogWriter::uriCodes_, TableLogWriter::varList_, and LogWriter::write().
Referenced by forceWriteRow(), and writeToColumn().
|
virtual |
Write the log footer, if any.
Reimplemented from TableLogWriter.
References forceWriteRow().
Referenced by Supervisor::RestartLogs(), and ~LinearApproximationLogWriter().
|
virtual |
Write the log header, if any.
Reimplemented from TableLogWriter.
References TableLogWriter::outputTo_, and LogWriter::writeHeader().
Referenced by Supervisor::RestartLogs().
|
privatevirtual |
Reimplemented from TableLogWriter.
References cycleStartEntry_, TableLogWriter::lastTime_, TableLogWriter::outputTo_, recentOutput_, sendAtStartCycle_, LogEntry::setTimestamp(), TableLogWriter::varCount_, LogWriter::write(), and writeToColumn().
Referenced by forceWriteRow().
|
privatevirtual |
Reimplemented from TableLogWriter.
References CodedStr::getCode(), SyslogEntry::getLoggerFacility(), makeDirEntries_, nameWrites_, TableLogWriter::outputTo_, and LogWriter::write().
|
privatevirtual |
Reimplemented from TableLogWriter.
References LinearApproximationLogWriter::VarData::advance(), approxErrors_, LinearApproximationLogWriter::VarData::checkNextEntry(), LinearApproximationLogWriter::VarData::getDataEntry(), recentOutput_, sendOutput(), varData_, and LinearApproximationLogWriter::VarData::wasNaN().
Referenced by writeRow().
|
friend |
|
private |
Referenced by sendOutput(), writeToColumn(), and ~LinearApproximationLogWriter().
|
private |
Referenced by writeRow().
|
private |
Referenced by preInitialize(), resetDirectoryEntries(), sendOutput(), and ~LinearApproximationLogWriter().
|
private |
Referenced by preInitialize(), resetDirectoryEntries(), sendOutput(), and ~LinearApproximationLogWriter().
|
private |
Referenced by forceWrite(), and resetDirectoryEntries().
|
private |
Referenced by forceWrite(), sendOutput(), and writeSyslog().
|
private |
Referenced by forceWrite(), resetDirectoryEntries(), sendOutput(), and writeSyslog().
|
private |
Referenced by forceWriteRow(), writeRow(), and writeToColumn().
|
private |
Referenced by writeRow().
|
private |
Referenced by forceWriteRow(), preInitialize(), writeToColumn(), and ~LinearApproximationLogWriter().