This commit is contained in:
@@ -114,7 +114,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)
|
||||
{
|
||||
|
||||
@@ -219,6 +219,7 @@
|
||||
<MenuItem Header="测试" Style="{StaticResource MenuItemStyle}">
|
||||
<MenuItem Header="空载测试" Style="{StaticResource MenuItemStyle}"/>
|
||||
<MenuItem Header="负载测试" Style="{StaticResource MenuItemStyle}" Click="LoadTestMenuItem_Click"/>
|
||||
<MenuItem Header="跳动测试" Style="{StaticResource MenuItemStyle}" Click="JumpingTest_Click"/>
|
||||
<MenuItem Header="报表" Style="{StaticResource MenuItemStyle}" Click="ReportMenuItem_Click"/>
|
||||
</MenuItem>
|
||||
|
||||
@@ -341,7 +342,8 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 按钮区域 --><!--
|
||||
<!-- 按钮区域 -->
|
||||
<!--
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1"
|
||||
HorizontalAlignment="Center" Margin="0,300,0,0" Cursor="">
|
||||
<Button Content="开始" Style="{StaticResource StartButtonStyle}" Click="Button_Click_1"/>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
|
||||
<GenerateTargetFrameworkAttribute>False</GenerateTargetFrameworkAttribute>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
@@ -25,4 +27,8 @@
|
||||
<PackageReference Include="System.IO.Ports" Version="10.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="ModbusDemo4CS\ModbusDemo4CS.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36327.8 d17.14
|
||||
# Visual Studio Version 18
|
||||
VisualStudioVersion = 18.2.11408.102 d18.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "医用刨削器特征新版8", "医用刨削器特征新版8.csproj", "{B0C9D63D-2C43-43F4-8273-273BCC58C3AE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModbusDemo4CS", "ModbusDemo4CS\ModbusDemo4CS.csproj", "{7401784B-5723-4579-B056-A6F23EC80C9A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +17,10 @@ Global
|
||||
{B0C9D63D-2C43-43F4-8273-273BCC58C3AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B0C9D63D-2C43-43F4-8273-273BCC58C3AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B0C9D63D-2C43-43F4-8273-273BCC58C3AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7401784B-5723-4579-B056-A6F23EC80C9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7401784B-5723-4579-B056-A6F23EC80C9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7401784B-5723-4579-B056-A6F23EC80C9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7401784B-5723-4579-B056-A6F23EC80C9A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user