BAOS SDK
18.2.0
|
Reads the datapoint descriptions from the baos server and stores the datapoint descriptions internally. More...
#include <BaosDatapointDescriptions.h>
Public Types | |
typedef std::map< unsigned int, BaosDatapointDescription > | Descriptions |
Public Member Functions | |
BaosDatapointDescriptions (std::shared_ptr< BaosConnector > connector) | |
Creates a empty BaosDatapointDescriptions object. More... | |
~BaosDatapointDescriptions () | |
Destroys the Baos Datapoint Descriptions object. More... | |
void | clear () |
Clears the internally stored values. More... | |
void | erase (unsigned short startId, unsigned short count) |
Clears the internally stored values from datapoint ids between startId and (startId + count) - 1. More... | |
void | readFromDevice () |
Reads all datapoint descriptions from the baos server when it is possible to determine how many datapoints have been allocated. More... | |
void | readFromDevice (unsigned short startId, unsigned short count) |
Requests a range of datapoint descriptions from the baos server. More... | |
unsigned short | getCount () const |
Returns the number of datapoint descriptors. More... | |
const BaosDatapointDescription & | at (unsigned int id) const |
Returns a single datapoint description by id. More... | |
const BaosDatapointDescription & | get (unsigned int id) const |
Returns a single datapoint description by id. More... | |
bool | has (unsigned int id) const |
Returns true if a datapoint description is found with this id. More... | |
const Descriptions & | getDescriptions () const |
Returns the datapoint descriptions. More... | |
std::vector< BaosDatapointDescription > | getList () const |
Returns the list of datapoint descriptions. More... | |
Reads the datapoint descriptions from the baos server and stores the datapoint descriptions internally.
This retrieval can be done with readFromDevice.
typedef std::map<unsigned int, BaosDatapointDescription> kdrive::baos::BaosDatapointDescriptions::Descriptions |
BaosDatapointDescriptions::BaosDatapointDescriptions | ( | std::shared_ptr< BaosConnector > | connector | ) |
Creates a empty BaosDatapointDescriptions object.
BaosDatapointDescriptions::~BaosDatapointDescriptions | ( | ) |
Destroys the Baos Datapoint Descriptions object.
const BaosDatapointDescription & BaosDatapointDescriptions::at | ( | unsigned int | id | ) | const |
Returns a single datapoint description by id.
If a corresponding description is not found with this id an exception is throw
void BaosDatapointDescriptions::clear | ( | ) |
Clears the internally stored values.
void BaosDatapointDescriptions::erase | ( | unsigned short | startId, |
unsigned short | count | ||
) |
Clears the internally stored values from datapoint ids between startId and (startId + count) - 1.
const BaosDatapointDescription & BaosDatapointDescriptions::get | ( | unsigned int | id | ) | const |
Returns a single datapoint description by id.
If a corresponding description is not found with this id an exception is throw
unsigned short BaosDatapointDescriptions::getCount | ( | ) | const |
Returns the number of datapoint descriptors.
const BaosDatapointDescriptions::Descriptions & BaosDatapointDescriptions::getDescriptions | ( | ) | const |
Returns the datapoint descriptions.
std::vector< BaosDatapointDescription > BaosDatapointDescriptions::getList | ( | ) | const |
Returns the list of datapoint descriptions.
bool BaosDatapointDescriptions::has | ( | unsigned int | id | ) | const |
Returns true if a datapoint description is found with this id.
void BaosDatapointDescriptions::readFromDevice | ( | ) |
Reads all datapoint descriptions from the baos server when it is possible to determine how many datapoints have been allocated.
This is either via the protocol version (i.e. protocol version 1.2 has a max of 250 datapoints) or via the server item getMaxDatapoints. If the limit can not be found we try to read a max of 1000 datapoints. The block size is calculated with the server item current buffer size.
void BaosDatapointDescriptions::readFromDevice | ( | unsigned short | startId, |
unsigned short | count | ||
) |
Requests a range of datapoint descriptions from the baos server.
Before the new values are read the current values from the request range are erased.
startId | the id of the first datapoint |
count | the number of datapoints to read |