浏览代码

1.修改出餐序号显示问题。;2.删除出碗出餐订单号绑定。3.新增出餐互锁信号修改多出餐任务同时发出被覆盖的问题。

master
ZhaoGang 1年前
父节点
当前提交
f90ff1ed54
共有 2 个文件被更改,包括 73 次插入30 次删除
  1. +61
    -28
      BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs
  2. +12
    -2
      BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs

+ 61
- 28
BPASmartClient.MorkSUpgradedVer/Control_MorkSUpgradedVer.cs 查看文件

@@ -411,6 +411,7 @@ namespace BPASmartClient.MorkSUpgradedVer
OrderChange(order.MorkOrder.SuborderId, ORDER_STATUS.WAIT);
DeviceProcessLogShow($"接收到{OrderCount}次订单,订单ID:{order.MorkOrder.SuborderId}");
mORKS.HistorySuborderId.Add(order.MorkOrder.SuborderId);
mORKS.IDSortNums.TryAdd(order.MorkOrder.SuborderId, order.MorkOrder.SortNum);
foreach (var item in order.MorkOrder.GoodBatchings)
{
var res = orderMaterialDelivery?.BatchingInfo?.FirstOrDefault(p => p.BatchingId == item.BatchingId);
@@ -479,12 +480,17 @@ namespace BPASmartClient.MorkSUpgradedVer
{
if (orderLocInfo.Loc >= 10 && orderLocInfo.Loc <= 11)
{
mORKS.TakeBowlId = orderLocInfo.SuborderId;
//mORKS.TakeBowlId = orderLocInfo.SuborderId;
mORKS.TakeBowName = orderLocInfo.GoodName;
mORKS.TakeBowSortNum = orderLocInfo.SortNum;
TakeBowlControl(orderLocInfo.Loc);
OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
DeviceProcessLogShow($"订单【{mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]");

//OrderChange(mORKS.TakeBowlId, ORDER_STATUS.COOKING);
OrderChange(orderLocInfo.SuborderId, ORDER_STATUS.COOKING);

//DeviceProcessLogShow($"订单【{mORKS.TakeBowlId}】执行取碗控制,位置:[{orderLocInfo.Loc}]");
DeviceProcessLogShow($"订单【{orderLocInfo.SuborderId}】执行取碗控制,位置:[{orderLocInfo.Loc}]");

mORKS.TakeBowlInterlock = true;
}
}
@@ -661,7 +667,6 @@ namespace BPASmartClient.MorkSUpgradedVer
DeviceProcessLogShow($"转盘位置[{mORKS.CurrentFeedbackLoc}]:写入煮面时间{x.Minute}分{x.Second}秒。");
}
}

mORKS.CurrentLoc = 0;
mORKS.CookNodelId[loc] = orderLocInfo.SuborderId;
mORKS.NoodleCookerStatus[loc] = true;
@@ -682,27 +687,49 @@ namespace BPASmartClient.MorkSUpgradedVer
/// </summary>
private void OutNoodleTask()
{
if (mORKS.AllowInvertedFace && mORKS.RobotTaskInterlock && !mORKS.TakeNoodleInterlock && mORKS.RobotStatus)
{
int loc = Array.FindIndex(mORKS.CookNodelId, p => p == mORKS.IngredientsCompleteId && p.Length > 0);
if (loc >= 0 && loc <= 5)
{
if (mORKS.CookNoodleCom[loc])
{
SetTakeNoodleLoc((ushort)(loc + 1));
mORKS.NoodleCookerStatus[loc] = false;
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.OutMealSortNum = mORKS.IngredientsCompleteSortNum;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{mORKS.OutMealId}");
mORKS.CookNoodleCom[loc] = false;
}
if (mORKS.AllowInvertedFace && mORKS.RobotTaskInterlock && !mORKS.RobotOutDinnigLock && !mORKS.TakeNoodleInterlock && mORKS.RobotStatus)
{
#region 修改之前的代码
//int loc = Array.FindIndex(mORKS.CookNodelId, p => p == mORKS.IngredientsCompleteId && p.Length > 0);
//if (loc >= 0 && loc <= 5)
//{
// if (mORKS.CookNoodleCom[loc])
// {
// SetTakeNoodleLoc((ushort)(loc + 1));
// mORKS.NoodleCookerStatus[loc] = false;
// 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.OutMealSortNum = mORKS.IngredientsCompleteSortNum;
// mORKS.IngredientsCompleteId = string.Empty;
// mORKS.CookNodelId[loc] = string.Empty;
// DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{mORKS.OutMealId}");
// mORKS.CookNoodleCom[loc] = false;
// }
//}
#endregion

for (int loc = 0; loc < mORKS.CookNodelId.Length; loc++) {
if (mORKS.CookNoodleCom[loc]&&!mORKS.RobotOutDinnigLock) {
SetTakeNoodleLoc((ushort)(loc + 1));
mORKS.NoodleCookerStatus[loc] = false;
WriteData($"VW260", (ushort)0);//设置出汤时间
OrderChange(mORKS.CookNodelId[loc], ORDER_STATUS.COMPLETED_COOK);
DeviceProcessLogShow($"订单【{mORKS.CookNodelId[loc]}】制作完成");
mORKS.CookCompleteFlatBit = true;
mORKS.OutMealId = mORKS.CookNodelId[loc];
mORKS.OutMealName = mORKS.IngredientsCompleteName;
mORKS.OutMealSortNum = mORKS.IngredientsCompleteSortNum;
mORKS.IngredientsCompleteId = string.Empty;
mORKS.CookNodelId[loc] = string.Empty;
DeviceProcessLogShow($"{loc + 1} 号位置出餐控制,订单ID:{mORKS.OutMealId}");
mORKS.CookNoodleCom[loc] = false;
mORKS.RobotOutDinnigLock = true;
}
}
}
}
@@ -715,14 +742,16 @@ namespace BPASmartClient.MorkSUpgradedVer
//允许倒面信号检测
if (RTrig.GetInstance("AllowFallNoodle").Start(mORKS.AllowInvertedFace))
{
mORKS.IngredientsCompleteId = mORKS.TakeBowlId;
//mORKS.IngredientsCompleteId = mORKS.TakeBowlId;
mORKS.IngredientsCompleteName = mORKS.TakeBowName;
mORKS.IngredientsCompleteSortNum = mORKS.TakeBowSortNum;
mORKS.TakeBowSortNum = 0;
mORKS.TakeBowlId = string.Empty;
mORKS.TakeBowName = string.Empty;
DeviceProcessLogShow($"碗到位,允许到面,{mORKS.IngredientsCompleteId}");
//DeviceProcessLogShow($"碗到位,允许到面,{mORKS.IngredientsCompleteId}");
DeviceProcessLogShow($"碗到位,允许倒面。");
mORKS.TakeBowlInterlock = false;
mORKS.RobotOutDinnigLock = false;
}

//取餐完成逻辑处理
@@ -731,6 +760,9 @@ namespace BPASmartClient.MorkSUpgradedVer
OrderChange(mORKS.OutMealId, ORDER_STATUS.COMPLETED_TAKE);
DeviceProcessLogShow($"订单【{mORKS.OutMealId}】取餐完成");
WriteData("M10.1", false);
int takeDinningNum;
mORKS.IDSortNums.TryRemove(mORKS.OutMealId, out takeDinningNum);
mORKS.OutMealSortNum = takeDinningNum;
DeviceProcessLogShow($"出餐订单序号【{mORKS.OutMealSortNum}】");
VoiceAPI.Speak(mORKS.OutMealSortNum.ToString());
//DeviceProcessLogShow($"叫号系统通知主题【MORKS/VoiceCall/{DeviceId}】");
@@ -759,7 +791,8 @@ namespace BPASmartClient.MorkSUpgradedVer

mORKS.PriorityJudgment = Delay.GetInstance("取餐优先级判断").Start(mORKS.TurntableLocLists.Count > 0 && !mORKS.TurntableLowPosition, 4);
//mORKS.RobotTaskInterlock = OutMealRequstCount > 0 && mORKS.AllowInvertedFace && (mlCount >= 2 || mORKS.RBTakeNoodleTask.Count == 0 || mORKS.PriorityJudgment);
mORKS.RobotTaskInterlock = isok && mORKS.AllowInvertedFace && (mlCount >= 2 || mORKS.RBTakeNoodleTask.Count == 0 || mORKS.PriorityJudgment);
//mORKS.RobotTaskInterlock = isok && mORKS.AllowInvertedFace && (mlCount >= 2 || mORKS.RBTakeNoodleTask.Count == 0 || mORKS.PriorityJudgment);
mORKS.RobotTaskInterlock = mORKS.AllowInvertedFace && (mlCount >= 6 || mORKS.RBTakeNoodleTask.Count == 0 || mORKS.PriorityJudgment);


}


+ 12
- 2
BPASmartClient.MorkSUpgradedVer/GVL_MorkSUpgradedVer.cs 查看文件

@@ -59,6 +59,11 @@ namespace BPASmartClient.MorkSUpgradedVer
/// </summary>
[VariableMonitor("转台互锁信号")]
public bool TurntableInterlock { get; set; }
/// <summary>
/// 机器人出餐互锁
/// </summary>
[VariableMonitor("机器人出餐互锁")]
public bool RobotOutDinnigLock { get; set; }


/// <summary>
@@ -103,6 +108,11 @@ namespace BPASmartClient.MorkSUpgradedVer
/// </summary>
public ConcurrentQueue<OrderLocInfo> TakeBowlTask { get; set; } = new ConcurrentQueue<OrderLocInfo>();

/// <summary>
/// 订单ID对应的排序号字典
/// </summary>
public ConcurrentDictionary<string, int> IDSortNums { get; set; } = new ConcurrentDictionary<string, int>();


public List<DoOrderEvent> doOrderEvents { get; set; } = new List<DoOrderEvent>();

@@ -123,7 +133,7 @@ namespace BPASmartClient.MorkSUpgradedVer
/// </summary>
public string TakeBowName { get; set; } = string.Empty;
/// <summary>
/// 配料完成订单名称
/// 取碗完成订单排序号
/// </summary>
public int TakeBowSortNum { get; set; } = 0;

@@ -137,7 +147,7 @@ namespace BPASmartClient.MorkSUpgradedVer
/// </summary>
public string IngredientsCompleteName { get; set; } = string.Empty;
/// <summary>
/// 配料完成订单名称
/// 配料完成订单排序号
/// </summary>
public int IngredientsCompleteSortNum { get; set; } = 0;



正在加载...
取消
保存