Browse Source

吉香居代码更新

master
pengliangyang 2 years ago
parent
commit
3c3199b0fa
9 changed files with 126 additions and 70 deletions
  1. +15
    -0
      BPASmartClient.JXJFoodBigStation/BPASmartClient.JXJFoodBigStation.csproj
  2. +45
    -23
      BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs
  3. +3
    -3
      BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs
  4. +1
    -15
      BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs
  5. +26
    -0
      BPASmartClient.JXJFoodBigStation/Properties/Settings.Designer.cs
  6. +6
    -0
      BPASmartClient.JXJFoodBigStation/Properties/Settings.settings
  7. +20
    -15
      BPASmartClient.JXJFoodSmallStation/Model/ProcessControl.cs
  8. +4
    -8
      BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs
  9. +6
    -6
      BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml

+ 15
- 0
BPASmartClient.JXJFoodBigStation/BPASmartClient.JXJFoodBigStation.csproj View File

@@ -17,6 +17,21 @@
<ProjectReference Include="..\BPASmartClient.S7Net\BPASmartClient.S7Net.csproj" /> <ProjectReference Include="..\BPASmartClient.S7Net\BPASmartClient.S7Net.csproj" />
</ItemGroup> </ItemGroup>


<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>

<ItemGroup> <ItemGroup>
<Page Update="View\HardwareStatusView.xaml"> <Page Update="View\HardwareStatusView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime> <XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>


+ 45
- 23
BPASmartClient.JXJFoodBigStation/Model/ProcessControl.cs View File

@@ -366,15 +366,19 @@ namespace BPASmartClient.JXJFoodBigStation.Model
item.Laying_Off_Weight = HKDevice.PlcRead.StockBin14ActualWeight; item.Laying_Off_Weight = HKDevice.PlcRead.StockBin14ActualWeight;
} }
} }
FinishData.Order_No = Recipes.ElementAt(index).RecipeCode;
FinishData.Product_Code = Recipes.ElementAt(index).RecipeName;
for (int i = 0; i < Recipes.ElementAt(index).RawMaterial.Count; i++)
{
FinishData.Material[i] = new UDT1();
FinishData.Material[i].Material_Name = Recipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialName;
FinishData.Material[i].Material_BarrelNum = (short)Recipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum;
FinishData.Material[i].Material_Laying_Off_Weight = Recipes.ElementAt(index).RawMaterial.ElementAt(i).Laying_Off_Weight;
}
}
FinishData.Order_No = Recipes.ElementAt(index).RecipeCode;
FinishData.Product_Code = Recipes.ElementAt(index).RecipeName;
FinishData.job_No =(short) Recipes.ElementAt(index).TrayCode;
for (int i = 0; i < FinishData.Material.Length; i++)
{
FinishData.Material[i] = new UDT1();
}
for (int i = 0; i < Recipes.ElementAt(index).RawMaterial.Count; i++)
{
FinishData.Material[i].Material_Name = Recipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialName;
FinishData.Material[i].Material_BarrelNum = (short)Recipes.ElementAt(index).RawMaterial.ElementAt(i).RawMaterialBarrelNum;
FinishData.Material[i].Material_Laying_Off_Weight = Recipes.ElementAt(index).RawMaterial.ElementAt(i).Laying_Off_Weight;
} }
if (SiemensDevice.IsConnected) if (SiemensDevice.IsConnected)
{ {
@@ -819,20 +823,38 @@ namespace BPASmartClient.JXJFoodBigStation.Model
RawMaterialsNamePos.Clear(); RawMaterialsNamePos.Clear();
if (!HKDevice.IsConnected) if (!HKDevice.IsConnected)
{ {
RawMaterialsNamePos.Add("A10", 1);
RawMaterialsNamePos.Add("A20", 2);
RawMaterialsNamePos.Add("A30", 3);
RawMaterialsNamePos.Add("A40", 4);
RawMaterialsNamePos.Add("A50", 5);
RawMaterialsNamePos.Add("A60", 6);
RawMaterialsNamePos.Add("A70", 7);
RawMaterialsNamePos.Add("A80", 8);
RawMaterialsNamePos.Add("A90", 9);
RawMaterialsNamePos.Add("A100", 10);
RawMaterialsNamePos.Add("A110", 11);
RawMaterialsNamePos.Add("A120", 12);
RawMaterialsNamePos.Add("A130", 13);
RawMaterialsNamePos.Add("A140", 14);
RawMaterialsNamePos.Add("0005", 1);
RawMaterialsNamePos.Add("0006", 2);
RawMaterialsNamePos.Add("0007", 3);
RawMaterialsNamePos.Add("0008", 4);
RawMaterialsNamePos.Add("0009", 5);
RawMaterialsNamePos.Add("0010", 6);
RawMaterialsNamePos.Add("0011", 7);
RawMaterialsNamePos.Add("0012", 8);
RawMaterialsNamePos.Add("0013", 9);
RawMaterialsNamePos.Add("0014", 10);
RawMaterialsNamePos.Add("0015", 11);
RawMaterialsNamePos.Add("0016", 12);
RawMaterialsNamePos.Add("0017", 13);
RawMaterialsNamePos.Add("0018", 14);
RawMaterialsNamePos.Add("0019", 14);
RawMaterialsNamePos.Add("0020", 14);
RawMaterialsNamePos.Add("0021", 14);
RawMaterialsNamePos.Add("0022", 14);
RawMaterialsNamePos.Add("0023", 14);
RawMaterialsNamePos.Add("0024", 14);
RawMaterialsNamePos.Add("0025", 14);
RawMaterialsNamePos.Add("0026", 14);
RawMaterialsNamePos.Add("0027", 14);
RawMaterialsNamePos.Add("0028", 14);
RawMaterialsNamePos.Add("0029", 14);
RawMaterialsNamePos.Add("0030", 14);
RawMaterialsNamePos.Add("0031", 14);
RawMaterialsNamePos.Add("0032", 14);
RawMaterialsNamePos.Add("0033", 14);
RawMaterialsNamePos.Add("0034", 14);
RawMaterialsNamePos.Add("0035", 14);
RawMaterialsNamePos.Add("0040", 14);
} }
/* /*
HKDevice.StockBinName.RawMaterialName1 = "1"; HKDevice.StockBinName.RawMaterialName1 = "1";


+ 3
- 3
BPASmartClient.JXJFoodBigStation/Model/Siemens/DL_Finish_DB.cs View File

@@ -20,12 +20,12 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
/// <summary> /// <summary>
/// 生产工单编码 /// 生产工单编码
/// </summary> /// </summary>
public string Order_No{get; set; }
public string Order_No { get; set; } = "";
[Siemens(16)] [Siemens(16)]
/// <summary> /// <summary>
/// 产品名称 /// 产品名称
/// </summary> /// </summary>
public string Product_Code { get; set; }
public string Product_Code { get; set; } = "";
public short job_No { get; set; } public short job_No { get; set; }
/// <summary> /// <summary>
/// 原料信息 /// 原料信息
@@ -43,7 +43,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
public class UDT1 public class UDT1
{ {
[Siemens(6)] [Siemens(6)]
public string Material_Name { get; set; }
public string Material_Name { get; set; } = "";
public float Material_Laying_Off_Weight { get; set; } public float Material_Laying_Off_Weight { get; set; }
public short Material_BarrelNum { get; set; } public short Material_BarrelNum { get; set; }
} }


+ 1
- 15
BPASmartClient.JXJFoodBigStation/Model/Siemens/SiemensDeviceStatus.cs View File

@@ -29,20 +29,6 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
var res3 = this.Siemens_PLC_S7.ReadClass<DL_DataColl_DB>(2391); var res3 = this.Siemens_PLC_S7.ReadClass<DL_DataColl_DB>(2391);
if (res != null && res is DL_Start_DB start) if (res != null && res is DL_Start_DB start)
{ {
if (a)
{
start.RecipeName = "配方1";
start.RecipeCode = "1201";
start.Order_Request_Ack = true;

for (int i = 0; i < GVL_BigStation.Max_DosingSotckBinNum ; i++)
{
start.Material[i] = new UDT();
start.Material[i].Material_Name = "" + (i +1);
start.Material[i].Material_Weight = 100 + (i + 1);
start.Material[i].Material_BarrelNum = (short)(i + 1);
}
}
if (RTrig.GetInstance("Order_Request").Start(GVL_BigStation.Order_Request) && GVL_BigStation.SiemensSendRecipeStatus == 0) if (RTrig.GetInstance("Order_Request").Start(GVL_BigStation.Order_Request) && GVL_BigStation.SiemensSendRecipeStatus == 0)
{ {
GVL_BigStation.SiemensSendRecipeStatus = 1; GVL_BigStation.SiemensSendRecipeStatus = 1;
@@ -78,7 +64,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model.Siemens
GVL_BigStation.SiemensSendRecipeStatus = 0; GVL_BigStation.SiemensSendRecipeStatus = 0;
finish.Ask_For_Finish = false; finish.Ask_For_Finish = false;
finish.ProcessTime = 0; finish.ProcessTime = 0;
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2261);
this.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(finish, 2361);
} }
} }
Thread.Sleep(10); Thread.Sleep(10);


+ 26
- 0
BPASmartClient.JXJFoodBigStation/Properties/Settings.Designer.cs View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace BPASmartClient.JXJFoodBigStation.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

+ 6
- 0
BPASmartClient.JXJFoodBigStation/Properties/Settings.settings View File

@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>

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

@@ -1183,21 +1183,26 @@ namespace BPASmartClient.JXJFoodSmallStation.Model
} }
private void testData() private void testData()
{ {
RawMaterialsNamePos.Add("A10", 1);
RawMaterialsNamePos.Add("A20", 2);
RawMaterialsNamePos.Add("A30", 3);
RawMaterialsNamePos.Add("A40", 4);
RawMaterialsNamePos.Add("A50", 5);
RawMaterialsNamePos.Add("A60", 6);
RawMaterialsNamePos.Add("A70", 7);
RawMaterialsNamePos.Add("A80", 8);
RawMaterialsNamePos.Add("A90", 9);
RawMaterialsNamePos.Add("A100", 10);
RawMaterialsNamePos.Add("A110", 11);
RawMaterialsNamePos.Add("A120", 12);
RawMaterialsNamePos.Add("A130", 13);
RawMaterialsNamePos.Add("A140", 14);
RawMaterialsNamePos.Add("A150", 15);
RawMaterialsNamePos.Add("0041", 1);
RawMaterialsNamePos.Add("0042", 2);
RawMaterialsNamePos.Add("0043", 3);
RawMaterialsNamePos.Add("0044", 4);
RawMaterialsNamePos.Add("0045", 5);
RawMaterialsNamePos.Add("0046", 6);
RawMaterialsNamePos.Add("0047", 7);
RawMaterialsNamePos.Add("0048", 8);
RawMaterialsNamePos.Add("0049", 9);
RawMaterialsNamePos.Add("0050", 10);
RawMaterialsNamePos.Add("0051", 11);
RawMaterialsNamePos.Add("0052", 12);
RawMaterialsNamePos.Add("0053", 13);
RawMaterialsNamePos.Add("0054", 14);
RawMaterialsNamePos.Add("0055", 15);
RawMaterialsNamePos.Add("0056", 15);
RawMaterialsNamePos.Add("0057", 15);
RawMaterialsNamePos.Add("0058", 15);
RawMaterialsNamePos.Add("0059", 15);
RawMaterialsNamePos.Add("0060", 15);
} }
} }
} }

+ 4
- 8
BPASmartClient.JXJFoodSmallStation/Model/Siemens/SiemensDeviceStatus.cs View File

@@ -26,14 +26,6 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens
var Status = this.Siemens_PLC_S7.ReadClass<XL_Status_DB>(2231); var Status = this.Siemens_PLC_S7.ReadClass<XL_Status_DB>(2231);
var Finish = this.Siemens_PLC_S7.ReadClass<XL_Finish_DB>(2261); var Finish = this.Siemens_PLC_S7.ReadClass<XL_Finish_DB>(2261);
var DataColl = this.Siemens_PLC_S7.ReadClass<XL_DataColl_DB>(2291); var DataColl = this.Siemens_PLC_S7.ReadClass<XL_DataColl_DB>(2291);
if (test)
{
for (int i = 0; i < XL_Status.Powder.Length; i++) {

XL_Status.Powder.ElementAt(i).Powder_Name = ""+i;
}
Siemens_PLC_S7.WriteClass<XL_Status_DB>(XL_Status, 2231);
}
if (Start != null && Start is XL_Start_DB st) if (Start != null && Start is XL_Start_DB st)
{ {
if (RTrig.GetInstance("DB2201.DBX450.0").Start(GVL_SmallStation.IsAllowSiemensSendRecipe) && GVL_SmallStation.SiemensSendRecipeStatus == 0) if (RTrig.GetInstance("DB2201.DBX450.0").Start(GVL_SmallStation.IsAllowSiemensSendRecipe) && GVL_SmallStation.SiemensSendRecipeStatus == 0)
@@ -80,6 +72,10 @@ namespace BPASmartClient.JXJFoodSmallStation.Model.Siemens
} }
if (Status != null && Status is XL_Status_DB state) if (Status != null && Status is XL_Status_DB state)
{ {
for (int i = 0; i < XL_Status.Powder.Length; i++)
{
XL_Status.Powder[i] = new PowderStatus();
}
XL_Status = state; XL_Status = state;
if (RTrig.GetInstance("Allow_AGV_Put[0]").Start(Status.AgvRequestPut)) if (RTrig.GetInstance("Allow_AGV_Put[0]").Start(Status.AgvRequestPut))
{ {


+ 6
- 6
BPASmartClient.JXJFoodSmallStation/View/RecipeInfosView.xaml View File

@@ -77,17 +77,17 @@
<RowDefinition></RowDefinition> <RowDefinition></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<WrapPanel> <WrapPanel>
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方名称:" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="配方名称:" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="{Binding RecipeName}" />
</WrapPanel> </WrapPanel>
<WrapPanel Grid.Column="1"> <WrapPanel Grid.Column="1">
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="配方编号:" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="配方编号:" />
<TextBlock Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="{Binding RecipeCode}" />
</WrapPanel> </WrapPanel>


<WrapPanel Grid.Row="1"> <WrapPanel Grid.Row="1">
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="托盘编号:" />
<TextBlock Grid.Row="1" Margin="10,0,0,0" Background="Transparent" FontSize="20" Foreground="#FF2AB2E7" Text="{Binding TrayCode}" />
<TextBlock Margin="10,0,0,0" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="托盘编号:" />
<TextBlock Grid.Row="1" Margin="10,10" Background="Transparent" FontSize="16" Foreground="#FF2AB2E7" Text="{Binding TrayCode}" />
</WrapPanel> </WrapPanel>
<Button Grid.Column="1" Grid.Row="1" Width="100" Command="{Binding ReturnPage}" HorizontalAlignment="Left" Margin="10,0,0,0">返回</Button> <Button Grid.Column="1" Grid.Row="1" Width="100" Command="{Binding ReturnPage}" HorizontalAlignment="Left" Margin="10,0,0,0">返回</Button>


Loading…
Cancel
Save