private void ReadValueFromDevice() { if (IsCalibrationFetched == false) { return; } LastValue2 result = null; try { result = channel.GetLastValue(this.Id); } catch (System.Exception ex) { logger.LogException(LogLevel.Info, string.Format("MonitoringAIO.ReadValueFromDevice.{0}", this.Id), ex); return; } if (result == null) { return; } if (result.HasError) { return; } var temp = result.Value; if (temp == null) { return; } if (this.Calibration != 0) { if (this.CalibrationOperation == CalibrationOperation.Jam) { temp += this.Calibration; } else if (this.CalibrationOperation == CalibrationOperation.Zarb) { temp *= this.Calibration; } } this.Value = (double)temp; this.PersianDateString = string.Format("تاریخ : {0}", result.PersianDateString); Dispatcher.BeginInvoke(new Action(SetValueOnUI)); }