![]() |
Fledge
An open source edge computing platform for industrial users
|
The OMFLinkedData class. More...
#include <omflinkeddata.h>
Public Member Functions | |
OMFLinkedData (std::unordered_map< std::string, LALookup > *linkedAssetState, const OMF_ENDPOINT PIServerEndpoint=ENDPOINT_CR) | |
bool | processReading (OMFBuffer &payload, bool needDelim, const Reading &reading, const std::string &DefaultAFLocation=std::string(), OMFHints *hints=NULL) |
OMFLinkedData constructor, generates the OMF message containing the data. More... | |
void | buildLookup (const std::vector< Reading *> &reading) |
If the entries are needed in the lookup table for this block of readings then create them. More... | |
void | setSendFullStructure (const bool sendFullStructure) |
bool | flushContainers (HttpSender &sender, const std::string &path, std::vector< std::pair< std::string, std::string > > &header, OMFError &error, bool *isConnected) |
Flush the container definitions that have been built up. More... | |
void | setDelimiter (const std::string &delimiter) |
void | setFormats (const std::string &doubleFormat, const std::string &integerFormat) |
The OMFLinkedData class.
A reading is formatted with OMF specifications using the linked type creation scheme supported for OMF Version 1.2 onwards.
This is based on the new mechanism discussed at AVEVA World 2022 and the mechanism is detailed in the Google Doc, https://docs.google.com/document/d/1w0e7VRqX7xzc0lEBLq-sYhgaHE0ABasOa6EC9dJMrMs/edit
The principle is to use links to containers in OMF with each container being a single data point in the asset. There are no specific types for the assets, they share a set of base types via these links. This should allow for readings that have different sets of datapoints for each asset.
It is also a goal of this mechanism to move away from the need to persist state data between invocations and make the process more robust.
void OMFLinkedData::buildLookup | ( | const std::vector< Reading *> & | reading | ) |
If the entries are needed in the lookup table for this block of readings then create them.
readings | A block of readings to process |
This loop creates the data values for each of the datapoints in the reading.
bool OMFLinkedData::flushContainers | ( | HttpSender & | sender, |
const std::string & | path, | ||
std::vector< std::pair< std::string, std::string > > & | header, | ||
OMFError & | error, | ||
bool * | isConnected | ||
) |
Flush the container definitions that have been built up.
sender | HTTP client |
path | REST server URL |
header | REST call headers |
error | OMFError object with parsed PI Web API HTTP response |
isConnected | Set to false if REST call shows loss of connection to PI |
bool OMFLinkedData::processReading | ( | OMFBuffer & | payload, |
bool | needDelim, | ||
const Reading & | reading, | ||
const std::string & | DefaultAFLocation = std::string() , |
||
OMFHints * | hints = NULL |
||
) |
OMFLinkedData constructor, generates the OMF message containing the data.
payload | The buffer into which to populate the payload |
delim | Add a delimiter before outputting anything |
reading | Reading for which the OMF message must be generated |
AFHierarchyPrefix | Unused at the current stage |
hints | OMF hints for the specific reading for changing the behaviour of the operation |
This loop creates the data values for each of the datapoints in the reading.