using FLY.Thick.FilmCasting.Server.Model;
using SQLite;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FLY.FilmCasting.AutoDie.Server.Model
{
    /// <summary>
    /// 厚度记录
    /// </summary>
    public class Lc_ThickHeat:IDbBase
    {
        public Int64 ID { get; set; }

        /// <summary>
        /// 测厚仪过来的 scandata id，用于画面显示，与扫描图一致
        /// </summary>
        public Int64 ScanDataID { get; set; }

        public Int64 ProfileID { get; set; }
        
        public DateTime Time { get; set; }

        public DateTime EndTime { get; set; }

        /// <summary>
        /// 目标值
        /// </summary>
        public double Target { get; set; }

        /// <summary>
        /// 规格线% ，最后规格值为目标值*TolerancePercent 
        /// </summary>
        public double TolerancePercent { get; set; }

        public double K { get; set; }

        public double B { get; set; }

        public double FilmPosition { get; set; }

        public double FilmVelocity { get; set; }

        /// <summary>
        /// 膜宽度 mm
        /// </summary>
        public int FilmWidth { get; set; }

        /// <summary>
        /// 厚度均值
        /// </summary>
        public double Avg { get; set; }

        public double[] Thicks { get; set; }

        public int[] SampleADs { get; set; }

        public Lc_BoltMapInfo BoltMapInfo { get; set; }

        /// <summary>
        /// 膜距离 m
        /// </summary>
        public double FilmLength { get; set; }

        /// <summary>
        /// 分区表, Thicks 是还没分区前的数据
        /// </summary>
        public BoltMapCell[] Boltmap { get; set; }

        /// <summary>
        /// 加热生效
        /// </summary>
        public bool IsStable { get; set; }

        /// <summary>
        /// 开始改变加热时间
        /// </summary>
        public DateTime HTime { get; set; }

        /// <summary>
        /// 1幅加热数据 % 
        /// </summary>
        public int[] Heats { get; set; }
    }


    /// <summary>
    /// 分区表
    /// </summary>
    public class BoltMapCell
    {
        /// <summary>
        /// 旧位置
        /// </summary>
        public int OldNo { get; set; }
        /// <summary>
        /// 新位置
        /// </summary>

        public int NewNo { get; set; }

        /// <summary>
        /// 全复制
        /// </summary>
        /// <returns></returns>
        public BoltMapCell Clone()
        {
            return new BoltMapCell() { NewNo = NewNo, OldNo = OldNo };
        }
    }
}
