|
|
@@ -417,7 +417,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void OpenLed()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.OpenLedWait();
|
|
|
+ // M8-G3-1:LED 开关为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "打开LED灯",
|
|
|
+ () => Serial.OpenLedWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
LedState = KeyToStringConvert.GetLanguageStringByKey("C0306");
|
|
|
//LedState = "开启";
|
|
|
}
|
|
|
@@ -428,7 +431,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void CloseLed()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.CloseLedWait();
|
|
|
+ // M8-G3-1:LED 开关为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "关闭LED灯",
|
|
|
+ () => Serial.CloseLedWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
//LedState = "关闭";
|
|
|
LedState = KeyToStringConvert.GetLanguageStringByKey("C0305");
|
|
|
}
|
|
|
@@ -439,7 +445,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void OpenIntake()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.OpenIntakeValveWait();
|
|
|
+ // M8-G3-1:进气阀开关为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "打开进气阀",
|
|
|
+ () => Serial.OpenIntakeValveWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -448,7 +457,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void CloseIntake()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.CloseIntakeValveWait();
|
|
|
+ // M8-G3-1:进气阀开关为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "关闭进气阀",
|
|
|
+ () => Serial.CloseIntakeValveWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -457,7 +469,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void OpenExhaust()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.OpenExhaustValveWait();
|
|
|
+ // M8-G3-1:排气阀开关为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "打开排气阀",
|
|
|
+ () => Serial.OpenExhaustValveWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -467,7 +482,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void CloseExhaust()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.CloseExhaustValveWait();
|
|
|
+ // M8-G3-1:排气阀开关为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "关闭排气阀",
|
|
|
+ () => Serial.CloseExhaustValveWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -476,7 +494,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void HouseAeration()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.HouseAerationWait();
|
|
|
+ // M8-G3-1:舱室补气为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "舱室补气",
|
|
|
+ () => Serial.HouseAerationWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -485,7 +506,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void HouseVent()
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.HouseVentWait();
|
|
|
+ // M8-G3-1:舱室排气为串口设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "舱室排气",
|
|
|
+ () => Serial.HouseVentWait(),
|
|
|
+ input: new { houseSn = CurrentHouseId });
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -497,7 +521,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
// M1-B2:走 lease.Serial→control ComBin(builder 与 operate 逐字节一致)。⚠ 待真机 V-010(写E方回包判定)。
|
|
|
- Serial.WriteOpenIntakeTimeWait(newValue, isBuffer: false);
|
|
|
+ // M8-G3-1:写舱室进气阀时间为写 EEPROM 设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "写舱室进气阀时间",
|
|
|
+ () => Serial.WriteOpenIntakeTimeWait(newValue, isBuffer: false),
|
|
|
+ input: new { houseSn = CurrentHouseId, newValue });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -509,7 +536,11 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
if (Serial == null) return;
|
|
|
// ⚠ M1-B2:control Commander 缺 CreateWriteEEPROOpenVentTimeCommand(T1.1 核实),不臆造字节 → 暂不下发。
|
|
|
// 待真机核对字节后在 control Commander 补 builder 再接入。当前仅本地回显,未真正写入下位机。
|
|
|
- if (!Serial.WriteOpenVentTimeWait(newValue))
|
|
|
+ // M8-G3-1:写舱室排气阀时间为写 EEPROM 设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ var written = Aivfo.OperationLog.OperationLogger.Run("对焦调试", "写舱室排气阀时间",
|
|
|
+ () => Serial.WriteOpenVentTimeWait(newValue),
|
|
|
+ input: new { houseSn = CurrentHouseId, newValue });
|
|
|
+ if (!written)
|
|
|
{
|
|
|
AddMessageInfo($"[排气阀时间]control 端暂缺写E方命令(待真机补字节),本次未下发到下位机,仅本地暂存{newValue}");
|
|
|
}
|
|
|
@@ -535,7 +566,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
// M1-B2:走 lease.Serial→control ComBin(builder 与 operate 逐字节一致)。⚠ 待真机 V-010。
|
|
|
- Serial.WriteScanStepWait(newValue);
|
|
|
+ // M8-G3-1:写垂直电机间隔脉冲为写 EEPROM 设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "写垂直电机间隔脉冲",
|
|
|
+ () => Serial.WriteScanStepWait(newValue),
|
|
|
+ input: new { houseSn = CurrentHouseId, newValue });
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -573,7 +607,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void HorizontalMotorForward(int value)
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.HorizontalForwardWait(value, tLSetting.motorDelay);
|
|
|
+ // M8-G3-1:电机控制命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "水平电机正向",
|
|
|
+ () => Serial.HorizontalForwardWait(value, tLSetting.motorDelay),
|
|
|
+ input: new { houseSn = CurrentHouseId, value });
|
|
|
CurrentHor += value;
|
|
|
}
|
|
|
|
|
|
@@ -583,7 +620,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void HorizontalMotorBackward(int value)
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.HorizontalBackwardWait(value, tLSetting.motorDelay);
|
|
|
+ // M8-G3-1:电机控制命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "水平电机反向",
|
|
|
+ () => Serial.HorizontalBackwardWait(value, tLSetting.motorDelay),
|
|
|
+ input: new { houseSn = CurrentHouseId, value });
|
|
|
CurrentHor -= value;
|
|
|
}
|
|
|
|
|
|
@@ -600,7 +640,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
AddMessageInfo($"[未获取到{newWell}号well的水平电机位置]");
|
|
|
return;
|
|
|
}
|
|
|
- Serial.HorizontalMoveToWait(currentHorSetting.horizontalMotorPosition, tLSetting.motorDelay);
|
|
|
+ // M8-G3-1:电机控制命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "水平电机到well",
|
|
|
+ () => Serial.HorizontalMoveToWait(currentHorSetting.horizontalMotorPosition, tLSetting.motorDelay),
|
|
|
+ input: new { houseSn = CurrentHouseId, well = newWell, hor = currentHorSetting.horizontalMotorPosition });
|
|
|
CurrentHor = currentHorSetting.horizontalMotorPosition;
|
|
|
CurrentWell = newWell;
|
|
|
}
|
|
|
@@ -624,7 +667,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void VerticalMotorForward(int newValue)
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.VerticalForwardWait(newValue, tLSetting.motorDelay);
|
|
|
+ // M8-G3-1:电机控制命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "垂直电机正向",
|
|
|
+ () => Serial.VerticalForwardWait(newValue, tLSetting.motorDelay),
|
|
|
+ input: new { houseSn = CurrentHouseId, newValue });
|
|
|
CurrentVer += newValue;
|
|
|
}
|
|
|
|
|
|
@@ -634,7 +680,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void VerticalMotorBackward(int newValue)
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.VerticalBackwardWait(newValue, tLSetting.motorDelay);
|
|
|
+ // M8-G3-1:电机控制命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "垂直电机反向",
|
|
|
+ () => Serial.VerticalBackwardWait(newValue, tLSetting.motorDelay),
|
|
|
+ input: new { houseSn = CurrentHouseId, newValue });
|
|
|
CurrentVer -= newValue;
|
|
|
}
|
|
|
|
|
|
@@ -644,7 +693,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void VerticalMotorAbsolute(int newValue)
|
|
|
{
|
|
|
if (Serial == null) return;
|
|
|
- Serial.VerticalMoveToWait(newValue, tLSetting.motorDelay);
|
|
|
+ // M8-G3-1:电机控制命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ Aivfo.OperationLog.OperationLogger.Run("对焦调试", "垂直电机绝对运动",
|
|
|
+ () => Serial.VerticalMoveToWait(newValue, tLSetting.motorDelay),
|
|
|
+ input: new { houseSn = CurrentHouseId, newValue });
|
|
|
CurrentVer = newValue;
|
|
|
}
|
|
|
|
|
|
@@ -668,6 +720,11 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
verNewValue = cc.clearestPosition;
|
|
|
}
|
|
|
|
|
|
+ // M8-G3-1:一键电机准备为多步串口动作流程,用 Begin scope 串联各子动作(module=对焦调试)。
|
|
|
+ using var _op = Aivfo.OperationLog.OperationLogger.Begin("对焦调试", "一键电机准备",
|
|
|
+ houseSn: CurrentHouseId);
|
|
|
+ try { _op.Input(new { houseSn = CurrentHouseId, targetHor = currentHorSetting.horizontalMotorPosition, targetVer = verNewValue }); } catch { }
|
|
|
+
|
|
|
Serial.HorizontalResetWait(tLSetting.motorDelay);
|
|
|
CurrentHor = 0;
|
|
|
CurrentWell = 0;
|
|
|
@@ -695,7 +752,11 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
if (GetPicData() == 0)
|
|
|
{
|
|
|
if (Cam == null) return false;
|
|
|
- return Cam.SavePic(fullName, CurrentHouse.ccdWidth, CurrentHouse.ccdHeight);
|
|
|
+ // M8-G3-1:单张抓拍落盘为相机采图+保存命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ // 批量抓图(水平抓图/清晰图层抓图)经 Begin scope 调用时,本埋点自动成为其子埋点(父子链)。
|
|
|
+ return Aivfo.OperationLog.OperationLogger.Run("对焦调试", "单张抓拍",
|
|
|
+ () => Cam.SavePic(fullName, CurrentHouse.ccdWidth, CurrentHouse.ccdHeight),
|
|
|
+ input: new { houseSn = CurrentHouseId, well = CurrentWell, focal = CurrentFocal, hor = CurrentHor, ver = CurrentVer });
|
|
|
|
|
|
}
|
|
|
return false;
|
|
|
@@ -718,6 +779,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
IsStop = false;
|
|
|
if (Serial == null) return;
|
|
|
if (IsStop) return;
|
|
|
+ // M8-G3-1:水平抓图为多步循环采图流程,用 Begin scope 串联各 well 抓拍子埋点(module=对焦调试)。
|
|
|
+ using var _op = Aivfo.OperationLog.OperationLogger.Begin("对焦调试", "水平抓图",
|
|
|
+ houseSn: CurrentHouseId);
|
|
|
+ try { _op.Input(new { houseSn = CurrentHouseId }); } catch { }
|
|
|
Serial.HorizontalResetWait(tLSetting.motorDelay);
|
|
|
CurrentHor = 0;
|
|
|
CurrentWell = 0;
|
|
|
@@ -781,6 +846,10 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
AddMessageInfo($"[未获取到{CurrentWell}号well的自动对焦起点]");
|
|
|
return;
|
|
|
}
|
|
|
+ // M8-G3-1:清晰图层抓图为多步循环采图流程,用 Begin scope 串联各层抓拍子埋点(module=对焦调试)。
|
|
|
+ using var _op = Aivfo.OperationLog.OperationLogger.Begin("对焦调试", "清晰图层抓图",
|
|
|
+ houseSn: CurrentHouseId);
|
|
|
+ try { _op.Input(new { houseSn = CurrentHouseId, well = CurrentWell, focalCount, xun }); } catch { }
|
|
|
startAutoFocus = cc.autoFocusPosition;
|
|
|
string dtnow = string.Format("{0:yyyy-MM-dd-HH-mm-ss}", DateTime.Now); //24小时制
|
|
|
string path = null;
|
|
|
@@ -872,7 +941,11 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
public void SetExposure(int newExporuse)
|
|
|
{
|
|
|
if (Cam == null) { AddMessageInfo("设置曝光失败:相机句柄为空"); return; }
|
|
|
- AddMessageInfo($"设置曝光结果:{Cam.SetExposure(newExporuse)}");
|
|
|
+ // M8-G3-1:设置相机曝光为相机设备命令入口,补操作日志埋点(module=对焦调试)。
|
|
|
+ var ret = Aivfo.OperationLog.OperationLogger.Run("对焦调试", "设置相机曝光值",
|
|
|
+ () => Cam.SetExposure(newExporuse),
|
|
|
+ input: new { houseSn = CurrentHouseId, ccdId = CurrentCCDId, newExporuse });
|
|
|
+ AddMessageInfo($"设置曝光结果:{ret}");
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -1441,11 +1514,17 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ // M8-G3-1:保存手调拍摄层为"本地校验/计算 + HTTP 持久化 + 内存同步"打包的关键业务操作,
|
|
|
+ // 用 Begin scope 给一个父操作名(统一 traceId 串联其内的 WellUpdateApi HTTP 埋点;module=对焦调试)。
|
|
|
+ using var _op = Aivfo.OperationLog.OperationLogger.Begin("对焦调试", "保存手调拍摄层设置",
|
|
|
+ houseSn: CurrentHouseId);
|
|
|
+
|
|
|
// 校验:层数≥1、间距>0、下移≥0 且 <层数;非法不保存。
|
|
|
var eff = ResolveEffectiveTune(out string msg);
|
|
|
if (eff == null)
|
|
|
{
|
|
|
AddMessageInfo($"[手调拍摄层]保存被拦截(非法值):{msg}");
|
|
|
+ try { _op.Output(new { rejected = msg }).Fail("校验未通过:" + msg); } catch { }
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -1454,6 +1533,7 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
int? wellSpacing = string.IsNullOrWhiteSpace(ManualLayerSpacing) ? (int?)null : int.Parse(ManualLayerSpacing.Trim());
|
|
|
// 下移复用 move_down_layer(库列非空);留空时回退取生效值(eff.down)写回,不破坏旧列语义。
|
|
|
int wellMoveDown = string.IsNullOrWhiteSpace(ManualMoveDown) ? eff.Value.down : int.Parse(ManualMoveDown.Trim());
|
|
|
+ try { _op.Input(new { houseSn = CurrentHouseId, well = ManualTuneWell, wellCount, wellSpacing, wellMoveDown }); } catch { }
|
|
|
|
|
|
// 复用现有 well 设置保存通道:与 SetWellMotorPosition/SetWellAutoFocus 同一 WellUpdateApi。
|
|
|
// 后端按 tlSn/houseSn/wellSn 定位 house_well_setting 行做部分更新(仅本次携带的字段)。
|
|
|
@@ -1470,6 +1550,7 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
if (!ok)
|
|
|
{
|
|
|
AddMessageInfo("[手调拍摄层]保存失败(接口返回失败)");
|
|
|
+ try { _op.Fail("WellUpdateApi 返回失败"); } catch { }
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -1483,6 +1564,7 @@ namespace ivf_tl_Operate.ViewModel
|
|
|
}
|
|
|
AddMessageInfo($"[手调拍摄层]well{ManualTuneWell} 已存为默认:层数={(wellCount?.ToString() ?? "继承")} " +
|
|
|
$"间距={(wellSpacing?.ToString() ?? "继承")} 下移={wellMoveDown}(写 house_well_setting well 级覆盖,留空继承设备级)");
|
|
|
+ try { _op.Output(new { ok = true }).Success(); } catch { }
|
|
|
return true;
|
|
|
}
|
|
|
catch (Exception ex)
|