[][src]Struct opcua_server::prelude::DataChangeFilter

pub struct DataChangeFilter {
    pub trigger: DataChangeTrigger,
    pub deadband_type: u32,
    pub deadband_value: f64,
}

Fields

trigger: DataChangeTriggerdeadband_type: u32deadband_value: f64

Implementations

impl DataChangeFilter[src]

pub fn compare(
    &self,
    v1: &DataValue,
    v2: &DataValue,
    eu_range: Option<(f64, f64)>
) -> bool
[src]

Compares one data value to another and returns true if they differ, according to their trigger type of status, status/value or status/value/timestamp

pub fn compare_value_option(
    &self,
    v1: &Option<Variant>,
    v2: &Option<Variant>,
    eu_range: Option<(f64, f64)>
) -> bool
[src]

Compares two variant values to each other. Returns true if they are considered the "same".

pub fn compare_value(
    &self,
    v1: &Variant,
    v2: &Variant,
    eu_range: Option<(f64, f64)>
) -> Result<bool, StatusCode>
[src]

Compares two values, either a straight value compare or a numeric comparison against the deadband settings. If deadband is asked for and the values are not convertible into a numeric value, the result is false. The value is true if the values are the same within the limits set.

The eu_range is the engineering unit range and represents the range that the value should typically operate between. It's used for percentage change operations and ignored otherwise.

Errors

BadDeadbandFilterInvalid indicates the deadband settings were invalid, e.g. an invalid type, or the args were invalid. A (low, high) range must be supplied for a percentage deadband compare.

pub fn abs_compare(v1: f64, v2: f64, threshold_diff: f64) -> bool[src]

Compares the difference between v1 and v2 to the threshold. The two values are considered equal if their difference is less than or equal to the threshold.

pub fn pct_compare(
    v1: f64,
    v2: f64,
    low: f64,
    high: f64,
    threshold_pct_change: f64
) -> bool
[src]

Compares the percentage difference between v1 and v2 using the low-high range as the comparison. The two values are considered equal if their perentage difference is less than or equal to the threshold.

Trait Implementations

impl BinaryEncoder<DataChangeFilter> for DataChangeFilter[src]

impl Clone for DataChangeFilter[src]

impl Debug for DataChangeFilter[src]

impl PartialEq<DataChangeFilter> for DataChangeFilter[src]

impl Serialize for DataChangeFilter[src]

impl StructuralPartialEq for DataChangeFilter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,