@@ -52,11 +52,6 @@ namespace BPASmartClient.PLC | |||
}); | |||
} | |||
//public override void ReadData(string address) | |||
//{ | |||
//} | |||
public override void Start() | |||
{ | |||
@@ -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 | |||
{ | |||
/// <summary> | |||
/// PLC读取参数 | |||
/// </summary> | |||
internal class PLCReadParameter | |||
{ | |||
/// <summary> | |||
/// 读取类型 | |||
/// </summary> | |||
internal CommandType CmdType { get; set; } | |||
/// <summary> | |||
/// 地址 | |||
/// </summary> | |||
internal string Address { get; set; } | |||
/// <summary> | |||
/// 长度 | |||
/// </summary> | |||
internal ushort Length { get; set; } | |||
/// <summary> | |||
/// 配置转模型 | |||
/// </summary> | |||
/// <param name="content">M,M0.3,3;M,M100.0,16;M,M235.0,1;M,M102,7;M,M103,6;VW,VW372,1</param> | |||
/// <returns>读取参数模型</returns> | |||
public static List<PLCReadParameter> DeSerialize(string content) | |||
{ | |||
List<PLCReadParameter> result = new List<PLCReadParameter>(); | |||
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; | |||
} | |||
} | |||
} |
@@ -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 | |||
{ | |||
/// <summary> | |||
/// 读取数据的地址 | |||
/// </summary> | |||
public string Address { get; set; } | |||
/// <summary> | |||
/// 读取数据的长度 | |||
/// </summary> | |||
public ushort Length { get; set; } | |||
/// <summary> | |||
/// 读取数据的参数 | |||
/// </summary> | |||
public object ReadPar { get; set; } | |||
} | |||
} |
@@ -0,0 +1,36 @@ | |||
<Application | |||
x:Class="DosingSystem.App" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource" | |||
xmlns:local="clr-namespace:DosingSystem" | |||
StartupUri="View/MainWindow.xaml"> | |||
<Application.Resources> | |||
<ResourceDictionary> | |||
<ResourceDictionary.MergedDictionaries> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecCheckBox.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecTitleBarButton.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/GlobalStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecComboBox.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecIcoButtonStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecToggleButton.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/BeveledRadioButtonStyle.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/DatePickeerDictionary.xaml" /> | |||
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/RecDictionarys/RecButtonStyle.xaml" /> | |||
<ResourceDictionary> | |||
<con:ColorConverter x:Key="ColorConverter" /> | |||
<con:TextConverter x:Key="TextConverter" /> | |||
<con:VisibleTypeConverter x:Key="VisibleTypeConverter" /> | |||
</ResourceDictionary> | |||
<ResourceDictionary> | |||
<ImageBrush x:Key="hbl" ImageSource="/BPASmartClient.CustomResource;component/Image/HBL.png" /> | |||
<ImageBrush x:Key="dbxt" ImageSource="/BPASmartClient.CustomResource;component/Image/顶部线条.png" /> | |||
</ResourceDictionary> | |||
</ResourceDictionary.MergedDictionaries> | |||
</ResourceDictionary> | |||
</Application.Resources> | |||
</Application> |
@@ -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 | |||
{ | |||
/// <summary> | |||
/// Interaction logic for App.xaml | |||
/// </summary> | |||
public partial class App : Application | |||
{ | |||
} | |||
} |
@@ -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) | |||
)] |
@@ -0,0 +1,19 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
<PropertyGroup> | |||
<OutputType>WinExe</OutputType> | |||
<TargetFramework>net6.0-windows</TargetFramework> | |||
<Nullable>enable</Nullable> | |||
<UseWPF>true</UseWPF> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\BPASmartClient.CustomResource\BPASmartClient.CustomResource.csproj" /> | |||
<ProjectReference Include="..\BPASmartClient.Helper\BPASmartClient.Helper.csproj" /> | |||
</ItemGroup> | |||
</Project> |
@@ -0,0 +1,74 @@ | |||
<Window | |||
x:Class="DosingSystem.View.MainWindow" | |||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||
xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||
xmlns:local="clr-namespace:DosingSystem" | |||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" | |||
Title="MainWindow" | |||
Width="800" | |||
Height="450" | |||
AllowsTransparency="True" | |||
Background="{x:Null}" | |||
Opacity="0.8" | |||
Topmost="False" | |||
WindowStartupLocation="CenterScreen" | |||
WindowStyle="None" | |||
mc:Ignorable="d"> | |||
<Grid> | |||
<Grid.RowDefinitions> | |||
<RowDefinition Height="50" /> | |||
<RowDefinition /> | |||
</Grid.RowDefinitions> | |||
<!--#region 标题栏设置--> | |||
<Border | |||
x:Name="MoveBorder" | |||
Height="50" | |||
VerticalAlignment="Top" | |||
Background="#0C2349" | |||
BorderBrush="#55ffffff" | |||
BorderThickness="0,0,0,1"> | |||
<StackPanel Orientation="Horizontal"> | |||
<Image Margin="15,5,0,5" Source="pack://application:,,,/BPASmartClient.CustomResource;component/Image/HBL.png" /> | |||
<TextBlock | |||
Name="tbTitle" | |||
Margin="20,0" | |||
HorizontalAlignment="Left" | |||
VerticalAlignment="Center" | |||
FontSize="18" | |||
Foreground="White" | |||
Text="配料演示系统" /> | |||
</StackPanel> | |||
</Border> | |||
<UniformGrid | |||
Width="150" | |||
Height="50" | |||
HorizontalAlignment="Right" | |||
Columns="3"> | |||
<Button | |||
Name="ButMin" | |||
Content="" | |||
Style="{StaticResource TitleBarStyle}" /> | |||
<Button | |||
Name="ButMax" | |||
Content="" | |||
Style="{StaticResource TitleBarStyle}" /> | |||
<Button | |||
Name="ButClose" | |||
Content="" | |||
Style="{StaticResource TitleBarStyle}" /> | |||
</UniformGrid> | |||
<!--#endregion--> | |||
</Grid> | |||
</Window> |
@@ -0,0 +1,34 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
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 DosingSystem.View | |||
{ | |||
/// <summary> | |||
/// Interaction logic for MainWindow.xaml | |||
/// </summary> | |||
public partial class MainWindow : Window | |||
{ | |||
public MainWindow() | |||
{ | |||
InitializeComponent(); | |||
this.MoveBorder.MouseLeftButtonDown += (o, e) => { this.DragMove(); }; | |||
this.ButMin.Click += (o, e) => { this.WindowState = WindowState.Minimized; }; | |||
this.ButMax.Click += (o, e) => { this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; }; | |||
this.ButClose.Click += (o, e) => { this.Close(); }; | |||
this.MaxWidth = SystemParameters.WorkArea.Width; | |||
this.MaxHeight = SystemParameters.WorkArea.Height; | |||
} | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||
using System.Collections.Concurrent; | |||
using System.Collections.ObjectModel; | |||
using System.Windows; | |||
namespace DosingSystem.ViewModel | |||
{ | |||
public class MainViewModel : ObservableObject | |||
{ | |||
public MainViewModel() | |||
{ | |||
} | |||
} | |||
} |
@@ -84,13 +84,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTLebaiJC | |||
EndProject | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkTJAKAJC", "BPASmartClient.Morkt.JAKA.JC\BPASmartClient.MorkTJAKAJC.csproj", "{6B0FD858-A60D-41B9-A923-358B0CE2A254}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MCU", "BPASmartClient.MCU\BPASmartClient.MCU.csproj", "{1C7E17B3-40E0-44ED-B8E0-C52D824604DB}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MCU", "BPASmartClient.MCU\BPASmartClient.MCU.csproj", "{1C7E17B3-40E0-44ED-B8E0-C52D824604DB}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JakaRobot", "BPASmartClient.JakaRobot\BPASmartClient.JakaRobot.csproj", "{1055EA6E-6C10-4A0D-A053-85871AF8D7A9}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.JakaRobot", "BPASmartClient.JakaRobot\BPASmartClient.JakaRobot.csproj", "{1055EA6E-6C10-4A0D-A053-85871AF8D7A9}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.JAKA", "BPASmartClient.JAKA\BPASmartClient.JAKA.csproj", "{C935435D-6182-4A01-8E59-B832B2FF0D72}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.JAKA", "BPASmartClient.JAKA\BPASmartClient.JAKA.csproj", "{C935435D-6182-4A01-8E59-B832B2FF0D72}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.Juicer", "BPASmartClient.Juicer\BPASmartClient.Juicer.csproj", "{C28A88B1-E449-484C-AC67-B5038FF2CA79}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.Juicer", "BPASmartClient.Juicer\BPASmartClient.Juicer.csproj", "{C28A88B1-E449-484C-AC67-B5038FF2CA79}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DosingSystem", "DosingSystem\DosingSystem.csproj", "{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
@@ -826,6 +828,26 @@ Global | |||
{C28A88B1-E449-484C-AC67-B5038FF2CA79}.Release|x64.Build.0 = Release|Any CPU | |||
{C28A88B1-E449-484C-AC67-B5038FF2CA79}.Release|x86.ActiveCfg = Release|Any CPU | |||
{C28A88B1-E449-484C-AC67-B5038FF2CA79}.Release|x86.Build.0 = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|ARM.ActiveCfg = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|ARM.Build.0 = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|ARM64.ActiveCfg = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|ARM64.Build.0 = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|x64.ActiveCfg = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|x64.Build.0 = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|x86.ActiveCfg = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Debug|x86.Build.0 = Debug|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|Any CPU.Build.0 = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|ARM.ActiveCfg = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|ARM.Build.0 = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|ARM64.ActiveCfg = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|ARM64.Build.0 = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|x64.ActiveCfg = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|x64.Build.0 = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|x86.ActiveCfg = Release|Any CPU | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB}.Release|x86.Build.0 = Release|Any CPU | |||
EndGlobalSection | |||
GlobalSection(SolutionProperties) = preSolution | |||
HideSolutionNode = FALSE | |||
@@ -867,6 +889,7 @@ Global | |||
{1055EA6E-6C10-4A0D-A053-85871AF8D7A9} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} | |||
{C935435D-6182-4A01-8E59-B832B2FF0D72} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} | |||
{C28A88B1-E449-484C-AC67-B5038FF2CA79} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} | |||
{4E0B01AD-CFD0-4BD5-BBE6-AD2A4183B4DB} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} | |||
EndGlobalSection | |||
GlobalSection(ExtensibilityGlobals) = postSolution | |||
SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC} | |||