更新模式切换
This commit is contained in:
@@ -1586,10 +1586,11 @@ namespace 全自动水压检测仪
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// 根据温度模式更新控件可见性
|
||||
/// 常温模式:隐藏高温相关参数(高温实时液位、高温箱温度、高温加水)
|
||||
/// 高温模式:隐藏常温相关参数(常温实时液位、出口温度、常温加水、水箱加热)
|
||||
/// 常温模式:显示常温相关参数(常温实时液位、常温加水)
|
||||
/// 高温模式:显示高温相关参数(高温实时液位、箱体温度、出口温度、高温加水、水箱加热)
|
||||
/// </summary>
|
||||
private void UpdateControlsVisibilityByMode()
|
||||
{
|
||||
@@ -1598,42 +1599,47 @@ namespace 全自动水压检测仪
|
||||
// 判断当前是否为高温模式(uiLight2亮起表示高温模式)
|
||||
bool isHighTempMode = uiLight2 != null && uiLight2.State == UILightState.On;
|
||||
|
||||
// 高温模式相关控件
|
||||
// ========== 高温模式专属控件(高温模式显示,常温模式隐藏) ==========
|
||||
|
||||
// 高温实时液位(mm) - uiPanel31包含uiLabel7, uiLabel8, uiLabel34, uiProcessBar2
|
||||
if (uiPanel31 != null) uiPanel31.Visible = isHighTempMode;
|
||||
|
||||
// 高温箱温度(°C) - uiPanel35包含uiLabel42, uiLabel43
|
||||
// 箱体温度(°C) - uiPanel35包含uiLabel42, uiLabel43(实时数据监控区域)
|
||||
if (uiPanel35 != null) uiPanel35.Visible = isHighTempMode;
|
||||
|
||||
// 出口温度(°C) - uiPanel33包含uiLabel38, uiLabel39(实时数据监控区域)
|
||||
if (uiPanel33 != null) uiPanel33.Visible = isHighTempMode;
|
||||
|
||||
// 高温加水按钮 - uiButton5
|
||||
if (uiButton5 != null) uiButton5.Visible = isHighTempMode;
|
||||
|
||||
// 高温加水指示灯 - uiLight11
|
||||
if (uiPanel43 != null) uiPanel43.Visible = isHighTempMode;
|
||||
|
||||
// 水箱加热按钮 - uiButton4(用户操作设定区域)
|
||||
if (uiButton4 != null) uiButton4.Visible = isHighTempMode;
|
||||
|
||||
// 出口温度判定设置 - uiLabel48和uiTextBox9(用户操作设定区域)
|
||||
if (uiLabel48 != null) uiLabel48.Visible = isHighTempMode;
|
||||
if (uiTextBox9 != null) uiTextBox9.Visible = isHighTempMode;
|
||||
|
||||
// 写入按钮 - uiButton8(与出口温度相关,用于写入PLC)
|
||||
if (uiButton8 != null) uiButton8.Visible = isHighTempMode;
|
||||
|
||||
// 箱体温度设置 - uiLabel37和uiTextBox4(用户操作设定区域)
|
||||
if (uiLabel37 != null) uiLabel37.Visible = isHighTempMode;
|
||||
if (uiTextBox4 != null) uiTextBox4.Visible = isHighTempMode;
|
||||
|
||||
// 常温模式相关控件
|
||||
// ========== 常温模式专属控件(常温模式显示,高温模式隐藏) ==========
|
||||
|
||||
// 常温实时液位(mm) - uiPanel23包含uiLabel12, uiLabel16, uiLabel17, uiProcessBar1
|
||||
if (uiPanel23 != null) uiPanel23.Visible = !isHighTempMode;
|
||||
|
||||
// 出口温度(°C) - uiPanel33包含uiLabel38, uiLabel39
|
||||
if (uiPanel33 != null) uiPanel33.Visible = !isHighTempMode;
|
||||
|
||||
// 常温加水按钮 - uiButton13
|
||||
if (uiButton13 != null) uiButton13.Visible = !isHighTempMode;
|
||||
|
||||
// 常温加水指示灯 - uiLight6
|
||||
if (uiPanel38 != null) uiPanel38.Visible = !isHighTempMode;
|
||||
|
||||
// 水箱加热按钮 - uiButton4
|
||||
if (uiButton4 != null) uiButton4.Visible = !isHighTempMode;
|
||||
|
||||
// 出口温度设置 - uiLabel48和uiTextBox9
|
||||
if (uiLabel48 != null) uiLabel48.Visible = !isHighTempMode;
|
||||
if (uiTextBox9 != null) uiTextBox9.Visible = !isHighTempMode;
|
||||
|
||||
// 高温箱温度设置 - uiLabel37和uiTextBox4
|
||||
if (uiLabel37 != null) uiLabel37.Visible = isHighTempMode;
|
||||
if (uiTextBox4 != null) uiTextBox4.Visible = isHighTempMode;
|
||||
|
||||
Debug.WriteLine($"[UpdateControlsVisibilityByMode] 模式切换完成 - 高温模式: {isHighTempMode}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user