This commit is contained in:
xyy
2026-04-18 09:11:19 +08:00
parent 2eab2f3a1b
commit cd1bee5c1e

View File

@@ -654,32 +654,36 @@ namespace 全自动水压检测仪
// if (percentage > 100) percentage = 100; // if (percentage > 100) percentage = 100;
bool[] a = _modbusMaster?.ReadCoils(1, 10042, 1); // 常温低液位 0无水/1有水 bool[] a = _modbusMaster?.ReadCoils(1, 10042, 1); // 常温低液位 0无水/1有水
bool[] b = _modbusMaster?.ReadCoils(1, 10043, 1); // 常温高液位 0无水/1有水 bool[] b = _modbusMaster?.ReadCoils(1, 10043, 1); // 常温高液位 0无水/1有水
bool[] cc = _modbusMaster?.ReadCoils(1, 10040, 1); // 高温低液位 0无水/1有水 bool[] cc = _modbusMaster?.ReadCoils(1, 10040, 1); // 高温低液位 0无水/1有水
bool[] d = _modbusMaster?.ReadCoils(1, 10041, 1); // 高温高液位 0无水/1有水 bool[] d = _modbusMaster?.ReadCoils(1, 10041, 1); // 高温高液位 0无水/1有水
if (TryGetCoilValue(a, out bool normalSensorA) && if (TryGetCoilValue(a, out bool normalSensorA) &&
TryGetCoilValue(b, out bool normalSensorB)) TryGetCoilValue(b, out bool normalSensorB))
{ {
UpdateLiquidLevelStatusBar(_normalTempLevelBarSegments, normalSensorA, normalSensorB, "常温液位"); UpdateLiquidLevelStatusBar(_normalTempLevelBarSegments, normalSensorA, normalSensorB, "常温液位");
} }
if (TryGetCoilValue(cc, out bool highSensorA) && if (TryGetCoilValue(cc, out bool highSensorA) &&
TryGetCoilValue(d, out bool highSensorB)) TryGetCoilValue(d, out bool highSensorB))
{ {
UpdateLiquidLevelStatusBar(_highTempLevelBarSegments, highSensorA, highSensorB, "高温液位"); UpdateLiquidLevelStatusBar(_highTempLevelBarSegments, highSensorA, highSensorB, "高温液位");
} }
#region
if (a[0] || cc[0])
{
ma?.BtnClickFunctionForNew(Function.ButtonType., 10082);
}
#endregion
//// 更新进度条
//if (uiProcessBar1 != null && !uiProcessBar1.IsDisposed)
// uiProcessBar1.Value = (int)percentage;
//uiLabel12.Text = value1.ToString("F2");
//// 更新进度条
//if (uiProcessBar1 != null && !uiProcessBar1.IsDisposed)
// uiProcessBar1.Value = (int)percentage;
//uiLabel12.Text = value1.ToString("F2");
//} //}
// 初始压力 // 初始压力