|
|
@@ -234,7 +234,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
if (mORKS.doOrderEvents!=null&&mORKS.doOrderEvents.Count>0&&!string.IsNullOrEmpty(subid)) |
|
|
|
{ |
|
|
|
var res = mORKS.doOrderEvents.FirstOrDefault(p => p.MorkOrder.SuborderId == subid); |
|
|
|
var res = mORKS.doOrderEvents.Find(p => p.MorkOrder.SuborderId == subid); |
|
|
|
string goodName = string.Empty; |
|
|
|
string SortNum = string.Empty; |
|
|
|
if (res != null) |
|
|
@@ -499,6 +499,9 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
if (obj is bool[] bools && bools.Length > 0 && bools.Length <= 1) |
|
|
|
{ |
|
|
|
mORKS.FixedFlag = bools[0]; |
|
|
|
if (!mORKS.FixedFlag&& NoodOrderCtrl.GetInstance.stateInfo== "补料中") |
|
|
|
NoodOrderCtrl.GetInstance.StateShow("设备正常运行"); |
|
|
|
|
|
|
|
} |
|
|
|
})); |
|
|
|
|
|
|
@@ -647,6 +650,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
Loc = ushort.Parse(res.BatchingLoc), |
|
|
|
SuborderId = order.MorkOrder.SuborderId, |
|
|
|
SortNum = order.MorkOrder.SortNum, |
|
|
|
IsLocal = false, |
|
|
|
BatchingId = res.BatchingId |
|
|
|
}); |
|
|
|
} |
|
|
@@ -666,6 +670,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
Loc = ushort.Parse(res.BatchingLoc), |
|
|
|
SuborderId = order.MorkOrder.SuborderId, |
|
|
|
SortNum = order.MorkOrder.SortNum, |
|
|
|
IsLocal = false, |
|
|
|
RecipeNumber = (index >= 1 && index <= 10) ? (ushort)index : (ushort)0 |
|
|
|
}); |
|
|
|
} |
|
|
@@ -785,14 +790,15 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.DropBowlMechanismStatus && !mORKS.TakeBowlInterlock) |
|
|
|
{ |
|
|
|
ushort BowLoc = 0; |
|
|
|
if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo)) |
|
|
|
var re = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == mORKS.TakeBowlTask.ElementAt(0).SuborderId); |
|
|
|
if (re != null) |
|
|
|
{ |
|
|
|
var re = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == orderLocInfo.SuborderId); |
|
|
|
if (re != null) |
|
|
|
if (mORKS.TakeBowlTask.TryDequeue(out OrderLocInfo orderLocInfo)) |
|
|
|
{ |
|
|
|
BowLoc = (ushort)re.FoodMenuModel.BowLoc; |
|
|
|
BowlControl(orderLocInfo); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList(); |
|
|
|
//if (res == null || res?.Count == 0) |
|
|
@@ -845,6 +851,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
/// <summary>转台控制</summary> |
|
|
|
private void TurntableControl() |
|
|
|
{ |
|
|
|
Global.EnableLocalSimOrder=true; |
|
|
|
if (Global.EnableLocalSimOrder) |
|
|
|
{ |
|
|
|
//不做轮询,直接取面,本地订单使用 |
|
|
@@ -852,16 +859,30 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
if (!mORKS.TurntableLowPosition) |
|
|
|
{ |
|
|
|
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc !=0) |
|
|
|
if (mORKS.RBTakeNoodleTask.ElementAt(0).IsLocal) |
|
|
|
{ |
|
|
|
if (!mORKS.TurntableLocLists.Contains(mORKS.RBTakeNoodleTask.ElementAt(0).Loc)) |
|
|
|
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc != 0) |
|
|
|
{ |
|
|
|
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); |
|
|
|
if (!mORKS.TurntableLocLists.Contains(mORKS.RBTakeNoodleTask.ElementAt(0).Loc)) |
|
|
|
{ |
|
|
|
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
DeviceProcessLogShow("未找到可用的物料信息"); |
|
|
|
mORKS.TurntableLocLists.Clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
DeviceProcessLogShow("未找到可用的物料信息"); |
|
|
|
mORKS.TurntableLocLists.Clear(); |
|
|
|
if (mORKS.CurrentFeedbackLoc == 5) |
|
|
|
{ |
|
|
|
TurntableStart((ushort)1); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
TurntableStart((ushort)(mORKS.CurrentFeedbackLoc + 1)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
@@ -870,20 +891,34 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
TurntableStart((ushort)1); |
|
|
|
} |
|
|
|
TurntableStart((ushort)(mORKS.CurrentFeedbackLoc + 1)); |
|
|
|
else |
|
|
|
{ |
|
|
|
TurntableStart((ushort)(mORKS.CurrentFeedbackLoc + 1)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc == 0) |
|
|
|
if (mORKS.RBTakeNoodleTask.ElementAt(0).IsLocal) |
|
|
|
{ |
|
|
|
if (mORKS.RBTakeNoodleTask.ElementAt(0).Loc == 0) |
|
|
|
{ |
|
|
|
mORKS.RBTakeNoodleTask.ElementAt(0).Loc = mORKS.CurrentFeedbackLoc; |
|
|
|
} |
|
|
|
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); |
|
|
|
mORKS.AllowTakeNoodle = true; |
|
|
|
DeviceProcessLogShow($"控制机器人去转台【{mORKS.RBTakeNoodleTask.ElementAt(0).Loc}】号位置取面"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
mORKS.RBTakeNoodleTask.ElementAt(0).Loc = mORKS.CurrentFeedbackLoc; |
|
|
|
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); |
|
|
|
mORKS.AllowTakeNoodle = true; |
|
|
|
DeviceProcessLogShow($"控制机器人去转台【{mORKS.RBTakeNoodleTask.ElementAt(0).Loc}】号位置取面"); |
|
|
|
} |
|
|
|
TurntableStart(mORKS.RBTakeNoodleTask.ElementAt(0).Loc); |
|
|
|
mORKS.AllowTakeNoodle = true; |
|
|
|
DeviceProcessLogShow($"控制机器人去转台【{mORKS.RBTakeNoodleTask.ElementAt(0).Loc}】号位置取面"); |
|
|
|
} |
|
|
|
//if (mORKS.TurntableLowPosition) |
|
|
|
//{ |
|
|
@@ -952,6 +987,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
} |
|
|
|
if (RTrig.GetInstance("mORKS.FixedFlag").Start(mORKS.FixedFlag)) |
|
|
|
{ |
|
|
|
NoodOrderCtrl.GetInstance.StateShow("补料中"); |
|
|
|
mORKS.AllowTakeNoodle = false; |
|
|
|
mORKS.TakeNoodleInterlock = false; |
|
|
|
} |
|
|
@@ -989,11 +1025,13 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
//if (!Json<MorksPar>.Data.parSets.ElementAt(loc).IsShield)//检查该煮面篮是否被屏蔽 |
|
|
|
//{ |
|
|
|
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo)) |
|
|
|
var res = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == mORKS.RBTakeNoodleTask.ElementAt(0).SuborderId); |
|
|
|
|
|
|
|
if (res != null) |
|
|
|
{ |
|
|
|
var res = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == orderLocInfo.SuborderId); |
|
|
|
if (res != null) |
|
|
|
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo)) |
|
|
|
{ |
|
|
|
|
|
|
|
//写入煮面时间 |
|
|
|
//List<ushort> values = new List<ushort>(); |
|
|
|
//values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute); |
|
|
@@ -1001,27 +1039,26 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
//WriteData($"VW{324 + (loc * 4)}", values.ToArray()); |
|
|
|
if (mORKS.CurrentFeedbackLoc >= 1 && mORKS.CurrentFeedbackLoc <= 5) |
|
|
|
{ |
|
|
|
var x = Json<MorksPar>.Data.DishLibraryParSets.FirstOrDefault(p => p.TextBlockContext == mORKS.CurrentFeedbackLoc.ToString()); |
|
|
|
if (x != null) |
|
|
|
//var x = Json<MorksPar>.Data.DishLibraryParSets.FirstOrDefault(p => p.TextBlockContext == mORKS.CurrentFeedbackLoc.ToString()); |
|
|
|
//if (x != null) |
|
|
|
//{ |
|
|
|
List<ushort> values = new List<ushort>(); |
|
|
|
if (Json<NoodOrder>.Data.localOrder.ContainsKey(res.OrderPush.GoodsName)) |
|
|
|
{ |
|
|
|
var re = FoodMenuViewModel.orderStatusLists.FirstOrDefault(o => o.OrderPush.SuborderId == orderLocInfo.SuborderId); |
|
|
|
List<ushort> values = new List<ushort>(); |
|
|
|
if (Json<NoodOrder>.Data.localOrder.ContainsKey(re.OrderPush.GoodsName)) |
|
|
|
{ |
|
|
|
values.Add((ushort)Json<NoodOrder>.Data.localOrder[re.OrderPush.GoodsName].FryTimeMin); |
|
|
|
values.Add((ushort)Json<NoodOrder>.Data.localOrder[re.OrderPush.GoodsName].FryTimeS); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
values.Add(2); |
|
|
|
values.Add(0); |
|
|
|
} |
|
|
|
/* |
|
|
|
values.Add(re); |
|
|
|
values.Add(x.Second);*/ |
|
|
|
WriteData($"VW{324 + (loc * 4)}", values.ToArray()); |
|
|
|
DeviceProcessLogShow($"转盘位置[{mORKS.CurrentFeedbackLoc}]:写入煮面时间{x.Minute}分{x.Second}秒。"); |
|
|
|
values.Add((ushort)Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].FryTimeMin); |
|
|
|
values.Add((ushort)Json<NoodOrder>.Data.localOrder[res.OrderPush.GoodsName].FryTimeS); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
values.Add(2); |
|
|
|
values.Add(0); |
|
|
|
} |
|
|
|
/* |
|
|
|
values.Add(re); |
|
|
|
values.Add(x.Second);*/ |
|
|
|
WriteData($"VW{324 + (loc * 4)}", values.ToArray()); |
|
|
|
//DeviceProcessLogShow($"转盘位置[{mORKS.CurrentFeedbackLoc}]:写入煮面时间{x.Minute}分{x.Second}秒。"); |
|
|
|
//} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|