增加线性工件校准 增加信号变化日志记录
This commit is contained in:
@@ -253,7 +253,9 @@ namespace MesWork.Pages
|
||||
|
||||
ConfigureWeightCard(weightBox, weightTitle, weightValue, weightUnit, topCardWidth, 128, 41F);
|
||||
weightBox.Location = new Point(margin, weightY);
|
||||
ConfigureMetricCard(station, waterBox, waterTitle, waterValue, waterUnit, "水含量", "ppm", margin + topCardWidth + gap, weightY, topCardWidth, 128, 28F);
|
||||
ConfigureMetricCard(station, waterBox, waterTitle, waterValue, waterUnit, "最终重量", "KG", margin + topCardWidth + gap, weightY, topCardWidth, 128, 28F);
|
||||
if (string.IsNullOrWhiteSpace(waterValue.Text) || waterValue.Text == "0.00")
|
||||
waterValue.Text = "0.000";
|
||||
|
||||
metricBox.BackColor = Color.White;
|
||||
metricBox.Location = new Point(margin, metricY);
|
||||
@@ -266,7 +268,9 @@ namespace MesWork.Pages
|
||||
ConfigureMetricCard(metricBox, extractOilBox, extractOilTitle, extractOilValue, extractOilUnit, "抽油量", "L", (metricCardWidth + gap) * 2, 0, metricCardWidth, 74, 18F);
|
||||
ConfigureMetricCard(metricBox, oilReleaseBox, oilReleaseTitle, oilReleaseValue, oilReleaseUnit, "放油量", "L", 0, 74 + metricRowGap, metricCardWidth, 74, 18F);
|
||||
ConfigureMetricCard(metricBox, residualOilBox, residualOilTitle, residualOilValue, residualOilUnit, "残油量", "L", metricCardWidth + gap, 74 + metricRowGap, metricCardWidth, 74, 18F);
|
||||
ConfigureMetricCard(metricBox, qualityBox, qualityTitle, qualityValue, null, "合格结果", "", (metricCardWidth + gap) * 2, 74 + metricRowGap, metricCardWidth, 74, 18F);
|
||||
ConfigureMetricCard(metricBox, qualityBox, qualityTitle, qualityValue, null, "水含量", "", (metricCardWidth + gap) * 2, 74 + metricRowGap, metricCardWidth, 74, 18F);
|
||||
if (string.IsNullOrWhiteSpace(qualityValue.Text) || qualityValue.Text == "--" || qualityValue.Text == "0.00")
|
||||
qualityValue.Text = "0.00 ppm";
|
||||
}
|
||||
|
||||
private void LayoutStationHeaderSection(
|
||||
@@ -597,7 +601,7 @@ namespace MesWork.Pages
|
||||
waterValue.Font = new Font("微软雅黑", 18F, FontStyle.Bold);
|
||||
waterValue.Location = new Point(660, 401);
|
||||
waterValue.Size = new Size(599, 164);
|
||||
waterValue.Text = "水含量:0.00 ppm";
|
||||
waterValue.Text = "最终重量:0.000 KG";
|
||||
waterValue.TextAlign = ContentAlignment.MiddleCenter;
|
||||
waterValue.AutoSize = false;
|
||||
|
||||
@@ -610,7 +614,7 @@ namespace MesWork.Pages
|
||||
ConfigureDesignerMetricLabel(extractOilValue, "抽油量:0.00", 840, 0);
|
||||
ConfigureDesignerMetricLabel(oilReleaseValue, "放油量:0.00", 0, 93);
|
||||
ConfigureDesignerMetricLabel(residualOilValue, "残油量:0.00", 420, 93);
|
||||
ConfigureDesignerMetricLabel(qualityValue, "合格结果:--", 840, 93);
|
||||
ConfigureDesignerMetricLabel(qualityValue, "水含量:0.00 ppm", 840, 93);
|
||||
|
||||
alarmLabel.Font = new Font("微软雅黑", 13F, FontStyle.Bold);
|
||||
alarmLabel.Location = new Point(30, 792);
|
||||
@@ -679,12 +683,12 @@ namespace MesWork.Pages
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_op1))
|
||||
PollStation(1, _op1, _s1Signals,
|
||||
lbl_S1_Weight, lbl_S1_Info1, lbl_S1_Info2,
|
||||
lbl_S1_Weight, lbl_S1_QualityVal, lbl_S1_Info2,
|
||||
lbl_S1_PalletVal, lbl_S1_AlarmVal);
|
||||
|
||||
if (!string.IsNullOrEmpty(_op2))
|
||||
PollStation(2, _op2, _s2Signals,
|
||||
lbl_S2_Weight, lbl_S2_Info1, lbl_S2_Info2,
|
||||
lbl_S2_Weight, lbl_S2_QualityVal, lbl_S2_Info2,
|
||||
lbl_S2_PalletVal, lbl_S2_AlarmVal);
|
||||
}
|
||||
catch { }
|
||||
@@ -728,9 +732,6 @@ namespace MesWork.Pages
|
||||
signals[11].BackColor = qColor;
|
||||
signals[11].Invalidate();
|
||||
}
|
||||
var lblQuality = station == 1 ? lbl_S1_QualityVal : lbl_S2_QualityVal;
|
||||
lblQuality.Text = qFlag == 1 ? "合格" : (qFlag == 2 ? "不合格" : "--");
|
||||
lblQuality.ForeColor = qFlag == 2 ? C_SignalBad : Color.FromArgb(30, 58, 95);
|
||||
}
|
||||
catch { }
|
||||
|
||||
@@ -756,7 +757,7 @@ namespace MesWork.Pages
|
||||
{
|
||||
var sv = PlcLinkForm.ReadPLC(100180, opName);
|
||||
if (sv != null)
|
||||
lblWater.Text = Convert.ToDouble(sv).ToString("F2");
|
||||
lblWater.Text = $"{Convert.ToDouble(sv):F2} ppm";
|
||||
}
|
||||
catch { }
|
||||
|
||||
@@ -812,6 +813,39 @@ namespace MesWork.Pages
|
||||
lbl.Text = weight.ToString("F3");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新保存时采用的最终重量显示。
|
||||
/// </summary>
|
||||
public void UpdateFinalWeight(int station, decimal weight)
|
||||
{
|
||||
var lbl = station == 1 ? lbl_S1_Info1 : lbl_S2_Info1;
|
||||
Action act = () => lbl.Text = weight.ToString("F3");
|
||||
if (lbl.InvokeRequired) lbl.Invoke(act); else act();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空保存结果相关显示。
|
||||
/// </summary>
|
||||
public void ClearSaveResult(int station)
|
||||
{
|
||||
Action act = () =>
|
||||
{
|
||||
if (station == 1)
|
||||
{
|
||||
lbl_S1_Info1.Text = "0.000";
|
||||
lbl_S1_QualityVal.Text = "0.00 ppm";
|
||||
lbl_S1_QualityVal.ForeColor = Color.FromArgb(30, 58, 95);
|
||||
}
|
||||
else
|
||||
{
|
||||
lbl_S2_Info1.Text = "0.000";
|
||||
lbl_S2_QualityVal.Text = "0.00 ppm";
|
||||
lbl_S2_QualityVal.ForeColor = Color.FromArgb(30, 58, 95);
|
||||
}
|
||||
};
|
||||
if (InvokeRequired) Invoke(act); else act();
|
||||
}
|
||||
|
||||
public void UpdateStationInfo(int station, string engineNo, string modelNo, string orderNo)
|
||||
{
|
||||
Action act = () =>
|
||||
|
||||
Reference in New Issue
Block a user