| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- using Newtonsoft.Json;
- //using OpenCvSharp;
- namespace DaJiaoYan.Models
- {
- public class TestTemplate
- {
- private const string V2 = "v2";
- public enum TemplateVersion
- {
- V1, V2
- }
- // {
- // "barcodeRect": {
- // "height": 394,
- // "width": 631,
- // "x": 953,
- // "y": 411
- // },
- // "card_size_type": 4,
- // "missedRect": {
- // "height": 20,
- // "width": 56,
- // "x": 702,
- // "y": 234
- // },
- // "nameRect": {
- // "height": 292,
- // "width": 492,
- // "x": 251,
- // "y": 233
- // },
- // "numberRect": {
- // "height": 154,
- // "width": 670,
- // "x": 839,
- // "y": 272
- // },
- // "temp_height": 2004,
- // "temp_rect": {
- // "height": 26,
- // "width": 48,
- // "x": 125,
- // "y": 126
- // },
- // "temp_width": 2937
- //}
- [JsonProperty(PropertyName = "barcodeRect", NullValueHandling = NullValueHandling.Ignore)]
- public Rect BarcodeRect { get; set; }
- [JsonProperty(PropertyName = "card_size_type")]
- public Enumerates.CardSizeType CardSizeType { get; set; }
- [JsonProperty(PropertyName = "missedRect", NullValueHandling = NullValueHandling.Ignore)]
- public Rect MissedRect { get; set; }
- [JsonProperty(PropertyName = "nameRect", NullValueHandling = NullValueHandling.Ignore)]
- public Rect NameRect { get; set; }
- [JsonProperty(PropertyName = "numberRect", NullValueHandling = NullValueHandling.Ignore)]
- public Rect NumberRect { get; set; }
- //[JsonProperty(PropertyName = "temp_rect", NullValueHandling = NullValueHandling.Ignore)]
- public TemplateRect TemplateRect { get; set; }
- /// <summary>
- /// 锚点内宽度
- /// </summary>
- [JsonProperty(PropertyName = "temp_width", NullValueHandling = NullValueHandling.Ignore)]
- public int TemplateWidth { get; set; }
- /// <summary>
- /// 锚点内高度
- /// </summary>
- [JsonProperty(PropertyName = "temp_height", NullValueHandling = NullValueHandling.Ignore)]
- public int TemplateHeight { get; set; }
- /// <summary>
- /// 锚点宽度
- /// </summary>
- [JsonProperty(PropertyName = "anchor_width", NullValueHandling = NullValueHandling.Ignore)]
- public int AnchorWidth { get; set; }
- /// <summary>
- /// 锚点高度
- /// </summary>
- [JsonProperty(PropertyName = "anchor_height", NullValueHandling = NullValueHandling.Ignore)]
- public int AnchorHeight { get; set; }
- /// <summary>
- /// 版本
- /// </summary>
- [JsonProperty(PropertyName = "version", NullValueHandling = NullValueHandling.Ignore)]
- public string Version { get; set; }
- /// <summary>
- /// 阅卷方式
- /// </summary>
- [JsonProperty(PropertyName = "marking_mode", NullValueHandling = NullValueHandling.Ignore)]
- public int MarkingMode { get; set; }
- //[JsonProperty(PropertyName = "Version", NullValueHandling = NullValueHandling.Ignore), JsonConverter(typeof(StringEnumConverter))]
- /// <summary>
- /// 当前模版信息
- /// </summary>
- public TemplateVersion ParsedVersion
- {
- get
- {
- return string.Equals(Version, V2, System.StringComparison.OrdinalIgnoreCase) ? TemplateVersion.V2 : TemplateVersion.V1;
- }
- set
- {
- Version = value == TemplateVersion.V2 ? "v2" : "";
- }
- }
- /// <summary>
- /// 模版dpi
- /// </summary>
- public int Dpi { get; set; }
- [JsonProperty(PropertyName = "answer_sheet")]
- public TestAnswerSheet[] AnswerSheets { get; set; }
- /// <summary>
- /// 是否在线阅卷
- /// </summary>
- /// <returns></returns>
- public bool MarkingOnLine
- {
- get
- {
- return MarkingMode == 0;
- }
- }
- }
- }
|