|
@@ -384,8 +384,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
if (!string.IsNullOrEmpty(GVL_SmallStation.GetInstance.Order_CancelRecipeCode)) |
|
|
if (!string.IsNullOrEmpty(GVL_SmallStation.GetInstance.Order_CancelRecipeCode)) |
|
|
{ |
|
|
{ |
|
|
string code = GVL_SmallStation.GetInstance.Order_CancelRecipeCode; |
|
|
string code = GVL_SmallStation.GetInstance.Order_CancelRecipeCode; |
|
|
|
|
|
//index是在远程配方集合文件中,该配方所在位置索引。 |
|
|
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == code); |
|
|
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == code); |
|
|
int[] cnt = new int[5] { -1, -1, -1, -1, -1 }; |
|
|
int[] cnt = new int[5] { -1, -1, -1, -1, -1 }; |
|
|
|
|
|
//index1 是在五个配方队列中,该配方所在的配方队列的key。 |
|
|
int index1 = -1; |
|
|
int index1 = -1; |
|
|
for (int i = 0; i < 5; i++) |
|
|
for (int i = 0; i < 5; i++) |
|
|
{ |
|
|
{ |
|
@@ -401,7 +403,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
if (index == -1) |
|
|
if (index == -1) |
|
|
{ |
|
|
{ |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 30; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 30; |
|
|
MessageNotify.GetInstance.ShowRunLog($"配方中并未找到订单配方号:【{code}】"); |
|
|
|
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"远程配方集合中并未找到订单配方号:【{code}】"); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@@ -410,6 +412,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
//在配方执行列表中找到此配方。 |
|
|
//在配方执行列表中找到此配方。 |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 1; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 1; |
|
|
} |
|
|
} |
|
|
|
|
|
//在远程配方集合的文件中找到了,但是没在配方队列中找到。 |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 20; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 20; |
|
@@ -419,11 +422,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
|
|
|
|
|
//Case 1-9为 |
|
|
//Case 1-9为 |
|
|
case 1: |
|
|
case 1: |
|
|
if (GVL_SmallStation.GetInstance.RecipeProcessStatus[index] != 0) |
|
|
|
|
|
|
|
|
if (GVL_SmallStation.GetInstance.RecipeProcessStatus[index1] != 0) |
|
|
{ |
|
|
{ |
|
|
GVL_SmallStation.GetInstance.RecipeProcessStatus[index] = 0; |
|
|
|
|
|
|
|
|
GVL_SmallStation.GetInstance.RecipeProcessStatus[index1] = 0; |
|
|
HKDevice.HK_PLC_S7.Write("DB4.DBX6." + index1, true); |
|
|
HKDevice.HK_PLC_S7.Write("DB4.DBX6." + index1, true); |
|
|
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,正在申请取消订单:{code}"); |
|
|
|
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,正在申请取消订单:{code}。配方流程状态【{index1}】已经清零。"); |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 2; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 2; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@@ -439,8 +442,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
if (GVL_SmallStation.GetInstance.Station1Cylinder == false) |
|
|
if (GVL_SmallStation.GetInstance.Station1Cylinder == false) |
|
|
{ |
|
|
{ |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 3; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 3; |
|
|
|
|
|
HKDevice.HK_PLC_S7.Write("DB4.DBX6." + index1, false); |
|
|
//MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,取消订单:{code}"); |
|
|
//MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,取消订单:{code}"); |
|
|
MessageNotify.GetInstance.ShowRunLog($"检测到配料PLC气缸信号为False,已取消订单:【{code}】"); |
|
|
|
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"检测到配料PLC工位气缸信号为False,已取消订单:【{code}】"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
@@ -454,7 +458,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
{ |
|
|
{ |
|
|
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); |
|
|
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false); |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 9; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 9; |
|
|
MessageNotify.GetInstance.ShowRunLog($"检测到主控PLC为False,已向主控PLC写入订单取消确认信号为False.配方队列【{index1}】,西门子取消订单完成,订单号:【{code}】。"); |
|
|
|
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"检测到主控PLC的【DB2201.DBX440.1】为False,已向主控PLC写入订单取消确认信号为False。配方队列【{index1+1}】,西门子取消订单【{code}】完成。"); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case 9: |
|
|
case 9: |
|
@@ -462,8 +466,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
{ |
|
|
{ |
|
|
Json<RemoteRecipeDataColl>.Data.Recipes.RemoveAt(index); |
|
|
Json<RemoteRecipeDataColl>.Data.Recipes.RemoveAt(index); |
|
|
}); |
|
|
}); |
|
|
RecipeQueueTray1.TryDequeue(out code); |
|
|
|
|
|
GVL_SmallStation.GetInstance.RecipeProcessStatus[index] = 0; |
|
|
|
|
|
|
|
|
//RecipeQueueTray1.TryDequeue(out code); |
|
|
|
|
|
if (RecipeQueueTray[index1].TryDequeue(out _)) |
|
|
|
|
|
{ |
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"已从配方队列【{index1+1}】移除配方:【{code}】。"); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"从配方队列【{index1 + 1}】移除配方:【{code}】失败。"); |
|
|
|
|
|
} |
|
|
|
|
|
GVL_SmallStation.GetInstance.RecipeProcessStatus[index1] = 0; |
|
|
GVL_SmallStation.GetInstance.Order_Cancel = false; |
|
|
GVL_SmallStation.GetInstance.Order_Cancel = false; |
|
|
GVL_SmallStation.GetInstance.Order_CancelRecipeCode = ""; |
|
|
GVL_SmallStation.GetInstance.Order_CancelRecipeCode = ""; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 0; |
|
|
GVL_SmallStation.GetInstance.OrderCancelStep = 0; |
|
|