using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json;

namespace TEAMModelOS.SDK.Models
{
    public class SheetConfig :CosmosEntity
    {
        /// <summary>
        /// exam代表评测来源的答题卡,paper代表试卷来源的答题卡,sheet 代表直接创建答题卡的来源
        /// </summary>
        public string from { get; set; }
        /// <summary>
        /// 答题卡编号
        /// </summary>
        public string no { get; set; }
        public string school { get; set; }
        public string creatorId { get; set; }
        public string scope { get; set; }
        /// <summary>
        /// 关联id，如果没有关联则为null
        /// </summary>
        //public string sid { get; set; } = null;

        /// <summary>
        ///  //列数
        /// </summary>
        public int columns { get; set; }
        /// <summary>
        /// 题目数量
        /// </summary>
        public int itemCount { get; set; }
        /// <summary>
        /// 页数
        /// </summary>
        public int pageCount { get; set; }
        /// <summary>
        /// 页面大小(回字组成的)
        /// </summary>
        public int pageWidth { get; set; }
        /// <summary>
        /// 页面大小(回字组成的)
        /// </summary>
        public int pageHeight { get; set; }
        /// <summary>
        /// 标记是读取填涂黑块还是读取二维码
        /// </summary>
        public string infoMode { get; set; }
        public List<JsonElement> infoPos{ get; set; } = new List<JsonElement>();
        public List<JsonElement> objectivePos { get; set; } = new List<JsonElement>();
        /// <summary>
        /// 答题卡是A3 A4纸张
        /// </summary>
        public string mode { get; set; }
        /// <summary>
        /// 页码块数量
        /// </summary>
        public int pageNumBlockCount { get; set; }
        /// <summary>
        /// 页码起始值, 起始是3个空格方块开始,写1; 2个空格1个实心,写0
        /// </summary>
        public int pageNumStartValue { get; set; }
        /// <summary>
        /// 二值化区间(pc)-->不同扫描仪的结果图像数据有差距, 按需调整
        /// </summary>
       // public List<int> threshValue { get; set; } = new List<int> { 190, 220, 10 };
        /// <summary>
        /// 二值化区间(手机)
        /// </summary>
       // public List<int> threshValuePhone { get; set; } = new List<int> { 190, 220, 10 };
        /// <summary>
        /// 单个整体回字大小
        /// </summary>
        //public double huiSize { get; set; } = 70;
        /// <summary>
        /// 最小回字的大小比列, 以回字最中间的方块为最小
        /// </summary>
       // public double minHuiSize { get; set; } = 0.005;
        /// <summary>
        /// 最大回字的大小比列, 以回字最外层的方块为最大
        /// </summary>
       // public double maxHuiSize { get; set; } = 0.1;
        /// <summary>
        /// 不检测回字区域(pc版辅助效果20%, 手机版50%)
        /// </summary>
       //public List<double> notHuisRect { get; set; } = new List<double> { 0.3, 0.3, 0.4, 0.4 };
        /// <summary>
        /// 内容块 vblockCount为该模块竖向的方块数 hblockCount为该模块横向方块数
        /// </summary>
        public List<ConfigContent> contents { get; set; }
    }
    public class ConfigContent
    {
        public int index { get; set; }
        public int count { get; set; }
        public int type { get; set; }
        public int x { get; set; }
        public int y { get; set; }
        public int width { get; set; }
        public int height { get; set; }
        public int pageNum { get; set; }
        public int vblockCount { get; set; }
        public int hblockCount { get; set; }
        public string id { get; set; }
        public bool isFix { get; set; }
    }
}
