From c7c1fea9026d2862fd64513b1db4a67f4b71e977 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com>
Date: Fri, 13 May 2022 18:32:25 +0800
Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AEUI=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Themes/Generic.xaml | 6 +-
BPASmartClient.MorkF/Control_MorkF.cs | 2 +-
BPASmartClient.MorkS/Control.cs | 2 +-
.../Model/DeviceConfigModel.cs | 124 ++++++
.../NewShopWindowModel.cs | 17 +
.../ShopDeviceConfigViewModel.cs | 6 +
.../Control/ShopDeviceConfigView.xaml | 268 ++++++++++++-
.../Control/ShopDeviceConfigView.xaml.cs | 7 +
.../DialogWindow/NewShopWindow.xaml | 364 ++++++++++++++++++
.../DialogWindow/NewShopWindow.xaml.cs | 42 ++
BPASmartClient/MainWindow.xaml | 2 +-
11 files changed, 820 insertions(+), 20 deletions(-)
create mode 100644 BPASmartClient.ViewModel/Model/DeviceConfigModel.cs
create mode 100644 BPASmartClient.ViewModel/NewShopWindowModel.cs
create mode 100644 BPASmartClient/DialogWindow/NewShopWindow.xaml
create mode 100644 BPASmartClient/DialogWindow/NewShopWindow.xaml.cs
diff --git a/BPASmartClient.CustomResource/Themes/Generic.xaml b/BPASmartClient.CustomResource/Themes/Generic.xaml
index d7f154d7..a355ea52 100644
--- a/BPASmartClient.CustomResource/Themes/Generic.xaml
+++ b/BPASmartClient.CustomResource/Themes/Generic.xaml
@@ -14,11 +14,11 @@
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" />
-
-
+
+
diff --git a/BPASmartClient.MorkS/Control.cs b/BPASmartClient.MorkS/Control.cs
index 25e65e0b..b788434d 100644
--- a/BPASmartClient.MorkS/Control.cs
+++ b/BPASmartClient.MorkS/Control.cs
@@ -67,7 +67,7 @@ namespace BPASmartClient.MorkS
private void OrderChange(string subid, ORDER_STATUS oRDER_STATUS)
{
- EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { DeviceId = DeviceId, Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType });
+ EventBus.EventBus.GetInstance().Publish(new OrderStatusChangedEvent() { Status = oRDER_STATUS, SubOrderId = subid, deviceClientType = DeviceType });
}
private void ReadData(string address, ushort len = 1, Action action = null)
diff --git a/BPASmartClient.ViewModel/Model/DeviceConfigModel.cs b/BPASmartClient.ViewModel/Model/DeviceConfigModel.cs
new file mode 100644
index 00000000..8301b3ca
--- /dev/null
+++ b/BPASmartClient.ViewModel/Model/DeviceConfigModel.cs
@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+using System.Collections.ObjectModel;
+
+namespace BPASmartClient.ViewModel.Model
+{
+ ///
+ /// 店铺设备
+ ///
+ public class DeviceConfigModel : ObservableObject
+ {
+ ///
+ /// 店铺名称
+ ///
+ public string ShopName { get { return _mShopName; } set { _mShopName = value; OnPropertyChanged(); } }
+ private string _mShopName = string.Empty;
+
+ ///
+ /// 店铺ID
+ ///
+ public string ShopId { get { return _mShopId; } set { _mShopId = value; OnPropertyChanged(); } }
+ private string _mShopId = string.Empty;
+
+ ///
+ /// 设备集合
+ ///
+ public ObservableCollection deviceModels = new ObservableCollection();
+ }
+
+ ///
+ /// 启动模块
+ ///
+ public class DeviceModel : ObservableObject
+ {
+ ///
+ /// 设备名称
+ ///
+ public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
+ private string _mDeviceName = string.Empty;
+
+ ///
+ /// 启动设备模块
+ ///
+ public string DeviceModule { get { return _mDeviceModule; } set { _mDeviceModule = value; OnPropertyChanged(); } }
+ private string _mDeviceModule = string.Empty;
+
+ ///
+ /// 设备ID
+ ///
+ public string DeviceId { get { return _mDeviceId; } set { _mDeviceId = value; OnPropertyChanged(); } }
+ private string _mDeviceId = string.Empty;
+
+ ///
+ /// 通讯模块
+ ///
+ public ObservableCollection communicationDevcies = new ObservableCollection();
+
+ }
+
+ ///
+ /// 通讯模块
+ ///
+ public class CommunicationModel : ObservableObject
+ {
+ ///
+ /// 通讯启动模块
+ ///
+ public string CommunicationModule { get { return _mCommunicationModule; } set { _mCommunicationModule = value; OnPropertyChanged(); } }
+ private string _mCommunicationModule = string.Empty;
+
+
+
+ }
+
+ ///
+ /// 通讯参数
+ ///
+ public class CommunicationPar : ObservableObject
+ {
+ public CommunicationParType communicationType { get { return _mcommunicationType; } set { _mcommunicationType = value; OnPropertyChanged(); } }
+ private CommunicationParType _mcommunicationType;
+
+
+ public string CommunicationValue { get { return _mCommunicationValue; } set { _mCommunicationValue = value; OnPropertyChanged(); } }
+ private string _mCommunicationValue = string.Empty;
+
+ }
+
+ public enum CommunicationParType
+ {
+ ///
+ /// IP地址
+ ///
+ IPAddress,
+ ///
+ /// 端口号
+ ///
+ Port,
+ ///
+ /// 串口端口号
+ ///
+ SerialPort,
+ ///
+ /// 波特率
+ ///
+ BaudRate,
+ ///
+ /// 数据位
+ ///
+ DataBits,
+ ///
+ /// 停止位
+ ///
+ StopBits,
+ ///
+ /// 校验位
+ ///
+ Parity,
+ }
+}
diff --git a/BPASmartClient.ViewModel/NewShopWindowModel.cs b/BPASmartClient.ViewModel/NewShopWindowModel.cs
new file mode 100644
index 00000000..7c2e1cc7
--- /dev/null
+++ b/BPASmartClient.ViewModel/NewShopWindowModel.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Toolkit.Mvvm.ComponentModel;
+
+namespace BPASmartClient.ViewModel
+{
+ public class NewShopWindowModel : ObservableObject
+ {
+ public NewShopWindowModel()
+ {
+
+ }
+ }
+}
diff --git a/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs b/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs
index b6b6154e..51572f95 100644
--- a/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs
+++ b/BPASmartClient.ViewModel/ShopDeviceConfigViewModel.cs
@@ -9,5 +9,11 @@ namespace BPASmartClient.ViewModel
{
public class ShopDeviceConfigViewModel : ObservableObject
{
+ public ShopDeviceConfigViewModel()
+ {
+ //NewCommand = new Action(() => {ActionManager });
+ }
+
+ public Action NewCommand { get; set; }
}
}
diff --git a/BPASmartClient/Control/ShopDeviceConfigView.xaml b/BPASmartClient/Control/ShopDeviceConfigView.xaml
index 44787ea3..1231d2d4 100644
--- a/BPASmartClient/Control/ShopDeviceConfigView.xaml
+++ b/BPASmartClient/Control/ShopDeviceConfigView.xaml
@@ -76,7 +76,10 @@
-
+
@@ -95,13 +98,22 @@
Style="{StaticResource ComboBoxStyle}"
Text="{Binding ClientDeviceType}" />
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -->
+
+
+ -->
+
-
+
+
+ -->
+
-
+
+
+ -->
+
-
+
+
+ -->
+
+
diff --git a/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs b/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs
index 2ab78a44..2cb92a67 100644
--- a/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs
+++ b/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs
@@ -12,6 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using BPASmartClient.DialogWindow;
namespace BPASmartClient.Control
{
@@ -24,5 +25,11 @@ namespace BPASmartClient.Control
{
InitializeComponent();
}
+
+ private void IcoButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ NewShopWindow newShopWindow = new NewShopWindow();
+ newShopWindow.ShowDialog();
+ }
}
}
diff --git a/BPASmartClient/DialogWindow/NewShopWindow.xaml b/BPASmartClient/DialogWindow/NewShopWindow.xaml
new file mode 100644
index 00000000..37795b52
--- /dev/null
+++ b/BPASmartClient/DialogWindow/NewShopWindow.xaml
@@ -0,0 +1,364 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient/DialogWindow/NewShopWindow.xaml.cs b/BPASmartClient/DialogWindow/NewShopWindow.xaml.cs
new file mode 100644
index 00000000..26a6b069
--- /dev/null
+++ b/BPASmartClient/DialogWindow/NewShopWindow.xaml.cs
@@ -0,0 +1,42 @@
+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.Shapes;
+
+namespace BPASmartClient.DialogWindow
+{
+ ///
+ /// NewShopWindow.xaml 的交互逻辑
+ ///
+ public partial class NewShopWindow : Window
+ {
+ public NewShopWindow()
+ {
+ InitializeComponent();
+ this.MoveBorder.MouseLeftButtonDown += (o, e) =>
+ {
+ this.DragMove();
+ };
+
+ //WeakReferenceMessenger.Default.Register(this, "Close", (o, e) =>
+ //{
+ // App.Current.Dispatcher.Invoke(new Action(() =>
+ // {
+ // this.DialogResult = Convert.ToBoolean(e);
+ // this.Close();
+ // }));
+ //});
+ }
+
+
+ }
+}
diff --git a/BPASmartClient/MainWindow.xaml b/BPASmartClient/MainWindow.xaml
index 4f087c8c..d147de7a 100644
--- a/BPASmartClient/MainWindow.xaml
+++ b/BPASmartClient/MainWindow.xaml
@@ -184,7 +184,7 @@