Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="valueStatusTimestamp"></param>
        void IValueSubscription.Update(ValueStatusTimestamp valueStatusTimestamp)
        {
            var oldValueStatusTimestamp = ValueStatusTimestamp;

            ValueStatusTimestamp = valueStatusTimestamp;
            if (_valueUpdated is not null)
            {
                _valueUpdated(oldValueStatusTimestamp, valueStatusTimestamp);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="valueStatusTimestamp"></param>
        void IValueSubscription.Update(ValueStatusTimestamp valueStatusTimestamp)
        {
            if (valueStatusTimestamp.ValueStatusCode == ValueStatusCode.Unknown)
            {
                return;
            }

            _dataProvider.RemoveItem(this);

            if (_setValueAction is not null)
            {
                _setValueAction(valueStatusTimestamp);
                _setValueAction = null;
            }
        }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="valueStatusTimestamp"></param>
 public void Write(ValueStatusTimestamp valueStatusTimestamp)
 {
     DataAccessProvider.Write(this, valueStatusTimestamp, null);
 }
Esempio n. 4
0
 public bool Equals(ValueStatusTimestamp that)
 {
     return(ValueStatusCode == that.ValueStatusCode && TimestampUtc == that.TimestampUtc && Value == that.Value);
 }
Esempio n. 5
0
 /// <summary>
 ///     Uses ValueAsDouble(false), ValueAsInt32(false), ValueAsString(false) depending of ValueStorageType.
 ///     Returns true if diff is less than or equal deadband.
 ///     TimestampUtc is NOT compared.
 /// </summary>
 /// <param name="that"></param>
 /// <param name="deadband"></param>
 /// <returns></returns>
 public bool Compare(ValueStatusTimestamp that, double deadband = 0.0)
 {
     return(ValueStatusCode == that.ValueStatusCode && Value.Compare(that.Value, deadband));
 }