DataPoint
-
class DataPoint : public std::enable_shared_from_this<DataPoint>
Public Functions
-
std::shared_ptr<Station> getStation()
Get the NetworkStation that owns this DataPoint.
- Returns:
Pointer to NetworkStation or nullptr
-
std::uint_fast32_t getInformationObjectAddress() const
Get the information object address.
- Returns:
IOA
-
std::optional<std::uint_fast32_t> getRelatedInformationObjectAddress() const
Get the information object address of a related monitoring point.
- Returns:
IOA
-
void setRelatedInformationObjectAddress(std::optional<std::uint_fast32_t> related_io_address)
Set the information object address of a related monitoring point.
- Throws:
std::invalid_argument – if not a server-sided control point or invalid IOA
-
bool getRelatedInformationObjectAutoReturn() const
Test if a related monitoring point should be auto-transmitted on incoming update of this control point.
- Returns:
if auto-transmit of related point is enabled
-
void setRelatedInformationObjectAutoReturn(bool auto_return)
Configure if the related monitoring point should be auto-transmitted on incoming update of this control point.
- Throws:
std::invalid_argument – if not a server-sided control point or invalid IOA
-
CommandTransmissionMode getCommandMode() const
Get command transmission mode.
- Returns:
direct or select-and-execute
-
void setCommandMode(CommandTransmissionMode mode)
Configure command transmission mode to direct or select-and-execute.
-
std::optional<std::uint_fast8_t> getSelectedByOriginatorAddress()
Get select-and-execute lock originator address.
- Returns:
client originator address or zero if no active selection lock exists
-
std::uint_fast16_t getReportInterval_ms() const
Get automatic report transmission interval of this point.
- Returns:
interval in milliseconds, 0 if disabled
-
void setReportInterval_ms(std::uint_fast16_t interval_ms)
Configure automatic report transmission interval of this monitoring point.
- Throws:
std::invalid_argument – if not a server-sided monitoring point
-
std::uint_fast16_t getTimerInterval_ms() const
Get automatic timer interval of this point.
- Returns:
interval in milliseconds, 0 if disabled
Set point value.
-
void setValue(InfoValue new_value)
Set point value.
-
void setQuality(InfoQuality new_value)
Set point value.
-
std::optional<std::chrono::system_clock::time_point> getRecordedAt() const
get timestamp bundled with value
- Returns:
milliseconds since unix-epoch
-
std::chrono::system_clock::time_point getProcessedAt() const
get timestamp of last local processing operation (receiving/sending)
- Returns:
milliseconds since unix-epoch
-
void setProcessedAt(std::chrono::system_clock::time_point val)
set timestamp of last local processing operation (receiving/sending)
-
std::optional<std::chrono::steady_clock::time_point> nextReportAt() const
get next timer event point
- Returns:
seconds since unix-epoch
-
std::optional<std::chrono::steady_clock::time_point> nextTimerAt() const
get next timer event point
- Returns:
seconds since unix-epoch
handle remote point update, execute python callback
- Parameters:
message – incoming messsage information
- Returns:
response handling information (success, failure or none)
-
void setOnReceiveCallback(py::object &callable)
set python callback that will be executed on every incoming message
- Throws:
std::invalid_argument – if callable signature does not match
-
void onBeforeRead()
handle point value request before automatic read-command response, execute python callback
-
void setOnBeforeReadCallback(py::object &callable)
set python callback that will be called on incoming interrogation or read commands to support polling
- Throws:
std::invalid_argument – if callable signature does not match, parent station reference is invalid or function is called from client context
-
void onBeforeAutoTransmit()
handle point value request before automatic transmission, execute python callback
-
void setOnBeforeAutoTransmitCallback(py::object &callable)
set python callback that will be called before server reports a measured value interval-based
- Throws:
std::invalid_argument – if callable signature does not match, parent station reference is invalid or function is called from client context
-
void onTimer()
handle timer event, execute python callback
-
void setOnTimerCallback(py::object &callable, std::uint_fast16_t interval_ms = 0)
set python callback that will be called at a fixed interval
- Throws:
std::invalid_argument – if callable signature does not match
-
bool read()
send read command to update the points value
- Throws:
std::invalid_argument – if parent station or connection reference is invalid or function is called from server context
-
bool transmit(CS101_CauseOfTransmission cause = CS101_COT_UNKNOWN_COT)
transmit point
- Parameters:
cause – cause of transmission
qualifier – parameter for command duration
- Throws:
std::invalid_argument – if parent station or connection reference is invalid
- Returns:
success information
Public Static Functions
create a new DataPoint instance
- Parameters:
dp_ioa – information object address
dp_type – iec60870-5-104 information type
dp_station – station object reference
dp_report_ms – auto reporting interval
dp_related_ioa – related information object address, if any
dp_related_auto_return – auto transmit related point on command
dp_cmd_mode – command transmission mode (direct or select-and-execute)
tick_rate_ms – outer tick rate
- Throws:
std::invalid_argument – if type is invalid
-
std::shared_ptr<Station> getStation()