|
|
@@ -691,6 +691,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.0", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},1号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -709,6 +710,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.1", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -727,6 +729,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.2", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -745,30 +748,34 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.3", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘1,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (GVL_SmallStation.GetInstance.DosingTray1) |
|
|
|
if (GVL_SmallStation.GetInstance.DosingTray1 && GVL_SmallStation.GetInstance.DosingTray1Loc > 0 && GVL_SmallStation.GetInstance.DosingTray1Loc < 16) |
|
|
|
{ |
|
|
|
for (int i = 1; i < 16; i++) |
|
|
|
int i = GVL_SmallStation.GetInstance.DosingTray1Loc; |
|
|
|
if (RTrig.GetInstance("Tray1StatusDevice" + i).Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3)) |
|
|
|
{ |
|
|
|
if (RTrig.GetInstance("Tray1StatusDevice" + i).Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3)) |
|
|
|
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成"); |
|
|
|
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i); |
|
|
|
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback; |
|
|
|
string info = DeviceInquire.GetInstance.GetDevice(i).StatusReset(); |
|
|
|
MessageLog.GetInstance.ShowRunLog(info); |
|
|
|
if (i >= 1 && i <= 8) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘1,配方:{recipeName},{i}号仓,配料完成"); |
|
|
|
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i); |
|
|
|
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback; |
|
|
|
DeviceInquire.GetInstance.GetDevice(i).StatusReset(); |
|
|
|
if (i >= 1 && i <= 8) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB4.DBX30." + (i - 1), true); |
|
|
|
} |
|
|
|
else if (i >= 9 && i <= 15) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1 = false; |
|
|
|
string commInfo = HKDevice.HK_PLC_S7.Write("DB4.DBX30." + (i - 1), true); |
|
|
|
MessageLog.GetInstance.ShowRunLog(commInfo); |
|
|
|
} |
|
|
|
else if (i >= 9 && i <= 15) |
|
|
|
{ |
|
|
|
string commInfo1 = HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true); |
|
|
|
MessageLog.GetInstance.ShowRunLog(commInfo1); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1 = false; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray1Loc = 0; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (RTrig.GetInstance("配方配料完成").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX1.1")) && (GVL_SmallStation.GetInstance.WindSendDosingFinish || !GVL_SmallStation.GetInstance.IsUseWindSend)) |
|
|
|
{ |
|
|
@@ -847,6 +854,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.0", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},1号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -865,6 +873,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.5", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},2号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -875,7 +884,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
if (res > 0 && res is float loc) |
|
|
|
{ |
|
|
|
int loc_index = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == loc); |
|
|
|
double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeight; |
|
|
|
double weight = RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(loc_index).RawMaterialWeightW; |
|
|
|
if (loc_index >= 0) |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.GetDevice((int)loc)?.Start((uint)weight);//启动并写入每个原料重量 |
|
|
@@ -883,6 +892,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.6", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},3号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
@@ -901,29 +911,32 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
//HKDevice.HK_PLC_S7.Write("DB3.DBX50.7", false); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2 = true; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2Loc = (int)loc; |
|
|
|
MessageLog.GetInstance.ShowRunLog($"托盘2,配方:{recipeName},4号桶,{(int)loc}号仓,配料完成"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (GVL_SmallStation.GetInstance.DosingTray2 == true) |
|
|
|
if (GVL_SmallStation.GetInstance.DosingTray2 == true && GVL_SmallStation.GetInstance.DosingTray1 == false && GVL_SmallStation.GetInstance.DosingTray2Loc > 0 && GVL_SmallStation.GetInstance.DosingTray2Loc < 16) |
|
|
|
{ |
|
|
|
for (int i = 1; i < 16; i++) |
|
|
|
int i = GVL_SmallStation.GetInstance.DosingTray2Loc; |
|
|
|
if (RTrig.GetInstance("Tray2StatusDevice" + i).Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3)) |
|
|
|
{ |
|
|
|
if (RTrig.GetInstance("Tray2StatusDevice" + i).Start(DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3)) |
|
|
|
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘2,配方:{recipeName},{i}号仓,配料完成"); |
|
|
|
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i); |
|
|
|
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback; |
|
|
|
string info = DeviceInquire.GetInstance.GetDevice(i).StatusReset(); |
|
|
|
MessageLog.GetInstance.ShowRunLog(info); |
|
|
|
if (i >= 1 && i <= 8) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowRunLog($"柔性味魔方,托盘2,配方:{recipeName},{i}号仓,配料完成"); |
|
|
|
int res = Array.FindIndex(RemoteRecipes.ElementAt(index).RawMaterial.ToArray(), p => p.RawMaterialLocation == i); |
|
|
|
RemoteRecipes.ElementAt(index).RawMaterial.ElementAt(res).Laying_Off_Weight = DeviceInquire.GetInstance.GetDevice(i).deviceStatus.CutWeightFeedback; |
|
|
|
DeviceInquire.GetInstance.GetDevice(i).StatusReset(); |
|
|
|
if (i >= 1 && i <= 8) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB4.DBX30." + (i - 1), true); |
|
|
|
} |
|
|
|
else if (i >= 9 && i <= 15) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2 = false; |
|
|
|
string commInfo = HKDevice.HK_PLC_S7.Write("DB4.DBX30." + (i - 1), true); |
|
|
|
MessageLog.GetInstance.ShowRunLog(commInfo); |
|
|
|
} |
|
|
|
else if (i >= 9 && i <= 15) |
|
|
|
{ |
|
|
|
string commInfo1 = HKDevice.HK_PLC_S7.Write("DB4.DBX31." + (i - 9), true); |
|
|
|
MessageLog.GetInstance.ShowRunLog(commInfo1); |
|
|
|
} |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2 = false; |
|
|
|
GVL_SmallStation.GetInstance.DosingTray2Loc = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
if (RTrig.GetInstance("DB3.DBX1.2").Start(HKDevice.HK_PLC_S7.Read<bool>("DB3.DBX1.2"))) |
|
|
@@ -957,7 +970,16 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void StockBinInit() |
|
|
|
{ |
|
|
|
for (int i = 1; i < 16; i++) |
|
|
|
{ |
|
|
|
if (DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3) |
|
|
|
{ |
|
|
|
DeviceInquire.GetInstance.GetDevice(i).StatusReset(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
private void DosingDevice(int Index,int DeviceID) |
|
|
|
{ |
|
|
|
if (RTrig.GetInstance("Tray2StatusDevice" + DeviceID).Start(DeviceInquire.GetInstance.GetDevice(DeviceID).deviceStatus.RunStatus == 3)) |
|
|
|