
// Created with MonoDevelop
//
//    QuickStep: Acquire, view and identify spectra 
//    Copyright (C) 2023. Hiperscan GmbH Dresden, Germany
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;

using Hiperscan.Unix;

namespace Hiperscan.Extensions.ReferenceCheck.Control
{
    public class DeviceState
    {
        public DeviceState()
        {
            this.Reset(true);
        }

        public void Reset(bool with_config)
        {
            if (with_config)
            {
                this.ConfigIsActive = false;
                this.ConfigOutput = this.NotAvailableOutput;
            }

            this.ConnectionIsActive = false;
            this.ConnectionOutput = this.NotAvailableOutput;

            this.SerialIsActive = false;
            this.SerialOutput = this.NotAvailableOutput;

            this.ProductIsActive = false;
            this.ProductOutput = this.NotAvailableOutput;

            this.TemperatureIsActive = false;
            this.TemperatureOutput = this.NotAvailableOutput;

            this.WarmingupIsActive = false;
            this.WarmingOutput = 0;
        }

        public string ConfigOutput { get; set; }
        public string ConnectionOutput { get; set; }
        public string SerialOutput { get; set; }
        public string ProductOutput { get; set; }
        public string TemperatureOutput { get; set; }
        public double WarmingOutput { get; set; }

        public bool ConfigIsActive { get; set; }
        public bool ConnectionIsActive { get; set; }
        public bool SerialIsActive { get; set; }
        public bool ProductIsActive { get; set; }
        public bool TemperatureIsActive { get; set; }
        public bool WarmingupIsActive { get; set; }

        private string NotAvailableOutput => Catalog.GetString("n/a");
        public string ReadingOutput => Catalog.GetString("Reading...");
    }
}
