Пример #1
0
 public Measurement(MeasurementEntity measurementEntity, Installation installation, MeasurementItem measurementItem)
 {
     Current      = measurementItem;
     History      = JsonConvert.DeserializeObject <IEnumerable <MeasurementItem> >(measurementEntity.History);
     Forecast     = JsonConvert.DeserializeObject <IEnumerable <MeasurementItem> >(measurementEntity.Forecast);
     Installation = installation;
 }
        public void AddData(List <Measurement> _data)
        {
            if (_data == null)
            {
                return;
            }
            if (_con == null)
            {
                throw new Exception("Connection closed");
            }

            var _measure = new MeasurementEntity();

            _measure.Measurement = JsonConvert.SerializeObject(_data);
            _measure.Date        = DateTime.Now;

            _con.Insert(_measure);
        }
 public Measurement(MeasurementEntity me)
 {
     History  = JsonConvert.DeserializeObject <MeasurementItem[]>(me.History);
     Forecast = JsonConvert.DeserializeObject <MeasurementItem[]>(me.Forecast);
 }
Пример #4
0
 public Measurement(MeasurementEntity measurement)
 {
     this.CurrentDisplayValue = measurement.CurrentDisplayValue;
     this.History             = JsonConvert.DeserializeObject <MeasurementItem[]>(measurement.History);
     this.Forecast            = JsonConvert.DeserializeObject <MeasurementItem[]>(measurement.Forecast);
 }