Esempio n. 1
0
        public override void Initialization()
        {
            // define measurements list
            DateTime instant = DateTime.Now;
            Measurement m = new Measurement()
            {
                Value = MinValue,
                Unit = "[lx]",
                DisplayFormat = "0",
                SampleTime = instant,
                Name = this.Name,
            };
            LastMeasurements.Add(m);

            // NO!! non deve fare la taratura tutte le volte. Solo una volta e sotto controllo di un altro programma,
            // che chiama i metodi di taratura del sensore
            //calibration = new Calibration_2Points(CalibrationFileName);

            calibration = new Calibration_2Points();
            calibration.AddPoint(0, 0);
            calibration.AddPoint(4095, 100);
        }
Esempio n. 2
0
        public override void Initialization()
        {
            try
            {
                // define measurements list
                DateTime instant = DateTime.Now;
                Measurement rh = new Measurement()
                {
                    Value = MinValue,
                    Unit = "[RH%]",
                    DisplayFormat = "0.00",
                    SampleTime = instant,
                    Name = this.Name,
                };
                LastMeasurements.Add(rh);

                //Load the calibrationsettings if avaiable
                if (CalibrationFileName != null)
                    calibration = Calibration_2Points.Load(CalibrationFileName);
                else
                {
                    calibration = new Calibration_2Points();
                    calibration.AddPoint(0, 0);
                    calibration.AddPoint(4095, 100);
                }
            }
            catch (Exception ex)
            {
                logger.Error("Humidity_Air_HIH4000|Initialization: " + ex.Message);
            }
        }