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

namespace CCDCount.MODEL.ShuLiModel
{
    // 行有效区记录类
    public class ActiveObjectClass
    {
        /// <summary>
        /// 活动物体编号
        /// </summary>
        public int Num { get; set; }
        /// <summary>
        /// 有效物体的每一行数据
        /// </summary>
        public List<RowStartEndCol> RowsData;
        /// <summary>
        /// 物体起始列坐标
        /// </summary>
        public int MinStartCol { get; set; }
        /// <summary>
        /// 物体结束列坐标
        /// </summary>
        public int MaxEndCol { get; set; }
        /// <summary>
        /// 上一行起始列坐标
        /// </summary>
        public int LastSeenLineStartCol { get; set; }
        /// <summary>
        /// 上一行结束列坐标
        /// </summary>
        public int LastSeenLineEndCol { get; set; }
        /// <summary>
        /// 最开始出现的行号
        /// </summary>
        public long StartLine { get; set; }
        /// <summary>
        /// 最后出现的行号
        /// </summary>
        public long LastSeenLine { get; set; }
        /// <summary>
        /// 检测开始时间
        /// </summary>
        public DateTime StartCheckTime { get; set; }
        /// <summary>
        /// 检测结束时间
        /// </summary>
        public DateTime EndCheckTime { get; set; }
        /// <summary>
        /// 物体面积
        /// </summary>
        public int Area { get; set; }

        /// <summary>
        /// 整个物体的最长长度（任意角度）
        /// </summary>
        public double MaxLength { get; set; }
        /// <summary>
        /// 通道编号
        /// </summary>
        public int ChannelNO {  get; set; }
        /// <summary>
        /// 图像宽度
        /// </summary>
        public int ImageWidth { get; set; }
        /// <summary>
        /// 状态码
        /// -1:初始值-未赋值
        /// 0:正常
        /// 1:超长粒
        /// 2:超短粒
        /// 3:超宽粒
        /// 4:超窄粒
        /// 5:超大粒
        /// 6:超小粒
        /// 7:非颗粒视野异常遮挡
        /// 8:疑似叠粒或缺损粒
        /// 9;噪点
        /// 10:颗粒数据仅单行
        /// 11:外形有明显内凹
        /// </summary>
        public int StateCode { get; set; } = -1;
        /// <summary>
        /// 批次号
        /// </summary>
        public string BatchNumber { get; set; }
        /// <summary>
        /// 是否太近
        /// </summary>
        public bool IsTooClose { get; set; } = false;

        /// <summary>
        /// 是否有内凹
        /// </summary>
        public bool hasSignificantConcavity { get; set; }
        /// <summary>
        /// 内凹程度
        /// </summary>
        public double concavityRatio { get; set; }
    }

    // 活动物体跟踪类
    public class RowStartEndCol
    {
        /// <summary>
        /// 当前有效区行数
        /// </summary>
        public long RowsCol { get; set; }
        /// <summary>
        /// 当前行有效区域起始列坐标
        /// </summary>
        public int StartCol { get; set; }
        /// <summary>
        /// 当前行有效区域结束列坐标
        /// </summary>
        public int EndCol { get; set; }
    }
}
