This commit is contained in:
wxt
2026-01-13 19:07:40 +08:00
parent 32420657c6
commit b19a387b07
2 changed files with 4 additions and 2 deletions

View File

@@ -185,7 +185,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
"无氧环境/灭火 (0%)" "无氧环境/灭火 (0%)"
}; };
uiComboBox1.Items.AddRange(options); uiComboBox1.Items.AddRange(options);
uiComboBox1.SelectedIndex = 0;
} }
private void ManualDebugForm_FormClosed(object sender, FormClosedEventArgs e) private void ManualDebugForm_FormClosed(object sender, FormClosedEventArgs e)

View File

@@ -500,7 +500,9 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
ushort[] tem = _modbusMaster?.ReadHoldingRegisters(1, (ushort)tempRegAddress, 2); ushort[] tem = _modbusMaster?.ReadHoldingRegisters(1, (ushort)tempRegAddress, 2);
if (tem != null && tem.Length >= 2) if (tem != null && tem.Length >= 2)
{ {
temperature = c.UshortToFloat(tem[1], tem[0]); float rawTemperature = c.UshortToFloat(tem[1], tem[0]);
// 保留一位小数
temperature = (float)Math.Round(rawTemperature, 1);
} }
} }