Esempio n. 1
0
        private void GetCalibration()
        {
            CalibrationForAIO calibrationForAio = null;

            try
            {
                calibrationForAio = channel.GetCalibrationForAIO(this.Id);
            }
            catch (System.Exception ex)
            {
                logger.LogException(LogLevel.Info, string.Format("MonitoringAIOServer.GetCalibration.{0}", this.Id), ex);
                return;
            }

            if (calibrationForAio == null)
            {
                IsCalibrationFetched = true;
                return;
            }

            this.Calibration          = calibrationForAio.CalibrationValue;
            this.CalibrationOperation = (CalibrationOperation)calibrationForAio.CalibrationOperation;

            IsCalibrationFetched = true;
        }
Esempio n. 2
0
        public CalibrationForAIO GetCalibrationForAIO(int id)
        {
            var calibrationQuery = from calibration in Entities.Calibrations
                                   where calibration.IdId == id & calibration.IsEnabled == true
                                   select calibration;

            if (!calibrationQuery.Any())
            {
                return(null);
            }

            var result = calibrationQuery.FirstOrDefault();
            CalibrationForAIO calibrationForAio = new CalibrationForAIO(result.CalibrationValue, result.CalibrationOperation);

            return(calibrationForAio);
        }
        private void GetCalibration()
        {
            CalibrationForAIO result = null;

            try
            {
                result = channel.GetCalibrationForAIO(this.Id);
            }
            catch (System.Exception ex)
            {
                logger.LogException(LogLevel.Info, string.Format("MonitoringAIO.GetCalibration.{0}", this.Id), ex);
                return;
            }

            if (result != null)
            {
                this.Calibration          = result.CalibrationValue;
                this.CalibrationOperation = (CalibrationOperation)result.CalibrationOperation;
            }

            IsCalibrationFetched = true;
        }