|
LRAUV
revA
|
Defines a LogWriter that generates a NetCDF table of values. More...
#include <NetCdfLogWriter.h>


Public Member Functions | |
| NetCdfLogWriter (const Str &filename, bool version4, int varCount, char **varList, char **unitList, int attCount=0, char **attList=NULL) | |
| Constructor. More... | |
| virtual | ~NetCdfLogWriter () |
| Destructor. More... | |
| unsigned int | writeHeader () |
| Start writing the NetCDF file. More... | |
| unsigned int | write (const LogEntry *entry, const Unit *unit=NULL) |
| Write an entry to the buffer. More... | |
| unsigned int | writeFooter () |
| Finish writing the NetCDF file. More... | |
| virtual const Str & | getFilename () |
Public Member Functions inherited from FilterLogWriter | |
| FilterLogWriter (LogWriter *outputTo, int varCount, char **varList, char **unitList, bool passCycleStarts, int attCount=0, char **attList=NULL) | |
| Constructor. More... | |
| virtual | ~FilterLogWriter () |
| Destructor. 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... | |
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 () |
Public Member Functions inherited from HasFilename | |
| virtual | ~HasFilename () |
Protected Member Functions | |
| virtual unsigned int | writeData (const DataEntry *dataEntry, int index, const Unit *unit) |
| virtual unsigned int | writeAtt (const DataEntry *dataEntry, int index, const Unit *unit) |
Protected Member Functions inherited from FilterLogWriter | |
| virtual void | resetInputs () |
| Reset cached input settings. More... | |
| void | initializeFilterLogWriter () |
| virtual unsigned int | writeCycleStart (const EventEntry *eventEntry) |
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 Member Functions inherited from HasFilename | |
| HasFilename () | |
Private Member Functions | |
| NetCdfLogWriter (const NetCdfLogWriter &old) | |
| void | initializeNetCdfLogWriter () |
| Initialize variables, etc. More... | |
| void | addVar (const int index, const ElementURI *uri, BinaryDataType binaryType, const Unit &unit, short universalCode) |
| Add a new variable. More... | |
| void | setAttValue (const DataEntry *dataEntry, const int attIndex) |
| Set an attribute value. More... | |
| void | netCdfInitialize () |
| Initialize the NetCDF file. More... | |
Private Attributes | |
| const Str | filename_ |
| NetCdfWriter * | netCdfWriter_ |
| bool | netCdfInitialized_ |
| bool | finalized_ |
| NetCdf::NetCdfVar ** | vars_ |
| const ElementURI ** | varUris_ |
| NetCdf::NetCdfVar ** | timeVars_ |
Defines a LogWriter that generates a NetCDF table of values.
A list of variable names is supplied to the constructor. If any of these variables change their value in a computation cycle, then a record is added to the NetCDF file with the current value of every variable. The Timestamp for each record corresponds to the time of the start of the computation cycle in which any value changed.
| NetCdfLogWriter::NetCdfLogWriter | ( | const Str & | filename, |
| bool | version4, | ||
| int | varCount, | ||
| char ** | varList, | ||
| char ** | unitList, | ||
| int | attCount = 0, |
||
| char ** | attList = NULL |
||
| ) |
Constructor.
Streamless Constructor.
References initializeNetCdfLogWriter(), timeVars_, FilterLogWriter::varCount_, vars_, and varUris_.
|
virtual |
Destructor.
References finalized_, netCdfWriter_, timeVars_, vars_, varUris_, and writeFooter().
|
private |
|
private |
Add a new variable.
References NetCdfWriter::addDim(), NetCdfWriter::addGroup(), NetCdfWriter::addVar(), NetCdfWriter::addVarAtt(), BLOB_FLOAT32BE, BLOB_FLOAT32LE, BLOB_FLOAT64BE, BLOB_FLOAT64LE, BLOB_INT16BE, BLOB_INT16LE, BLOB_INT32BE, BLOB_INT32LE, BLOB_INT64BE, BLOB_INT64LE, BLOB_INT8, BLOB_UINT16BE, BLOB_UINT16LE, BLOB_UINT32BE, BLOB_UINT32LE, BLOB_UINT64BE, BLOB_UINT64LE, BLOB_UINT8, Str::cStr(), NetCdf::NetCdfVar::dataValue_, UniversalURI::DEPTH, DOUBLE4, DOUBLE6, DOUBLE8, Str::EMPTY_STR, Str::find(), NetCdf::findVar(), FLOAT2, FLOAT3, FLOAT4, Unit::getAbbreviation(), ElementURI::getBlobType(), ElementURI::getDimension1(), ElementURI::getDimension2(), ElementURI::getDimension3(), Slate::GetElementURI(), INT4, FilterLogWriter::isUniversal_, UniversalURI::LATITUDE, UniversalURI::LONGITUDE, MULTIVALUE, NetCdf::NC_ABSENT_TYPE, NetCdf::NC_BYTE_TYPE, NetCdf::NC_DOUBLE_TYPE, NetCdf::NC_FLOAT_TYPE, NetCdf::NC_INT64_TYPE, NetCdf::NC_INT_TYPE, NetCdf::NC_SHORT_TYPE, NetCdf::NC_STRING_TYPE, NetCdf::NC_UBYTE_TYPE, NetCdf::NC_UINT64_TYPE, NetCdf::NC_UINT_TYPE, NetCdf::NC_USHORT_TYPE, netCdfWriter_, ElementURI::NO_CODE, Str::NO_POS, NO_TYPE, NOT_BLOB, Str::replaceChar(), Units::SECOND, SHORT2, Str::substr(), timeVars_, UCHAR1, USHORT2, FilterLogWriter::varList_, vars_, and varUris_.
Referenced by netCdfInitialize().
|
inlinevirtual |
Implements HasFilename.
References filename_.
|
private |
Initialize variables, etc.
Referenced by NetCdfLogWriter().
|
private |
Initialize the NetCDF file.
References NetCdfWriter::addGlobalAtt(), addVar(), FilterLogWriter::attCount_, FilterLogWriter::attUriCodes_, Str::cStr(), Str::findLastOf(), DataAccess::getBinaryType(), Slate::GetDataAccess(), Slate::GetDataAccessCount(), DataAccess::getElementCode(), Slate::GetElementURI(), Slate::GetElementURICode(), DataAccess::getUnit(), DataAccess::getUniversalCode(), Slate::IsDirectoryRead(), FilterLogWriter::isUniversal_, netCdfInitialized_, netCdfWriter_, Str::NO_POS, NO_TYPE, FilterLogWriter::units_, FilterLogWriter::uriCodes_, FilterLogWriter::varCount_, FilterLogWriter::varList_, and vars_.
Referenced by write().
|
private |
Set an attribute value.
Write an entry to the buffer.
If a start of cycle is encountered, write the whole record to the NetCDF file.
Reimplemented from FilterLogWriter.
References Slate::GetElementURICount(), NetCdfWriter::initialize(), FilterLogWriter::initializedFilterLogWriter_, FilterLogWriter::initializeFilterLogWriter(), netCdfInitialize(), netCdfInitialized_, netCdfWriter_, FilterLogWriter::slateElementURICount_, and FilterLogWriter::write().
|
protectedvirtual |
Reimplemented from FilterLogWriter.
References FilterLogWriter::varCount_, and writeData().
|
protectedvirtual |
Reimplemented from FilterLogWriter.
References Timestamp::asDouble(), DataValue::copyTo(), NetCdf::NetCdfVar::dataValue_, DataEntry::getDataValue(), LogEntry::getTimestamp(), netCdfWriter_, Units::SECOND, DataValue::setFrom(), timeVars_, vars_, varUris_, and NetCdfWriter::writeVarRecord().
Referenced by writeAtt().
|
virtual |
Finish writing the NetCDF file.
Reimplemented from FilterLogWriter.
References NetCdfWriter::finalize(), finalized_, FilterLogWriter::initializedFilterLogWriter_, netCdfInitialized_, netCdfWriter_, ElementURI::NO_CODE, FilterLogWriter::uriCodes_, FilterLogWriter::varCount_, FilterLogWriter::varList_, vars_, and LogWriter::wroteFooter_.
Referenced by ~NetCdfLogWriter().
|
virtual |
Start writing the NetCDF file.
Reimplemented from FilterLogWriter.
|
private |
Referenced by getFilename().
|
private |
Referenced by writeFooter(), and ~NetCdfLogWriter().
|
private |
Referenced by netCdfInitialize(), write(), and writeFooter().
|
private |
Referenced by addVar(), netCdfInitialize(), write(), writeData(), writeFooter(), and ~NetCdfLogWriter().
|
private |
Referenced by addVar(), NetCdfLogWriter(), writeData(), and ~NetCdfLogWriter().
|
private |
Referenced by addVar(), netCdfInitialize(), NetCdfLogWriter(), writeData(), writeFooter(), and ~NetCdfLogWriter().
|
private |
Referenced by addVar(), NetCdfLogWriter(), writeData(), and ~NetCdfLogWriter().