From b14f307cd2a42524160998cdd43d372260850790 Mon Sep 17 00:00:00 2001 From: NXX <447201003@qq> Date: Sat, 11 Jun 2022 16:17:11 +0800 Subject: [PATCH 1/4] MiorkT --- BPASmartClient.DRCoffee/CoffeeMachine.cs | 3 + BPASmartClient.Juicer/JuicerMachine.cs | 2 + BPASmartClient.KLMCoffee/CoffeeMachine.cs | 32 +- BPASmartClient.Lebai/LebaiRobot.cs | 4 +- BPASmartClient.LebaiRobot/LebaiHelper.cs | 32 ++ .../乐白机器人/Enum/Lebai_qsqdCode.cs | 1 + .../乐白机器人/LebaiRobotEvent.cs | 3 +- BPASmartClient.MorkT/Control_MorkT.cs | 26 +- BPASmartClient.MorkT/View/DebugView.xaml | 14 +- .../ViewModel/DebugViewModel.cs | 21 +- ...Q.csproj => BPASmartClient.MorkTHQ.csproj} | 0 ...Control_MorkT_HQ.cs => Control_MorkTHQ.cs} | 394 +++++++++++------- .../{GLV_MorkT_HQ.cs => GLV_MorkTHQ.cs} | 45 +- BPASmartClient.MorkT_HQ/OrderLocInfo.cs | 4 +- BPASmartClient.MorkT_HQ/PolymerBatching.cs | 6 +- BPASmartClient.MorkT_HQ/View/DebugView.xaml | 65 +-- .../View/DebugView.xaml.cs | 2 +- BPASmartClient.MorkT_HQ/View/Monitor.xaml | 6 +- BPASmartClient.MorkT_HQ/View/Monitor.xaml.cs | 2 +- BPASmartClient.MorkT_HQ/View/ParSer.xaml | 4 +- BPASmartClient.MorkT_HQ/View/ParSer.xaml.cs | 2 +- .../ViewModel/DebugViewModel.cs | 93 ++++- .../ViewModel/MonitorViewModel.cs | 2 +- BPASmartClient.SCChip/CommandHandler.cs | 4 +- BPASmartClient.SCChip/ICChipMachine.cs | 6 +- SmartClient.sln | 2 +- 26 files changed, 536 insertions(+), 239 deletions(-) rename BPASmartClient.MorkT_HQ/{BPASmartClient.MorkT_HQ.csproj => BPASmartClient.MorkTHQ.csproj} (100%) rename BPASmartClient.MorkT_HQ/{Control_MorkT_HQ.cs => Control_MorkTHQ.cs} (69%) rename BPASmartClient.MorkT_HQ/{GLV_MorkT_HQ.cs => GLV_MorkTHQ.cs} (69%) diff --git a/BPASmartClient.DRCoffee/CoffeeMachine.cs b/BPASmartClient.DRCoffee/CoffeeMachine.cs index 40464a54..2bd9da96 100644 --- a/BPASmartClient.DRCoffee/CoffeeMachine.cs +++ b/BPASmartClient.DRCoffee/CoffeeMachine.cs @@ -191,6 +191,7 @@ namespace BPASmartClient.DRCoffee commProxy.SendData(DrCoffee.Packe(drinksOrder)); Thread.Sleep(200); free = false; + MessageLog.GetInstance.Show($"咖啡机: 制作咖啡指令"); } catch (Exception ex) { @@ -210,6 +211,7 @@ namespace BPASmartClient.DRCoffee commProxy.SendData(DrCoffee.Packe(drinksOrder)); Thread.Sleep(200); free = false; + MessageLog.GetInstance.Show($"咖啡机: 咖啡取消指令"); } catch (Exception ex) { @@ -228,6 +230,7 @@ namespace BPASmartClient.DRCoffee commProxy.SendData(DrCoffee.Packe(drinksOrder)); Thread.Sleep(200); free = false; + MessageLog.GetInstance.Show($"咖啡机: 咖啡模式设置指令"); } catch (Exception ex) { diff --git a/BPASmartClient.Juicer/JuicerMachine.cs b/BPASmartClient.Juicer/JuicerMachine.cs index 047e3770..d1d31366 100644 --- a/BPASmartClient.Juicer/JuicerMachine.cs +++ b/BPASmartClient.Juicer/JuicerMachine.cs @@ -17,6 +17,7 @@ namespace BPASmartClient.Juicer ThreadManage.GetInstance().StartLong(new Action(() => { IsConnected = juicerHelper.IsOpen; + status["JuiceIsConnect"] = juicerHelper.IsOpen; if (!IsConnected) IsWork = false; while (IsConnected) { @@ -24,6 +25,7 @@ namespace BPASmartClient.Juicer if (status != null) { SetStatus("GetDeviceStatus", juicerHelper.GetDeviceStatus()); + } Thread.Sleep(500); } diff --git a/BPASmartClient.KLMCoffee/CoffeeMachine.cs b/BPASmartClient.KLMCoffee/CoffeeMachine.cs index ae5519cf..1c084580 100644 --- a/BPASmartClient.KLMCoffee/CoffeeMachine.cs +++ b/BPASmartClient.KLMCoffee/CoffeeMachine.cs @@ -139,12 +139,18 @@ namespace BPASmartClient.KLMCoffee SystemStatusModel systemStatus = new K95Command().StateResolution(data); if (systemStatus != null) { - status["Status"] = systemStatus.temStatus; - status["drinkType"] = systemStatus.drinkType; - status["AppStatus"] = systemStatus.taskIndex; - status["progress"] = systemStatus.progress; - status["Warning"] = systemStatus.faultMessage.dataFault(); - status["Keep"] = systemStatus.upkeepMessage; + status["CoffeeIsconnected"] = OnLine; + if((K95SysTemStatus)status["Status"] == K95SysTemStatus.正在制作咖啡&&systemStatus.temStatus != K95SysTemStatus.正在制作咖啡) + { + status["Status"] = systemStatus.temStatus; + EventBus.EventBus.GetInstance().Publish(new KLMCoffee_CoffeEndCookEvent { DeviceId = DeviceId }); + } + else status["CoffeeStatus"] = systemStatus.temStatus; + status["CoffeedrinkType"] = systemStatus.drinkType; + status["CoffeeAppStatus"] = systemStatus.taskIndex; + status["Coffeeprogress"] = systemStatus.progress; + status["CoffeeWarning"] = systemStatus.faultMessage.dataFault(); + status["CoffeeKeep"] = systemStatus.upkeepMessage; if (systemStatus.faultMessage.IsFault() || systemStatus.upkeepMessage.IsUpkeep()) IsWork = false; else @@ -160,18 +166,18 @@ namespace BPASmartClient.KLMCoffee protected override void InitStatus() { - status["Status"] = K95SysTemStatus.空闲状态; - status["drinkType"] = DrinkType.意式; - status["AppStatus"] = TaskIndex.无任务; - status["progress"] = 0; - status["Warning"] = new FaultMessage(0x00, 0x00).dataFault(); - status["Keep"] = new UpkeepMessage(0x00).dataFault(); + status["CoffeeStatus"] = K95SysTemStatus.空闲状态; + status["CoffeedrinkType"] = DrinkType.意式; + status["CoffeeAppStatus"] = TaskIndex.无任务; + status["Coffeeprogress"] = 0; + status["CoffeeWarning"] = new FaultMessage(0x00, 0x00).dataFault(); + status["CoffeeKeep"] = new UpkeepMessage(0x00).dataFault(); } public override void Init() { - commProxy = new SerialPortClient(PortName, (BaudRates)Enum.Parse(typeof(BaudRates), BaudRate)); + commProxy = new SerialPortClient(communicationPar.SerialPort, (BaudRates)communicationPar.BaudRate); commProxy.SetDataStorage(dataStorage); //伽乐美咖啡机制作 diff --git a/BPASmartClient.Lebai/LebaiRobot.cs b/BPASmartClient.Lebai/LebaiRobot.cs index 62071417..9c66c5bc 100644 --- a/BPASmartClient.Lebai/LebaiRobot.cs +++ b/BPASmartClient.Lebai/LebaiRobot.cs @@ -136,9 +136,9 @@ namespace BPASmartClient.Lebai EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (@event == null) return; - if (@event is LebaiRobot_LebaiSenceEvent lebaiSenceEvent) + if (@event is LebaiRobot_SetOutPutEvent SetOutEvent) { - + LebaiHelper.GetInstance().SetOutput(SetOutEvent.bDO, SetOutEvent.pin); } }); diff --git a/BPASmartClient.LebaiRobot/LebaiHelper.cs b/BPASmartClient.LebaiRobot/LebaiHelper.cs index 91f68806..8632e8b5 100644 --- a/BPASmartClient.LebaiRobot/LebaiHelper.cs +++ b/BPASmartClient.LebaiRobot/LebaiHelper.cs @@ -312,5 +312,37 @@ namespace BPASmartClient.LebaiRobot await client?.RunScene(id); MessageLog.GetInstance.Show($"调用场景:{id}"); } + /// + /// 设置输出 + /// + /// + /// + public void SetOutput(bool bDO, int pin = 0) + { + try + { + if (client == null) { return; } + var res = client.SetDIO(new DIO() { Pin = pin, Value = bDO ? 1 : 0 }); + + } + catch (Exception ex) + { + MessageLog.GetInstance.ShowEx(ex.ToString()); + } + } + + public void MoveL(double pose) + { + //try + //{ + // if (client == null) { return; } + // var res = client.MovePT(new PVATRequest() { }) + + //} + //catch (Exception ex) + //{ + // MessageLog.GetInstance.ShowEx(ex.ToString()); + //} + } } } diff --git a/BPASmartClient.Model/乐白机器人/Enum/Lebai_qsqdCode.cs b/BPASmartClient.Model/乐白机器人/Enum/Lebai_qsqdCode.cs index 42d7557e..a6505da7 100644 --- a/BPASmartClient.Model/乐白机器人/Enum/Lebai_qsqdCode.cs +++ b/BPASmartClient.Model/乐白机器人/Enum/Lebai_qsqdCode.cs @@ -29,6 +29,7 @@ namespace BPASmartClient.Model.乐白机器人.Enum public const int SENCE_冰淇淋杯回原点 = 10049; public const int SENCE_取咖啡出餐 = 10052; + public const int SENCE_机器人回原点 = 10058; // 单片机冰淇淋机器场景 public const int SENCE_单片机接冰淇淋 = 10055; public const int SENCE_单片机放冰淇淋位置 = 10056; diff --git a/BPASmartClient.Model/乐白机器人/LebaiRobotEvent.cs b/BPASmartClient.Model/乐白机器人/LebaiRobotEvent.cs index 090b189f..7ae3093a 100644 --- a/BPASmartClient.Model/乐白机器人/LebaiRobotEvent.cs +++ b/BPASmartClient.Model/乐白机器人/LebaiRobotEvent.cs @@ -48,7 +48,8 @@ namespace BPASmartClient.Model.乐白机器人 public class LebaiRobot_SetOutPutEvent : BaseEvent { - public int RobotSetOut { get; set; } + public bool bDO { get; set; } = true; + public int pin { get; set; } } } diff --git a/BPASmartClient.MorkT/Control_MorkT.cs b/BPASmartClient.MorkT/Control_MorkT.cs index ee205f58..19a56e14 100644 --- a/BPASmartClient.MorkT/Control_MorkT.cs +++ b/BPASmartClient.MorkT/Control_MorkT.cs @@ -432,7 +432,7 @@ namespace BPASmartClient.MorkT /// private void DoCoffeeQC(OrderLocInfo order) { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10052 }); //SENCE_取咖啡出餐 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡出餐 }); //SENCE_取咖啡出餐 Wait(); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); //订单状态改变:完成 @@ -451,7 +451,7 @@ namespace BPASmartClient.MorkT { EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ }); OrderChange(order.SuborderId, ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10031 }); //SENCE_取咖啡杯 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取咖啡杯 }); //SENCE_取咖啡杯 Wait(); EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制 @@ -461,7 +461,7 @@ namespace BPASmartClient.MorkT int count = 1; bool result = true; p: - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10033 }); //SENCE_咖啡杯检测 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯检测 }); //SENCE_咖啡杯检测 Wait(); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o)=> @@ -478,14 +478,14 @@ namespace BPASmartClient.MorkT { //退出循环回到初始位置 DeviceProcessLogShow($"执行{count}次取咖啡杯,仍为成功,订单默认废弃,机器人回到初始位置!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10050 }); //SENCE_咖啡杯回原点 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_咖啡杯回原点 }); //SENCE_咖啡杯回原点 Wait(); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); morkT.GetCoffeeCup = false; return; } DeviceProcessLogShow("执行二次取咖啡杯"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10035 }); //SENCE_二次取咖啡杯 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取咖啡杯 }); //SENCE_二次取咖啡杯 Wait(); EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制 EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); @@ -575,7 +575,7 @@ namespace BPASmartClient.MorkT { MessageLog.GetInstance.Show("准备开始制作冰淇淋"); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10032 }); //SENCE_取冰淇淋杯 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_取冰淇淋杯 }); //SENCE_取冰淇淋杯 Wait(); EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 Thread.Sleep(500); @@ -592,7 +592,7 @@ namespace BPASmartClient.MorkT bool result = true; EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); p: - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10034 }); //SENCE_冰淇淋杯检测 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯检测 }); //SENCE_冰淇淋杯检测 Wait(); Thread.Sleep(500); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => @@ -627,14 +627,14 @@ namespace BPASmartClient.MorkT { //退出循环回到初始位置 DeviceProcessLogShow($"执行{count}次取冰淇淋杯,仍未成功,订单默认废弃,机器人回到初始位置!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10049 }); //SENCE_冰淇淋杯回原点 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_冰淇淋杯回原点 }); //SENCE_冰淇淋杯回原点 Wait(); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 },(o) => { }); morkT.GetIceCreamCup = false; return; } DeviceProcessLogShow($"执行{count}次取冰淇淋杯!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10036 }); //SENCE_二次取冰淇淋杯 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_二次取冰淇淋杯 }); //SENCE_二次取冰淇淋杯 EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 Wait(); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); @@ -655,7 +655,7 @@ namespace BPASmartClient.MorkT //EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent {DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); OrderChange(order.SuborderId, ORDER_STATUS.COOKING); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10055 }); //SENCE_接1号冰淇淋 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_单片机接冰淇淋 }); //SENCE_接1号冰淇淋 Wait(); bool doItResult = true; @@ -663,7 +663,9 @@ namespace BPASmartClient.MorkT //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); //Thread.Sleep(500); //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); - //EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId=DeviceId,}) + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = true ,pin = 1}); + Thread.Sleep(500); + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = false, pin = 1 }); Thread.Sleep(500); EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料 @@ -714,7 +716,7 @@ namespace BPASmartClient.MorkT Thread.Sleep(500); } - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10056 }); //SENCE_放冰淇淋位置 + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_放冰淇淋位置 }); //SENCE_放冰淇淋位置 Wait(); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); //订单状态改变:完成 diff --git a/BPASmartClient.MorkT/View/DebugView.xaml b/BPASmartClient.MorkT/View/DebugView.xaml index a0ce2f63..9635229e 100644 --- a/BPASmartClient.MorkT/View/DebugView.xaml +++ b/BPASmartClient.MorkT/View/DebugView.xaml @@ -79,10 +79,16 @@ Command="{Binding Button_RobotControlCommand}" CommandParameter="机器人急停"/> + + + - - + { }); + //MessageLog.GetInstance.Show("开始执行乐白机器人回原点"); + //EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_qsqdCode.SENCE_机器人回原点 }); + //MessageLog.GetInstance.Show("开始执行乐白机器人回原点-----"); + } + #endregion #region 冰淇淋机器 @@ -222,10 +233,13 @@ namespace BPASmartClient.MorkT.ViewModel private void Button_SCChipRefrigeration() { - EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); + //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); + //Thread.Sleep(500); + //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = true, pin = 1 }); Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); - + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetOutPutEvent { DeviceId = DeviceId, bDO = false, pin = 1 }); + } private void Button_SCChipDischarge() @@ -248,6 +262,7 @@ namespace BPASmartClient.MorkT.ViewModel { Button_RobotControlCommand = new RelayCommand(Button_RobotControl); Button_SetValueCommand = new RelayCommand(Button_SetValue); + Button_GoToHomeCommand = new RelayCommand(Button_GoToHome); Button_MakeIceCreamCommand = new RelayCommand(Button_MakeIceCream); Button_SetIceCreamModelCommand = new RelayCommand(Button_SetIceCreamModel); diff --git a/BPASmartClient.MorkT_HQ/BPASmartClient.MorkT_HQ.csproj b/BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj similarity index 100% rename from BPASmartClient.MorkT_HQ/BPASmartClient.MorkT_HQ.csproj rename to BPASmartClient.MorkT_HQ/BPASmartClient.MorkTHQ.csproj diff --git a/BPASmartClient.MorkT_HQ/Control_MorkT_HQ.cs b/BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs similarity index 69% rename from BPASmartClient.MorkT_HQ/Control_MorkT_HQ.cs rename to BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs index d4cef71f..0f3785a6 100644 --- a/BPASmartClient.MorkT_HQ/Control_MorkT_HQ.cs +++ b/BPASmartClient.MorkT_HQ/Control_MorkTHQ.cs @@ -1,4 +1,5 @@ -using BPA.Message.Enum; +using BPA.Message; +using BPA.Message.Enum; using BPASmartClient.Device; using BPASmartClient.DRCoffee; using BPASmartClient.EventBus; @@ -22,14 +23,14 @@ using System.Threading; using System.Threading.Tasks; using static BPASmartClient.EventBus.EventBus; -namespace BPASmartClient.MorkT_HQ +namespace BPASmartClient.MorkTHQ { - public class Control_MorkT_HQ : BaseDevice + public class Control_MorkTHQ : BaseDevice { public override global::BPA.Message.Enum.DeviceClientType DeviceType { get { return BPA.Message.Enum.DeviceClientType.MORKT; } } - GLV_MorkT_HQ morkT = new GLV_MorkT_HQ(); - + GLV_MorkTHQ morkT = new GLV_MorkTHQ(); + int[] devStatusBy = new int[2] { 0, 0 }; public override void DoMain() { @@ -40,7 +41,7 @@ namespace BPASmartClient.MorkT_HQ IsHealth = true; ServerInit(); DataParse(); - EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) + EventBus.EventBus.GetInstance().Subscribe(DeviceId, delegate (IEvent @event, EventCallBackHandle callBack) { if (morkT.MakeCoffeeOrder != null) morkT.MakeCoffeeOrder.OrderStatus = 1; @@ -55,7 +56,7 @@ namespace BPASmartClient.MorkT_HQ public override void ResetProgram() { morkT = null; - morkT = new GLV_MorkT_HQ(); + morkT = new GLV_MorkTHQ(); } @@ -72,34 +73,16 @@ namespace BPASmartClient.MorkT_HQ public override void MainTask() { - if (morkT.waitMorkOrder != null)//更新订单取走状态 - { - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent() { DeviceId = DeviceId, Pin = 0 }, (o) => - { - if (o != null && o.Length > 0 && o[0] is bool res) - { - if (!res) - { - OrderChange(morkT.waitMorkOrder.SuborderId, ORDER_STATUS.COMPLETED_TAKE); - DeviceProcessLogShow("订单取餐完成"); - morkT.waitMorkOrder = null; - } - } - }); - } + //制作咖啡 MakeCoffeeProcess(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 0 },(o)=> - { - if(o != null && o.Length > 0 && o[0] is bool resultValue) - { - if(!resultValue)//取餐口有空余位置 - { - MakeIceCreamProcess(); - MakeCoffeeComplete(); - } - } - }); - + //制作果汁 + MakeJuiceProcess(); + //制作冰淇淋 + MakeIceCreamProcess(); + //制作完取咖啡 + MakeCoffeeComplete(); + + } @@ -232,6 +215,14 @@ namespace BPASmartClient.MorkT_HQ morkT.CaffeeFault = coffeeFault; } })); + GetStatus("Coffeeprogress", new Action((o) => + { + if (o is int coffeeFault) + { + morkT.Coffeeprogress = coffeeFault; + } + })); + GetStatus("SCChipIsConnect", new Action((o) => { if (o is bool b) @@ -239,6 +230,13 @@ namespace BPASmartClient.MorkT_HQ morkT.SCChipIsConnect = b; } })); + GetStatus("JuiceIsConnect", new Action((o) => + { + if (o is bool b) + { + morkT.JuiceIsConnect = b; + } + })); } @@ -333,6 +331,20 @@ namespace BPASmartClient.MorkT_HQ }); } break; + case GOODS_TYPE.JUICE: + if(morkT.morkOrderPushesIceCream.FirstOrDefault(p=>p.SuborderId == order?.MorkOrder.SuborderId) == null) + { + morkT.GuMake = order.MorkOrder.MakeID == "2"; + morkT.morkOrderPushesJuice.Enqueue(new OrderLocInfo() + { + SuborderId = order.MorkOrder.SuborderId, + BatchingId = res.BatchingId, + Loc = loc_Goods, + GoodsName = order.MorkOrder.GoodsName, + SortNum = order.MorkOrder.SortNum + }); + } + break; case GOODS_TYPE.NEITHER: DeviceProcessLogShow("未知的商品类型"); break; @@ -371,6 +383,7 @@ namespace BPASmartClient.MorkT_HQ } } + #region 咖啡 /// /// 是否可以开始制作咖啡 /// @@ -397,7 +410,7 @@ namespace BPASmartClient.MorkT_HQ EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10051}); //接咖啡后回原点 Wait(); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new DRCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (Model.咖啡机.Enum.DrCoffeeDrinksCode)int.Parse(orderLoc.Loc) });//接咖啡控制 + EventBus.EventBus.GetInstance().Publish(new KLMCoffee_MakeCoffeeEvent() {DeviceId = DeviceId, DrinkCode = (Model.咖啡机.Enum.DrinkType)int.Parse(orderLoc.Loc) });//接咖啡控制 DeviceProcessLogShow($"发送咖啡机制作{orderLoc.Loc}!"); morkT.IsCoffeeMake = true; morkT.MakeCoffeeOrder = orderLoc; } @@ -450,50 +463,16 @@ namespace BPASmartClient.MorkT_HQ EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 },(o)=>{ }); OrderChange(order.SuborderId, ORDER_STATUS.COOKING); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10031 }); //SENCE_取咖啡杯 - Wait(); - EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId= DeviceId ,Cup = IC_CUP.CUP_COFFEE});//落碗控制 Thread.Sleep(500); - DeviceProcessLogShow("尝试取咖啡杯!"); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - int count = 1; - bool result = true; - p: - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10033 }); //SENCE_咖啡杯检测 - Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetTCPInputEvent { DeviceId = DeviceId, Pin = 1 }, (o)=> - { - if(o != null && o.Length > 0 && o[0] is bool resultValue) - { - result = resultValue; - } - }); - - if (!result) - { - if (count >= 3) - { - //退出循环回到初始位置 - DeviceProcessLogShow($"执行{count}次取咖啡杯,仍为成功,订单默认废弃,机器人回到初始位置!"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10050 }); //SENCE_咖啡杯回原点 - Wait(); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - morkT.GetCoffeeCup = false; - return; - } - DeviceProcessLogShow("执行二次取咖啡杯"); - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10035 }); //SENCE_二次取咖啡杯 - Wait(); - EventBus.EventBus.GetInstance().Equals(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_COFFEE });//落碗控制 - EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); - count++; - goto p; - } + morkT.GetCoffeeCup = true; DeviceProcessLogShow("取咖啡杯完成"); } + #endregion + #region 冰淇淋 /// /// 冰淇淋是否可以开始制作 /// @@ -509,45 +488,40 @@ namespace BPASmartClient.MorkT_HQ /// private void MakeIceCreamProcess() { - //if (IceCreamCanMake()) - //{ - if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order)) - { - DoIceCream(order); - } - - //if(peripheralStatus.ContainsKey("IceCreamCurrentMode")) - //{ - // if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); - //} - - //if(peripheralStatus.ContainsKey("IceCreamCXB")) - //{ - // if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作 - // { - // bool result = true; - // EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => - // { - // if (res[0] is bool resultValue) - // { - // result = resultValue; - // } - // }); - // if (result) - // { - // if (morkT.IceIsOK) DeviceProcessLogShow("请检查冰淇淋出料口有无遮挡"); - // morkT.IceIsOK = false; - // } - // else if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order)) - // { - // morkT.IceIsOK = true; - // DeviceProcessLogShow($"开始制作 [冰淇淋] 订单[{order.SortNum}]"); - // DoIceCream(order); - // } - // } - //} + if (IceCreamCanMake()) + { + if (peripheralStatus.ContainsKey("IceCreamCurrentMode")) + { + if ((MORKI_MODE)peripheralStatus["IceCreamCurrentMode"] != MORKI_MODE.制冷模式) EventBus.EventBus.GetInstance().Publish(new GSIceCream_ModeSetEvent { DeviceId = DeviceId, Mode = MORKI_MODE.制冷模式 }); + } - //} + if (peripheralStatus.ContainsKey("IceCreamCXB")) + { + if ((byte)peripheralStatus["IceCreamCXB"] >= 86 && morkT.morkOrderPushesIceCream.Count > 0)//成型比大于86才可以制作 + { + bool result = true; + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_GetInputEvent { DeviceId = DeviceId, Pin = 3 }, (res) => + { + if (res[0] is bool resultValue) + { + result = resultValue; + } + }); + if (result) + { + if (morkT.IceIsOK) DeviceProcessLogShow("请检查冰淇淋出料口有无遮挡"); + morkT.IceIsOK = false; + } + else if (morkT.morkOrderPushesIceCream.TryDequeue(out OrderLocInfo order)) + { + morkT.IceIsOK = true; + DeviceProcessLogShow($"开始制作 [冰淇淋] 订单[{order.SortNum}]"); + DoIceCream(order); + } + } + } + + } } @@ -557,12 +531,9 @@ namespace BPASmartClient.MorkT_HQ private void DoIceCream(OrderLocInfo order) { GetIceCreamCup(); - CheckICeCreaCup(); - if(morkT.GetIceCreamCup) - { - GetIceCream(order); - PutIceCream(order); - } + //CheckICeCreaCup(); + GetIceCream(order); + PutIceCream(order); } @@ -575,7 +546,6 @@ namespace BPASmartClient.MorkT_HQ EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 0 }, (o) => { }); EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 10032 }); //SENCE_取冰淇淋杯 Wait(); - EventBus.EventBus.GetInstance().Publish(new SCChip_TakeCupEvent { DeviceId = DeviceId, Cup = IC_CUP.CUP_ICECREAM });//落碗控制 Thread.Sleep(500); DeviceProcessLogShow("尝试取冰淇淋杯!"); @@ -657,37 +627,37 @@ namespace BPASmartClient.MorkT_HQ Wait(); bool doItResult = true; - //出料 - EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); - Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); - Thread.Sleep(500); - EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料 - DeviceProcessLogShow("开始等待6s"); - Thread.Sleep(5000); + ////出料 + //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = true }); + //Thread.Sleep(500); + //EventBus.EventBus.GetInstance().Publish(new SCChip_RotorSwitchEvent { DeviceId = DeviceId, TurnOn = false }); + //Thread.Sleep(500); + //EventBus.EventBus.GetInstance().Publish(new SCChip_MakeIceCreamEvent { DeviceId = DeviceId, SteeringEngine = IC_SE.SE_2 });//冰淇淋出料 + //DeviceProcessLogShow("开始等待6s"); + //Thread.Sleep(5000); + + // 出料 + EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId }, (o) => + { + doItResult = (bool)o[0]; + }); + if (doItResult) + { + IceCreamCookCheck(); + } + else + { + int count_1 = 0; - //出料 - //EventBus.EventBus.GetInstance().Publish(new GSIceCream_DischargeEvent { DeviceId = DeviceId },(o)=> - //{ - // doItResult = (bool)o[0]; - //}); - //if (doItResult) - //{ - // IceCreamCookCheck(); - //} - //else - //{ - // int count_1 = 0; - - // while ((byte)peripheralStatus["IceCreamCXB"] <= 86) - // { - // Thread.Sleep(5); - // count_1++; - // if (count_1 >= 2000) - // break; - // } - // IceCreamCookCheck(); - //} + while ((byte)peripheralStatus["IceCreamCXB"] <= 86) + { + Thread.Sleep(5); + count_1++; + if (count_1 >= 2000) + break; + } + IceCreamCookCheck(); + } EventBus.EventBus.GetInstance().Publish(new LebaiRobot_SetValueEvent { DeviceId = DeviceId, RobotSetValue = 1 }, (o) => { }); } @@ -757,10 +727,138 @@ namespace BPASmartClient.MorkT_HQ Thread.Sleep(5000); } + #endregion + #region 果汁 + /// + /// 制作果汁流程 + /// + private void MakeJuiceProcess() + { + if(morkT.morkOrderPushesJuice.TryDequeue(out OrderLocInfo order)) + { + OrderChange(order.SuborderId, BPA.Message.Enum.ORDER_STATUS.COOKING); + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = 11111 });//SENCE_取果汁杯位置 + int JuicerNum1 = int.Parse(order.Loc); + switch (JuicerNum1) + { + case 52: + if (morkT.GuMake) + { + morkT.JuicerNum = 0x00; + } + else + { + morkT.JuicerNum = 0x01; + } + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + Wait(); + + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 }); + Wait(); + break; + case 53: + if (morkT.GuMake) + { + morkT.JuicerNum = 0x02; + } + else + { + morkT.JuicerNum = 0x03; + } + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + Wait(); + + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接2号果汁位置 }); + Wait(); + break; + case 54: + if (morkT.GuMake) + { + morkT.JuicerNum = 0x04; + } + else + { + morkT.JuicerNum = 0x05; + } + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + Wait(); + + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接3号果汁位置 }); + Wait(); + break; + case 55: + if (morkT.GuMake) + { + morkT.JuicerNum = 0x06; + } + else + { + morkT.JuicerNum = 0x07; + } + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + Wait(); + + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接4号果汁位置 }); + Wait(); + break; + default: + morkT.JuicerNum = 0x00; + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接果汁公共位置 }); + Wait(); + + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_接1号果汁位置 }); + Wait(); + break; + } + var devStatus = GetDeviceStatus("GetDeviceStatus"); + var devStatus1 = Convert.ToString(devStatus[0], 2); + var devStatus2 = devStatus[1]; + + if (devStatus1.IndexOf("0") == 1 && devStatus2 == 0) + { + EventBus.EventBus.GetInstance().Publish(new WriteJuicer() { Value = morkT.JuicerNum }); + Thread.Sleep(100); + devStatusBy = GetDeviceStatus("GetDeviceStatus"); + while (!(devStatusBy[1] == 0)) + { + Thread.Sleep(100); + devStatusBy = GetDeviceStatus("GetDeviceStatus"); + while (devStatusBy.Length != 2) + { + Thread.Sleep(100); + devStatusBy = GetDeviceStatus("GetDeviceStatus"); + } + } + devStatusBy = GetDeviceStatus("GetDeviceStatus"); + Thread.Sleep(5000); + EventBus.EventBus.GetInstance().Publish(new LebaiRobot_LebaiSenceEvent { DeviceId = DeviceId, LebaiSence = Lebai_HQ.SENCE_放果汁杯位置后回原点 }); + Wait(); + + OrderChange(order.SuborderId, BPA.Message.Enum.ORDER_STATUS.COMPLETED_TAKE); + MessageLog.GetInstance.Show("果汁制作完成"); + } + } + + + + } + + private T GetDeviceStatus(string key) + { + if (peripheralStatus.ContainsKey(key)) + { + if (peripheralStatus[key] != null) + { + return (T)(peripheralStatus[key]); + } + } + return default; + } + #endregion public override void SimOrder() { - throw new NotImplementedException(); + } } } diff --git a/BPASmartClient.MorkT_HQ/GLV_MorkT_HQ.cs b/BPASmartClient.MorkT_HQ/GLV_MorkTHQ.cs similarity index 69% rename from BPASmartClient.MorkT_HQ/GLV_MorkT_HQ.cs rename to BPASmartClient.MorkT_HQ/GLV_MorkTHQ.cs index 1b337a82..0a67253e 100644 --- a/BPASmartClient.MorkT_HQ/GLV_MorkT_HQ.cs +++ b/BPASmartClient.MorkT_HQ/GLV_MorkTHQ.cs @@ -11,9 +11,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace BPASmartClient.MorkT_HQ +namespace BPASmartClient.MorkTHQ { - public class GLV_MorkT_HQ:IStatus + public class GLV_MorkTHQ:IStatus { /// /// 咖啡订单队列 @@ -25,6 +25,10 @@ namespace BPASmartClient.MorkT_HQ /// public ConcurrentQueue morkOrderPushesIceCream = new ConcurrentQueue(); /// + /// 果汁订单队列 + /// + public ConcurrentQueue morkOrderPushesJuice = new ConcurrentQueue(); + /// /// 等待取餐订单 /// public OrderLocInfo waitMorkOrder = null; @@ -57,6 +61,16 @@ namespace BPASmartClient.MorkT_HQ /// public bool GetIceCreamCup; + /// + /// 果汁机做法,true:热饮,false:冷饮 + /// + public bool GuMake = false; + + /// + /// 果汁机控制信号 + /// + public byte JuicerNum; + #region [VariableMonitor("机器人连接状态")] @@ -110,9 +124,36 @@ namespace BPASmartClient.MorkT_HQ [VariableMonitor("咖啡机故障")] public DrCoffeeFault CaffeeFault { get; set; } + [VariableMonitor("咖啡机制作进度")] + public int Coffeeprogress { get; set; } + [VariableMonitor("单片机连接状态")] public bool SCChipIsConnect { get; set; } + + [VariableMonitor("果汁机连接状态")] + public bool JuiceIsConnect { get; set; } + #endregion + } + + public class Lebai_HQ + { + #region 环球设备 + public const int SENCE_取咖啡杯 = 10001; + public const int SENCE_取冰淇淋杯 = 10002; + public const int SENCE_接咖啡后回原点 = 10003; + public const int SENCE_取咖啡出餐 = 10004; + public const int SENCE_接1号冰淇淋 = 10005; + public const int SENCE_放冰淇淋位置 = 10006; + public const int SENCE_取果汁杯位置 = 10007; + public const int SENCE_接果汁公共位置 = 10008; + public const int SENCE_接1号果汁位置 = 10009; + public const int SENCE_接2号果汁位置 = 10010; + public const int SENCE_接3号果汁位置 = 10011; + public const int SENCE_接4号果汁位置 = 10012; + public const int SENCE_放果汁杯位置后回原点 = 10013; + + #endregion } } diff --git a/BPASmartClient.MorkT_HQ/OrderLocInfo.cs b/BPASmartClient.MorkT_HQ/OrderLocInfo.cs index 4e78cecd..ee011066 100644 --- a/BPASmartClient.MorkT_HQ/OrderLocInfo.cs +++ b/BPASmartClient.MorkT_HQ/OrderLocInfo.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace BPASmartClient.MorkT_HQ +namespace BPASmartClient.MorkTHQ { public class OrderLocInfo { @@ -16,7 +16,7 @@ namespace BPASmartClient.MorkT_HQ public int OrderStatus { get; set; } - + public string MakeID { get; set; } public OrderLocInfo() { OrderStatus = 0; diff --git a/BPASmartClient.MorkT_HQ/PolymerBatching.cs b/BPASmartClient.MorkT_HQ/PolymerBatching.cs index 66a41ab5..0d163ceb 100644 --- a/BPASmartClient.MorkT_HQ/PolymerBatching.cs +++ b/BPASmartClient.MorkT_HQ/PolymerBatching.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace BPASmartClient.MorkT_HQ +namespace BPASmartClient.MorkTHQ { public enum GOODS_TYPE { @@ -29,6 +29,10 @@ namespace BPASmartClient.MorkT_HQ internal const string ICE_MAIN_BATCHIN1_LOC = "52"; internal const string ICE_MAIN_BATCHIN2_LOC = "53"; internal const string ICE_MAIN_BATCHIN3_LOC = "54"; + //internal const string Juicer_MAIN_BATCHIN1_LOC = "52"; + //internal const string Juicer_MAIN_BATCHIN2_LOC = "53"; + //internal const string Juicer_MAIN_BATCHIN3_LOC = "54"; + //internal const string Juicer_MAIN_BATCHIN4_LOC = "55"; internal const string COFFEE_HOLDER_LOC = "30"; internal const string ICE_HOLDER_LOC = "51"; public static Dictionary GOODS_TYPES = new Dictionary() { diff --git a/BPASmartClient.MorkT_HQ/View/DebugView.xaml b/BPASmartClient.MorkT_HQ/View/DebugView.xaml index a8bf758c..30cf3490 100644 --- a/BPASmartClient.MorkT_HQ/View/DebugView.xaml +++ b/BPASmartClient.MorkT_HQ/View/DebugView.xaml @@ -1,9 +1,9 @@ - @@ -25,7 +25,7 @@ - + @@ -198,6 +198,7 @@ + @@ -209,20 +210,23 @@ - 应用状态 + 制作任务 + Text="{Binding CoffeeAppStatus}" Height="23"/> 告警信息 - 故障信息 + Text="{Binding CoffeeWarning}" /> + 保养信息 + Text="{Binding CoffeeFault}" Height="22" Width="60" /> + + @@ -238,28 +242,41 @@ Command="{}" Content="停止制作"/> - - 模式 - -