工具表定模块 使用科学计数法
This commit is contained in:
@@ -24,6 +24,7 @@ namespace MesWork
|
||||
public decimal? StableWeight;
|
||||
public int? StableStartSeq;
|
||||
public int? StableEndSeq;
|
||||
public DateTime LastCalibrationErrorLogTime;
|
||||
}
|
||||
|
||||
private static readonly ConcurrentDictionary<string, CurveCollectorState> _curveCollectors
|
||||
@@ -76,7 +77,7 @@ namespace MesWork
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 采集线程:200ms读取一次实时重量,只缓存到内存,保存时一次性写库。
|
||||
/// 采集线程:200ms读取一次实时重量,先按工具标定公式计算,再缓存到内存,保存时一次性写库。
|
||||
/// </summary>
|
||||
private void CurveCollector_Work(CurveCollectorState state)
|
||||
{
|
||||
@@ -84,7 +85,17 @@ namespace MesWork
|
||||
{
|
||||
try
|
||||
{
|
||||
decimal weight = Convert.ToDecimal(ReadPLC(100220, state.OpName)); // 实时重量点位
|
||||
decimal rawWeight = Convert.ToDecimal(ReadPLC(100220, state.OpName)); // 实时重量点位
|
||||
if (!WeightCalibrationHelper.Apply(state.OpName, rawWeight, out decimal weight, out _, out string msg))
|
||||
{
|
||||
if ((DateTime.Now - state.LastCalibrationErrorLogTime).TotalSeconds >= 5)
|
||||
{
|
||||
state.LastCalibrationErrorLogTime = DateTime.Now;
|
||||
WeighingPage?.AppendLog($"[{state.OpName}] 曲线采样标定失败:{msg}");
|
||||
}
|
||||
Thread.Sleep(CurveCollectorSampleIntervalMs);
|
||||
continue;
|
||||
}
|
||||
lock (state.BufferLock)
|
||||
{
|
||||
state.Buffer.Add(new CurveSamplePoint
|
||||
@@ -139,7 +150,7 @@ namespace MesWork
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 优先用曲线点计算稳定重量;失败时调用方继续使用PLC锁定重量。
|
||||
/// 优先用已标定曲线点计算稳定重量;失败时调用方继续使用PLC锁定重量。
|
||||
/// </summary>
|
||||
private bool CurveCollector_TryGetStableWeight(string opName, out decimal weight, out int pointCount, out string msg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user