using System;
using System.Collections.Generic;

namespace MainShell.Hardware.Acs
{
    public sealed class AcsBondingLogAdress
    {
        public const string AP_SAPosName = "AP_SAPos";
        public const string AP_SFPosName = "AP_SFPos";
        public const string AP_SAvelName = "AP_SAvel";
        public const string AP_SFvelName = "AP_SFvel";
        public const string AP_SPeName = "AP_SPe";
        public const string AP_EFPosName = "AP_EFPos";
        public const string AP_EAvelName = "AP_EAvel";
        public const string AP_EAPosName = "AP_EAPos";
        public const string AP_EFvelName = "AP_EFvel";
        public const string AP_EPeName = "AP_EPe";

        public AcsBondingLogAdress(string addressSuffix)
        {
            if (addressSuffix == null)
            {
                throw new ArgumentNullException(nameof(addressSuffix));
            }

            AP_SAPos = AcsAddressDefinition.CreateDoubleSymbol(AP_SAPosName, AP_SAPosName + addressSuffix, 1, "固晶起始 A 位置日志。");
            AP_SFPos = AcsAddressDefinition.CreateDoubleSymbol(AP_SFPosName, AP_SFPosName + addressSuffix, 1, "固晶起始 F 位置日志。");
            AP_SAvel = AcsAddressDefinition.CreateDoubleSymbol(AP_SAvelName, AP_SAvelName + addressSuffix, 1, "固晶起始 A 速度日志。");
            AP_SFvel = AcsAddressDefinition.CreateDoubleSymbol(AP_SFvelName, AP_SFvelName + addressSuffix, 1, "固晶起始 F 速度日志。");
            AP_SPe = AcsAddressDefinition.CreateDoubleSymbol(AP_SPeName, AP_SPeName + addressSuffix, 1, "固晶起始误差日志。");
            AP_EFPos = AcsAddressDefinition.CreateDoubleSymbol(AP_EFPosName, AP_EFPosName + addressSuffix, 1, "固晶结束 F 位置日志。");
            AP_EAvel = AcsAddressDefinition.CreateDoubleSymbol(AP_EAvelName, AP_EAvelName + addressSuffix, 1, "固晶结束 A 速度日志。");
            AP_EAPos = AcsAddressDefinition.CreateDoubleSymbol(AP_EAPosName, AP_EAPosName + addressSuffix, 1, "固晶结束 A 位置日志。");
            AP_EFvel = AcsAddressDefinition.CreateDoubleSymbol(AP_EFvelName, AP_EFvelName + addressSuffix, 1, "固晶结束 F 速度日志。");
            AP_EPe = AcsAddressDefinition.CreateDoubleSymbol(AP_EPeName, AP_EPeName + addressSuffix, 1, "固晶结束误差日志。");
        }

        public AcsAddressDefinition AP_SAPos { get; }

        public AcsAddressDefinition AP_SFPos { get; }

        public AcsAddressDefinition AP_SAvel { get; }

        public AcsAddressDefinition AP_SFvel { get; }

        public AcsAddressDefinition AP_SPe { get; }

        public AcsAddressDefinition AP_EFPos { get; }

        public AcsAddressDefinition AP_EAvel { get; }

        public AcsAddressDefinition AP_EAPos { get; }

        public AcsAddressDefinition AP_EFvel { get; }

        public AcsAddressDefinition AP_EPe { get; }

        public IReadOnlyList<AcsAddressDefinition> GetAddresses()
        {
            return new[]
            {
                AP_SAPos,
                AP_SFPos,
                AP_SAvel,
                AP_SFvel,
                AP_SPe,
                AP_EFPos,
                AP_EAvel,
                AP_EAPos,
                AP_EFvel,
                AP_EPe
            };
        }
    }
}
