This commit is contained in:
wxt
2026-01-07 14:27:13 +08:00
2 changed files with 3 additions and 2 deletions

View File

@@ -103,7 +103,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
if (_modbusMaster == null || _tcpClient == null || !_tcpClient.Connected)
{
return;
}
}
float value = float.Parse(uiLabel23.Text);
await _modbusMaster.WriteMultipleRegistersAsync(1, 74, c.SplitFloatToUShortArray((float)value));
//});
@@ -111,6 +111,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
//ShowError($"读取数据失败:{ex.Message}");
}
}
@@ -1104,7 +1105,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
if (double.TryParse(trimmedLine, NumberStyles.Float, CultureInfo.InvariantCulture, out double powerValue))
{
uiLabel23.Text = $"{powerValue:F3} W";
uiLabel23.Text = $"{powerValue:F3}";
_waitingResponse = false;
}
else if (trimmedLine.Contains(".") && trimmedLine.Length > 0)