| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using System;
- using SqlSugar;
- namespace IvfTl.Control.Entity.DBEntitys
- {
- /// <summary>
- /// 本地自动对焦标定结果的库内镜像实体(M2-04)。
- /// 依据:sql/migrations/2026-06-17-autofocus-data-layer.sql 的 house_autofocus_calibration;
- /// 需求文档/12 §2.7(真相源=本地 calibration.json;本表为镜像;scene 0 基准/1 日常)。
- /// 列名按迁移脚本的蛇形命名,用 [SugarColumn(ColumnName=...)] 显式映射(control 端其余实体
- /// 多为 camelCase 直映,此表为对齐中央端 MySQL 迁移列名,统一走蛇形 ColumnName)。
- /// scene:0=出厂基准(每 well 一条 upsert) 1=日常对焦(append,受清理周期约束,只删 scene=1)。
- /// </summary>
- [SugarTable("house_autofocus_calibration")]
- public partial class HouseAutofocusCalibrationDB
- {
- public HouseAutofocusCalibrationDB()
- {
- }
- /// <summary>自增 id。</summary>
- [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
- // D1-09 修复:本地 SQLite 的 AUTOINCREMENT 只允许 INTEGER PRIMARY KEY;
- // C# long → SQLite BIGINT 触发 "AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY"
- // 致 CodeFirst.InitTables 建表失败。改 int(→SQLite INTEGER)即修。id 仅作自增主键,
- // 业务从不按值读取(查询均按 tl_sn/house_sn/well_sn/scene),int 范围对标定记录足够。
- public int id { get; set; }
- /// <summary>tl 设备 sn。</summary>
- [SugarColumn(ColumnName = "tl_sn")]
- public string tlSn { get; set; }
- /// <summary>仓室编号(1-11,11 号为缓冲瓶无相机不对焦)。</summary>
- [SugarColumn(ColumnName = "house_sn")]
- public int houseSn { get; set; }
- /// <summary>well 编号(1-16)。</summary>
- [SugarColumn(ColumnName = "well_sn")]
- public int wellSn { get; set; }
- /// <summary>场景:0=出厂基准 1=日常对焦。</summary>
- [SugarColumn(ColumnName = "scene")]
- public int scene { get; set; }
- /// <summary>对焦算出的最清晰层 Z 脉冲(锚点)。</summary>
- [SugarColumn(ColumnName = "focus_z")]
- public int focusZ { get; set; }
- /// <summary>曝光(×100µs)。</summary>
- [SugarColumn(ColumnName = "exposure", IsNullable = true)]
- public int? exposure { get; set; }
- /// <summary>水平电机位置脉冲。</summary>
- [SugarColumn(ColumnName = "horizontal_pulse", IsNullable = true)]
- public int? horizontalPulse { get; set; }
- /// <summary>清晰度峰比(合格判据,阈值见 tl_setting.focus_peak_ratio_threshold)。</summary>
- [SugarColumn(ColumnName = "peak_ratio", IsNullable = true)]
- public decimal? peakRatio { get; set; }
- /// <summary>是否检到 well 圆:0 否 1 是。</summary>
- [SugarColumn(ColumnName = "circle_found", IsNullable = true)]
- public int? circleFound { get; set; }
- /// <summary>居中偏移百分比。</summary>
- [SugarColumn(ColumnName = "center_offset_pct", IsNullable = true)]
- public decimal? centerOffsetPct { get; set; }
- /// <summary>标定时间。</summary>
- [SugarColumn(ColumnName = "calib_time")]
- public DateTime calibTime { get; set; }
- /// <summary>结果来源(LOCAL_JSON=本地标定镜像)。</summary>
- [SugarColumn(ColumnName = "source")]
- public string source { get; set; }
- /// <summary>备注。</summary>
- [SugarColumn(ColumnName = "note", IsNullable = true)]
- public string note { get; set; }
- /// <summary>创建人。</summary>
- [SugarColumn(ColumnName = "create_by", IsNullable = true)]
- public string createBy { get; set; }
- /// <summary>创建时间。</summary>
- [SugarColumn(ColumnName = "create_time", IsNullable = true)]
- public DateTime? createTime { get; set; }
- /// <summary>修改人。</summary>
- [SugarColumn(ColumnName = "update_by", IsNullable = true)]
- public string updateBy { get; set; }
- /// <summary>修改时间。</summary>
- [SugarColumn(ColumnName = "update_time", IsNullable = true)]
- public DateTime? updateTime { get; set; }
- /// <summary>逻辑删除标记:操作时间戳(mybatis-plus 逻辑删除约定)。</summary>
- [SugarColumn(ColumnName = "deleted", IsNullable = true)]
- public DateTime? deleted { get; set; }
- /// <summary>操作终端。</summary>
- [SugarColumn(ColumnName = "platform_id", IsNullable = true)]
- public int? platformId { get; set; }
- }
- }
|