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

namespace HBLConsole.Model
{
    /// <summary>
    /// 连接设备类型分类
    /// </summary>
    public class DeviceTypeSort
    {

        private volatile static DeviceTypeSort _Instance;
        public static DeviceTypeSort GetInstance => _Instance ?? (_Instance = new DeviceTypeSort());
        private DeviceTypeSort()
        {
            List<string> DeviceName;

            DeviceName = new List<string>();
            DeviceName.Add(EDeviceType.Siemens.ToString());
            DevceTypes.TryAdd(EDeviceTypeSort.Siemens.ToString(), DeviceName);

            DeviceName = new List<string>();
            DeviceName.Add(EDeviceType.ModbusTcp.ToString());
            DeviceName.Add(EDeviceType.Lebai.ToString());
            DeviceName.Add(EDeviceType.JAKA.ToString());
            DevceTypes.TryAdd(EDeviceTypeSort.TCP.ToString(), DeviceName);

            DeviceName = new List<string>();
            DeviceName.Add(EDeviceType.ModbusRtu.ToString());
            DeviceName.Add(EDeviceType.SerialPort.ToString());
            DeviceName.Add(EDeviceType.Coffee.ToString());
            DeviceName.Add(EDeviceType.IceCream.ToString());
            DevceTypes.TryAdd(EDeviceTypeSort.Serial.ToString(), DeviceName);
        }

        public ConcurrentDictionary<string, List<string>> DevceTypes { get; set; } = new ConcurrentDictionary<string, List<string>>();

    }
}
