@@ -279,7 +279,6 @@ namespace BPASmartClient.MorkS | |||||
}); | }); | ||||
} | } | ||||
public override void MainTask() | public override void MainTask() | ||||
{ | { | ||||
mORKS.AllowRun = mORKS.InitComplete; | mORKS.AllowRun = mORKS.InitComplete; | ||||
@@ -322,8 +321,6 @@ namespace BPASmartClient.MorkS | |||||
{ | { | ||||
if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.TakeBowlIdle && !mORKS.TakeBowlInterlock) | if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.TakeBowlIdle && !mORKS.TakeBowlInterlock) | ||||
{ | { | ||||
//if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo)) | |||||
//{ | |||||
ushort BowLoc = 0; | ushort BowLoc = 0; | ||||
var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList(); | var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList(); | ||||
if (res == null || res?.Count == 0) | if (res == null || res?.Count == 0) | ||||
@@ -355,27 +352,6 @@ namespace BPASmartClient.MorkS | |||||
BowlControl(orderLocInfo); | 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; | 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); | OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE); | ||||
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成"); | DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成"); | ||||
@@ -564,6 +531,15 @@ namespace BPASmartClient.MorkS | |||||
mORKS.OutMealId = string.Empty; | 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)) | if (RTrig.GetInstance("TakeNoodleComplete").Start(mORKS.RbTakeNoodleComplete)) | ||||
{ | { | ||||
@@ -83,7 +83,6 @@ namespace BPASmartClient.MorkS | |||||
public bool TurntableInterlock { get; set; } | public bool TurntableInterlock { get; set; } | ||||
#endregion | #endregion | ||||
/// <summary> | /// <summary> | ||||
/// 初始化完成 | /// 初始化完成 | ||||
/// PLC -> M100.0 | /// PLC -> M100.0 | ||||
@@ -71,15 +71,17 @@ namespace BPASmartClient.ViewModel | |||||
System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => | System.Windows.Application.Current?.Dispatcher.Invoke((Action)(() => | ||||
{ | { | ||||
NetworkConnectState = UniversalHelper.GetInstance().GetNetworkState(); | NetworkConnectState = UniversalHelper.GetInstance().GetNetworkState(); | ||||
CurrentOrderCount = Json<KeepDataBase>.Data.orderLists.Count; | |||||
})); | })); | ||||
}; | }; | ||||
dispatcherTimer.Interval = TimeSpan.FromSeconds(1); | dispatcherTimer.Interval = TimeSpan.FromSeconds(1); | ||||
dispatcherTimer.Start(); | dispatcherTimer.Start(); | ||||
} | } | ||||
public int CurrentOrderCount { get { return Json<KeepDataBase>.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(); } } | public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } } | ||||
@@ -96,60 +96,6 @@ namespace BPASmartClient.ViewModel | |||||
}), "AddOrder"); | }), "AddOrder"); | ||||
EventBus.EventBus.GetInstance().Subscribe<OrderStatusChangedEvent>(0, OrderStatusChangedHandle); | EventBus.EventBus.GetInstance().Subscribe<OrderStatusChangedEvent>(0, OrderStatusChangedHandle); | ||||
//ActionManage.GetInstance.Register(new Action<object>((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<KeepDataBase>.Data.orderLists.FirstOrDefault(p => p.morkOrderPushes.FirstOrDefault(s => s.OrderPush.SuborderId == re.OrderPush.SuborderId) != null); | |||||
// if (removeObj != null) Json<KeepDataBase>.Data.orderLists.Remove(removeObj); | |||||
// }); | |||||
// } | |||||
// break; | |||||
// default: | |||||
// break; | |||||
// } | |||||
// } | |||||
//}), "OrderStatusChange"); | |||||
} | } | ||||
private static void OrderStatusChangedHandle(IEvent @event, EventBus.EventBus.EventCallBackHandle callBack) | private static void OrderStatusChangedHandle(IEvent @event, EventBus.EventBus.EventCallBackHandle callBack) | ||||
@@ -184,7 +130,7 @@ namespace BPASmartClient.ViewModel | |||||
break; | break; | ||||
case ORDER_STATUS.COMPLETED_TAKE: | 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; | orderStatusLists.ElementAt(index).OrderStatus = orderStatusChange.Status; | ||||
//压力测试时注释,正常使用需要取消注释 | //压力测试时注释,正常使用需要取消注释 | ||||