This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Modbus.Device;
|
||||
using P_RTU_TEST_WinForm;
|
||||
using System.Configuration;
|
||||
using System.Net.Http;
|
||||
using System.Net.Sockets;
|
||||
@@ -64,7 +65,8 @@ namespace EmptyLoadTest
|
||||
try
|
||||
{
|
||||
|
||||
string plcIp = "192.168.1.10";
|
||||
//string plcIp = "192.168.1.10";
|
||||
string plcIp = "127.0.0.1";
|
||||
bool initSuccess = ModbusResourceManager.Instance.Init(plcIp, 502);
|
||||
if (!initSuccess)
|
||||
{
|
||||
@@ -468,5 +470,27 @@ namespace EmptyLoadTest
|
||||
|
||||
Close();
|
||||
}
|
||||
|
||||
private void JumpingTest_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
|
||||
// WPF 跳转到 WinForm 窗口
|
||||
var mainWindow = MainForm.Instance;
|
||||
|
||||
// WinForm 用:IsHandleCreated 替代 IsVisible
|
||||
if (!mainWindow.IsHandleCreated)
|
||||
{
|
||||
// 关键:WinForm 窗口必须用 Show() 不能用 ShowDialog()
|
||||
mainWindow.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
mainWindow.Activate();
|
||||
}
|
||||
|
||||
// this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user