using System;
using System.Collections.Generic;

namespace StandardScene.ExtendDevice.Door
{
    /// <summary>
    /// 门控制器模型
    /// </summary>
    public class DoorControllerModel
    {
        /// <summary>
        /// 控制器索引
        /// </summary>
        public int Index { get; set; } = 0;

        /// <summary>
        /// IP地址
        /// </summary>
        public string Ip { get; set; } = string.Empty;

        /// <summary>
        /// 端口
        /// </summary>
        public int Port { get; set; } = 502;

        /// <summary>
        /// 控制器类型（类名）
        /// </summary>
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 门列表
        /// </summary>
        public List<DoorModel> Doors { get; set; } = new List<DoorModel>();
    }

    /// <summary>
    /// 门模型
    /// </summary>
    public class DoorModel
    {
        /// <summary>
        /// 门索引
        /// </summary>
        public int Index { get; set; } = 0;

        /// <summary>
        /// 开关控制信号地址（Modbus 线圈地址）
        /// </summary>
        public ushort ControlAddress { get; set; } = 0;

        /// <summary>
        /// 开到位信号地址（Modbus 线圈地址）
        /// </summary>
        public ushort OpenStatusAddress { get; set; } = 0;

        /// <summary>
        /// 禁止对该门下发任何控制指令（打开或关闭）。
        /// 为 true 时，门控逻辑不会对该门调用 WriteDoorControl。
        /// </summary>
        public bool NoControl { get; set; } = false;
    }
}
