|
|
@@ -22,6 +22,7 @@ using BPASmartClient.Model.小炒机; |
|
|
|
using BPA.Models; |
|
|
|
using System.Windows.Forms; |
|
|
|
using System.Media; |
|
|
|
//using BPA.Helper; |
|
|
|
|
|
|
|
namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
@@ -200,6 +201,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
if (obj is bool[] bools && bools.Length > 0 && bools.Length <= 7) |
|
|
|
{ |
|
|
|
Initing = !bools[0]; |
|
|
|
mORKS.InitComplete = bools[0]; |
|
|
|
mORKS.MoveScrewRodInitCom = bools[1]; |
|
|
|
mORKS.SacrificialVesselInitCom = bools[2]; |
|
|
@@ -208,13 +210,13 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
mORKS.RobotInitCom = bools[5]; |
|
|
|
mORKS.SiloInitCom = bools[6]; |
|
|
|
|
|
|
|
alarm.DeviceNoInit = mORKS.InitComplete; |
|
|
|
alarm.MoveScrewRodNoInit = mORKS.MoveScrewRodInitCom; |
|
|
|
alarm.SacrificialVesselNoInit = mORKS.SacrificialVesselInitCom; |
|
|
|
alarm.CylinderNoInit = mORKS.CylinderInitCom; |
|
|
|
alarm.NoodleCookerNoInit = mORKS.NoodleCookerInitCom; |
|
|
|
alarm.RobotNoInit = mORKS.RobotInitCom; |
|
|
|
alarm.SiloNoInit = mORKS.SiloInitCom; |
|
|
|
alarm.DeviceNoInit = !mORKS.InitComplete; |
|
|
|
alarm.MoveScrewRodNoInit = !mORKS.MoveScrewRodInitCom; |
|
|
|
alarm.SacrificialVesselNoInit = !mORKS.SacrificialVesselInitCom; |
|
|
|
alarm.CylinderNoInit = !mORKS.CylinderInitCom; |
|
|
|
alarm.NoodleCookerNoInit = !mORKS.NoodleCookerInitCom; |
|
|
|
alarm.RobotNoInit = !mORKS.RobotInitCom; |
|
|
|
alarm.SiloNoInit = !mORKS.SiloInitCom; |
|
|
|
} |
|
|
|
})); |
|
|
|
|
|
|
@@ -284,12 +286,23 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
if (obj is ushort[] ushorts && ushorts.Length > 0 && ushorts.Length <= 1) |
|
|
|
{ |
|
|
|
mORKS.CookNoodleCom[0] = ushorts[0].GetBitValue(1); |
|
|
|
mORKS.CookNoodleCom[1] = ushorts[0].GetBitValue(2); |
|
|
|
mORKS.CookNoodleCom[2] = ushorts[0].GetBitValue(3); |
|
|
|
mORKS.CookNoodleCom[3] = ushorts[0].GetBitValue(4); |
|
|
|
mORKS.CookNoodleCom[4] = ushorts[0].GetBitValue(5); |
|
|
|
mORKS.CookNoodleCom[5] = ushorts[0].GetBitValue(6); |
|
|
|
var tt = ushorts.UshortsToBytes(true).BytesToUshorts(); |
|
|
|
|
|
|
|
for (byte i = 0; i < 6; i++) |
|
|
|
{ |
|
|
|
if (RTrig.GetInstance($"CookNoodleCom{i + 1}").Start(tt[0].GetBitValue((byte)(i + 1)))) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(mORKS.CookNodelId[i])) |
|
|
|
mORKS.CookNoodleCom[i] = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//mORKS.CookNoodleCom[0] = tt[0].GetBitValue(1); |
|
|
|
//mORKS.CookNoodleCom[1] = tt[0].GetBitValue(2); |
|
|
|
//mORKS.CookNoodleCom[2] = tt[0].GetBitValue(3); |
|
|
|
//mORKS.CookNoodleCom[3] = tt[0].GetBitValue(4); |
|
|
|
//mORKS.CookNoodleCom[4] = tt[0].GetBitValue(5); |
|
|
|
//mORKS.CookNoodleCom[5] = tt[0].GetBitValue(6); |
|
|
|
mORKS.Heating = ushorts[0].GetBitValue(15); |
|
|
|
mORKS.TemperatureReaches = ushorts[0].GetBitValue(16); |
|
|
|
|
|
|
@@ -306,6 +319,10 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
} |
|
|
|
|
|
|
|
})); |
|
|
|
|
|
|
|
mORKS.TakeBowlTaskCount = mORKS.TakeBowlTask.Count; |
|
|
|
mORKS.RBTakeNoodleTaskCount = mORKS.RBTakeNoodleTask.Count; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -406,7 +423,6 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
if (mORKS.AllowRun && mORKS.TakeBowlTask.Count > 0 && !mORKS.DropBowlMechanismStatus && !mORKS.TakeBowlInterlock) |
|
|
|
{ |
|
|
|
DeviceProcessLogShow("开始取碗流程"); |
|
|
|
ushort BowLoc = 0; |
|
|
|
var res = orderMaterialDelivery?.BatchingInfo?.Where(p => p.BatchingId == mORKS.TakeBowlTask.ElementAt(0).BatchingId).ToList(); |
|
|
|
if (res == null || res?.Count == 0) |
|
|
@@ -419,12 +435,12 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
if (ushort.TryParse(item.BatchingLoc, out ushort loc)) |
|
|
|
{ |
|
|
|
if (loc == 10 && !mORKS.SmallBowlYesOrNoCheck) |
|
|
|
if (loc == 10 && mORKS.SmallBowlYesOrNoCheck) |
|
|
|
{ |
|
|
|
BowLoc = loc; |
|
|
|
break; |
|
|
|
} |
|
|
|
else if (loc == 11 && !mORKS.LargeBowYesOrNoCheck) |
|
|
|
else if (loc == 11 && mORKS.LargeBowYesOrNoCheck) |
|
|
|
{ |
|
|
|
BowLoc = loc; |
|
|
|
break; |
|
|
@@ -491,7 +507,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
if (!mORKS.TurntableLowPosition) |
|
|
|
{ |
|
|
|
//WriteData("M32.7", false); |
|
|
|
//WriteData("M32.7", false); 定位完成复位 |
|
|
|
DeviceProcessLogShow($"执行了转台启动互锁信号复位"); |
|
|
|
} |
|
|
|
TurntableStart(loc); |
|
|
@@ -518,7 +534,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
//转台到位检测 |
|
|
|
if (RTrig.GetInstance("TurntableInPlace").Start(mORKS.SiloInPlace && mORKS.CurrentLoc == mORKS.CurrentFeedbackLoc)) |
|
|
|
{ |
|
|
|
mORKS.CurrentLoc = 0; |
|
|
|
|
|
|
|
mORKS.TurntableInterlock = false; |
|
|
|
DeviceProcessLogShow("转台到位检测"); |
|
|
|
} |
|
|
@@ -544,25 +560,31 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
//取面控制 |
|
|
|
if (mORKS.AllowRun && mORKS.RobotStatus && !mORKS.Feeding && !mORKS.RobotTaskInterlock && mORKS.AllowTakeNoodle && mORKS.SiloInPlace && !mORKS.TakeNoodleInterlock && mORKS.RBTakeNoodleTask.Count > 0) |
|
|
|
{ |
|
|
|
int loc = Array.FindIndex(mORKS.NoodleCookerStatus, p => p == false);//查找煮面炉空闲位置 |
|
|
|
if (loc >= 0 && loc <= 5) |
|
|
|
if (mORKS.CurrentLoc == mORKS.CurrentFeedbackLoc) |
|
|
|
{ |
|
|
|
if (!Json<MorksPar>.Data.parSets.ElementAt(loc).IsShield)//检查该煮面篮是否被屏蔽 |
|
|
|
int loc = Array.FindIndex(mORKS.NoodleCookerStatus, p => p == false);//查找煮面炉空闲位置 |
|
|
|
if (loc >= 0 && loc <= 5) |
|
|
|
{ |
|
|
|
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo)) |
|
|
|
if (!Json<MorksPar>.Data.parSets.ElementAt(loc).IsShield)//检查该煮面篮是否被屏蔽 |
|
|
|
{ |
|
|
|
mORKS.CookNodelId[loc] = orderLocInfo.SuborderId; |
|
|
|
mORKS.NoodleCookerStatus[loc] = true; |
|
|
|
SetFallNoodleLoc((ushort)(loc + 1)); |
|
|
|
//机器人开始取面 |
|
|
|
OrderChange(orderLocInfo.SuborderId, ORDER_STATUS.COOKING); |
|
|
|
DeviceProcessLogShow($"订单【{orderLocInfo.SuborderId}】,机器人倒面至【{loc + 1}】号煮面栏"); |
|
|
|
//写入煮面时间 |
|
|
|
List<ushort> values = new List<ushort>(); |
|
|
|
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute); |
|
|
|
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Second); |
|
|
|
WriteData($"VW{320 + (loc * 4)}", values.ToArray()); |
|
|
|
mORKS.TakeNoodleInterlock = true; |
|
|
|
if (mORKS.RBTakeNoodleTask.TryDequeue(out OrderLocInfo orderLocInfo)) |
|
|
|
{ |
|
|
|
//写入煮面时间 |
|
|
|
List<ushort> values = new List<ushort>(); |
|
|
|
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Minute); |
|
|
|
values.Add(Json<MorksPar>.Data.parSets.ElementAt(loc).Second); |
|
|
|
WriteData($"VW{324 + (loc * 4)}", values.ToArray()); |
|
|
|
|
|
|
|
mORKS.CurrentLoc = 0; |
|
|
|
mORKS.CookNodelId[loc] = orderLocInfo.SuborderId; |
|
|
|
mORKS.NoodleCookerStatus[loc] = true; |
|
|
|
SetFallNoodleLoc((ushort)(loc + 1)); |
|
|
|
//机器人开始取面 |
|
|
|
OrderChange(orderLocInfo.SuborderId, ORDER_STATUS.COOKING); |
|
|
|
DeviceProcessLogShow($"订单【{orderLocInfo.SuborderId}】,机器人倒面至【{loc + 1}】号煮面栏"); |
|
|
|
|
|
|
|
mORKS.TakeNoodleInterlock = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -583,15 +605,16 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
{ |
|
|
|
SetTakeNoodleLoc((ushort)(loc + 1)); |
|
|
|
mORKS.NoodleCookerStatus[loc] = false; |
|
|
|
WriteData($"VW260", 0);//设置出汤时间 |
|
|
|
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_COOK); |
|
|
|
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】制作完成"); |
|
|
|
WriteData($"VW260", (ushort)0);//设置出汤时间 |
|
|
|
OrderChange(mORKS.IngredientsCompleteId, ORDER_STATUS.COMPLETED_COOK); |
|
|
|
DeviceProcessLogShow($"订单【{mORKS.IngredientsCompleteId}】制作完成"); |
|
|
|
mORKS.CookCompleteFlatBit = true; |
|
|
|
mORKS.OutMealId = mORKS.IngredientsCompleteId; |
|
|
|
mORKS.OutMealName = mORKS.IngredientsCompleteName; |
|
|
|
mORKS.IngredientsCompleteId = string.Empty; |
|
|
|
mORKS.CookNodelId[loc] = string.Empty; |
|
|
|
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{mORKS.OutMealId}"); |
|
|
|
mORKS.CookNoodleCom[loc] = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -614,10 +637,11 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
} |
|
|
|
|
|
|
|
//取餐完成逻辑处理 |
|
|
|
if (Delay.GetInstance("CompleteChange1").Start(!mORKS.DiningComplete, 1) && mORKS.CookCompleteFlatBit == true) |
|
|
|
if (RTrig.GetInstance("CompleteChange1").Start(mORKS.DiningComplete) && mORKS.CookCompleteFlatBit == true) |
|
|
|
{ |
|
|
|
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE); |
|
|
|
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成"); |
|
|
|
WriteData("M10.1", false); |
|
|
|
mORKS.CookCompleteFlatBit = false; |
|
|
|
mORKS.OutMealId = string.Empty; |
|
|
|
mORKS.OutMealName = string.Empty; |
|
|
@@ -721,7 +745,7 @@ namespace BPASmartClient.MorkSUpgradedVer |
|
|
|
private void SetTakeNoodleLoc(ushort loc) |
|
|
|
{ |
|
|
|
if (loc >= 1 && loc <= 6) |
|
|
|
WriteData($"M16.{loc - 1}", true); |
|
|
|
WriteData($"M15.{loc - 1}", true); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|