// Created with MonoDevelop
//
//    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;
namespace Hiperscan.SGS.Benchtop.TemperatureControl
{
    public class DeviceTemperatures
    {
        public CapsuleTemperature Capsule { get; set; }
        public DetectorTemperature Detector { get; set; }
        public Temperature Finder { get; set; }  //Maybe replaced by a class
        public Temperature ScanEngine { get; set; } //Maybe replaced by a class
        public EnvironmentQuery Environment { get; set; }

        public DeviceTemperatures Clone()
        {
            return new DeviceTemperatures()
            {
                Capsule = this.Capsule.Clone(),
                Detector = this.Detector.Clone(),
                Finder = this.Finder.Clone(),
                ScanEngine = this.ScanEngine.Clone(),
                Environment = this.Environment.Clone()
            };
        }

        public override string ToString()
        {
            string data = String.Empty;

            if (this.SupportsScanEngine)
                data += String.Format("Scan Engine:\n\t{0}\n", this.ScanEngine);

            if (this.SupportsFinder)
                data += String.Format("Finder Platine:\n\t{0}\n", this.Finder);

            if (this.SupportsCapsule)
                data += this.Capsule.ToString();

            if (this.SupportsDetector)
                data += this.Detector.ToString();

            if (this.SupportsEnvironment)
                data += this.Environment.ToString();

            return data;
        }

        public bool SupportsCapsule
        {
            get
            {
                return this.Capsule != null;
            }
        }

        public bool SupportsDetector
        {
            get
            {
                return this.Detector != null;
            }
        }

        public bool SupportsFinder
        {
            get
            {
                return this.Finder != null;
            }
        }

        public bool SupportsScanEngine
        {
            get
            {
                return this.ScanEngine != null;
            }
        }

        public bool SupportsEnvironment
        {
            get
            {
                return this.Environment != null;
            }
        }
    }
}
