diff --git a/BPASmartClient.MorkS/Control_Morks.cs b/BPASmartClient.MorkS/Control_Morks.cs index 99ed126a..8ebe8c34 100644 --- a/BPASmartClient.MorkS/Control_Morks.cs +++ b/BPASmartClient.MorkS/Control_Morks.cs @@ -279,7 +279,6 @@ namespace BPASmartClient.MorkS }); } - public override void MainTask() { mORKS.AllowRun = mORKS.InitComplete; @@ -322,8 +321,6 @@ namespace BPASmartClient.MorkS { if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.TakeBowlIdle && !mORKS.TakeBowlInterlock) { - //if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo)) - //{ ushort BowLoc = 0; var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList(); if (res == null || res?.Count == 0) @@ -355,27 +352,6 @@ namespace BPASmartClient.MorkS BowlControl(orderLocInfo); } } - - //if (BowLoc >= 10 && BowLoc <= 11) - //{ - // mORKS.TakeBowlInterlock = true; - // mORKS.TakeBowlId = orderLocInfo.SuborderId; - // TakeBowlControl(BowLoc); - // SetRecipeNumber(orderLocInfo.RecipeNumber); - // OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING); - // DeviceProcessLogShow($"订单【{ mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]"); - //} - - - //之前版本 - //mORKS.TakeBowlId = orderLocInfo.SuborderId; - //TakeBowlControl(orderLocInfo.Loc); - //SetRecipeNumber(orderLocInfo.RecipeNumber); - //OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING); - //DeviceProcessLogShow($"订单【{ mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]"); - //mORKS.TakeBowlInterlock = true; - //} - } } @@ -493,7 +469,6 @@ namespace BPASmartClient.MorkS mORKS.TakeNoodleInterlock = true; } } - } } @@ -547,15 +522,7 @@ namespace BPASmartClient.MorkS } //取餐完成逻辑处理 - //if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.RbOutMealComplete && !mORKS.TakeMealDetect, 2)) - //{ - // OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE); - // DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成"); - // ResetCookComplete(); - // mORKS.OutMealId = string.Empty; - //} - - if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.CookCompleteFlatBit && !mORKS.TakeMealDetect, 2)) + if (Delay.GetInstance("CompleteChange1").Start(mORKS.CookCompleteFlatBit && !mORKS.TakeMealDetect, 2)) { OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE); DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成"); @@ -564,6 +531,15 @@ namespace BPASmartClient.MorkS mORKS.OutMealId = string.Empty; } + //if (DelayRTrig.GetInstance("CompleteChange1").Start(mORKS.CookCompleteFlatBit && !mORKS.TakeMealDetect, 2)) + //{ + // OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE); + // DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成"); + // ResetCookComplete(); + // mORKS.CookCompleteFlatBit = false; + // mORKS.OutMealId = string.Empty; + //} + //机器人取面完成信号检测 if (RTrig.GetInstance("TakeNoodleComplete").Start(mORKS.RbTakeNoodleComplete)) { diff --git a/BPASmartClient.MorkS/GVL_MORKS.cs b/BPASmartClient.MorkS/GVL_MORKS.cs index a889adc4..bc1c6a73 100644 --- a/BPASmartClient.MorkS/GVL_MORKS.cs +++ b/BPASmartClient.MorkS/GVL_MORKS.cs @@ -83,7 +83,6 @@ namespace BPASmartClient.MorkS public bool TurntableInterlock { get; set; } #endregion - /// /// 初始化完成 /// PLC -> M100.0 diff --git a/BPASmartClient.ViewModel/MainViewModel.cs b/BPASmartClient.ViewModel/MainViewModel.cs index 47a3a476..05ecf3df 100644 --- a/BPASmartClient.ViewModel/MainViewModel.cs +++ b/BPASmartClient.ViewModel/MainViewModel.cs @@ -71,15 +71,17 @@ namespace BPASmartClient.ViewModel System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => { NetworkConnectState = UniversalHelper.GetInstance().GetNetworkState(); + CurrentOrderCount = Json.Data.orderLists.Count; })); }; dispatcherTimer.Interval = TimeSpan.FromSeconds(1); dispatcherTimer.Start(); - } - public int CurrentOrderCount { get { return Json.Data.orderLists.Count; } set { OnPropertyChanged(); } } + + public int CurrentOrderCount { get { return _mCurrentOrderCount; } set { _mCurrentOrderCount = value; OnPropertyChanged(); } } + private int _mCurrentOrderCount; public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } } diff --git a/BPASmartClient.ViewModel/OrderStatusViewModel.cs b/BPASmartClient.ViewModel/OrderStatusViewModel.cs index 9e786960..fcab5843 100644 --- a/BPASmartClient.ViewModel/OrderStatusViewModel.cs +++ b/BPASmartClient.ViewModel/OrderStatusViewModel.cs @@ -96,60 +96,6 @@ namespace BPASmartClient.ViewModel }), "AddOrder"); EventBus.EventBus.GetInstance().Subscribe(0, OrderStatusChangedHandle); - - //ActionManage.GetInstance.Register(new Action((o) => - //{ - // if (o is OrderStatusChangedEvent orderStatusChange) - // { - // int index = Array.FindIndex(orderStatusLists.ToArray(), p => p.OrderPush.SuborderId == orderStatusChange.SubOrderId); - // switch (orderStatusChange.Status) - // { - // case ORDER_STATUS.COOKING: - // if (index >= 0 && index < orderStatusLists.Count) - // orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status; - // break; - // case ORDER_STATUS.COMPLETED_COOK: - // if (index >= 0 && index < orderStatusLists.Count) - // { - // Application.Current.Dispatcher.BeginInvoke((Action)delegate - // { - // orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status; - // orderStatusLists.ElementAt(index).EndDate = DateTime.Now.ToString("HH:mm:ss"); - // TimeSpan timeSpan = DateTime.Now.Subtract(Convert.ToDateTime(orderStatusLists.ElementAt(index).StartDate)); - // orderStatusLists.ElementAt(index).CompleteDate = $"{timeSpan.TotalSeconds.ToString("0.00")} S"; - - // //压力测试时注释,正常使用需要取消注释 - // if (!BPASmartClient.Business.InternetInfo.IsEnableTest) - // { - // WaitTakeMeal.Insert(0, orderStatusLists.ElementAt(index)); - // orderStatusLists.RemoveAt(index); - // } - - // }); - // } - - // break; - // case ORDER_STATUS.COMPLETED_TAKE: - // if (BPASmartClient.Business.InternetInfo.IsEnableTest) - // orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status; - - // //压力测试时注释,正常使用需要取消注释 - // var re = WaitTakeMeal.FirstOrDefault(p => p.OrderPush.SuborderId == orderStatusChange.SubOrderId); - // if (re != null) - // { - // Application.Current.Dispatcher.BeginInvoke((Action)delegate - // { - // WaitTakeMeal.Remove(re); - // var removeObj = Json.Data.orderLists.FirstOrDefault(p => p.morkOrderPushes.FirstOrDefault(s => s.OrderPush.SuborderId == re.OrderPush.SuborderId) != null); - // if (removeObj != null) Json.Data.orderLists.Remove(removeObj); - // }); - // } - // break; - // default: - // break; - // } - // } - //}), "OrderStatusChange"); } private static void OrderStatusChangedHandle(IEvent @event, EventBus.EventBus.EventCallBackHandle callBack) @@ -184,7 +130,7 @@ namespace BPASmartClient.ViewModel break; case ORDER_STATUS.COMPLETED_TAKE: - if (BPASmartClient.Business.InternetInfo.IsEnableTest) + if (BPASmartClient.Business.InternetInfo.IsEnableTest && index >= 0 && index < orderStatusLists.Count) orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status; //压力测试时注释,正常使用需要取消注释