Просмотр исходного кода

1. 本地下发的配方,不对MES系统返回结束数据。

master
ZhaoGang 1 год назад
Родитель
Сommit
4f38dcf7fb
6 измененных файлов: 42 добавлений и 8 удалений
  1. +23
    -5
      BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
  2. +4
    -1
      BPASmartClient.JXJFoodBigStation/View/RecipeSendDownView.xaml
  3. +6
    -2
      BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
  4. +7
    -0
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeData.cs
  5. +1
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs
  6. +1
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs

+ 23
- 5
BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs Просмотреть файл

@@ -1355,7 +1355,8 @@ namespace BPASmartClient.JXJFoodBigStation.Model
GVL_BigStation.Recipe1DosingStatus = 3;
MessageNotify.GetInstance.ShowRunLog($"配方1,配方编号:{code},托盘编号:{trayCode},配料完成");
ReadStockBinDosingWeight(SiemensRecipes.ElementAt(index));
if (SiemensDevice.IsConnected && !GVL_BigStation.IsUseLocalRecipe)
//2023-8-21:如果不是MES系统下发的配方,不要返回结束数据。
if (SiemensDevice.IsConnected && SiemensRecipes.ElementAt(index).RecipesSource==RecipeSource.远程 /*!GVL_BigStation.IsUseLocalRecipe*/)
{
FinishData.Order_No = SiemensRecipes.ElementAt(index).RecipeCode;
FinishData.Product_Code = SiemensRecipes.ElementAt(index).RecipeName;
@@ -1375,7 +1376,11 @@ namespace BPASmartClient.JXJFoodBigStation.Model
double a = DateTime.Now.Subtract(GVL_BigStation.DosingRecipe1Time).TotalSeconds;
FinishData.ProcessTime = Convert.ToInt16(a);
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361);
MessageNotify.GetInstance.ShowRunLog($"配方1,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子");
MessageNotify.GetInstance.ShowRunLog($"配方1,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子。");
}
else
{
MessageNotify.GetInstance.ShowRunLog($"配方1,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,西门子未连接或配方为本地下发未将完成数据反馈至MES系统。");
}
HKDevice.HK_PLC_S7.Write("DB99.DBX1.4", true);
GVL_BigStation.Recipe1DosingStatus = 3;
@@ -1468,7 +1473,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
GVL_BigStation.Recipe2DosingFinish = true;
MessageNotify.GetInstance.ShowRunLog($"配方2,配方编号:{code},托盘编号:{trayCode},配料完成");
ReadStockBinDosingWeight(SiemensRecipes.ElementAt(index));
if (SiemensDevice.IsConnected && !GVL_BigStation.IsUseLocalRecipe)
if (SiemensDevice.IsConnected && SiemensRecipes.ElementAt(index).RecipesSource == RecipeSource.远程 /*!GVL_BigStation.IsUseLocalRecipe*/)
{
FinishData.Order_No = SiemensRecipes.ElementAt(index).RecipeCode;
FinishData.Product_Code = SiemensRecipes.ElementAt(index).RecipeName;
@@ -1490,9 +1495,14 @@ namespace BPASmartClient.JXJFoodBigStation.Model
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361);
MessageNotify.GetInstance.ShowRunLog($"配方2,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子");
}
else
{
MessageNotify.GetInstance.ShowRunLog($"配方2,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,西门子未连接或配方为本地下发未将完成数据反馈至MES系统。");
}
HKDevice.HK_PLC_S7.Write("DB99.DBX1.5", true);
GVL_BigStation.Recipe2DosingStatus = 3;
}
if (GVL_BigStation.Recipe2DosingStatus == 3 && HKDevice.PlcRead.Recipe2DosingFinish == false)
{
HKDevice.HK_PLC_S7.Write("DB99.DBX1.5", false);
@@ -1582,7 +1592,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
GVL_BigStation.Recipe3DosingStatus = 3;
MessageNotify.GetInstance.ShowRunLog($"配方3,配方编号:{code},托盘编号:{trayCode},配料完成");
ReadStockBinDosingWeight(SiemensRecipes.ElementAt(index));
if (SiemensDevice.IsConnected && !GVL_BigStation.IsUseLocalRecipe)
if (SiemensDevice.IsConnected && SiemensRecipes.ElementAt(index).RecipesSource == RecipeSource.远程 /*!GVL_BigStation.IsUseLocalRecipe*/)
{
FinishData.Order_No = SiemensRecipes.ElementAt(index).RecipeCode;
FinishData.Product_Code = SiemensRecipes.ElementAt(index).RecipeName;
@@ -1604,6 +1614,10 @@ namespace BPASmartClient.JXJFoodBigStation.Model
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361);
MessageNotify.GetInstance.ShowRunLog($"配方3,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子");
}
else
{
MessageNotify.GetInstance.ShowRunLog($"配方3,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,西门子未连接或配方为本地下发未将完成数据反馈至MES系统。");
}
HKDevice.HK_PLC_S7.Write("DB99.DBX1.6", true);
GVL_BigStation.Recipe3DosingStatus = 3;
}
@@ -1695,7 +1709,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model
GVL_BigStation.Recipe4DosingStatus = 3;
MessageNotify.GetInstance.ShowRunLog($"配方4,配方编号:{code},托盘编号:{trayCode},配料完成");
ReadStockBinDosingWeight(SiemensRecipes.ElementAt(index));
if (SiemensDevice.IsConnected && !GVL_BigStation.IsUseLocalRecipe)
if (SiemensDevice.IsConnected && SiemensRecipes.ElementAt(index).RecipesSource == RecipeSource.远程 /*!GVL_BigStation.IsUseLocalRecipe*/)
{
FinishData.Order_No = SiemensRecipes.ElementAt(index).RecipeCode;
FinishData.Product_Code = SiemensRecipes.ElementAt(index).RecipeName;
@@ -1717,6 +1731,10 @@ namespace BPASmartClient.JXJFoodBigStation.Model
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361);
MessageNotify.GetInstance.ShowRunLog($"配方4,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子");
}
else
{
MessageNotify.GetInstance.ShowRunLog($"配方4,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,西门子未连接或配方为本地下发未将完成数据反馈至MES系统。");
}
HKDevice.HK_PLC_S7.Write("DB99.DBX1.7", true);
GVL_BigStation.Recipe4DosingStatus = 3;
}


+ 4
- 1
BPASmartClient.JXJFoodBigStation/View/RecipeSendDownView.xaml Просмотреть файл

@@ -427,7 +427,10 @@
<RowDefinition Height="40" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Button Content="筛选配方" Style="{StaticResource ButtonStyle}" Command="{Binding SelectRecipesCommand}" />
<Button
Command="{Binding SelectRecipesCommand}"
Content="筛选配方"
Style="{StaticResource ButtonStyle}" />

<Grid
Name="ggr"


+ 6
- 2
BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs Просмотреть файл

@@ -577,6 +577,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
RecipeQueueTray[i].Enqueue(data.RecipeCode);
GVL_SmallStation.GetInstance.SiemensSendRecipeStatus = 0;
MessageNotify.GetInstance.ShowRunLog($"西门子配方配料 ,不使用小料配料,配方ID:【{data.RecipeCode}】,加入配方队列【{i+1}】");
break;
}
}
else if (GVL_SmallStation.GetInstance.PlcAllowIssueRecipe[i])
@@ -586,6 +587,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
RecipeQueueTray[i].Enqueue(data.RecipeCode);
GVL_SmallStation.GetInstance.SiemensSendRecipeStatus = 0;
MessageNotify.GetInstance.ShowRunLog($"西门子配方配料 ,等待PLC允许配料,配方ID:【{data.RecipeCode}】,加入配方队列【{i+1}】");
break;
}
}
}
@@ -727,7 +729,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
{
Thread.Sleep(5000);
var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == code);
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;
@@ -1406,7 +1408,8 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
RecipeCode = recipe.RecipeCode,
RawMaterial = RawMaterials,
TrayCode = recipe.StockCode,
WindSend = WindSendData
WindSend = WindSendData,
RecipesSource=RecipeSource.远程
});
});
}
@@ -1424,6 +1427,7 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
newRecipe.RecipeName = rm.RecipeName;
newRecipe.RecipeCode = rm.RecipeCode;
newRecipe.TrayCode = rm.TrayCode;
newRecipe.RecipesSource = RecipeSource.本地;

foreach (var item in rm.RawMaterial)
{


+ 7
- 0
BPASmartClient.JXJFoodSmallStation/Model/Siemens/RemoteRecipeData.cs Просмотреть файл

@@ -39,5 +39,12 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
public ObservableCollection<WindSendRawMaterial> WindSend { get; set; } = new ObservableCollection<WindSendRawMaterial>();


public RecipeSource RecipesSource { get { return _mRecipesSource; } set { _mRecipesSource = value; OnPropertyChanged(); } }
private RecipeSource _mRecipesSource = RecipeSource.远程;
}
public enum RecipeSource
{
本地,
远程
}
}

+ 1
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/NewLocalRecipeViewModel.cs Просмотреть файл

@@ -237,6 +237,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
TrayCode = TrayNum,
RawMaterial = RawMaterials,
WindSend = WindSendRawMaterials,
RecipesSource=RecipeSource.本地
};
Json<LocalRecipeDataColl>.Data.Recipes.Add(newRemoteRecipeData);
//新增一条配方应该默认显示出来。


+ 1
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs Просмотреть файл

@@ -150,6 +150,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
RecipeCode = recipeCode,
TrayCode = trayCode,
RawMaterial = RawMaterials,
RecipesSource=RecipeSource.本地,
};
Json<LocalRecipeDataColl>.Data.Recipes.Add(newRemoteRecipedata);



Загрузка…
Отмена
Сохранить