Exemple #1
0
        public void SetValue(double value)
        {
            Value = value;
            var args = new SensorValueChangedEventArgs {
                Value = value
            };

            SensorValueChanged?.Invoke(args);
        }
 private void InstanceOnNewMessageArrived(Message msg)
 {
     if (SensorValueChanged != null)
     {
         if (msg != null && msg.Command != String.Empty)
         {
             try
             {
                 if (msg.Response.FunctionIndex == ReaderFunctionIndex.ToString())
                 //update the events if the this is the right sensor
                 {
                     CurrentValue = Convert.ToInt32(Response.GetResponse(msg).Value);
                     SensorValueChanged?.Invoke(Convert.ToInt32(Response.GetResponse(msg).Value));
                 }
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.Message);
             }
         }
     }
 }
Exemple #3
0
 protected virtual void OnSensorValueChanged(SensorValueChangedEventArgs e)
 => SensorValueChanged?.Invoke(this, e);
Exemple #4
0
 private void OnSensorValueChanged(SensorValue e)
 {
     SensorValueChanged?.Invoke(this, e);
 }