|
|
@@ -1,4 +1,5 @@ |
|
|
|
using BPASmartClient.CustomResource.Pages.Model; |
|
|
|
using BPA.Message; |
|
|
|
using BPASmartClient.CustomResource.Pages.Model; |
|
|
|
using BPASmartClient.Helper; |
|
|
|
using BPASmartClient.JXJFoodSmallStation.Model.GVL; |
|
|
|
using BPASmartClient.JXJFoodSmallStation.Model.HK_PLC; |
|
|
@@ -10,6 +11,7 @@ using System; |
|
|
|
using System.Collections.Concurrent; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.ObjectModel; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using System.Configuration; |
|
|
|
using System.Linq; |
|
|
|
using System.Reflection; |
|
|
@@ -538,7 +540,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
{ |
|
|
|
foreach (var data in RemoteRecipes) |
|
|
|
{ |
|
|
|
if (data.TrayCode == 1) |
|
|
|
if (data.TrayCode == 1 && IsInQueue(data.RecipeCode)) |
|
|
|
{ |
|
|
|
if (SiemensDevice.XL_Status is XL_Status_DB status) |
|
|
|
{ |
|
|
@@ -1010,8 +1012,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方ID:【{code}】:【{item.RawMaterialName}】,下料重量:【{item.Laying_Off_Weight}】g"); |
|
|
|
} |
|
|
|
|
|
|
|
GVL_SmallStation.GetInstance.RecipeProcessStatus[recipeNum] = 3; |
|
|
|
|
|
|
|
#region 给主控PLC发送配料完成数据信号。 |
|
|
|
if (SiemensDevice.IsConnected && !GVL_SmallStation.GetInstance.IsUseLocalRecipe) |
|
|
|
if (SiemensDevice.IsConnected && RemoteRecipes.ElementAt(index).RecipesSource==RecipeSource.远程 /*!GVL_SmallStation.GetInstance.IsUseLocalRecipe*/) |
|
|
|
{ |
|
|
|
RecipeFinishInfo.Order_No = RemoteRecipes.ElementAt(index).RecipeCode; |
|
|
|
RecipeFinishInfo.Product_Code = RemoteRecipes.ElementAt(index).RecipeName; |
|
|
@@ -1044,10 +1048,12 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"托盘1,配方【{res.RecipeCode}】,配料完成,数据无法反馈给西门子,西门子设备未连接或处于本地配方"); |
|
|
|
MessageNotify.GetInstance.ShowRecipeLog(res.RecipeName); |
|
|
|
} |
|
|
|
MessageNotify.GetInstance.ShowRecipeLog($"配方名称:【{res.RecipeName}】\t 配方号:【{res.RecipeCode}】"); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GVL_SmallStation.GetInstance.WindSendDosing = false; |
|
|
|
App.Current.Dispatcher.Invoke(() => |
|
|
|
{ |
|
|
@@ -1777,5 +1783,47 @@ namespace BPASmartClient.JXJFoodSmallStation.Model |
|
|
|
GVL_SmallStation.GetInstance.RawMaterialsNameCode.TryAdd("0059", "孜然粉"); |
|
|
|
GVL_SmallStation.GetInstance.RawMaterialsNameCode.TryAdd("0060", "孜然油"); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 检查指定的配方号是否已经下发至配方执行队列中。 |
|
|
|
/// </summary> |
|
|
|
/// <param name="recipeCode">需要检测的配方号</param> |
|
|
|
/// <returns>是否在下发配方执行队列中</returns> |
|
|
|
private bool IsInQueue(string recipeCode) |
|
|
|
{ |
|
|
|
bool result = false; |
|
|
|
foreach (var queue in RecipeQueueTray.Values) |
|
|
|
{ |
|
|
|
if (queue.Contains(recipeCode)) |
|
|
|
{ |
|
|
|
result = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
private void SendFinishData(XL_Finish_DB finishData) |
|
|
|
{ |
|
|
|
var isConnected = SiemensDevice.IsConnected; |
|
|
|
|
|
|
|
if (isConnected) |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<XL_Finish_DB>(finishData, 2261); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//读取mes是否收到完成数据。 |
|
|
|
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2261.DBX0.0")==true) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog("发送了完成数据"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |