﻿using Jarvis.Server.Data.Persistent;
using Jarvis.Server.Interfaces;
using System;
using System.Collections.Generic;

namespace Jarvis.Server.Data.Runtime
{
    /// <summary>
    /// Represents a sensor value history for all data kinds delivered by a single sensor node
    /// </summary>
    public class SensorHistory : IDeserializable
    {
        private Loggerino log = Loggerino.Instance;

        public List<SensorHistoryDataset> Dataset { get; set; }

        public string NodeLabel { get; set; }

        public List<string> UnitDescriptions { get; set; }

        public SensorHistory(string nodeLabel, List<string> unitDescriptions)
        {
            NodeLabel = nodeLabel;
            UnitDescriptions = unitDescriptions;
        }

        [Obsolete("Only for deserializing", true)]
        public SensorHistory()
        {
        }

        public void Init()
        {
            SensorReport.InitSensorHistory(this);
        }
    }
}