Переглянути джерело

Creat ModbusSlaveSim project

SenGao 2 тижнів тому
батько
коміт
a037f18284

+ 7 - 0
Minics.sln

@@ -93,6 +93,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdsCommunicatorNet8", "Comm
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PLCIOPointTool", "Tools\PLCIOPointTool\PLCIOPointTool.csproj", "{9C3E268E-4268-479E-9508-EFD76639B899}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModbusSlaveSim", "Tools\ModbusSlaveSim\ModbusSlaveSim.csproj", "{722495E5-E221-47F9-9045-7FC9E08948BC}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -235,6 +237,10 @@ Global
 		{9C3E268E-4268-479E-9508-EFD76639B899}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{9C3E268E-4268-479E-9508-EFD76639B899}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{9C3E268E-4268-479E-9508-EFD76639B899}.Release|Any CPU.Build.0 = Release|Any CPU
+		{722495E5-E221-47F9-9045-7FC9E08948BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{722495E5-E221-47F9-9045-7FC9E08948BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{722495E5-E221-47F9-9045-7FC9E08948BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{722495E5-E221-47F9-9045-7FC9E08948BC}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -270,6 +276,7 @@ Global
 		{EF692000-6C78-4EA6-81BF-58371231510E} = {2783D72A-0926-427D-B70D-5F3F5FA757FC}
 		{D784466C-1F32-4621-1B3D-D1AC0CC08709} = {165A518A-753D-4062-A100-9367AF27F900}
 		{9C3E268E-4268-479E-9508-EFD76639B899} = {2783D72A-0926-427D-B70D-5F3F5FA757FC}
+		{722495E5-E221-47F9-9045-7FC9E08948BC} = {2783D72A-0926-427D-B70D-5F3F5FA757FC}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {2E8CB4A6-1AFA-4CB2-BA42-1BAFC71AD68B}

+ 9 - 0
Tools/ModbusSlaveSim/App.xaml

@@ -0,0 +1,9 @@
+<Application x:Class="ModbusSlaveSim.App"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:local="clr-namespace:ModbusSlaveSim"
+             StartupUri="MainWindow.xaml">
+    <Application.Resources>
+         
+    </Application.Resources>
+</Application>

+ 13 - 0
Tools/ModbusSlaveSim/App.xaml.cs

@@ -0,0 +1,13 @@
+using System.Configuration;
+using System.Data;
+using System.Windows;
+
+namespace ModbusSlaveSim;
+
+/// <summary>
+/// Interaction logic for App.xaml
+/// </summary>
+public partial class App : Application
+{
+}
+

+ 10 - 0
Tools/ModbusSlaveSim/AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly:ThemeInfo(
+    ResourceDictionaryLocation.None,            //where theme specific resource dictionaries are located
+                                                //(used if a resource is not found in the page,
+                                                // or application resource dictionaries)
+    ResourceDictionaryLocation.SourceAssembly   //where the generic resource dictionary is located
+                                                //(used if a resource is not found in the page,
+                                                // app, or any theme specific resource dictionaries)
+)]

+ 12 - 0
Tools/ModbusSlaveSim/MainWindow.xaml

@@ -0,0 +1,12 @@
+<Window x:Class="ModbusSlaveSim.MainWindow"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:ModbusSlaveSim"
+        mc:Ignorable="d"
+        Title="MainWindow" Height="450" Width="800">
+    <Grid>
+        
+    </Grid>
+</Window>

+ 23 - 0
Tools/ModbusSlaveSim/MainWindow.xaml.cs

@@ -0,0 +1,23 @@
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace ModbusSlaveSim;
+
+/// <summary>
+/// Interaction logic for MainWindow.xaml
+/// </summary>
+public partial class MainWindow : Window
+{
+    public MainWindow()
+    {
+        InitializeComponent();
+    }
+}

+ 19 - 0
Tools/ModbusSlaveSim/ModbusSlaveSim.csproj

@@ -0,0 +1,19 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>net8.0-windows</TargetFramework>
+    <OutputPath>$(SolutionDir)Binary\Tools\ModbusSlaveSim</OutputPath>
+    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+    <Nullable>enable</Nullable>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <UseWPF>true</UseWPF>
+    <CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Prism.DryIoc" />
+    <PackageReference Include="CommunityToolkit.Mvvm" />
+    <PackageReference Include="NModbus" />
+  </ItemGroup>
+</Project>