工具表定模块 使用科学计数法
This commit is contained in:
@@ -177,7 +177,7 @@ namespace MesWork
|
||||
|
||||
int stIdx = WeighingPage?.GetStationIndex(opName) ?? 1;
|
||||
if (!B_DB_Opera.QueryWorkpieceByOrderNo(orderNo, out string matchedModelNo, out decimal addOilQty, out decimal extractOilQty, out decimal density,
|
||||
out decimal residualOilUpperLimit, out decimal residualOilLowerLimit))
|
||||
out decimal residualOilUpperLimit, out decimal residualOilLowerLimit)) // 根据订货号 查询基本参数
|
||||
{
|
||||
WritePLC_IF(112, opName, 3); // 报警代码=3,机型错误
|
||||
B_DB_Opera.SaveLog_Response($"【{opName}】工件管理中未找到订货号[{orderNo}]的匹配规则,发动机={engineNo}", AID);
|
||||
@@ -252,18 +252,26 @@ namespace MesWork
|
||||
engineNo = parsedProductNo;
|
||||
}
|
||||
|
||||
if (CurveCollector_TryGetStableWeight(opName, out decimal curveWeight, out int curvePointCount, out string curveMsg))
|
||||
{
|
||||
weight = curveWeight; // 优先使用曲线稳定段计算重量
|
||||
B_DB_Opera.SaveLog_Response($"【{opName}】曲线重量={curveWeight:F3}kg,PLC重量={plcWeight:F3}kg,差值={(curveWeight - plcWeight):F3}kg,点数={curvePointCount}", AID);
|
||||
}
|
||||
else
|
||||
{
|
||||
B_DB_Opera.SaveLog_Response($"【{opName}】曲线重量不可用,使用PLC锁定重量={plcWeight:F3}kg,原因={curveMsg}", AID);
|
||||
}
|
||||
|
||||
long curveWeighingRecordId = 0;
|
||||
B_DB_Opera.UpdateStationComplete(engineNo, opName, weight); // 过站记录保存最终采用重量
|
||||
if (CurveCollector_TryGetStableWeight(opName, out decimal curveWeight, out int curvePointCount, out string curveMsg))
|
||||
{
|
||||
weight = curveWeight; // 曲线采样点已按工具标定公式处理,稳定重量不再二次标定
|
||||
B_DB_Opera.SaveLog_Response($"【{opName}】标定曲线重量={curveWeight:F3}kg,PLC锁定重量={plcWeight:F3}kg,点数={curvePointCount}", AID);
|
||||
}
|
||||
else
|
||||
{
|
||||
B_DB_Opera.SaveLog_Response($"【{opName}】曲线重量不可用,使用PLC锁定重量={plcWeight:F3}kg,原因={curveMsg}", AID);
|
||||
decimal rawWeight = plcWeight;
|
||||
if (!WeightCalibrationHelper.Apply(opName, rawWeight, out decimal calibratedWeight, out string calibrationFormula, out string calibrationMsg))
|
||||
{
|
||||
throw new Exception($"工具标定公式处理失败:{calibrationMsg}");
|
||||
}
|
||||
weight = calibratedWeight;
|
||||
B_DB_Opera.SaveLog_Response($"【{opName}】PLC锁定重量标定:原始重量={rawWeight:F3}kg,公式={calibrationFormula},标定后={weight:F3}kg", AID);
|
||||
WeighingPage?.AppendLog($"[{opName}] PLC锁定重量标定:原始={rawWeight:F3}kg,公式={calibrationFormula},结果={weight:F3}kg");
|
||||
}
|
||||
|
||||
long curveWeighingRecordId = 0;
|
||||
B_DB_Opera.UpdateStationComplete(engineNo, opName, weight); // 过站记录保存最终采用重量
|
||||
string weighType = GetWeighingType(opName);
|
||||
decimal oilReleaseQty = 0;
|
||||
decimal residualOilQty = 0;
|
||||
|
||||
Reference in New Issue
Block a user