using System.Collections.Generic;
using System.ComponentModel;


namespace VSview
{

    public class Command : INotifyPropertyChanged
    {

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }


        //cislo commandu 
        private int _ID;
        public int ID
        {
            get
            {
                return _ID;
            }
            set
            {
                _ID = value;
                OnPropertyChanged("ID");
            }
        }

        //nazev commandu
        private string _Name;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
                OnPropertyChanged("Name");
            }
        }

        //informace o commandu
        private string _Information;
        public string Information
        {
            get
            {
                return _Information;
            }
            set
            {
                _Information = value;
                OnPropertyChanged("Information");
            }
        }

        /// <summary>
        /// Construktor commandu ktery obsahuje hodnotu
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="info"></param>

        public Command(int id, string name, string info)
        {
            ID = id;
            Name = name;
            Information = info;
        }
    }


    public class Enquiry
    {

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        //cislo dotazu
        private int _ID;
        public int ID
        {
            get
            {
                return _ID;
            }
            set
            {
                _ID = value;
                OnPropertyChanged("ID");
            }
        }
        //nazev dotazu
        private string _Name;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                _Name = value;
                OnPropertyChanged("Name");
            }
        }

        //informace o dotazu
        private string _Information;
        public string Information
        {
            get
            {
                return _Information;
            }
            set
            {
                _Information = value;
                OnPropertyChanged("Information");
            }
        }
        public Enquiry(int id, string name, string info)
        {
            ID = id;
            Name = name;
            Information = info;
        }
    }


    public class CommunicationList
    {
        public List<Command> Commands { get; set; }
        public List<Enquiry> Enquires { get; set; }

        public List<string> CommandList { get; set; }
        public List<string> EnquiryList { get; set; }

        public CommunicationList()
        {

            Commands = new List<Command>();
            SetupCommandList();
            Enquires = new List<Enquiry>();
            SetupEnquiryList();

            CommandList = new List<string>();
            EnquiryList = new List<string>();

            foreach (Command cmd in Commands)
            {
                CommandList.Add(cmd.Name);
            }

            foreach (Enquiry enq in Enquires)
            {
                EnquiryList.Add(enq.Name);
            }

        }

        /// <summary>
        /// Creates a list containing all commands
        /// </summary>
        public void SetupCommandList()
        {
            Commands.Add(new Command(0, "INIT-AZ<0", "Command0"));
            Commands.Add(new Command(1, "INIT-CPLOCKOUT", "Command1"));
            Commands.Add(new Command(2, "INIT-DATE", ""));
            Commands.Add(new Command(3, "INIT-DISPLAY", ""));
            Commands.Add(new Command(4, "INIT-EMISSION", ""));
            Commands.Add(new Command(5, "INIT-EXPONENT", ""));
            Commands.Add(new Command(6, "INIT-EXTLEAK", ""));
            Commands.Add(new Command(7, "INIT-FILAMENT", ""));
            Commands.Add(new Command(8, "INIT-GAIN", ""));
            Commands.Add(new Command(9, "INIT-INTERNAL-TYPE", ""));
            Commands.Add(new Command(10, "INIT-ION", ""));
            Commands.Add(new Command(11, "INIT-LANGUAGE", ""));
            Commands.Add(new Command(12, "INIT-LKEXPIRE", ""));
            Commands.Add(new Command(13, "INIT-1LOG", ""));
            Commands.Add(new Command(14, "INIT-2LOG", ""));
            Commands.Add(new Command(15, "INIT-PASSWORD", ""));
            Commands.Add(new Command(16, "INIT-PREHEAT-TIME", ""));
            Commands.Add(new Command(17, "INIT-RANGE", ""));
            Commands.Add(new Command(18, "INIT-RANGESTOP", ""));
            Commands.Add(new Command(19, "INIT-REJECT", ""));
            Commands.Add(new Command(20, "INIT-1REJECT", ""));
            Commands.Add(new Command(21, "INIT-2REJECT", ""));
            Commands.Add(new Command(22, "INIT-3REJECT", ""));
            Commands.Add(new Command(23, "INIT-4REJECT", ""));
            Commands.Add(new Command(24, "INIT-AREJECT", ""));
            Commands.Add(new Command(25, "INIT-1REJECTP", ""));
            Commands.Add(new Command(26, "INIT-2REJECTP", ""));
            Commands.Add(new Command(27, "INIT-3REJECTP", ""));
            Commands.Add(new Command(28, "INIT-4REJECTP", ""));
            Commands.Add(new Command(29, "INIT-STDLEAK", ""));
            Commands.Add(new Command(30, "INIT-TCPZERO", ""));
            Commands.Add(new Command(31, "INIT-TC-GAUGE", ""));
            Commands.Add(new Command(32, "AUTO", ""));
            Commands.Add(new Command(33, "CALIBRATE", ""));
            Commands.Add(new Command(34, "DECREMENT", ""));
            Commands.Add(new Command(35, "DISABLE-0ENABLE", ""));
            Commands.Add(new Command(36, "DISABLE-NOCAL-VMAXOUT", ""));
            Commands.Add(new Command(37, "DISABLE-PASSWORD", ""));
            Commands.Add(new Command(38, "DISABLE-1REJECT", ""));
            Commands.Add(new Command(39, "DISABLE-2REJECT", ""));
            Commands.Add(new Command(40, "DISABLE-3REJECT", ""));
            Commands.Add(new Command(41, "DISABLE-4REJECT", ""));
            Commands.Add(new Command(42, "DISABLE-AREJECT", ""));
            Commands.Add(new Command(43, "DISABLE-RANGESTOP", ""));
            Commands.Add(new Command(44, "DISABLE-SPLITFLOW", ""));
            Commands.Add(new Command(45, "DISABLE-VOLUME", ""));
            Commands.Add(new Command(46, "ENABLE-0ENABLE", ""));
            Commands.Add(new Command(47, "ENABLE-NOCAL-VMAXOUT", ""));
            Commands.Add(new Command(48, "ENABLE-PASSWORD", ""));
            Commands.Add(new Command(49, "ENABLE-1REJECT", ""));
            Commands.Add(new Command(50, "ENABLE-2REJECT", ""));
            Commands.Add(new Command(51, "ENABLE-3REJECT", ""));
            Commands.Add(new Command(52, "ENABLE-4REJECT", ""));
            Commands.Add(new Command(53, "ENABLE-AREJECT", ""));
            Commands.Add(new Command(54, "ENABLE-RANGESTOP", ""));
            Commands.Add(new Command(55, "ENABLE-SPLITFLOW", ""));
            Commands.Add(new Command(56, "ENABLE-VOLUME", ""));
            Commands.Add(new Command(57, "EXTERNAL", ""));
            Commands.Add(new Command(58, "HIGH-1REJECT", ""));
            Commands.Add(new Command(59, "HIGH-2REJECT", ""));
            Commands.Add(new Command(60, "HIGH-3REJECT", ""));
            Commands.Add(new Command(61, "HIGH-4REJECT", ""));
            Commands.Add(new Command(62, "HIGH-AREJECT", ""));
            Commands.Add(new Command(63, "INCREMENT", ""));
            Commands.Add(new Command(64, "INTERNAL", ""));
            Commands.Add(new Command(65, "LEAK-1REJECT", ""));
            Commands.Add(new Command(66, "LEAK-2REJECT", ""));
            Commands.Add(new Command(67, "LEAK-3REJECT", ""));
            Commands.Add(new Command(68, "LEAK-4REJECT", ""));
            Commands.Add(new Command(69, "LOW-1REJECT", ""));
            Commands.Add(new Command(70, "LOW-2REJECT", ""));
            Commands.Add(new Command(71, "LOW-3REJECT", ""));
            Commands.Add(new Command(72, "LOW-4REJECT", ""));
            Commands.Add(new Command(73, "LOW-AREJECT", ""));
            Commands.Add(new Command(74, "!OFFSET", ""));
            Commands.Add(new Command(75, "PSI-1REJECT", ""));
            Commands.Add(new Command(76, "PSI-2REJECT", ""));
            Commands.Add(new Command(77, "PSI-3REJECT", ""));
            Commands.Add(new Command(78, "PSI-4REJECT", ""));
            Commands.Add(new Command(79, "RESET-FIL1-HRS", ""));
            Commands.Add(new Command(80, "RESET-FIL2-HRS", ""));
            Commands.Add(new Command(81, "RESET-TB-HRS", ""));
            Commands.Add(new Command(82, "SOFTSTARTOFF", ""));
            Commands.Add(new Command(83, "SOFTSTARTON", ""));
            Commands.Add(new Command(84, "STDLEAK", ""));
            Commands.Add(new Command(85, "TPTCATM", ""));
            Commands.Add(new Command(86, "TPTCZERO", ""));
            Commands.Add(new Command(87, "TUNE", ""));
            Commands.Add(new Command(88, "XYZZY", ""));
            Commands.Add(new Command(89, "ZERO", ""));
        }

        /// <summary>
        /// Creates a list containing all enquires
        /// </summary>
        public void SetupEnquiryList()
        {
            Enquires.Add(new Enquiry(0, "?ALL", "Enquiry0"));
            Enquires.Add(new Enquiry(1, "?AZ<0", "Enquiry1"));
            Enquires.Add(new Enquiry(2, "?CALOK", ""));
            Enquires.Add(new Enquiry(3, "?CALINTOK", ""));
            Enquires.Add(new Enquiry(4, "?CPLOCKOUT", ""));
            Enquires.Add(new Enquiry(5, "?CURRDATE", ""));
            Enquires.Add(new Enquiry(6, "?DISPLAY", ""));
            Enquires.Add(new Enquiry(7, "?EMISSION", ""));
            Enquires.Add(new Enquiry(8, "?EXPONENT", ""));
            Enquires.Add(new Enquiry(9, "?EXTLEAK", ""));
            Enquires.Add(new Enquiry(10, "?FIL1HOURS", ""));
            Enquires.Add(new Enquiry(11, "?FIL2HOURS", ""));
            Enquires.Add(new Enquiry(12, "?GAIN", ""));
            Enquires.Add(new Enquiry(13, "?INTERNAL-TYPE", ""));
            Enquires.Add(new Enquiry(14, "?INTEXT", ""));
            Enquires.Add(new Enquiry(15, "?I/O BOARD", ""));
            Enquires.Add(new Enquiry(16, "?IONCHAMBER", ""));
            Enquires.Add(new Enquiry(17, "?I/O_VER", ""));
            Enquires.Add(new Enquiry(18, "?LANGUAGE", ""));
            Enquires.Add(new Enquiry(19, "?LEAK", ""));
            Enquires.Add(new Enquiry(20, "?LKEXPIRE", ""));
            Enquires.Add(new Enquiry(21, "?LEAKTEMP", ""));
            Enquires.Add(new Enquiry(22, "?LP", ""));
            Enquires.Add(new Enquiry(23, "?LPV", ""));
            Enquires.Add(new Enquiry(24, "?LPVR", ""));
            Enquires.Add(new Enquiry(25, "?LPVRM", ""));
            Enquires.Add(new Enquiry(26, "?LPVRJG", ""));
            Enquires.Add(new Enquiry(27, "?LPVRJGC", ""));
            Enquires.Add(new Enquiry(28, "?LPVRJGCTbTpV", ""));
            Enquires.Add(new Enquiry(29, "?NOCAL-VMAXOUT", ""));
            Enquires.Add(new Enquiry(30, "?OFFSET", ""));
            Enquires.Add(new Enquiry(31, "?PREHEAT", ""));
            Enquires.Add(new Enquiry(32, "?PREHEAT-TIME", ""));
            Enquires.Add(new Enquiry(33, "?PRESSURES", ""));
            Enquires.Add(new Enquiry(34, "?PWDONOFF", ""));
            Enquires.Add(new Enquiry(35, "?RANGE", ""));
            Enquires.Add(new Enquiry(36, "?RANGESTOP", ""));
            Enquires.Add(new Enquiry(37, "?1REJECT", ""));
            Enquires.Add(new Enquiry(38, "?2REJECT", ""));
            Enquires.Add(new Enquiry(39, "?3REJECT", ""));
            Enquires.Add(new Enquiry(40, "?4REJECT", ""));
            Enquires.Add(new Enquiry(41, "?AREJECT", ""));
            Enquires.Add(new Enquiry(42, "?1REJECTP", ""));
            Enquires.Add(new Enquiry(43, "?2REJECTP", ""));
            Enquires.Add(new Enquiry(44, "?3REJECTP", ""));
            Enquires.Add(new Enquiry(45, "?4REJECTP", ""));
            Enquires.Add(new Enquiry(46, "?>1REJECT", ""));
            Enquires.Add(new Enquiry(47, "?>2REJECT", ""));
            Enquires.Add(new Enquiry(48, "?>3REJECT", ""));
            Enquires.Add(new Enquiry(49, "?>4REJECT", ""));
            Enquires.Add(new Enquiry(50, "?>AREJECT", ""));
            Enquires.Add(new Enquiry(51, "?RSONOFF", ""));
            Enquires.Add(new Enquiry(52, "SERVICE1", ""));
            Enquires.Add(new Enquiry(53, "SERVICE2", ""));
            Enquires.Add(new Enquiry(54, "?SETUP", ""));
            Enquires.Add(new Enquiry(55, "?SOFTSTART", ""));
            Enquires.Add(new Enquiry(56, "?SPLITFLOW", ""));
            Enquires.Add(new Enquiry(57, "?STDLEAK", ""));
            Enquires.Add(new Enquiry(58, "?STDLK-GAIN", ""));
            Enquires.Add(new Enquiry(59, "?SYS-GAIN", ""));
            Enquires.Add(new Enquiry(60, "?SYSPWD", ""));
            Enquires.Add(new Enquiry(61, "?TC-GAUGE", ""));
            Enquires.Add(new Enquiry(62, "?TUNEOK", ""));
            Enquires.Add(new Enquiry(63, "?TURBO", ""));
            Enquires.Add(new Enquiry(64, "?TURBOHR", ""));
            Enquires.Add(new Enquiry(65, "?VALVESTATE", ""));
            Enquires.Add(new Enquiry(66, "VER", ""));
            Enquires.Add(new Enquiry(67, "?VOLUMEONOFF", ""));
            Enquires.Add(new Enquiry(68, "WHYNOCAL", ""));
            Enquires.Add(new Enquiry(69, "WHYNOCAL-INT", ""));
            Enquires.Add(new Enquiry(70, "?0ENABLE", ""));
        }


    }

}
