|
RAVE
|
Utilities when working with ODIM H5 files. More...
#include "odim_io_utilities.h"#include "rave_debug.h"#include "rave_alloc.h"#include "rave_hlhdf_utilities.h"#include "hlhdf_compound_utils.h"#include "rave_legend.h"#include <string.h>#include <math.h>Macros | |
| #define | SPEED_OF_LIGHT 299792458 /* m/s */ |
| #define | DEFAULT_MINKEYLEN 64 |
| #define | DEFAULT_MINVALUELEN 32 |
Functions | |
| int | OdimIoUtilities_convertGainOffsetFromInternalRave (const char *quantity, RaveIO_ODIM_Version version, double *gain, double *offset) |
| Converts the gain and offset so that quantity is adjusted for ODIM version to be written. | |
| int | OdimIoUtilities_convertGainOffsetToInternalRave (const char *quantity, RaveIO_ODIM_Version version, double *gain, double *offset) |
| Converts the gain and offset so that quantity is adjusted for the internally used quantity. | |
| int | OdimIoUtilities_addRaveField (RaveField_t *field, HL_NodeList *nodelist, RaveIO_ODIM_Version version, const char *fmt,...) |
| Adds a rave field to a nodelist. | |
| int | OdimIoUtilities_addQualityFields (RaveObjectList_t *fields, HL_NodeList *nodelist, RaveIO_ODIM_Version version, const char *fmt,...) |
| Adds a list of quality fields (RaveField_t) to a nodelist. | |
| RaveField_t * | OdimIoUtilities_loadField (LazyNodeListReader_t *lazyReader, RaveIO_ODIM_Version version, const char *fmt,...) |
| Loads a rave field. | |
| RaveLegend_t * | OdimIOUtilities_loadLegend (LazyNodeListReader_t *lazyReader, RaveIO_ODIM_Version version, const char *fmt,...) |
| Loads a rave legend. | |
| int | OdimIoUtilities_getIdFromSource (const char *source, const char *id, char *buf, size_t buflen) |
| Gets the specified id from the source string, for example. | |
| int | OdimIoUtilities_getNodOrCmtFromSource (const char *source, char *buf, size_t buflen) |
| Like OdimIoUtilities_getIdFromSource but will first check NOD: and then CMT: | |
| int | OdimIoUtilities_createLegend (RaveLegend_t *legend, HL_NodeList *nodelist, RaveIO_ODIM_Version version, const char *fmt,...) |
| Adds a legend (RaveLegend_t) to a nodelist. | |
| int | OdimIoUtilities_createSubGroups (const char *attrname, HL_NodeList *nodelist) |
| int | OdimIoUtilities_addValuesToFile (RaveValue_t *hashtable, HL_NodeList *nodelist) |
| Adds a number of attributes to the nodelist assuming that the RaveValue instance is of hashtable type. | |
Utilities when working with ODIM H5 files.
| int OdimIoUtilities_addQualityFields | ( | RaveObjectList_t * | fields, |
| HL_NodeList * | nodelist, | ||
| RaveIO_ODIM_Version | version, | ||
| const char * | fmt, | ||
| ... ) |
Adds a list of quality fields (RaveField_t) to a nodelist.
| [in] | fields | - the list of fields |
| [in] | nodelist | - the hlhdf node list |
| [in] | fmt | - the varargs format string |
| [in] | ... | - the varargs |
| int OdimIoUtilities_addRaveField | ( | RaveField_t * | field, |
| HL_NodeList * | nodelist, | ||
| RaveIO_ODIM_Version | outversion, | ||
| const char * | fmt, | ||
| ... ) |
Adds a rave field to a nodelist.
| [in] | field | - the field |
| [in] | nodelist | - the hlhdf node list |
| [in] | outversion | - the version of file to be written |
| [in] | fmt | - the varargs format string |
| [in] | ... | - the varargs |
| int OdimIoUtilities_addValuesToFile | ( | RaveValue_t * | hashtable, |
| HL_NodeList * | nodelist ) |
Adds a number of attributes to the nodelist assuming that the RaveValue instance is of hashtable type.
| [in] | hashtable | - the rave value hashtable |
| [in] | nodelist | - the nodelist that the values should be added to |
| int OdimIoUtilities_convertGainOffsetFromInternalRave | ( | const char * | quantity, |
| RaveIO_ODIM_Version | version, | ||
| double * | gain, | ||
| double * | offset ) |
Converts the gain and offset so that quantity is adjusted for ODIM version to be written.
| [in] | quantity | - the quantity that is affected |
| [in] | version | - ODIM version that should be written |
| [in,out] | gain | - the gain. Will be adjusted according to needs |
| [in,out] | offset | - the offset. Will be adjusted according to needs |
| int OdimIoUtilities_convertGainOffsetToInternalRave | ( | const char * | quantity, |
| RaveIO_ODIM_Version | version, | ||
| double * | gain, | ||
| double * | offset ) |
Converts the gain and offset so that quantity is adjusted for the internally used quantity.
| [in] | quantity | - the quantity that is affected |
| [in] | version | - ODIM version that should be written |
| [in,out] | gain | - the gain. Will be adjusted according to needs |
| [in,out] | offset | - the offset. Will be adjusted according to needs |
| int OdimIoUtilities_createLegend | ( | RaveLegend_t * | legend, |
| HL_NodeList * | nodelist, | ||
| RaveIO_ODIM_Version | version, | ||
| const char * | fmt, | ||
| ... ) |
Adds a legend (RaveLegend_t) to a nodelist.
| [in] | legend | - the legend |
| [in] | nodelist | - the hlhdf node list |
| [in] | outversion | - the version of file to be written |
| [in] | fmt | - the varargs format string |
| [in] | ... | - the varargs |
| int OdimIoUtilities_getIdFromSource | ( | const char * | source, |
| const char * | id, | ||
| char * | buf, | ||
| size_t | buflen ) |
Gets the specified id from the source string, for example.
If source string contains CMT:abc,NOD:selek,RAD:se50 then if id = NOD: buf will be filled with selek
| [in] | source | - the what/source string |
| [in] | id | - the id to search for ended with a :, for example NOD: |
| [in,out] | buf | - the buffer filled with the found id |
| [in] | buflen | - the length of buf |
| int OdimIoUtilities_getNodOrCmtFromSource | ( | const char * | source, |
| char * | buf, | ||
| size_t | buflen ) |
Like OdimIoUtilities_getIdFromSource but will first check NOD: and then CMT:
| [in] | source | - the what/source string |
| [in] | id | - the id to search for ended with a :, for example NOD: |
| [in,out] | buf | - the buffer filled with the found id |
| [in] | buflen | - the length of buf |
| RaveField_t * OdimIoUtilities_loadField | ( | LazyNodeListReader_t * | lazyReader, |
| RaveIO_ODIM_Version | version, | ||
| const char * | fmt, | ||
| ... ) |
Loads a rave field.
A rave field can be just about anything with a mapping between attributes and a dataset.
| [in] | nodelist | - the hlhdf node list |
| [in] | nodelist | - version of the file read |
| [in] | fmt | - the variable argument list string format |
| [in] | ... | - the variable argument list |
| RaveLegend_t * OdimIOUtilities_loadLegend | ( | LazyNodeListReader_t * | lazyReader, |
| RaveIO_ODIM_Version | version, | ||
| const char * | fmt, | ||
| ... ) |
Loads a rave legend.
The compound type should have been written in a dataset according to the specification.
| [in] | lazyReader | - the wrapper around the hlhdf node list |
| [in] | version | - version of the file read |
| [in] | fmt | - the variable argument list string format |
| [in] | ... | - the variable argument list |