This commit is contained in:
wxt
2026-01-19 14:32:39 +08:00
parent 14e3f62ca8
commit ddf1752fac
4 changed files with 13 additions and 15 deletions

View File

@@ -152,8 +152,8 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
private void MainForm_Load(object sender, EventArgs e)
{
string plcIp = "192.168.1.10";
//string plcIp = "127.0.0.1";
//string plcIp = "192.168.1.10";
string plcIp = "127.0.0.1";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (!initSuccess)
{

View File

@@ -254,6 +254,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
private void ManualDebugForm_Load(object sender, EventArgs e)
{
string plcIp = "192.168.1.10";
//string plcIp = "127.0.0.1";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (!initSuccess)
{

View File

@@ -342,15 +342,13 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
if (uiButton3.IsDisposed || !uiButton3.IsHandleCreated)
return;
if (uiButton3.InvokeRequired)
if (value3)
{
uiButton3.Invoke(new Action(() =>
{
// 再次检查,防止回调执行时控件已被销毁
if (!uiButton3.IsDisposed && uiButton3.IsHandleCreated && value3)
uiButton3.Text = "灭火中";
uiButton3.ForeColor = Color.Red;
}));
uiButton3.Invoke(new Action(() =>
{
uiButton3.Text = "灭火中";
uiButton3.ForeColor = Color.Red;
}));
}
else
{
@@ -376,14 +374,12 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
if (uiButton11.IsDisposed || !uiButton11.IsHandleCreated)
return;
if (uiButton11.InvokeRequired)
if (value4)
{
uiButton11.Invoke(new Action(() =>
{
// 再次检查,防止回调执行时控件已被销毁
if (!uiButton11.IsDisposed && uiButton11.IsHandleCreated && value4)
uiButton11.Text = "开灯中";
uiButton11.ForeColor = Color.Red;
uiButton11.Text = "开灯中";
uiButton11.ForeColor = Color.Red;
}));
}
else

View File

@@ -558,6 +558,7 @@ namespace 外科辅料和患者防护罩激光抗性测试仪
private void SecondaryIgnitionForm_Load(object sender, EventArgs e)
{
string plcIp = "192.168.1.10";
//string plcIp = "127.0.0.1";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (!initSuccess)
{