using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;




namespace Maser.Feanor.Model
{
    public class Chamber
    {
        public Chamber() { }

        public Chamber(Int32 PK, Int32 mIDS, String description, Int32 Interval, String network, ServerType serverType, Boolean active, Boolean RS485, Boolean Humidity)
        {
            _PK = PK;
            _mIDS = mIDS;
            _description = description;
            _Interval = Interval;
            _Network = network;
            _Active = active;
            _serverType = serverType;
            _RS485 = RS485;
            _Humidity = Humidity;
        }


        public Int32 PK
        {
            set { _PK = value; }
            get { return _PK; }
        }
        private Int32 _PK;


        public Int32 MIDS
        {
            set { _mIDS = value; }
            get { return _mIDS; }
        }
        private Int32 _mIDS;


        public String Description
        {
            set { _description = value; }
            get { return _description; }
        }
        private String _description;


        public Int32 Interval
        {
            set { _Interval = value; }
            get { return _Interval; }
        }
        private Int32 _Interval = 60;


        public ServerType ServerType
        {
            set { _serverType = value; }
            get { return _serverType; }
        }

        private ServerType _serverType;

        public Boolean Active
        {
            set { _Active = value; }
            get { return _Active; }
        }
        private Boolean _Active;

        public Boolean RS485
        {
            set { _RS485 = value; }
            get { return _RS485; }
        }
        private Boolean _RS485;

        public Boolean Humidity
        {
            set { _Humidity = value; }
            get { return _Humidity; }
        }
        private Boolean _Humidity;

        public String MIDSandDescription { get { return string.Format("{0:00000}", _mIDS); } } // descption (node ID) removed, only chamber # now!
         //public String MIDSandDescription { get { return string.Format("{0:00000}   Node {1}", _mIDS, _description); } }

        public String Network
        {
            set { _Network = value; }
            get { return _Network; }
        }
        private String _Network;

        public override string ToString()
        {
            return string.Format("Chamber: Chamber_PK={0}, MIDS={1}, Description={2}, IP={3}, Valid={4}",
                _PK, _mIDS, _description, _Network, _Active);
        }


        // Extract chamberpath from projectinfo
        public string PathToFolderOnServer
        {
            get
            {
                return String.Format("Z:\\inventory\\{0:00000}", _mIDS);
            }
        }
    }


    
}
