From 0f50f5c3413527dfa116d95bee7837e15959a00a Mon Sep 17 00:00:00 2001 From: NXX <447201003@qq> Date: Fri, 12 Aug 2022 15:29:38 +0800 Subject: [PATCH] =?UTF-8?q?Dosing=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.Business/Plugin/MQTTMgr.cs | 2 +- .../Pages/Model/Global.cs | 6 + .../Pages/Model/LocaMaterial.cs | 15 + .../Pages/Model/MaterailConfig.cs | 17 + .../Pages/Model/UserInfo.cs | 14 + .../Pages/View/UserConfigView.xaml | 419 +++++++++++++++++- .../Pages/ViewModel/LoginViewModel.cs | 9 +- .../Pages/ViewModel/MainViewModel.cs | 7 + .../Pages/ViewModel/UserConfigViewModel.cs | 210 ++++++++- BPASmartClient.MQTT/MQTTProxy.cs | 13 + .../柔性味魔方}/RawMaterialModel.cs | 3 +- BPASmartClient/App.config | 8 +- DosingSystem/App.xaml.cs | 1 + DosingSystem/Model/DeviceInquire.cs | 20 +- DosingSystem/Model/GlobalData.cs | 15 + DosingSystem/Model/LocaPar.cs | 3 + DosingSystem/Model/RecipeModel.cs | 2 +- DosingSystem/View/NewMaterialView.xaml | 156 +++++++ DosingSystem/View/NewMaterialView.xaml.cs | 35 ++ DosingSystem/View/RecipeSettingsView.xaml | 11 + .../ViewModel/ChangeDeviceNameViewModel.cs | 6 +- .../ViewModel/NewMaterialViewModel.cs | 64 +++ DosingSystem/ViewModel/NewRecipeViewModel.cs | 76 +++- .../ViewModel/RecipeSettingsViewModel.cs | 10 + SmartClient.sln | 1 + 25 files changed, 1040 insertions(+), 83 deletions(-) create mode 100644 BPASmartClient.CustomResource/Pages/Model/LocaMaterial.cs create mode 100644 BPASmartClient.CustomResource/Pages/Model/MaterailConfig.cs rename {DosingSystem/Model => BPASmartClient.Model/柔性味魔方}/RawMaterialModel.cs (98%) create mode 100644 DosingSystem/Model/GlobalData.cs create mode 100644 DosingSystem/View/NewMaterialView.xaml create mode 100644 DosingSystem/View/NewMaterialView.xaml.cs create mode 100644 DosingSystem/ViewModel/NewMaterialViewModel.cs diff --git a/BPASmartClient.Business/Plugin/MQTTMgr.cs b/BPASmartClient.Business/Plugin/MQTTMgr.cs index 6f8765c9..c14ffa2b 100644 --- a/BPASmartClient.Business/Plugin/MQTTMgr.cs +++ b/BPASmartClient.Business/Plugin/MQTTMgr.cs @@ -60,7 +60,7 @@ namespace BPASmartClient.Business var MqttServerConfig = Plugin.GetInstance().GetPlugin().MQTT_Config; var MqttServerAccount = Plugin.GetInstance().GetPlugin().Mqtt_Account; //MQTT 初始化 - mqttProxy.Connect(MqttServerAccount.UserName, MqttServerAccount.Password, MqttServerConfig.Host, MqttServerConfig.Port, Guid.NewGuid().ToString()); + mqttProxy.Connect(MqttServerAccount.UserName, MqttServerAccount.Password, MqttServerConfig.Host, MqttServerConfig.Port, "qsqd--morks--"+ Guid.NewGuid().ToString()); ThreadManage.GetInstance().Start(() => { diff --git a/BPASmartClient.CustomResource/Pages/Model/Global.cs b/BPASmartClient.CustomResource/Pages/Model/Global.cs index 86de75c5..5cbbbb66 100644 --- a/BPASmartClient.CustomResource/Pages/Model/Global.cs +++ b/BPASmartClient.CustomResource/Pages/Model/Global.cs @@ -1,6 +1,8 @@ using BPASmartClient.CustomResource.Pages.Enums; +using BPASmartClient.Model; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -13,6 +15,10 @@ namespace BPASmartClient.CustomResource.Pages.Model public static UserInfo userInfo { get; set; } = new UserInfo(); /// + /// 设备原料集合 + /// + public static ObservableCollection DeviceRawMaterials { get; set; } = new ObservableCollection(); + /// /// 重置密码页面传值 /// public static UserInfo changeUserInfo { get; set; } = null; diff --git a/BPASmartClient.CustomResource/Pages/Model/LocaMaterial.cs b/BPASmartClient.CustomResource/Pages/Model/LocaMaterial.cs new file mode 100644 index 00000000..656813d4 --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/Model/LocaMaterial.cs @@ -0,0 +1,15 @@ +using BPASmartClient.Model; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.CustomResource.Pages.Model +{ + public class LocaMaterial + { + public ObservableCollection LocalMaterails { get; set; } = new ObservableCollection(); + } +} diff --git a/BPASmartClient.CustomResource/Pages/Model/MaterailConfig.cs b/BPASmartClient.CustomResource/Pages/Model/MaterailConfig.cs new file mode 100644 index 00000000..af6d9c71 --- /dev/null +++ b/BPASmartClient.CustomResource/Pages/Model/MaterailConfig.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.CustomResource.Pages.Model +{ + public class MaterailConfig + { + public string MaterialName { get; set; } + + public string MaterialId { get; set; } + + public string DeviceAddress { get; set; } + } +} diff --git a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs index 7f85b3dc..d9d67582 100644 --- a/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs +++ b/BPASmartClient.CustomResource/Pages/Model/UserInfo.cs @@ -1,4 +1,5 @@ using BPASmartClient.CustomResource.Pages.Enums; +using BPASmartClient.Model; using Microsoft.Toolkit.Mvvm.ComponentModel; using System; using System.Collections.Generic; @@ -11,16 +12,29 @@ namespace BPASmartClient.CustomResource.Pages.Model public class UserInfo:ObservableObject { public String LastLogInTime { get; set; } = "无"; + public List userTreeViewModels { get; set; } + public string Id { get { return _id; }set { _id = value;OnPropertyChanged(); } } private string _id; + public Permission permission { get { return _perimission; } set { _perimission = value;OnPropertyChanged(); } } private Permission _perimission; + public string UserName { get { return _userName; } set { _userName = value;OnPropertyChanged(); } } private string _userName; + public string Password { get { return _password; } set { _password = value;OnPropertyChanged(); } } private string _password; + public List CardId { get; set; } = new List(); + public List locaRawMaterials { get; set; } = new List(); + + public List devRawMaterials { get; set; } = new List(); + + + + } } diff --git a/BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml b/BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml index 635a2b48..ddd5b27d 100644 --- a/BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml +++ b/BPASmartClient.CustomResource/Pages/View/UserConfigView.xaml @@ -224,6 +224,131 @@ + + + + @@ -243,13 +368,13 @@ - - - - - + + + + + - + - + + + - + @@ -343,18 +470,18 @@ - + @@ -366,17 +493,271 @@ - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -385,14 +766,14 @@