From 636e629590a7d20f29f65ba636ff20759a12cc9a Mon Sep 17 00:00:00 2001 From: ZhaoGang <15196688790@163.com> Date: Sat, 24 Jun 2023 17:32:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E6=96=B9=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=91=BD=E4=BB=A4=E5=B9=B6=E5=81=9A?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E6=B5=8B=E8=AF=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BPASmartClient.MorkCL.csproj | 1 + BPASmartClient.Tourism/Control_MorkCL.cs | 6 + BPASmartClient.Tourism/HelpClass/FuncSet.cs | 11 +- .../Model/Json/MaterialsInfo.cs | 25 +++ .../Model/Json/RecipesInfo.cs | 14 ++ .../Model/Recipe/TempRecipe.cs | 43 +++++ .../View/AddRawMaterialView.xaml | 20 +- BPASmartClient.Tourism/View/Debug.xaml | 22 +-- .../View/EditFunctionParamView.xaml | 16 +- .../View/EditFunctionParamView.xaml.cs | 5 + .../View/EditRecipeView.xaml | 35 ++-- .../View/EditRecipeView.xaml.cs | 5 + .../View/ItemStorageView.xaml | 57 +++++- BPASmartClient.Tourism/View/ParSet.xaml | 2 +- .../View/RecipeManageView.xaml | 12 +- .../ViewModel/AddRawMaterialViewModel.cs | 50 ++++- .../ViewModel/EditFunctionParamViewModel.cs | 20 +- .../ViewModel/EditRecipeViewModel.cs | 172 ++++++++++++++---- .../ViewModel/ItemStorageViewModel.cs | 38 +++- .../ViewModel/RecipeManageViewModel.cs | 55 +++--- 20 files changed, 477 insertions(+), 132 deletions(-) create mode 100644 BPASmartClient.Tourism/Model/Json/MaterialsInfo.cs create mode 100644 BPASmartClient.Tourism/Model/Json/RecipesInfo.cs create mode 100644 BPASmartClient.Tourism/Model/Recipe/TempRecipe.cs diff --git a/BPASmartClient.Tourism/BPASmartClient.MorkCL.csproj b/BPASmartClient.Tourism/BPASmartClient.MorkCL.csproj index 5cf2eeff..c8e31cf8 100644 --- a/BPASmartClient.Tourism/BPASmartClient.MorkCL.csproj +++ b/BPASmartClient.Tourism/BPASmartClient.MorkCL.csproj @@ -7,6 +7,7 @@ + diff --git a/BPASmartClient.Tourism/Control_MorkCL.cs b/BPASmartClient.Tourism/Control_MorkCL.cs index cbce75a0..3fa9a092 100644 --- a/BPASmartClient.Tourism/Control_MorkCL.cs +++ b/BPASmartClient.Tourism/Control_MorkCL.cs @@ -1,5 +1,6 @@ using BPA.Message.Enum; using BPASmartClient.Device; +using BPASmartClient.MorkCL.Model.Json; using BPASmartClient.MorkCL.Server; using SqlSugar; using System; @@ -48,6 +49,11 @@ namespace BPASmartClient.MorkCL devices[EDeviceType.机器人].Init(ConnectPar.RobotIP); devices[EDeviceType.压力锅].Init(ConnectPar.PressureCookerIP); devices[EDeviceType.外部设备].Init(ConnectPar.PPortName); + + #region 读取本地文件数据 + Json.Read(); + Json.Read(); + #endregion } public override void MainTask() diff --git a/BPASmartClient.Tourism/HelpClass/FuncSet.cs b/BPASmartClient.Tourism/HelpClass/FuncSet.cs index 92d5e768..0ce9e940 100644 --- a/BPASmartClient.Tourism/HelpClass/FuncSet.cs +++ b/BPASmartClient.Tourism/HelpClass/FuncSet.cs @@ -13,7 +13,16 @@ namespace BPASmartClient.MorkCL.HelpClass public class FuncSet { public int Step { get; set; } - public string FuncName { get; set; } + + private string _FuncName; + public string FuncName + { + get { return _FuncName; } + set { _FuncName = value; + FuncPars = InitData.FunParInit[(EFunc)Enum.Parse(typeof(EFunc),value)]?.ToList(); + } + } + public List FuncPars { get; set; } } } diff --git a/BPASmartClient.Tourism/Model/Json/MaterialsInfo.cs b/BPASmartClient.Tourism/Model/Json/MaterialsInfo.cs new file mode 100644 index 00000000..a3364616 --- /dev/null +++ b/BPASmartClient.Tourism/Model/Json/MaterialsInfo.cs @@ -0,0 +1,25 @@ +using BPASmartClient.MorkCL.Model.DataInfo; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.MorkCL.Model.Json +{ + public class MaterialsInfo + { + /// + /// 辅料信息集合 + /// + public ObservableCollection Accessories { get; set; }=new ObservableCollection(); + /// + /// 主料信息集合 + /// + public ObservableCollection Ingredients { get; set; }=new ObservableCollection(); + /// + /// 调料信息集合 + /// + public ObservableCollection Seasonings { get; set; }=new ObservableCollection(); + } +} diff --git a/BPASmartClient.Tourism/Model/Json/RecipesInfo.cs b/BPASmartClient.Tourism/Model/Json/RecipesInfo.cs new file mode 100644 index 00000000..0bc7e8f1 --- /dev/null +++ b/BPASmartClient.Tourism/Model/Json/RecipesInfo.cs @@ -0,0 +1,14 @@ +using BPASmartClient.MorkCL.Model.Recipe; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.MorkCL.Model.Json +{ + public class RecipesInfo + { + public ObservableCollection LocalRecipes { get; set; }=new ObservableCollection(); + } +} diff --git a/BPASmartClient.Tourism/Model/Recipe/TempRecipe.cs b/BPASmartClient.Tourism/Model/Recipe/TempRecipe.cs new file mode 100644 index 00000000..1d3cf005 --- /dev/null +++ b/BPASmartClient.Tourism/Model/Recipe/TempRecipe.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPASmartClient.MorkCL.Model.Recipe +{ + public class TempRecipeData:NotifyBase + { + private string _Name; + + public string Name + { + get { return _Name; } + set { _Name = value; OnPropertyChanged(); } + } + private string _ID; + + public string ID + { + get { return _ID; } + set { _ID = value; OnPropertyChanged(); } + } + private string _Remark; + + public string Remark + { + get { return _Remark; } + set { _Remark = value; OnPropertyChanged(); } + } + private Dictionary _Functions; + + public Dictionary Functions + { + get { return _Functions; } + set { _Functions = value; OnPropertyChanged(); } + } + + + + } +} diff --git a/BPASmartClient.Tourism/View/AddRawMaterialView.xaml b/BPASmartClient.Tourism/View/AddRawMaterialView.xaml index c76f1023..feff48b3 100644 --- a/BPASmartClient.Tourism/View/AddRawMaterialView.xaml +++ b/BPASmartClient.Tourism/View/AddRawMaterialView.xaml @@ -48,12 +48,12 @@