Fledge
An open source edge computing platform for industrial users
OMFLinkedData Class Reference

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)
 

Detailed Description

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.

Member Function Documentation

◆ buildLookup()

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.

Parameters
readingsA block of readings to process

This loop creates the data values for each of the datapoints in the reading.

◆ flushContainers()

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.

Parameters
senderHTTP client
pathREST server URL
headerREST call headers
errorOMFError object with parsed PI Web API HTTP response
isConnectedSet to false if REST call shows loss of connection to PI
Returns
true if the containers were successfully flushed

◆ processReading()

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.

Parameters
payloadThe buffer into which to populate the payload
delimAdd a delimiter before outputting anything
readingReading for which the OMF message must be generated
AFHierarchyPrefixUnused at the current stage
hintsOMF 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.


The documentation for this class was generated from the following files: