|
@@ -25,6 +25,7 @@ using Npgsql.TypeHandlers.GeometricHandlers;
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
using System.Configuration;
|
|
using System.Configuration;
|
|
|
|
|
+using System.Linq;
|
|
|
using System.Diagnostics;
|
|
using System.Diagnostics;
|
|
|
using System.IO;
|
|
using System.IO;
|
|
|
using System.Text.Json.Nodes;
|
|
using System.Text.Json.Nodes;
|
|
@@ -211,6 +212,28 @@ namespace ivf_tl_Control
|
|
|
public HouseBin HouseBin10;
|
|
public HouseBin HouseBin10;
|
|
|
public BufferBottleBin BufferBottleBin;
|
|
public BufferBottleBin BufferBottleBin;
|
|
|
|
|
|
|
|
|
|
+ /// <summary>D2-02 第三阶段:按 houseSn 读该舱培养态(Dish!=null=在培养),供调试 acquire 给 operate 弹确认框。只读,不改采集。</summary>
|
|
|
|
|
+ public (bool cultivating, int embryoCount) GetCultivation(int houseSn)
|
|
|
|
|
+ {
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ var bin = houseSn switch
|
|
|
|
|
+ {
|
|
|
|
|
+ 1 => HouseBin1, 2 => HouseBin2, 3 => HouseBin3, 4 => HouseBin4, 5 => HouseBin5,
|
|
|
|
|
+ 6 => HouseBin6, 7 => HouseBin7, 8 => HouseBin8, 9 => HouseBin9, 10 => HouseBin10,
|
|
|
|
|
+ _ => null
|
|
|
|
|
+ };
|
|
|
|
|
+ var dish = bin?.Dish; // 缓冲瓶舱11无养胚胎 → 视为不培养
|
|
|
|
|
+ if (dish == null) return (false, 0);
|
|
|
|
|
+ // 优先数"仍在培养(state==0)"的胚胎(总数 embryoCount 含已移植/冷冻/作废的,不代表此刻在养);取不到明细则退回 embryoCount。
|
|
|
|
|
+ int count = dish.Embryo != null && dish.Embryo.Count > 0
|
|
|
|
|
+ ? dish.Embryo.Count(e => e.state == 0)
|
|
|
|
|
+ : dish.embryoCount;
|
|
|
|
|
+ return (true, count > 0 ? count : 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ catch { return (false, 0); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// ── M5-03-2:各链路「最后成功通讯时间」只读时间戳 ──
|
|
// ── M5-03-2:各链路「最后成功通讯时间」只读时间戳 ──
|
|
|
// 仅在已有的成功分支里赋值(不改上报逻辑/不改报文),供 GetMonitorSnapshot 只读呈现「不假装实时」。
|
|
// 仅在已有的成功分支里赋值(不改上报逻辑/不改报文),供 GetMonitorSnapshot 只读呈现「不假装实时」。
|
|
|
// LastHttpOkAt 由 operate 侧 HTTP 轮询(M5-04-4)写入,control 这里只持有/透传。
|
|
// LastHttpOkAt 由 operate 侧 HTTP 轮询(M5-04-4)写入,control 这里只持有/透传。
|