diff --git a/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs b/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs index eb34ff5e..a14a0740 100644 --- a/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs +++ b/BPASmartClient.MORKSM.BK.PLC/PLCMachine.cs @@ -52,11 +52,6 @@ namespace BPASmartClient.PLC }); } - //public override void ReadData(string address) - //{ - - //} - public override void Start() { diff --git a/BPASmartClient.MORKSM.BK.PLC/PLCReadParameter.cs b/BPASmartClient.MORKSM.BK.PLC/PLCReadParameter.cs deleted file mode 100644 index d95ebdd1..00000000 --- a/BPASmartClient.MORKSM.BK.PLC/PLCReadParameter.cs +++ /dev/null @@ -1,63 +0,0 @@ -using BPASmartClient.Modbus; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BPASmartClient.PLC -{ - /// - /// PLC读取参数 - /// - internal class PLCReadParameter - { - /// - /// 读取类型 - /// - internal CommandType CmdType { get; set; } - /// - /// 地址 - /// - internal string Address { get; set; } - /// - /// 长度 - /// - internal ushort Length { get; set; } - - /// - /// 配置转模型 - /// - /// M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102,7;M,M103,6;VW,VW372,1 - /// 读取参数模型 - public static List DeSerialize(string content) - { - List result = new List(); - var wholeTemp = content.Split(';'); - foreach (var temp in wholeTemp) - { - if (temp.Contains(",")) - { - var subTemp = temp.Split(','); - if (null != subTemp && subTemp.Length == 3) - { - PLCReadParameter parameter = new PLCReadParameter(); - switch (subTemp[0]) - { - case "M": - parameter.CmdType = CommandType.Coils; - break; - case "VW": - parameter.CmdType = CommandType.HoldingRegisters; - break; - } - parameter.Address = subTemp[1]; - parameter.Length = ushort.Parse(subTemp[2]); - result.Add(parameter); - } - } - } - return result; - } - } -} diff --git a/BPASmartClient.Model/ReadDataModel.cs b/BPASmartClient.Model/ReadDataModel.cs new file mode 100644 index 00000000..2057c4b8 --- /dev/null +++ b/BPASmartClient.Model/ReadDataModel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.Model +{ + public class ReadDataModel + { + /// + /// 读取数据的地址 + /// + public string Address { get; set; } + /// + /// 读取数据的长度 + /// + public ushort Length { get; set; } + /// + /// 读取数据的参数 + /// + public object ReadPar { get; set; } + } +} diff --git a/DosingSystem/App.xaml b/DosingSystem/App.xaml new file mode 100644 index 00000000..1f7b318e --- /dev/null +++ b/DosingSystem/App.xaml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DosingSystem/App.xaml.cs b/DosingSystem/App.xaml.cs new file mode 100644 index 00000000..c3181d4e --- /dev/null +++ b/DosingSystem/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace DosingSystem +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/DosingSystem/AssemblyInfo.cs b/DosingSystem/AssemblyInfo.cs new file mode 100644 index 00000000..8b5504ec --- /dev/null +++ b/DosingSystem/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) +)] diff --git a/DosingSystem/DosingSystem.csproj b/DosingSystem/DosingSystem.csproj new file mode 100644 index 00000000..d6a336b5 --- /dev/null +++ b/DosingSystem/DosingSystem.csproj @@ -0,0 +1,19 @@ + + + + WinExe + net6.0-windows + enable + true + + + + + + + + + + + + diff --git a/DosingSystem/View/MainWindow.xaml b/DosingSystem/View/MainWindow.xaml new file mode 100644 index 00000000..13c9c52f --- /dev/null +++ b/DosingSystem/View/MainWindow.xaml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + +