This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user