using CFX.Structures;
using Sln.Iot.CFX.CFXConnect;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sln.Iot.CFX.CFXBusiness
{
    /// <summary>
    /// CFX事件工具类
    /// </summary>
    public class CFXEventTools
    {
        private static readonly Lazy<CFXEventTools> lazy = new Lazy<CFXEventTools>(() => new CFXEventTools());

        public static CFXEventTools Instance
        {
            get
            {
                return lazy.Value;
            }
        }

        public List<UnitPosition> UnitPositionTrans(string[] unitIdentifier)
        {
            var units = new List<UnitPosition>();
            for (int i = 0; i < unitIdentifier.Length; i++)
            {
                units.Add(new UnitPosition()
                {
                    UnitIdentifier = unitIdentifier[i],
                    PositionNumber = i,
                    PositionName = $"Position{i}"
                });
            }
            return units;
        }
    }
}
