|
|
@@ -51,6 +51,13 @@ namespace BPASmartClient.MorkF |
|
|
|
/// </summary> |
|
|
|
private ConcurrentQueue<OrderLocInfo> StirFryGoodsQuenes = new ConcurrentQueue<OrderLocInfo>(); |
|
|
|
|
|
|
|
private const String striConst = "炒锅{0}炒制{1}线程"; |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 当前炒制菜品 |
|
|
|
/// </summary> |
|
|
|
private OrderLocInfo nowStirFryGood = null; |
|
|
|
|
|
|
|
List<int> resultorder = new List<int>();//调试变量 |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -58,7 +65,13 @@ namespace BPASmartClient.MorkF |
|
|
|
/// </summary> |
|
|
|
public override void DoMain() |
|
|
|
{ |
|
|
|
for(int i = 0;i< count;i++) |
|
|
|
|
|
|
|
WriteControl("VD836", 0); |
|
|
|
WriteControl("VD840", 0); |
|
|
|
Thread.Sleep(400); |
|
|
|
WriteControl("M0.0", true); |
|
|
|
|
|
|
|
for (int i = 0;i< count;i++) |
|
|
|
{ |
|
|
|
morkFs.Add(i, new GVL_MorkF()); |
|
|
|
DataParse(i);//数据解析 |
|
|
@@ -67,6 +80,8 @@ namespace BPASmartClient.MorkF |
|
|
|
CommandRegist();//调试 |
|
|
|
ServerInit(); |
|
|
|
DeviceProcessLogShow("MORKF 设备初始化完成"); |
|
|
|
|
|
|
|
ReadData(); |
|
|
|
} |
|
|
|
#region 调试代码 |
|
|
|
public void CommandRegist() |
|
|
@@ -75,6 +90,7 @@ namespace BPASmartClient.MorkF |
|
|
|
ActionManage.GetInstance.Register(PLCInite, "InitCommand"); |
|
|
|
ActionManage.GetInstance.Register(StartOrder, "StartOrder"); |
|
|
|
ActionManage.GetInstance.Register(StartLocalOrder, "StartLocalOrder"); |
|
|
|
ActionManage.GetInstance.Register(StopLocalOrder, "StopLocalOrder"); |
|
|
|
#endregion |
|
|
|
|
|
|
|
#region 菜品库 |
|
|
@@ -317,7 +333,7 @@ namespace BPASmartClient.MorkF |
|
|
|
} |
|
|
|
foreach (SeasoningList seasoning in seasoningLists) |
|
|
|
{ |
|
|
|
FirePot1_Write(morkF.StartPassWay[seasoning.Loc], false); |
|
|
|
FirePot1_Write(morkFs[num].StartPassWay[seasoning.Loc], false, num); |
|
|
|
Thread.Sleep(300); |
|
|
|
} |
|
|
|
|
|
|
@@ -585,6 +601,14 @@ namespace BPASmartClient.MorkF |
|
|
|
MessageLog.GetInstance.Show($"添加本地模拟的订单{Json<LocalPotStep>.Data.LocalstirFryGoods.GoodsKey}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void StopLocalOrder() |
|
|
|
{ |
|
|
|
//判断当前是否有炒制菜品 |
|
|
|
if (nowStirFryGood == null) return; |
|
|
|
|
|
|
|
ThreadManage.GetInstance().StopTask(String.Format(striConst, fryIndex.ToString(), nowStirFryGood.GoodName), new Action(() => { Plc1Reset(fryIndex); })); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
|
|
|
|
public override void ResetProgram() |
|
|
@@ -606,41 +630,46 @@ namespace BPASmartClient.MorkF |
|
|
|
|
|
|
|
for (int i = 0; i < morkFs.Count; i++) |
|
|
|
{ |
|
|
|
GetStatus("LB50", new Action<bool[]>((bools) => |
|
|
|
GetStatus("LB50", new Action<object>((objects) => |
|
|
|
{ |
|
|
|
if (!morkFs.ContainsKey(i)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
if(objects is bool[] bools) |
|
|
|
{ |
|
|
|
morkFs[i].FryPot1_InitialComplete = bools[0]; |
|
|
|
morkFs[i].FryPot1_HOBTPut = bools[1]; |
|
|
|
morkFs[i].FryPot1_HOBTGet = bools[2]; |
|
|
|
morkFs[i].FryPot1_MaterialIntoPot = bools[3]; |
|
|
|
morkFs[i].OutFoodCompelete = bools[4]; |
|
|
|
morkFs[i].CanOutFood = bools[5]; |
|
|
|
morkFs[i].GetFoodCompelete = bools[6]; |
|
|
|
morkFs[i].CanOutPotWashingWater = bools[7]; |
|
|
|
morkFs[i].ArmOnOrigin = bools[8]; |
|
|
|
morkFs[i].ArmOnWorking = bools[9]; |
|
|
|
morkFs[i].PotOnOrigin = bools[10]; |
|
|
|
} |
|
|
|
|
|
|
|
morkFs[i].FryPot1_InitialComplete = bools[0]; |
|
|
|
morkFs[i].FryPot1_HOBTPut = bools[1]; |
|
|
|
morkFs[i].FryPot1_HOBTGet = bools[2]; |
|
|
|
morkFs[i].FryPot1_MaterialIntoPot = bools[3]; |
|
|
|
morkFs[i].OutFoodCompelete = bools[4]; |
|
|
|
morkFs[i].CanOutFood = bools[5]; |
|
|
|
morkFs[i].GetFoodCompelete = bools[6]; |
|
|
|
morkFs[i].CanOutPotWashingWater = bools[7]; |
|
|
|
morkFs[i].ArmOnOrigin = bools[8]; |
|
|
|
morkFs[i].ArmOnWorking = bools[9]; |
|
|
|
morkFs[i].PotOnOrigin = bools[10]; |
|
|
|
}), i); |
|
|
|
} |
|
|
|
for (int j = 0; j < morkFs.Count; j++) |
|
|
|
{ |
|
|
|
GetStatus("LB74", new Action<bool[]>((bools) => |
|
|
|
GetStatus("LB74", new Action<object>((objects) => |
|
|
|
{ |
|
|
|
if (!morkFs.ContainsKey(j)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (int i = 0; i < 14; i++) |
|
|
|
if (objects is bool[] bools) |
|
|
|
{ |
|
|
|
morkFs[j].PassWay1_Compelete[i] = bools[i]; |
|
|
|
for (int i = 0; i < 14; i++) |
|
|
|
{ |
|
|
|
morkFs[j].PassWay1_Compelete[i] = bools[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}), j); |
|
|
|
} |
|
|
|
for (int i = 0; i < morkFs.Count; i++) |
|
|
@@ -650,14 +679,70 @@ namespace BPASmartClient.MorkF |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
GetStatus("LB90", new Action<bool[]>((bools) => |
|
|
|
GetStatus("LB90", new Action<object>((objects) => |
|
|
|
{ |
|
|
|
morkFs[i].AutoMode = bools[0]; |
|
|
|
if (objects is bool[] bools) |
|
|
|
{ |
|
|
|
morkFs[i].AutoMode = bools[0]; |
|
|
|
} |
|
|
|
|
|
|
|
}), i); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < morkFs.Count; j++) |
|
|
|
{ |
|
|
|
GetStatus("VD808", new Action<object>((objects) => |
|
|
|
{ |
|
|
|
if (!morkFs.ContainsKey(j)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (objects is object[] bools) |
|
|
|
{ |
|
|
|
for (int i = 0; i < 1; i++) |
|
|
|
{ |
|
|
|
var a = bools[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}), j); |
|
|
|
GetStatus("VD814", new Action<object>((objects) => |
|
|
|
{ |
|
|
|
if (!morkFs.ContainsKey(j)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (objects is object[] bools) |
|
|
|
{ |
|
|
|
for (int i = 0; i < 1; i++) |
|
|
|
{ |
|
|
|
var a = bools[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}), j); |
|
|
|
GetStatus("VD816", new Action<object>((objects) => |
|
|
|
{ |
|
|
|
if (!morkFs.ContainsKey(j)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (objects is object[] bools) |
|
|
|
{ |
|
|
|
for (int i = 0; i < 1; i++) |
|
|
|
{ |
|
|
|
var a = bools[i]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}), j); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
private void ServerInit() |
|
|
@@ -905,161 +990,167 @@ namespace BPASmartClient.MorkF |
|
|
|
//待炒小炒队列出队列 |
|
|
|
if (StirFryGoodsQuenes.TryDequeue(out var res)) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
|
|
|
|
//设置当前炒制菜品 |
|
|
|
nowStirFryGood = res; |
|
|
|
//炒锅工作状态置为正在工作中 |
|
|
|
morkFs[i].FryWorking = true; |
|
|
|
//空闲炒锅入队列 |
|
|
|
morkFs[i].StirFryGoodsQuenes.Enqueue(res); |
|
|
|
MessageLog.GetInstance.Show($"菜品{res.GoodName}开始炒制"); |
|
|
|
MessageLog.GetInstance.Show($"炒锅{i}开始炒制菜品{res.GoodName}"); |
|
|
|
|
|
|
|
//开启线程进行炒制 |
|
|
|
ThreadManage.GetInstance().Start(new Action(() => |
|
|
|
{ |
|
|
|
foreach (var potActions in res.StirPotActions) |
|
|
|
try |
|
|
|
{ |
|
|
|
switch (potActions.Actions) |
|
|
|
foreach (var potActions in res.StirPotActions) |
|
|
|
{ |
|
|
|
case nameof(StirFryPotActionEnum.加热开启): |
|
|
|
StartFire(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位1): |
|
|
|
SetFire(new List<int> { 1 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位2): |
|
|
|
SetFire(new List<int> { 2 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位3): |
|
|
|
SetFire(new List<int> { 3 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位4): |
|
|
|
SetFire(new List<int> { 4 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位5): |
|
|
|
SetFire(new List<int> { 5 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位6): |
|
|
|
SetFire(new List<int> { 6 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位7): |
|
|
|
SetFire(new List<int> { 7 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位8): |
|
|
|
SetFire(new List<int> { 8 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位9): |
|
|
|
SetFire(new List<int> { 9 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位10): |
|
|
|
SetFire(new List<int> { 10 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.停止加热): |
|
|
|
StopFire(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.加调料): |
|
|
|
OutSeasonings(potActions.SeasoningLists, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
if (ThreadManage.GetInstance().IsCanncel(String.Format(striConst, i.ToString(), nowStirFryGood.GoodName))) |
|
|
|
{ |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.取原料): |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.开启搅拌): |
|
|
|
StartStir(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置搅拌挡位1): |
|
|
|
SetStir(new List<int> { 1 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置搅拌挡位2): |
|
|
|
SetStir(new List<int> { 2 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置搅拌挡位3): |
|
|
|
SetStir(new List<int> { 3 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.关闭搅拌): |
|
|
|
StopStir(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.出餐启动): |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.道菜启动): |
|
|
|
OutFood(i); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.炒制菜品): |
|
|
|
Thread.Sleep(potActions.During * 1000); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.搅拌臂原点位): |
|
|
|
StirArmGoOrigin(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.搅拌臂炒制位): |
|
|
|
StirArmGoWork(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.洗锅): |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
switch (potActions.Actions) |
|
|
|
{ |
|
|
|
case nameof(StirFryPotActionEnum.加热开启): |
|
|
|
StartFire(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位1): |
|
|
|
SetFire(new List<int> { 1 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位2): |
|
|
|
SetFire(new List<int> { 2 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位3): |
|
|
|
SetFire(new List<int> { 3 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位4): |
|
|
|
SetFire(new List<int> { 4 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位5): |
|
|
|
SetFire(new List<int> { 5 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位6): |
|
|
|
SetFire(new List<int> { 6 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位7): |
|
|
|
SetFire(new List<int> { 7 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位8): |
|
|
|
SetFire(new List<int> { 8 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位9): |
|
|
|
SetFire(new List<int> { 9 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置加热挡位10): |
|
|
|
SetFire(new List<int> { 10 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.停止加热): |
|
|
|
StopFire(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.加调料): |
|
|
|
OutSeasonings(potActions.SeasoningLists, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.取原料): |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.开启搅拌): |
|
|
|
StartStir(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置搅拌挡位1): |
|
|
|
SetStir(new List<int> { 1 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置搅拌挡位2): |
|
|
|
SetStir(new List<int> { 2 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.设置搅拌挡位3): |
|
|
|
SetStir(new List<int> { 3 }, i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.关闭搅拌): |
|
|
|
StopStir(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.出餐启动): |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.道菜启动): |
|
|
|
OutFood(i); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.炒制菜品): |
|
|
|
Thread.Sleep(potActions.During * 1000); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.搅拌臂原点位): |
|
|
|
StirArmGoOrigin(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.搅拌臂炒制位): |
|
|
|
StirArmGoWork(i); |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
case nameof(StirFryPotActionEnum.洗锅): |
|
|
|
MessageLog.GetInstance.Show(potActions.Actions); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Plc1Reset(i);//复位 |
|
|
|
Thread.Sleep(3000); |
|
|
|
//回原点位 |
|
|
|
StirArmGoOrigin(i); |
|
|
|
Plc1Reset(i);//复位 |
|
|
|
Thread.Sleep(3000); |
|
|
|
//回原点位 |
|
|
|
StirArmGoOrigin(i); |
|
|
|
|
|
|
|
for (int i = 0; i < sleepCount && !morkFs[i].ArmOnOrigin; i++) |
|
|
|
{ |
|
|
|
Thread.Sleep(sleepTime); |
|
|
|
if (i >= sleepCount - 1) |
|
|
|
for (int i = 0; i < sleepCount && !morkFs[i].ArmOnOrigin; i++) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"炒锅{i}炒制过程完成后,搅拌臂去原点位超时"); |
|
|
|
Thread.Sleep(sleepTime); |
|
|
|
if (i >= sleepCount - 1) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.Show($"炒锅{i}炒制过程完成后,搅拌臂去原点位超时"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//while (!morkFs[i].ArmOnOrigin) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(100); |
|
|
|
//} |
|
|
|
//出餐 |
|
|
|
//OutMeal(i); |
|
|
|
MessageLog.GetInstance.Show($"菜品{res.GoodName}完成"); |
|
|
|
|
|
|
|
//while (!morkFs[i].ArmOnOrigin) |
|
|
|
//{ |
|
|
|
// Thread.Sleep(100); |
|
|
|
//} |
|
|
|
//出餐 |
|
|
|
//OutMeal(i); |
|
|
|
MessageLog.GetInstance.Show($"菜品{res.GoodName}完成"); |
|
|
|
|
|
|
|
}), $"炒锅{i}炒制线程"); |
|
|
|
} |
|
|
|
catch(Exception ex) |
|
|
|
{ |
|
|
|
ThreadManage.GetInstance().StopTask($"炒锅{i}炒制线程"); |
|
|
|
MessageLog.GetInstance.Show($"菜品{res.GoodName}出错,错误信息:" + ex.Message); |
|
|
|
} |
|
|
|
finally |
|
|
|
{ |
|
|
|
|
|
|
|
//炒完后出队列 |
|
|
|
morkFs[i].StirFryGoodsQuenes.TryDequeue(out var orderQueue); |
|
|
|
morkFs[i].FryWorking = false; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
ThreadManage.GetInstance().StopTask($"炒锅{i}{res.GoodName}炒制线程"); |
|
|
|
MessageLog.GetInstance.Show($"炒锅{i}炒制菜品{res.GoodName}出错,错误信息:" + ex.Message); |
|
|
|
} |
|
|
|
finally |
|
|
|
{ |
|
|
|
nowStirFryGood = null; |
|
|
|
//炒完后出队列 |
|
|
|
morkFs[i].StirFryGoodsQuenes.TryDequeue(out var orderQueue); |
|
|
|
morkFs[i].FryWorking = false; |
|
|
|
} |
|
|
|
}), String.Format(striConst, i.ToString(), nowStirFryGood.GoodName)/*$"炒锅{i}炒制{res.GoodName}线程"*/); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
@@ -1167,13 +1258,13 @@ namespace BPASmartClient.MorkF |
|
|
|
/// <param name="key"></param> |
|
|
|
/// <param name="action"></param> |
|
|
|
/// <param name="num">炒锅编号</param> |
|
|
|
private void GetStatus(string key, Action<bool[]> action,int num) |
|
|
|
private void GetStatus(string key, Action<object> action,int num) |
|
|
|
{ |
|
|
|
if(dicPort2peripheralStatus.ContainsKey(num)) |
|
|
|
{ |
|
|
|
if (dicPort2peripheralStatus[num].ContainsKey(key)) |
|
|
|
{ |
|
|
|
action((bool[])dicPort2peripheralStatus[num][key]);//获取PLC指定地址的状态值 |
|
|
|
action((object)dicPort2peripheralStatus[num][key]);//获取PLC指定地址的状态值 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|