IoT::Devices

class ScalarDatapoint

File Information

Library: IoT/Devices
Package: Datapoints
Header: IoT/Devices/ScalarDatapoint.h

Description

A scalar datapoint holding a single numeric (double) value.

In addition to the methods defined in this interface, a ScalarDatapoint implementation should expose the following properties:

  • physicalQuantity (string): The physical quantity that is being measured by the datapoint, e.g. "temperature".
  • physicalUnit (string): The physical unit the measured value is being represented in (e.g. "Cel" for degree Celsius). This should use the "c/s" symbols from the Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html). See the PHYSICAL_UNIT_* strings for predefined values.
  • displayValue (string, optional): The current value of the datapoint, formatted as string for display purposes.

Inheritance

Direct Base Classes: Datapoint

All Base Classes: Datapoint, Device

Member Summary

Member Functions: clearValueChangedFilter, setValueChangedHysteresisFilter, setValueChangedIsGreaterThanFilter, setValueChangedIsGreaterThanOrEqualToFilter, setValueChangedIsLessThanFilter, setValueChangedIsLessThanOrEqualToFilter, setValueChangedMinimumDeltaFilter, setValueChangedMinimumIntervalAndDeltaFilter, setValueChangedMinimumIntervalFilter, setValueChangedMinimumIntervalOrDeltaFilter, update, validValue, value

Inherited Functions: getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, invalidate, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, valid

Constructors

ScalarDatapoint

ScalarDatapoint();

Creates the ScalarDatapoint.

Destructor

~ScalarDatapoint virtual

~ScalarDatapoint();

Destroys the ScalarDatapoint.

Member Functions

clearValueChangedFilter

void clearValueChangedFilter(
    const std::string & subscriberURI
);

Clears the filter set for the valueChanged event.

setValueChangedHysteresisFilter

void setValueChangedHysteresisFilter(
    const std::string & subscriberURI,
    double lowerThreshold,
    double upperThreshold
);

Sets a Poco::RemotingNG::HysteresisFilter for the valueChanged event.

setValueChangedIsGreaterThanFilter

void setValueChangedIsGreaterThanFilter(
    const std::string & subscriberURI,
    double limit
);

Sets a Poco::RemotingNG::GreaterThanFilter for the valueChanged event.

setValueChangedIsGreaterThanOrEqualToFilter

void setValueChangedIsGreaterThanOrEqualToFilter(
    const std::string & subscriberURI,
    double limit
);

Sets a Poco::RemotingNG::GreaterThanFilter for the valueChanged event.

setValueChangedIsLessThanFilter

void setValueChangedIsLessThanFilter(
    const std::string & subscriberURI,
    double limit
);

Sets a Poco::RemotingNG::LessThanFilter for the valueChanged event.

setValueChangedIsLessThanOrEqualToFilter

void setValueChangedIsLessThanOrEqualToFilter(
    const std::string & subscriberURI,
    double limit
);

Sets a Poco::RemotingNG::LessThanOrEqualToFilter for the valueChanged event.

setValueChangedMinimumDeltaFilter

void setValueChangedMinimumDeltaFilter(
    const std::string & subscriberURI,
    double delta
);

Sets a Poco::RemotingNG::MinimumDeltaFilter for the valueChanged event.

setValueChangedMinimumIntervalAndDeltaFilter

void setValueChangedMinimumIntervalAndDeltaFilter(
    const std::string & subscriberURI,
    long milliseconds,
    double delta
);

Sets a Poco::RemotingNG::MinimumIntervalAndDeltaFilter for the valueChanged event.

setValueChangedMinimumIntervalFilter

void setValueChangedMinimumIntervalFilter(
    const std::string & subscriberURI,
    long milliseconds
);

Sets a Poco::RemotingNG::MinimumIntervalFilter for the valueChanged event.

setValueChangedMinimumIntervalOrDeltaFilter

void setValueChangedMinimumIntervalOrDeltaFilter(
    const std::string & subscriberURI,
    long milliseconds,
    double delta
);

Sets a Poco::RemotingNG::MinimumIntervalOrDeltaFilter for the valueChanged event.

update virtual

virtual void update(
    double value
) = 0;

Updates the value of the datapoint and makes it valid.

Not all Datapoint implementations may support this method.

validValue virtual

virtual Poco::Optional < double > validValue() const = 0;

Returns the current value held by the datapoint if it is valid, otherwise an empty value.

value virtual

virtual double value() const = 0;

Returns the current value held by the datapoint, even if the datapoint has been invalidated.

Use validValue() to get a valid value only.

Variables

PHYSICAL_UNIT_AMPERE static

static std::string PHYSICAL_UNIT_AMPERE;

PHYSICAL_UNIT_CANDELA static

static std::string PHYSICAL_UNIT_CANDELA;

PHYSICAL_UNIT_DEGREES_CELSIUS static

static std::string PHYSICAL_UNIT_DEGREES_CELSIUS;

PHYSICAL_UNIT_DEGREES_FAHRENHEIT static

static std::string PHYSICAL_UNIT_DEGREES_FAHRENHEIT;

PHYSICAL_UNIT_KELVIN static

static std::string PHYSICAL_UNIT_KELVIN;

PHYSICAL_UNIT_KILOGRAM static

static std::string PHYSICAL_UNIT_KILOGRAM;

PHYSICAL_UNIT_LUX static

static std::string PHYSICAL_UNIT_LUX;

PHYSICAL_UNIT_MBAR static

static std::string PHYSICAL_UNIT_MBAR;

PHYSICAL_UNIT_METER static

static std::string PHYSICAL_UNIT_METER;

PHYSICAL_UNIT_MOL static

static std::string PHYSICAL_UNIT_MOL;

PHYSICAL_UNIT_SECOND static

static std::string PHYSICAL_UNIT_SECOND;

PHYSICAL_UNIT_VOLT static

static std::string PHYSICAL_UNIT_VOLT;

validated

Poco::BasicEvent < const double > validated;

Fired when an invalid datapoint becomes valid again, by being updated with a new value. The new valud is given as event argument.

valueChanged

Poco::BasicEvent < const double > valueChanged;

Fired when the value of the Datapoint has changed.

Actual behavior of this event (e.g., minimum interval between fires) are implementation specific and can be configured via properties.

valueUpdated

Poco::BasicEvent < const double > valueUpdated;

Fired when the value of the Datapoint has been updated.

This event is fired whenever the value of the datapoint is set with a call to update(), even if the actual value has not changed.

Securely control IoT edge devices from anywhere   Connect a Device