diff --git a/BPASmartClient.MaxWokControl/MainWindow.xaml b/BPASmartClient.MaxWokControl/MainWindow.xaml index 3e46e029..3aa1ab76 100644 --- a/BPASmartClient.MaxWokControl/MainWindow.xaml +++ b/BPASmartClient.MaxWokControl/MainWindow.xaml @@ -1,12 +1,13 @@ - - - - + + diff --git a/BPASmartClient.MorkCL/BPASmartClient.MorkCL.csproj b/BPASmartClient.MorkCL/BPASmartClient.MorkCL.csproj index abf1786a..ad764358 100644 --- a/BPASmartClient.MorkCL/BPASmartClient.MorkCL.csproj +++ b/BPASmartClient.MorkCL/BPASmartClient.MorkCL.csproj @@ -6,9 +6,7 @@ true - - $(DefineConstants);FORMAL - + diff --git a/BPASmartClient.MorkCL/Control_MorkCL.cs b/BPASmartClient.MorkCL/Control_MorkCL.cs index 7df5a980..c82e746c 100644 --- a/BPASmartClient.MorkCL/Control_MorkCL.cs +++ b/BPASmartClient.MorkCL/Control_MorkCL.cs @@ -348,16 +348,18 @@ namespace BPASmartClient.MorkCL device.DiningOutStart = false; DeviceProcessLogShow($"{cd.Name}-任务执行-{fm.eFunc.ToString()}-设置机器人取空盆。"); //TODO:暂时修改,后期优化。 - //while (true) - //{ - // var emptyPanIndex = Array.FindIndex(otherDevice.BoxDetection, i => i == true); - // if (emptyPanIndex >= 0) - // { - // robot.RobotTaskControl((21 + emptyPanIndex).ToString(), et);//取空盆 - // break; - // } - //} - robot.RobotTaskControl("21", et);//取空盆 + while (true) + { + var emptyPanIndex = Array.FindIndex(otherDevice.BoxDetection, i => i == true); + if (emptyPanIndex >= 0) + { + robot.RobotTaskControl((21 + emptyPanIndex).ToString(), et);//取空盆 + break; + } + await Task.Delay(3000); + DeviceProcessLogShow("无空盆,请添加空盆!"); + } + //robot.RobotTaskControl("21", et);//取空盆 DeviceProcessLogShow($"{cd.Name}-任务执行-{fm.eFunc.ToString()}-设置机器人取空盆完成,等待机器人到出菜位置。"); robot.DiningOutRequest[index].Wait(Cts: TaskList[et].Cts);//等待机器人到出菜位置 @@ -561,7 +563,7 @@ namespace BPASmartClient.MorkCL void ManualActionRegiester() { - + //主料入库委托。 ActionManage.GetInstance.Register((object o) => { if (!morkCL.CanItemStorage) diff --git a/BPASmartClient.MorkCL/Server/OtherServer.cs b/BPASmartClient.MorkCL/Server/OtherServer.cs index 2854856f..d18b781c 100644 --- a/BPASmartClient.MorkCL/Server/OtherServer.cs +++ b/BPASmartClient.MorkCL/Server/OtherServer.cs @@ -46,7 +46,7 @@ namespace BPASmartClient.MorkCL.Server public void WriteValue(string address, T value) { - + throw new NotImplementedException(); } } } diff --git a/BPASmartClient.MorkCL/Server/PressureCookerServer.cs b/BPASmartClient.MorkCL/Server/PressureCookerServer.cs index e820f15c..77bcc4eb 100644 --- a/BPASmartClient.MorkCL/Server/PressureCookerServer.cs +++ b/BPASmartClient.MorkCL/Server/PressureCookerServer.cs @@ -26,7 +26,7 @@ namespace BPASmartClient.MorkCL.Server public void WriteValue(string address, T value) { - + throw new NotImplementedException(); } } } diff --git a/BPASmartClient.MorkCL/Server/RobotServer.cs b/BPASmartClient.MorkCL/Server/RobotServer.cs index 10b4165e..c2a2d38f 100644 --- a/BPASmartClient.MorkCL/Server/RobotServer.cs +++ b/BPASmartClient.MorkCL/Server/RobotServer.cs @@ -44,7 +44,7 @@ namespace BPASmartClient.MorkCL.Server public void WriteValue(string address, T value) { - + throw new NotImplementedException(); } private void RobotInit() diff --git a/BPASmartClient.MorkCL/View/Test.xaml b/BPASmartClient.MorkCL/View/Test.xaml index 075ed451..fcf7ae14 100644 --- a/BPASmartClient.MorkCL/View/Test.xaml +++ b/BPASmartClient.MorkCL/View/Test.xaml @@ -112,7 +112,8 @@ CanUserSortColumns="False" IsHitTestVisible="False" IsReadOnly="True" - ItemsSource="{Binding TBS}"> + ItemsSource="{Binding TBS}" + RowHeaderWidth="0"> (SqliteHelper.GetInstance.GetSeasoning().OrderBy(tb => tb.Loc)); } - /// - /// 辅料信息集合 - /// + /// 辅料信息集合 public ObservableCollection Accessories { get => accessories; set { accessories = value; OnPropertyChanged(); } } - /// - /// 主料信息集合 - /// + /// 主料信息集合 public ObservableCollection Ingredients { get => ingredients; set { ingredients = value; OnPropertyChanged(); } } - /// - /// 调料信息集合 - /// + /// 调料信息集合 public ObservableCollection Seasonings { get => seasonings; set { seasonings = value; OnPropertyChanged(); } } - /// - /// 删除辅料信息 - /// + /// 删除辅料信息 public BPARelayCommand RemoveAccessoryCommand { get; set; } - /// - /// 删除主料信息 - /// + /// 删除主料信息 public BPARelayCommand RemoveIngreditentCommand { get; set; } - /// - /// 删除调料信息 - /// + /// 删除调料信息 public BPARelayCommand RemoveSeasoningCommand { get; set; } - /// - /// 添加物料信息。 - /// + /// 添加物料信息。 public BPARelayCommand AddMaterialCommand { get; set; } - /// - /// 编辑物料信息。 - /// + /// 编辑物料信息。 public BPARelayCommand EditCommand { get; set; } } } \ No newline at end of file diff --git a/BPASmartClient.MorkCL/ViewModel/DebugViewModel.cs b/BPASmartClient.MorkCL/ViewModel/DebugViewModel.cs index 8474bfc3..567036ee 100644 --- a/BPASmartClient.MorkCL/ViewModel/DebugViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/DebugViewModel.cs @@ -1,10 +1,4 @@ - -using BPASmartClient.MorkCL.HelpClass; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using BPASmartClient.MorkCL.HelpClass; namespace BPASmartClient.MorkCL.ViewModel { @@ -15,7 +9,7 @@ namespace BPASmartClient.MorkCL.ViewModel public DebugViewModel() { - WriteAgitaParamCommand = new(async() => + WriteAgitaParamCommand = new(async () => { ActionManage.GetInstance.Send("WriteUshort", new WriteModel(FryingPanSelect, "LW1", AgitaFrequency)); @@ -31,7 +25,7 @@ namespace BPASmartClient.MorkCL.ViewModel ActionManage.GetInstance.Send("WriteBool", new WriteModel(FryingPanSelect, "LB0", false)); }); - WriteHeatParamCommand = new(async() => + WriteHeatParamCommand = new(async () => { ActionManage.GetInstance.Send("WriteUshort", new WriteModel(FryingPanSelect, "LW0", HeatGear)); @@ -49,13 +43,13 @@ namespace BPASmartClient.MorkCL.ViewModel await SendWriteRequest($"LB{LBOffset[channelIndex]}"); }); - GoFryLocCommand = new(async() => + GoFryLocCommand = new(async () => { var loc = StirFryLocSelect + 17; await SendWriteRequest($"LB{loc}"); }); - GoHomeCommand = new(async() => + GoHomeCommand = new(async () => { await SendWriteRequest("LB12"); }); @@ -76,6 +70,7 @@ namespace BPASmartClient.MorkCL.ViewModel } #region 私有方法 + private async Task SendWriteRequest(string address) { ActionManage.GetInstance.Send("WriteBool", new WriteModel(FryingPanSelect, address, false)); @@ -84,20 +79,21 @@ namespace BPASmartClient.MorkCL.ViewModel await Task.Delay(50); ActionManage.GetInstance.Send("WriteBool", new WriteModel(FryingPanSelect, address, false)); } - #endregion - #region 属性 - private EDeviceType fryingPanSelect=EDeviceType.炒锅1; - /// - /// 炒锅选择。 - /// + + #endregion 私有方法 + + #region 属性 + + private EDeviceType fryingPanSelect = EDeviceType.炒锅1; + + /// 炒锅选择。 public EDeviceType FryingPanSelect { get { return fryingPanSelect; } set { fryingPanSelect = value; OnPropertyChanged(); } } - /// - /// 搅拌频率 - /// + + /// 搅拌频率 public ushort AgitaFrequency { get => agitaFrequency; set @@ -112,14 +108,11 @@ namespace BPASmartClient.MorkCL.ViewModel } } - /// - /// 加热档位 - /// + /// 加热档位 public ushort HeatGear { get => heatGear; set { - if (value >= 8) heatGear = 8; else if (value <= 1) @@ -131,9 +124,8 @@ namespace BPASmartClient.MorkCL.ViewModel } private float weight; - /// - /// 下料重量 - /// + + /// 下料重量 public float Weight { get { return weight; } @@ -141,9 +133,8 @@ namespace BPASmartClient.MorkCL.ViewModel } private int channelSelect; - /// - /// 下料通道选择。 - /// + + /// 下料通道选择。 public int ChannelSelect { get { return channelSelect; } @@ -151,67 +142,56 @@ namespace BPASmartClient.MorkCL.ViewModel } private int stirFryLocSelect; - /// - /// 炒制位选择。 - /// + + /// 炒制位选择。 public int StirFryLocSelect { get { return stirFryLocSelect; } set { stirFryLocSelect = value; OnPropertyChanged(); } } - public ObservableCollection DeviceTypes { get; set; }=new ObservableCollection() {EDeviceType.炒锅1,EDeviceType.炒锅2 }; - #endregion + public ObservableCollection DeviceTypes { get; set; } = new ObservableCollection() { EDeviceType.炒锅1, EDeviceType.炒锅2 }; + + #endregion 属性 + #region 命令 - /// - /// 写入搅拌参数。 - /// + /// 写入搅拌参数。 public BPARelayCommand WriteAgitaParamCommand { get; set; } - /// - /// 开始搅拌。 - /// + + /// 开始搅拌。 public BPARelayCommand StartAgitateCommand { get; set; } - /// - /// 停止搅拌。 - /// + + /// 停止搅拌。 public BPARelayCommand StopAgitateCommand { get; set; } - /// - /// 写入加热参数。 - /// + + /// 写入加热参数。 public BPARelayCommand WriteHeatParamCommand { get; set; } - /// - /// 开始加热。 - /// + + /// 开始加热。 public BPARelayCommand StartHeatCommand { get; set; } - /// - /// 停止加热。 - /// + + /// 停止加热。 public BPARelayCommand StopHeatCommand { get; set; } - /// - /// 通道下料启动。 - /// + + /// 通道下料启动。 public BPARelayCommand ChannelCuttingCommand { get; set; } - /// - /// 去炒制位。 - /// + + /// 去炒制位。 public BPARelayCommand GoFryLocCommand { get; set; } - /// - /// 回原点/投料位置。 - /// + + /// 回原点/投料位置。 public BPARelayCommand GoHomeCommand { get; set; } - /// - /// 去调料投料位。 - /// + + /// 去调料投料位。 public BPARelayCommand GoSeasoningFeddLocCommand { get; set; } - /// - /// 出餐启动。 - /// + + /// 出餐启动。 public BPARelayCommand OutDiningStartCommand { get; set; } - /// - /// 炒锅清洗。 - /// + + /// 炒锅清洗。 public BPARelayCommand FryPanCleanCommand { get; set; } - #endregion + + #endregion 命令 } -} +} \ No newline at end of file diff --git a/BPASmartClient.MorkCL/ViewModel/EditFunctionParamViewModel.cs b/BPASmartClient.MorkCL/ViewModel/EditFunctionParamViewModel.cs index 91b29bdb..31e1f63d 100644 --- a/BPASmartClient.MorkCL/ViewModel/EditFunctionParamViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/EditFunctionParamViewModel.cs @@ -53,17 +53,19 @@ namespace BPASmartClient.MorkCL.ViewModel case EFunc.添加调料: item.Id = SqliteHelper.GetInstance.GetSeasoning().FirstOrDefault(material => material.Name == item.ParValue.ToString()).Id; break; + case EFunc.添加主料: item.Id = SqliteHelper.GetInstance.GetIngredients().FirstOrDefault(material => material.Name == item.ParValue.ToString()).Id; break; + case EFunc.添加辅料: item.Id = SqliteHelper.GetInstance.GetAccessories().FirstOrDefault(material => material.Name == item.ParValue.ToString()).Id; break; + default: break; } } - } //关闭视图窗口。 ActionManage.GetInstance.Send("CloseFuncParmEditView", true); @@ -87,16 +89,12 @@ namespace BPASmartClient.MorkCL.ViewModel } } - /// - /// 保存参数。 - /// + /// 保存参数。 public BPARelayCommand SaveParamCommand { get; set; } private EFunc _FuncName; - /// - /// 功能名称。 - /// + /// 功能名称。 public EFunc FuncName { get { return _FuncName; } diff --git a/BPASmartClient.MorkCL/ViewModel/EditRawMaterialViewModel.cs b/BPASmartClient.MorkCL/ViewModel/EditRawMaterialViewModel.cs index cec8ba13..028faca5 100644 --- a/BPASmartClient.MorkCL/ViewModel/EditRawMaterialViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/EditRawMaterialViewModel.cs @@ -197,9 +197,7 @@ namespace BPASmartClient.MorkCL.ViewModel private string _CurrentMaterialType; - /// - /// 物料类型 - /// + /// 物料类型 public string CurrentMaterialType { get { return _CurrentMaterialType; } @@ -218,9 +216,7 @@ namespace BPASmartClient.MorkCL.ViewModel private string _MaterialName; - /// - /// 物料名称 - /// + /// 物料名称 public string MaterialName { get { return _MaterialName; } @@ -229,9 +225,7 @@ namespace BPASmartClient.MorkCL.ViewModel private int _MaterialLoc; - /// - /// 物料位置 - /// + /// 物料位置 public int MaterialLoc { get { return _MaterialLoc; } @@ -248,9 +242,7 @@ namespace BPASmartClient.MorkCL.ViewModel private Visibility _MaterialTypeVis; - /// - /// 是否新增,如果是新增,则显示主料类型框。反之,则不显示。 - /// + /// 是否新增,如果是新增,则显示主料类型框。反之,则不显示。 public Visibility MaterialTypeVis { get { return _MaterialTypeVis; } @@ -259,9 +251,7 @@ namespace BPASmartClient.MorkCL.ViewModel private Visibility _LocationVis; - /// - /// 是否显示位置框,如果为主料,则不显示。反之,则显示。 - /// + /// 是否显示位置框,如果为主料,则不显示。反之,则显示。 public Visibility LocationVis { get { return _LocationVis; } diff --git a/BPASmartClient.MorkCL/ViewModel/EditRecipeViewModel.cs b/BPASmartClient.MorkCL/ViewModel/EditRecipeViewModel.cs index a38b5aeb..5ca5b614 100644 --- a/BPASmartClient.MorkCL/ViewModel/EditRecipeViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/EditRecipeViewModel.cs @@ -294,10 +294,10 @@ namespace BPASmartClient.MorkCL.ViewModel }); MoveUpCommand = new((o) => { - if (o !=null && o is FuncModel funcmodel) + if (o != null && o is FuncModel funcmodel) { - var index= Functions.IndexOf(funcmodel); - if (index>0) + var index = Functions.IndexOf(funcmodel); + if (index > 0) { int newIndex = index - 1; Functions.RemoveAt(index); @@ -311,7 +311,7 @@ namespace BPASmartClient.MorkCL.ViewModel if (o != null && o is FuncModel funcmodel) { var index = Functions.IndexOf(funcmodel); - if (index < Functions.Count-1) + if (index < Functions.Count - 1) { int newIndex = index + 1; Functions.RemoveAt(index); @@ -334,40 +334,26 @@ namespace BPASmartClient.MorkCL.ViewModel //} } - /// - /// 保存参数。 - /// + /// 保存参数。 public BPARelayCommand SaveParamCommand { get; set; } - /// - /// 添加功能 - /// + /// 添加功能 public BPARelayCommand AddFuncCommand { get; set; } - /// - /// 删除功能。 - /// + /// 删除功能。 public BPARelayCommand RemoveCommand { get; set; } - /// - /// 功能选择改变。 - /// + /// 功能选择改变。 public BPARelayCommand FuncChangeCommand { get; set; } - /// - /// 编辑功能。 - /// + /// 编辑功能。 public BPARelayCommand EditCommand { get; set; } - /// - /// 功能上移。 - /// + /// 功能上移。 public BPARelayCommand MoveUpCommand { get; set; } - /// - /// 功能下移。 - /// - public BPARelayCommand MoveDownCommand { get; set; } + /// 功能下移。 + public BPARelayCommand MoveDownCommand { get; set; } private ObservableCollection _Functions; @@ -379,9 +365,7 @@ namespace BPASmartClient.MorkCL.ViewModel private string _Name; - /// - /// 配方名称 - /// + /// 配方名称 public string Name { get { return _Name; } @@ -390,9 +374,7 @@ namespace BPASmartClient.MorkCL.ViewModel private string _ID; - /// - /// 配方ID。 - /// + /// 配方ID。 public string ID { get { return _ID; } @@ -401,9 +383,7 @@ namespace BPASmartClient.MorkCL.ViewModel private ObservableCollection _AllFunc; - /// - /// 所有功能集合。 - /// + /// 所有功能集合。 public ObservableCollection AllFunc { get { return _AllFunc; } @@ -412,9 +392,7 @@ namespace BPASmartClient.MorkCL.ViewModel private ObservableCollection _AllDishType; - /// - /// 所有菜品集合。 - /// + /// 所有菜品集合。 public ObservableCollection AllDishType { get { return _AllDishType; } diff --git a/BPASmartClient.MorkCL/ViewModel/FryPanSelectViewModel.cs b/BPASmartClient.MorkCL/ViewModel/FryPanSelectViewModel.cs index d6f2bc92..deeec853 100644 --- a/BPASmartClient.MorkCL/ViewModel/FryPanSelectViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/FryPanSelectViewModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BPASmartClient.MorkCL.ViewModel +namespace BPASmartClient.MorkCL.ViewModel { public class FryPanSelectViewModel : NotifyBase { @@ -12,16 +6,18 @@ namespace BPASmartClient.MorkCL.ViewModel { SelectFryPanCommand = new((object i) => { - if (int.TryParse(i.ToString(),out int res)) + if (int.TryParse(i.ToString(), out int res)) { switch (res) { case 1: DeviceType = EDeviceType.炒锅1; break; + case 2: DeviceType = EDeviceType.炒锅2; break; + default: DeviceType = EDeviceType.无; break; @@ -29,22 +25,19 @@ namespace BPASmartClient.MorkCL.ViewModel ActionManage.GetInstance.Send("CloseFryPanSelectView", true); } - }); - CloseCommand = new(() => { - ActionManage.GetInstance.Send("CloseFryPanSelectView",false); + ActionManage.GetInstance.Send("CloseFryPanSelectView", false); }); } - /// - /// 选择命令。 - /// + + /// 选择命令。 public BPARelayCommand SelectFryPanCommand { get; set; } public BPARelayCommand CloseCommand { get; set; } public static EDeviceType DeviceType { get; set; } } -} +} \ No newline at end of file diff --git a/BPASmartClient.MorkCL/ViewModel/ItemStorageViewModel.cs b/BPASmartClient.MorkCL/ViewModel/ItemStorageViewModel.cs index feeacbcc..09ef7931 100644 --- a/BPASmartClient.MorkCL/ViewModel/ItemStorageViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/ItemStorageViewModel.cs @@ -1,11 +1,6 @@ -using BPA.Helper; -using BPASmartClient.CustomResource.Pages.Model; -using BPASmartClient.CustomResource.UserControls.MessageShow; -using BPASmartClient.MorkCL.Model.DB; +using BPASmartClient.MorkCL.Model.DB; using BPASmartClient.MorkCL.Model.Json; using BPASmartClient.MorkCL.Server; -using S7.Net.Protocol; -using System.Transactions; namespace BPASmartClient.MorkCL.ViewModel { @@ -20,19 +15,16 @@ namespace BPASmartClient.MorkCL.ViewModel { IngredientsItorage = new ObservableCollection(Json.Data.IngredientsStorage); AccessoriesItorage = new ObservableCollection(Json.Data.AccessoriesStorage); - },"RefreshItemStorage",true); - + }, "RefreshItemStorage", true); ActionManage.GetInstance.Register((() => { Ingredients = new ObservableCollection(SqliteHelper.GetInstance.GetIngredients()); }), "RefreshIngredients", true); - - ActionManage.GetInstance.Register((object o) => { - if (o!=null) + if (o != null) { #if !FORMAL ScaleCurrentWeight = (float)o; @@ -42,8 +34,8 @@ namespace BPASmartClient.MorkCL.ViewModel } }, "SendCurrentWeight"); - ActionManage.GetInstance.Register((object o) => { - + ActionManage.GetInstance.Register((object o) => + { CanItemStorage = (bool)o; }, "RefreshCanItemStorage", true); @@ -56,6 +48,7 @@ namespace BPASmartClient.MorkCL.ViewModel ActionManage.GetInstance.Send(NotifyTopic.ItemStorage, o); #region 暂时弃用 + //if (!CanItemStorage) //{ // MessageNotify.GetInstance.ShowDialog("当前有炒菜任务正在排队,为避免影响菜品口味,不可入库,请稍后再试。", DialogType.Warning); @@ -66,7 +59,6 @@ namespace BPASmartClient.MorkCL.ViewModel //{ // if (o != null && o is IngredientsTB ingredients) // { - // foreach (ItemStorage item in Json.Data.IngredientsStorage) // { // if (item.IsEmploy == false) @@ -76,14 +68,14 @@ namespace BPASmartClient.MorkCL.ViewModel // item.IsEmploy = true; // item.Weight = ScaleCurrentWeight; - // ActionManage.GetInstance.Send("ItemStorage", IngredientsItorage.IndexOf(item) + 1); - // Json.Save(); + // ActionManage.GetInstance.Send("ItemStorage", IngredientsItorage.IndexOf(item) + + // 1); Json.Save(); - // IngredientsItorage = new ObservableCollection(Json.Data.IngredientsStorage); + // IngredientsItorage = new ObservableCollection(Json.Data.IngredientsStorage); - // Application.Current.Dispatcher.Invoke(() => - // { - // NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, Application.Current.MainWindow, "入库成功", $"物料{ingredients.Name}入库成功。"); + // Application.Current.Dispatcher.Invoke(() => { + // NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, + // Application.Current.MainWindow, "入库成功", $"物料{ingredients.Name}入库成功。"); // }); // return; @@ -101,9 +93,9 @@ namespace BPASmartClient.MorkCL.ViewModel // NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, Application.Current.MainWindow, "入库失败", $"物料入库失败。"); // }); // } - //}, "ItemStorageTask"); - #endregion + //}, "ItemStorageTask"); + #endregion 暂时弃用 }); } @@ -126,6 +118,7 @@ namespace BPASmartClient.MorkCL.ViewModel public BPARelayCommand InStorageCommand { get; set; } private float _ScaleCurrentWeight; + public float ScaleCurrentWeight { get { return _ScaleCurrentWeight; } set { _ScaleCurrentWeight = value; OnPropertyChanged(); } } @@ -139,9 +132,7 @@ namespace BPASmartClient.MorkCL.ViewModel private ObservableCollection _IngredientsItorage; - /// - /// 主料库位。 - /// + /// 主料库位。 public ObservableCollection IngredientsItorage { get { return _IngredientsItorage; } @@ -150,9 +141,7 @@ namespace BPASmartClient.MorkCL.ViewModel private ObservableCollection _AccessoriesItorage; - /// - /// 辅料库位 - /// + /// 辅料库位 public ObservableCollection AccessoriesItorage { get { return _AccessoriesItorage; } @@ -161,9 +150,7 @@ namespace BPASmartClient.MorkCL.ViewModel private ObservableCollection _Ingredients; - /// - /// 所有的主料数据。作为ComboBox的数据源。 - /// + /// 所有的主料数据。作为ComboBox的数据源。 public ObservableCollection Ingredients { get { return _Ingredients; } @@ -171,14 +158,12 @@ namespace BPASmartClient.MorkCL.ViewModel } private bool _CanItemStorage; - /// - /// 入库许可。 - /// + + /// 入库许可。 public bool CanItemStorage { get { return _CanItemStorage; } set { _CanItemStorage = value; OnPropertyChanged(); } } - } } \ No newline at end of file diff --git a/BPASmartClient.MorkCL/ViewModel/RecipeManageViewModel.cs b/BPASmartClient.MorkCL/ViewModel/RecipeManageViewModel.cs index a2e1a41d..dbeb38fc 100644 --- a/BPASmartClient.MorkCL/ViewModel/RecipeManageViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/RecipeManageViewModel.cs @@ -105,22 +105,30 @@ namespace BPASmartClient.MorkCL.ViewModel #endregion var tempDeviceType = EDeviceType.无; - FryPanSelectView selectView = new(); - if (selectView.ShowDialog() == true) + if (data.DishType==Model.Recipe.EDishType.炒菜) { - switch (FryPanSelectViewModel.DeviceType) + FryPanSelectView selectView = new(); + if (selectView.ShowDialog() == true) { - case EDeviceType.炒锅1: - case EDeviceType.炒锅2: - tempDeviceType = FryPanSelectViewModel.DeviceType; - break; + switch (FryPanSelectViewModel.DeviceType) + { + case EDeviceType.炒锅1: + case EDeviceType.炒锅2: + tempDeviceType = FryPanSelectViewModel.DeviceType; + break; - default: - return; + default: + return; + } } + else + return; } else - return; + { + tempDeviceType = EDeviceType.压力锅; + } + data.DeviceType= tempDeviceType; ActionManage.GetInstance.Send(NotifyTopic.FormulaDistribution, data); diff --git a/BPASmartClient.MorkCL/ViewModel/testViewModel.cs b/BPASmartClient.MorkCL/ViewModel/testViewModel.cs index 8730e3f7..af2f177e 100644 --- a/BPASmartClient.MorkCL/ViewModel/testViewModel.cs +++ b/BPASmartClient.MorkCL/ViewModel/testViewModel.cs @@ -8,14 +8,10 @@ namespace BPASmartClient.MorkCL.ViewModel { public testViewModel() { - TBS = new(SqliteHelper.GetInstance.GetAccessories()); - testCommand = new BPARelayCommand(() => { - - ControlData cd = new ControlData(); cd.Name = "莲白回锅"; cd.DeviceType = EDeviceType.炒锅1; @@ -109,12 +105,8 @@ namespace BPASmartClient.MorkCL.ViewModel // Name = $"AccessoriesTB{i}" // }); - // SqliteHelper.GetInstance.AddIngredients(new Model.DB.IngredientsTB() - // { - // Description = "IngredientsTB", - // Loc = 1, - // Name = $"IngredientsTB{i}" - // }); + // SqliteHelper.GetInstance.AddIngredients(new Model.DB.IngredientsTB() { + // Description = "IngredientsTB", Loc = 1, Name = $"IngredientsTB{i}" }); // SqliteHelper.GetInstance.AddSeasoning(new Model.DB.SeasoningTB() // { @@ -169,6 +161,6 @@ namespace BPASmartClient.MorkCL.ViewModel public BPARelayCommand testCommand { get; set; } - public ObservableCollection TBS { get; set; } + public ObservableCollection TBS { get; set; } } } \ No newline at end of file diff --git a/BPASmartClient.ScreenALL/App.xaml b/BPASmartClient.ScreenALL/App.xaml index ac841497..3ca651bb 100644 --- a/BPASmartClient.ScreenALL/App.xaml +++ b/BPASmartClient.ScreenALL/App.xaml @@ -1,8 +1,7 @@ - - - - + +