Browse Source

1. 修改订单取消功能流程。

master
ZhaoGang 1 year ago
parent
commit
4d21d7f3ac
2 changed files with 23 additions and 11 deletions
  1. +3
    -3
      BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs
  2. +20
    -8
      BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs

+ 3
- 3
BPASmartClient.JXJFoodSmallStation/Model/HK_PLC/HKDeviceStatus.cs View File

@@ -286,9 +286,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.HK_PLC
//HK_PLC_S7.Write<bool[]>(AddresBarrel1, barrel1);
//HK_PLC_S7.Write<bool[]>(AddresBarrel2, barrel2);
//HK_PLC_S7.Write<bool[]>(AddresBarrel3, barrel3);
MessageNotify.GetInstance.ShowRunLog($"小料仓配方下发,plc配方位置【{recipeLoction}】,桶1料仓配料【{barrel1_short}】,配料位置【{barrel1_short.ToBinString()}】");
MessageNotify.GetInstance.ShowRunLog($"小料仓配方下发,plc配方位置【{recipeLoction}】,桶2料仓配料【{barrel2_short}】,配料位置【{barrel2_short.ToBinString()}】");
MessageNotify.GetInstance.ShowRunLog($"小料仓配方下发,plc配方位置【{recipeLoction}】,桶3料仓配料【{barrel3_short}】,配料位置【{barrel3_short.ToBinString()}】");
MessageNotify.GetInstance.ShowRunLog($"小料仓配方下发,plc配方位置【{recipeLoction}】,桶1料仓配料【{barrel1_short}】,配料位置【{barrel1_short.ToBinString()}】");
MessageNotify.GetInstance.ShowRunLog($"小料仓配方下发,plc配方位置【{recipeLoction}】,桶2料仓配料【{barrel2_short}】,配料位置【{barrel2_short.ToBinString()}】");
MessageNotify.GetInstance.ShowRunLog($"小料仓配方下发,plc配方位置【{recipeLoction}】,桶3料仓配料【{barrel3_short}】,配料位置【{barrel3_short.ToBinString()}】");
MessageNotify.GetInstance.ShowRunLog($"小料仓配方下发,plc配方位置【{recipeLoction}】,料仓配料【{GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeLoction]}】,配料位置【{GVL_SmallStation.GetInstance.RecipeStockBinDosing[recipeLoction].ToBinString()}】");

}


+ 20
- 8
BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs View File

@@ -384,8 +384,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
if (!string.IsNullOrEmpty(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[] cnt = new int[5] { -1, -1, -1, -1, -1 };
//index1 是在五个配方队列中,该配方所在的配方队列的key。
int index1 = -1;
for (int i = 0; i < 5; i++)
{
@@ -401,7 +403,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
if (index == -1)
{
GVL_SmallStation.GetInstance.OrderCancelStep = 30;
MessageNotify.GetInstance.ShowRunLog($"配方中并未找到订单配方号:【{code}】");
MessageNotify.GetInstance.ShowRunLog($"远程配方集合中并未找到订单配方号:【{code}】");
}
else
{
@@ -410,6 +412,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
//在配方执行列表中找到此配方。
GVL_SmallStation.GetInstance.OrderCancelStep = 1;
}
//在远程配方集合的文件中找到了,但是没在配方队列中找到。
else
{
GVL_SmallStation.GetInstance.OrderCancelStep = 20;
@@ -419,11 +422,11 @@ namespace BPASmartClient.JXJFoodSmallStation.Model

//Case 1-9为
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);
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,正在申请取消订单:{code}");
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,正在申请取消订单:{code}。配方流程状态【{index1}】已经清零。");
GVL_SmallStation.GetInstance.OrderCancelStep = 2;
}
else
@@ -439,8 +442,9 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
if (GVL_SmallStation.GetInstance.Station1Cylinder == false)
{
GVL_SmallStation.GetInstance.OrderCancelStep = 3;
HKDevice.HK_PLC_S7.Write("DB4.DBX6." + index1, false);
//MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,取消订单:{code}");
MessageNotify.GetInstance.ShowRunLog($"检测到配料PLC气缸信号为False,已取消订单:【{code}】");
MessageNotify.GetInstance.ShowRunLog($"检测到配料PLC工位气缸信号为False,已取消订单:【{code}】");
}
}
break;
@@ -454,7 +458,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
SiemensDevice.Siemens_PLC_S7.Write("DB2201.DBX450.1", false);
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;
case 9:
@@ -462,8 +466,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
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_CancelRecipeCode = "";
GVL_SmallStation.GetInstance.OrderCancelStep = 0;


Loading…
Cancel
Save