Browse Source

对新增配料管理系统做修改。

master
ZhaoGang 1 year ago
parent
commit
54498f2e56
43 changed files with 105 additions and 1413 deletions
  1. +0
    -9
      BPASmartClient.FoodStationTest/App.config
  2. +7
    -21
      BPASmartClient.FoodStationTest/App.xaml.cs
  3. +1
    -10
      BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj
  4. +0
    -0
      BPASmartClient.FoodStationTest/Converter/DataTableRedundantConverter.cs
  5. +0
    -0
      BPASmartClient.FoodStationTest/Converter/RunStatusConvert.cs
  6. +0
    -6
      BPASmartClient.FoodStationTest/Model/GVL/GVL.cs
  7. +0
    -111
      BPASmartClient.FoodStationTest/Model/GVL/ReadSmallMaterial.cs
  8. +0
    -179
      BPASmartClient.FoodStationTest/Model/GVL/WriteSmallMaterial.cs
  9. +0
    -5
      BPASmartClient.FoodStationTest/Model/GVL_SmallStation.cs
  10. +0
    -10
      BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceRead.cs
  11. +0
    -134
      BPASmartClient.FoodStationTest/Model/HK_PLC/HKPlcCommAddress.cs
  12. +0
    -12
      BPASmartClient.FoodStationTest/Model/HK_PLC/PlcManualComm.cs
  13. +1
    -4
      BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs
  14. +9
    -1
      BPASmartClient.FoodStationTest/Model/Par/LocaPar.cs
  15. +24
    -14
      BPASmartClient.FoodStationTest/Model/ProcessControl.cs
  16. +0
    -22
      BPASmartClient.FoodStationTest/Model/RawMaterial/ActionMenu.cs
  17. +0
    -10
      BPASmartClient.FoodStationTest/Model/RawMaterial/ConveyorServer.cs
  18. +0
    -22
      BPASmartClient.FoodStationTest/Model/RawMaterial/CylinderStatusModel.cs
  19. +3
    -0
      BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceAddress.cs
  20. +17
    -16
      BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs
  21. +0
    -7
      BPASmartClient.FoodStationTest/Model/RawMaterial/GlobalData.cs
  22. +0
    -15
      BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeProcess.cs
  23. +4
    -0
      BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs
  24. +3
    -1
      BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeDataColl.cs
  25. +9
    -12
      BPASmartClient.FoodStationTest/View/HardwareStatusView.xaml
  26. +1
    -1
      BPASmartClient.FoodStationTest/View/ManualControlView.xaml
  27. +2
    -26
      BPASmartClient.FoodStationTest/View/ManualFlowView.xaml
  28. +1
    -10
      BPASmartClient.FoodStationTest/View/RecipeReceiveView.xaml
  29. +0
    -1
      BPASmartClient.FoodStationTest/View/RecipeReceiveView.xaml.cs
  30. +0
    -308
      BPASmartClient.FoodStationTest/View/RobotView.xaml
  31. +0
    -15
      BPASmartClient.FoodStationTest/View/RobotView.xaml.cs
  32. +2
    -16
      BPASmartClient.FoodStationTest/View/SystemParView.xaml
  33. +0
    -218
      BPASmartClient.FoodStationTest/View/WindSendParView.xaml
  34. +0
    -16
      BPASmartClient.FoodStationTest/View/WindSendParView.xaml.cs
  35. +3
    -3
      BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs
  36. +2
    -2
      BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs
  37. +9
    -9
      BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs
  38. +1
    -1
      BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs
  39. +1
    -2
      BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs
  40. +5
    -5
      BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs
  41. +0
    -129
      BPASmartClient.FoodStationTest/ViewModel/RobotViewModel.cs
  42. +0
    -8
      BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs
  43. +0
    -22
      BPASmartClient.FoodStationTest/ViewModel/WindSendParViewModel.cs

+ 0
- 9
BPASmartClient.FoodStationTest/App.config View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="RawMaterial_IP" value="107.107.2."/>
<add key="HKPlc_IP" value="107.107.2.88"/>
<add key="Siemens_IP" value="107.107.2.200"/>
<add key="WindSend_IP" value="107.107.2.210"/>
</appSettings>
</configuration>

+ 7
- 21
BPASmartClient.FoodStationTest/App.xaml.cs View File

@@ -35,7 +35,8 @@ namespace BPASmartClient.FoodStationTest
DataInit();
Init();
MainView mv = new MainView();
mv.TitleName = "自动化产线-小料站上位机控制系统";
//TODO:修改软件名称。
mv.TitleName = "自动化产线-上位机控制系统";
LoginView lv = new LoginView();
var res = lv.ShowDialog();
if (res != null && res == true)
@@ -45,7 +46,7 @@ namespace BPASmartClient.FoodStationTest
}
else
mv.Close();
GVL_SmallStation.GetInstance.RecipeDosingCompleNum = Json<LocaPar>.Data.RecipeDosingCompleNum;
GVL_SmallStation.GetInstance.RecipeDosingCompleNum = Json<LocalPar>.Data.RecipeDosingCompleNum;
MainWindow = mv;
}
private async void Init()
@@ -60,8 +61,8 @@ namespace BPASmartClient.FoodStationTest
protected override void OnExit(ExitEventArgs e)
{
base.OnExit(e);
Json<LocaPar>.Data.RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum;
Json<LocaPar>.Save();
Json<LocalPar>.Data.RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum;
Json<LocalPar>.Save();
Json<LocalRecipeDataColl>.Save();
Json<RemoteRecipeDataColl>.Save();
MessageNotify.GetInstance.LogSave();
@@ -122,13 +123,6 @@ namespace BPASmartClient.FoodStationTest
ToggleWindowPath = "View.DeviceMaterialParView"
});
ParSet.Add(new SubMenumodel()
{
SubMenuName = "粉仓参数设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
AssemblyName = "BPASmartClient.FoodStationTest",
ToggleWindowPath = "View.WindSendParView"
});
ParSet.Add(new SubMenumodel()
{
SubMenuName = "系统参数设置",
SubMenuPermission = new Permission[] { Permission.管理员 },
@@ -183,14 +177,6 @@ namespace BPASmartClient.FoodStationTest
AssemblyName = "BPASmartClient.FoodStationTest",
ToggleWindowPath = "View.ManualFlowView"

});
ManualControl.Add(new SubMenumodel()
{
SubMenuName = "机器人设备控制",
SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
AssemblyName = "BPASmartClient.FoodStationTest",
ToggleWindowPath = "View.RobotView"

});

MenuManage.GetInstance.menuModels.Add(new MenuModel()
@@ -239,7 +225,7 @@ namespace BPASmartClient.FoodStationTest
InfoLog.Add(new SubMenumodel()
{
SubMenuName = "调试日志",
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员, Permission.技术员 },
SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
AssemblyName = "BPASmartClient.CustomResource",
ToggleWindowPath = "Pages.View.DebugLogView"
});
@@ -339,7 +325,7 @@ namespace BPASmartClient.FoodStationTest
private void DataInit()
{
//Config.GetInstance.Init();
Json<LocaPar>.Read();
Json<LocalPar>.Read();
Json<DevicePar>.Read();
Json<LocalRecipeDataColl>.Read();
Json<RemoteRecipeDataColl>.Read();


+ 1
- 10
BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj View File

@@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BPA.Communication" Version="1.0.104" />
<PackageReference Include="BPA.Communication" Version="1.0.105" />
</ItemGroup>

<ItemGroup>
@@ -30,9 +30,6 @@
<Compile Update="View\ManualFlowView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\RobotView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SelectRecipesView.xaml.cs">
<SubType>Code</SubType>
</Compile>
@@ -81,9 +78,6 @@
<Page Update="View\RecipeSettingsView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\RobotView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\SiemensRecipeReceiveView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
@@ -93,9 +87,6 @@
<Page Update="View\SystemParView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="View\WindSendParView.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
</ItemGroup>

</Project>

BPASmartClient.FoodStationTest/Model/Converter/DataTableRedundantConverter.cs → BPASmartClient.FoodStationTest/Converter/DataTableRedundantConverter.cs View File


BPASmartClient.FoodStationTest/Model/Converter/RunStatusConvert.cs → BPASmartClient.FoodStationTest/Converter/RunStatusConvert.cs View File


+ 0
- 6
BPASmartClient.FoodStationTest/Model/GVL/GVL.cs View File

@@ -1,6 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model.GVL
{
public class GVL
{
}
}

+ 0
- 111
BPASmartClient.FoodStationTest/Model/GVL/ReadSmallMaterial.cs View File

@@ -1,111 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model.GVL
{
public class ReadSmallMaterial
{
/// <summary>
/// PLC到上位机心跳
/// </summary>
public bool Heart { get; set; }
public bool Agv1 { get; set; }
public bool Agv2 { get; set; }
public bool Agv3 { get; set; }
public bool Agv4 { get; set; }
public bool Agv5 { get; set; }
public bool Agv6 { get; set; }
/// <summary>
/// 1#托盘工位占用
/// </summary>
public bool Tray1BeOccupied { get; set; }
/// <summary>
/// 2#托盘工位占用
/// </summary>
public bool Tray2BeOccupied { get; set; }
/// <summary>
/// 1#托盘工位配料完成
/// </summary>
public bool Tray1MaterialFinish { get; set; }
/// <summary>
/// 2#托盘工位配料完成
/// </summary>
public bool Tray2MaterialFinish { get; set; }
/// <summary>
/// 接收托盘1配方数据完成
/// </summary>
public bool Tray1ReceiveFinish { get; set; }
/// <summary>
/// 接收托盘2配方数据完成
/// </summary>
public bool Tray2ReceiveFinish { get; set; }

public int Reserve1 { get; set; }
public int Receive2 { get; set; }
/// <summary>
/// 托盘1_1#桶位置反馈
/// </summary>
public float Tray1Barrel1Location { get; set; }
/// <summary>
/// 托盘1_2#桶位置反馈
/// </summary>
public float Tray1Barrel2Location { get; set; }
/// <summary>
/// 托盘1_3#桶位置反馈
/// </summary>
public float Tray1Barrel3Location { get; set; }
/// <summary>
/// 托盘1_4#桶位置反馈
/// </summary>
public float Tray1Barrel4Location { get; set; }
/// <summary>
/// 托盘2_1#桶位置反馈
/// </summary>
public float Tray2Barrel1Location { get; set; }
/// <summary>
/// 托盘2_2#桶位置反馈
/// </summary>
public float Tray2Barrel2Location { get; set; }
/// <summary>
/// 托盘2_3#桶位置反馈
/// </summary>
public float Tray2Barrel3Location { get; set; }
/// <summary>
/// 托盘2_4#桶位置反馈
/// </summary>
public float Tray2Barrel4Location { get; set; }

public int Reserve3 { get; set; }
public int Receive4 { get; set; }
/// <summary>
/// 托盘1_1#桶允许配料
/// </summary>
public float Tray1Barrel1AllowDosing { get; set; }
/// <summary>
/// 托盘1_2#桶允许配料
/// </summary>
public float Tray1Barrel2AllowDosing { get; set; }
/// <summary>
/// 托盘1_3#桶允许配料
/// </summary>
public float Tray1Barrel3AllowDosing { get; set; }
/// <summary>
/// 托盘1_4#桶允许配料
/// </summary>
public float Tray1Barrel4AllowDosing { get; set; }
/// <summary>
/// 托盘2_1#桶允许配料
/// </summary>
public float Tray2Barrel1AllowDosing { get; set; }
/// <summary>
/// 托盘2_2#桶允许配料
/// </summary>
public float Tray2Barrel2AllowDosing { get; set; }
/// <summary>
/// 托盘2_3#桶允许配料
/// </summary>
public float Tray2Barrel3AllowDosing { get; set; }
/// <summary>
/// 托盘2_4#桶允许配料
/// </summary>
public float Tray2Barrel4AllowDosing { get; set; }

}
}

+ 0
- 179
BPASmartClient.FoodStationTest/Model/GVL/WriteSmallMaterial.cs View File

@@ -1,179 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model.GVL
{
public class WriteSmallMaterial
{
/// <summary>
/// PLC到上位机心跳
/// </summary>
public bool Heart { get; set; }
public bool Agv1 { get; set; }
public bool Agv2 { get; set; }
public bool Agv3 { get; set; }
public bool Agv4 { get; set; }
public bool Agv5 { get; set; }
public bool Agv6 { get; set; }
public bool Agv7 { get; set; }
public bool Agv8 { get; set; }
public bool Agv9 { get; set; }
public bool Agv10 { get; set; }
/// <summary>
/// 下发配方到托盘1
/// </summary>
public bool Tray1IssueRecipe { get; set; }
/// <summary>
/// 下发配方到托盘2
/// </summary>
public bool Tray2IssueRecipe { get; set; }
public int Reserve1 { get; set; }
public int Receive2 { get; set; }


public bool Tray1Barrel1IsDosing1;
public bool Tray1Barrel1IsDosing2;
public bool Tray1Barrel1IsDosing3;
public bool Tray1Barrel1IsDosing4;
public bool Tray1Barrel1IsDosing5;
public bool Tray1Barrel1IsDosing6;
public bool Tray1Barrel1IsDosing7;
public bool Tray1Barrel1IsDosing8;
public bool Tray1Barrel1IsDosing9;
public bool Tray1Barrel1IsDosing10;
public bool Tray1Barrel1IsDosing11;
public bool Tray1Barrel1IsDosing12;
public bool Tray1Barrel1IsDosing13;
public bool Tray1Barrel1IsDosing14;
public bool Tray1Barrel1IsDosing15;
public bool Receive3;
public bool Tray1Barrel2IsDosing1;
public bool Tray1Barrel2IsDosing2;
public bool Tray1Barrel2IsDosing3;
public bool Tray1Barrel2IsDosing4;
public bool Tray1Barrel2IsDosing5;
public bool Tray1Barrel2IsDosing6;
public bool Tray1Barrel2IsDosing7;
public bool Tray1Barrel2IsDosing8;
public bool Tray1Barrel2IsDosing9;
public bool Tray1Barrel2IsDosing10;
public bool Tray1Barrel2IsDosing11;
public bool Tray1Barrel2IsDosing12;
public bool Tray1Barrel2IsDosing13;
public bool Tray1Barrel2IsDosing14;
public bool Tray1Barrel2IsDosing15;
public bool Receive4;
public bool Tray1Barrel3IsDosing1;
public bool Tray1Barrel3IsDosing2;
public bool Tray1Barrel3IsDosing3;
public bool Tray1Barrel3IsDosing4;
public bool Tray1Barrel3IsDosing5;
public bool Tray1Barrel3IsDosing6;
public bool Tray1Barrel3IsDosing7;
public bool Tray1Barrel3IsDosing8;
public bool Tray1Barrel3IsDosing9;
public bool Tray1Barrel3IsDosing10;
public bool Tray1Barrel3IsDosing11;
public bool Tray1Barrel3IsDosing12;
public bool Tray1Barrel3IsDosing13;
public bool Tray1Barrel3IsDosing14;
public bool Tray1Barrel3IsDosing15;
public bool Receive5;
public bool Tray1Barrel4IsDosing1;
public bool Tray1Barrel4IsDosing2;
public bool Tray1Barrel4IsDosing3;
public bool Tray1Barrel4IsDosing4;
public bool Tray1Barrel4IsDosing5;
public bool Tray1Barrel4IsDosing6;
public bool Tray1Barrel4IsDosing7;
public bool Tray1Barrel4IsDosing8;
public bool Tray1Barrel4IsDosing9;
public bool Tray1Barrel4IsDosing10;
public bool Tray1Barrel4IsDosing11;
public bool Tray1Barrel4IsDosing12;
public bool Tray1Barrel4IsDosing13;
public bool Tray1Barrel4IsDosing14;
public bool Tray1Barrel4IsDosing15;
public bool Receive6;

public bool Tray2Barrel1IsDosing1;
public bool Tray2Barrel1IsDosing2;
public bool Tray2Barrel1IsDosing3;
public bool Tray2Barrel1IsDosing4;
public bool Tray2Barrel1IsDosing5;
public bool Tray2Barrel1IsDosing6;
public bool Tray2Barrel1IsDosing7;
public bool Tray2Barrel1IsDosing8;
public bool Tray2Barrel1IsDosing9;
public bool Tray2Barrel1IsDosing10;
public bool Tray2Barrel1IsDosing11;
public bool Tray2Barrel1IsDosing12;
public bool Tray2Barrel1IsDosing13;
public bool Tray2Barrel1IsDosing14;
public bool Tray2Barrel1IsDosing15;
public bool Receive7;
public bool Tray2Barrel2IsDosing1;
public bool Tray2Barrel2IsDosing2;
public bool Tray2Barrel2IsDosing3;
public bool Tray2Barrel2IsDosing4;
public bool Tray2Barrel2IsDosing5;
public bool Tray2Barrel2IsDosing6;
public bool Tray2Barrel2IsDosing7;
public bool Tray2Barrel2IsDosing8;
public bool Tray2Barrel2IsDosing9;
public bool Tray2Barrel2IsDosing10;
public bool Tray2Barrel2IsDosing11;
public bool Tray2Barrel2IsDosing12;
public bool Tray2Barrel2IsDosing13;
public bool Tray2Barrel2IsDosing14;
public bool Tray2Barrel2IsDosing15;
public bool Receive8;
public bool Tray2Barrel3IsDosing1;
public bool Tray2Barrel3IsDosing2;
public bool Tray2Barrel3IsDosing3;
public bool Tray2Barrel3IsDosing4;
public bool Tray2Barrel3IsDosing5;
public bool Tray2Barrel3IsDosing6;
public bool Tray2Barrel3IsDosing7;
public bool Tray2Barrel3IsDosing8;
public bool Tray2Barrel3IsDosing9;
public bool Tray2Barrel3IsDosing10;
public bool Tray2Barrel3IsDosing11;
public bool Tray2Barrel3IsDosing12;
public bool Tray2Barrel3IsDosing13;
public bool Tray2Barrel3IsDosing14;
public bool Tray2Barrel3IsDosing15;
public bool Receive9;
public bool Tray2Barrel4IsDosing1;
public bool Tray2Barrel4IsDosing2;
public bool Tray2Barrel4IsDosing3;
public bool Tray2Barrel4IsDosing4;
public bool Tray2Barrel4IsDosing5;
public bool Tray2Barrel4IsDosing6;
public bool Tray2Barrel4IsDosing7;
public bool Tray2Barrel4IsDosing8;
public bool Tray2Barrel4IsDosing9;
public bool Tray2Barrel4IsDosing10;
public bool Tray2Barrel4IsDosing11;
public bool Tray2Barrel4IsDosing12;
public bool Tray2Barrel4IsDosing13;
public bool Tray2Barrel4IsDosing14;
public bool Tray2Barrel4IsDosing15;
public bool Receive10;
public int Receive11;

public bool StockIn1DosingFinish;
public bool StockIn2DosingFinish;
public bool StockIn3DosingFinish;
public bool StockIn4DosingFinish;
public bool StockIn5DosingFinish;
public bool StockIn6DosingFinish;
public bool StockIn7DosingFinish;
public bool StockIn8DosingFinish;
public bool StockIn9DosingFinish;
public bool StockIn10DosingFinish;
public bool StockIn11DosingFinish;
public bool StockIn12DosingFinish;
public bool StockIn13DosingFinish;
public bool StockIn14DosingFinish;
public bool StockIn15DosingFinish;
public bool Receive12;
}
}

+ 0
- 5
BPASmartClient.FoodStationTest/Model/GVL_SmallStation.cs View File

@@ -228,11 +228,6 @@ namespace BPASmartClient.FoodStationTest.Model
public bool[] StockInDosingComple { get; set; } = new bool[15];


[VarComm("Global", "是否使用粉仓配料")]
/// <summary>
/// 是否使用粉仓配料
/// </summary>
public bool IsUseWindSend { get; set; } = false;

[VarComm("Global", "粉仓正在配料")]
/// <summary>


+ 0
- 10
BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceRead.cs View File

@@ -1,10 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model.HK_PLC
{
public class HKDeviceRead
{
public bool HeartBeat { get; set; }
public bool SystemMode { get; set; }
public bool SystemStart { get; set; }
public bool SystemPause { get; set; }
}
}

+ 0
- 134
BPASmartClient.FoodStationTest/Model/HK_PLC/HKPlcCommAddress.cs View File

@@ -1,134 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model.HK_PLC
{
public class HKPlcCommAddress
{
#region 海科PLC ==> 上位机
/// <summary>
/// 是否允许配料
/// </summary>
public static string IsAllowDosing { get; set; } = "";
/// <summary>
/// 当前料仓位置
/// </summary>
public static string StockBinLocation { get; set; } = "";
/// <summary>
/// 当前料仓的状态(0:无意义,1:到达接料位置)
/// </summary>
public static string StockState { get; set; } = "";
#endregion

#region 上位机 ==> 海科PLC
/// <summary>
/// 料仓位置(配置该配方,所需要多个原料桶,每个原料桶有多个料仓位置)
/// </summary>
public static string StockBinLocationToPLC { get; set; } = "";
/// <summary>
/// 对应桶号
/// </summary>
public static string BarrelNumToPLC { get; set; } = "";
/// <summary>
/// 当前配料机配料完成
/// </summary>
public static string SingleDosingFinishToPLC { get; set; } = "";
/// <summary>
/// 当前配料料仓的位置
/// </summary>
public static string SingleStockBinLocationToPLC { get; set; } = "";

public static string RecipeDosingFinish { get; set; } = "";
#endregion

#region AGV进出站1
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string DeliveryAGVApply { get; set; } = "DB3.DBX0.1";
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string DeliveryAGVIsApply { get; set; } = "";
/// <summary>
/// Agv送货 进站顶升申请
/// </summary>
public static string DeliveryAGVApplyJack { get; set; } = "";
/// <summary>
/// Agv送货 进站顶升申请
/// </summary>
public static string DeliveryAGVIsApplyJack { get; set; } = "";
/// <summary>
/// Agv送货 送货完成
/// </summary>
public static string DeliveryAGVFinsih { get; set; } = "";
/// <summary>
/// Agv送货 工位上有货架
/// </summary>
public static string StationHaveCargo { get; set; } = "";
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string PickAGVApply { get; set; } = "";
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string PickAGVIsApply { get; set; } = "";
/// <summary>
/// Agv送货 取货架完成
/// </summary>
public static string PickCargoAGVFinish { get; set; } = "";
/// <summary>
/// Agv送货 取料完成
/// </summary>
public static string PickAGVFinish { get; set; } = "";
/// <summary>
/// 工位上是否有小车
/// </summary>
public static string StationIsExistTray { get; set; } = "";
#endregion
#region AGV进出站2
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string DeliveryAGVApplyStation2 { get; set; } = "";
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string DeliveryAGVIsApplyStation2 { get; set; } = "";
/// <summary>
/// Agv送货 进站顶升申请
/// </summary>
public static string DeliveryAGVApplyJackStation2 { get; set; } = "";
/// <summary>
/// Agv送货 进站顶升申请
/// </summary>
public static string DeliveryAGVIsApplyJackStation2 { get; set; } = "";
/// <summary>
/// Agv送货 送货完成
/// </summary>
public static string DeliveryAGVFinsihStation2 { get; set; } = "";
/// <summary>
/// Agv送货 工位上有货架
/// </summary>
public static string StationHaveCargoStation2 { get; set; } = "";
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string PickAGVApplyStation2 { get; set; } = "";
/// <summary>
/// Agv送货 进站申请
/// </summary>
public static string PickAGVIsApplyStation2 { get; set; } = "";
/// <summary>
/// Agv送货 取货架完成
/// </summary>
public static string PickCargoAGVFinishStation2 { get; set; } = "";
/// <summary>
/// Agv送货 取料完成
/// </summary>
public static string PickAGVFinishStation2 { get; set; } = "";
/// <summary>
/// 工位上是否有货架
/// </summary>
public static string StationIsExistTrayStation2 { get; set; } = "";
#endregion
}
}

+ 0
- 12
BPASmartClient.FoodStationTest/Model/HK_PLC/PlcManualComm.cs View File

@@ -1,12 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model.HK_PLC
{
public class PlcManualComm
{
public int SerialNum { get; set; }
public string Address { get; set; }
public string Describe { get; set; }
public string NowValue { get; set; }
public string SetValue { get; set; }

}
}

+ 1
- 4
BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs View File

@@ -4,10 +4,7 @@ namespace BPASmartClient.FoodStationTest.Model.Par
{
public class ConnectParMode : ObservableObject
{
public bool SiemensConnect { get { return _mSiemensConnect; } set { _mSiemensConnect = value; OnPropertyChanged(); } }
private bool _mSiemensConnect;
public bool WindSendConnect { get { return _mWindSendConnect; } set { _mWindSendConnect = value; OnPropertyChanged(); } }
private bool _mWindSendConnect;
public bool HKPlcConnect { get { return _mHKPlcConnect; } set { _mHKPlcConnect = value; OnPropertyChanged(); } }
private bool _mHKPlcConnect;
public bool ShieldStockbinAlarm { get { return _mShieldStockbinAlarm; } set { _mShieldStockbinAlarm = value; OnPropertyChanged(); } }


BPASmartClient.FoodStationTest/Model/RawMaterial/LocaPar.cs → BPASmartClient.FoodStationTest/Model/Par/LocaPar.cs View File

@@ -2,12 +2,20 @@

namespace BPASmartClient.FoodStationTest.Model
{
public class LocaPar
public class LocalPar
{
public ObservableCollection<RecipeModel> Recipes { get; set; } = new ObservableCollection<RecipeModel>();

/// <summary>
/// 配方完成数目。
/// </summary>
public int RecipeDosingCompleNum { get; set; } = 0;

/// <summary>
/// 味魔方数量,每个项目应该固定的。
/// </summary>
public int RawMaterialDeviceNum { get; } = 6;

public string HK_PLC_IP { get; }
}
}

+ 24
- 14
BPASmartClient.FoodStationTest/Model/ProcessControl.cs View File

@@ -41,9 +41,6 @@ namespace BPASmartClient.FoodStationTest.Model
/// </summary>
public Dictionary<int, ConcurrentQueue<string>> RecipeQueueTray { get; set; } = new Dictionary<int, ConcurrentQueue<string>>();

public ConcurrentQueue<string> RecipeQueueTray2 = new ConcurrentQueue<string>();



public HKDeviceStatus HKDevice = new HKDeviceStatus();

@@ -52,15 +49,17 @@ namespace BPASmartClient.FoodStationTest.Model

public DateTime StockBinAlarmTime = DateTime.Now;

public string? HK_PLC_IP = ConfigurationManager.AppSettings["HKPlc_IP"];
//public string? HK_PLC_IP = ConfigurationManager.AppSettings["HKPlc_IP"];
public string? HK_PLC_IP = Json<LocalPar>.Data.HK_PLC_IP;

public void Init()
{
RecipeQueueTray.TryAdd(0, new ConcurrentQueue<string>());
RecipeQueueTray.TryAdd(1, new ConcurrentQueue<string>());
RecipeQueueTray.TryAdd(2, new ConcurrentQueue<string>());
RecipeQueueTray.TryAdd(3, new ConcurrentQueue<string>());
RecipeQueueTray.TryAdd(4, new ConcurrentQueue<string>());
//初始化物料集合。
for (int i = 0; i < 5; i++)
{
RecipeQueueTray.TryAdd(i, new ConcurrentQueue<string>());
}

PlcVarMonitor();
StockBinNameWithPos();
RawMaterialNameWithCode();
@@ -75,12 +74,14 @@ namespace BPASmartClient.FoodStationTest.Model
GVL_SmallStation.GetInstance.HeartBeatToPlc = !GVL_SmallStation.GetInstance.HeartBeatToPlc;
HKDevice.HK_PLC_S7.Write("DB4.DBX0.0", GVL_SmallStation.GetInstance.HeartBeatToPlc);
GVL_SmallStation.GetInstance.HeartBeatFromPlc = HKDevice.HK_PLC_S7.Read<bool>("DB45.DBX0.0").Content;
if (DeviceInquire.GetInstance.devices.Count < 15 && HKDevice.IsConnected && Json<RemoteRecipeDataColl>.Data.Recipes.Count > 0 && GVL_SmallStation.GetInstance.DisEnableStockBinAlarm == false && DateTime.Now.Subtract(StockBinAlarmTime).TotalSeconds >= 60 & !GVL_SmallStation.GetInstance.DisEnableStockAlarm)
if (DeviceInquire.GetInstance.devices.Count < Json<LocalPar>.Data.RawMaterialDeviceNum && HKDevice.IsConnected
&& Json<RemoteRecipeDataColl>.Data.Recipes.Count > 0 && GVL_SmallStation.GetInstance.DisEnableStockBinAlarm == false
&& DateTime.Now.Subtract(StockBinAlarmTime).TotalSeconds >= 60 & !GVL_SmallStation.GetInstance.DisEnableStockAlarm)
{
HKDevice.HK_PLC_S7.Write("DB44.DBX3.0", true);
App.Current.Dispatcher.Invoke(() =>
{
MessageNotify.GetInstance.ShowDialog($"未读取到15个柔性味魔方料仓", DialogType.Error);
MessageNotify.GetInstance.ShowDialog($"未读取到全部柔性味魔方料仓。", DialogType.Error);
StockBinAlarmTime = DateTime.Now;
});
HKDevice.HK_PLC_S7.Write("DB44.DBX3.0", false);
@@ -502,7 +503,7 @@ namespace BPASmartClient.FoodStationTest.Model
else
{
//粉料仓下发配方
if (GVL_SmallStation.GetInstance.IsUseWindSend && GVL_SmallStation.GetInstance.WindSendDosing == false /*&& GVL_SmallStation.GetInstance.Tray_AGVLogic[recipeNum] == 2*/)
if (/*GVL_SmallStation.GetInstance.IsUseWindSend &&*/ GVL_SmallStation.GetInstance.WindSendDosing == false /*&& GVL_SmallStation.GetInstance.Tray_AGVLogic[recipeNum] == 2*/)
{

}
@@ -675,9 +676,12 @@ namespace BPASmartClient.FoodStationTest.Model
}
}

/// <summary>
/// 复位所有料仓。
/// </summary>
private void StockBinInit()
{
for (int i = 1; i < 16; i++)
for (int i = 1; i <= Json<LocalPar>.Data.RawMaterialDeviceNum; i++)
{
if (DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3)
{
@@ -703,7 +707,7 @@ namespace BPASmartClient.FoodStationTest.Model
}
}
/// <summary>
/// PLC的DB3变量列表
/// PLC的DB3变量列表。初始化PLC读取DB块变量以及流程变量数据。
/// </summary>
public void PlcVarMonitor()
{
@@ -743,6 +747,9 @@ namespace BPASmartClient.FoodStationTest.Model
}
}
}
/// <summary>
/// 注册需要用到的委托,主要是用于手动控制的。
/// </summary>
public void RegisterInit()
{
//手动控制气缸 DB5.DBX0.0~DB5.DBX4.5
@@ -1107,6 +1114,9 @@ namespace BPASmartClient.FoodStationTest.Model
}), "RobotSetProgramNum", true);

}
/// <summary>
/// 连接海科PLC,并开启重连线程。
/// </summary>
public void DeviceConnect()
{
try


+ 0
- 22
BPASmartClient.FoodStationTest/Model/RawMaterial/ActionMenu.cs View File

@@ -1,22 +0,0 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;

namespace BPASmartClient.FoodStationTest.Model
{
public class ActionMenu : ObservableObject
{
public string CommandParameter { get { return _mCommandParameter; } set { _mCommandParameter = value; OnPropertyChanged(); } }
private string _mCommandParameter;

//public Permission[] permission { get { return _mpermission; } set { _mpermission = value; OnPropertyChanged(); } }
//private Permission[] _mpermission;

public string MenuName { get { return _mMenuName; } set { _mMenuName = value; OnPropertyChanged(); } }
private string _mMenuName;


//public string NameSpace { get { return _mNameSpace; } set { _mNameSpace = value; OnPropertyChanged(); } }
//private string _mNameSpace;


}
}

+ 0
- 10
BPASmartClient.FoodStationTest/Model/RawMaterial/ConveyorServer.cs View File

@@ -1,10 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model
{
public class ConveyorServer
{
public ConveyorServer()
{

}
}
}

+ 0
- 22
BPASmartClient.FoodStationTest/Model/RawMaterial/CylinderStatusModel.cs View File

@@ -1,22 +0,0 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;

namespace BPASmartClient.FoodStationTest.Model
{
public class CylinderStatusModel : ObservableObject
{
/// <summary>
/// 气缸原点信号
/// </summary>
public bool HomeStatus { get { return _mHomeStatus; } set { _mHomeStatus = value; OnPropertyChanged(); } }
private bool _mHomeStatus;

/// <summary>
/// 气缸到位信号
/// </summary>
public bool InPlace { get { return _mInPlace; } set { _mInPlace = value; OnPropertyChanged(); } }
private bool _mInPlace;



}
}

+ 3
- 0
BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceAddress.cs View File

@@ -1,5 +1,8 @@
namespace BPASmartClient.FoodStationTest.Model
{
/// <summary>
/// 味魔法通讯地址。
/// </summary>
public class DeviceAddress
{
/// <summary>


+ 17
- 16
BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs View File

@@ -20,6 +20,7 @@ namespace BPASmartClient.FoodStationTest.Model
public static DeviceInquire GetInstance => _Instance ?? (_Instance = new DeviceInquire());
private DeviceInquire() { }

//代码片段。
string IPSegment = "107.107.2.";

ConcurrentDictionary<string, DeviceStatus> DeviceLists = new ConcurrentDictionary<string, DeviceStatus>();
@@ -158,16 +159,10 @@ namespace BPASmartClient.FoodStationTest.Model
{
IPLists.Clear();
IPQueues.Clear();
/* for (int i = 1; i <= 255; i++)
{
if (!InvalidIP.Contains($"{IPSegment}{i}") && !DeviceLists.ContainsKey($"{IPSegment}{i}"))
{
IPLists.Add($"{IPSegment}{i}");
}
}*/
//吉香居特定IP
for (int i = 0; i < 15; i++)
for (int i = 0; i < Json<LocalPar>.Data.RawMaterialDeviceNum; i++)
{
//这里“69”是味魔方起始地址。
//TODO:修改起始地址。
IPLists.Add($"{IPSegment}{i + 69}");
}

@@ -214,13 +209,13 @@ namespace BPASmartClient.FoodStationTest.Model
BottomDeviceCurrentStatuses.Add(new DeviceCurrentStatus() { DeviceName = DeviceName });


for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++)
for (int i = 0; i < Json<LocalPar>.Data.Recipes.Count; i++)
{
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
for (int m = 0; m < Json<LocalPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
{
if (Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip)
if (Json<LocalPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip)
{
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
Json<LocalPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
}
}
}
@@ -320,7 +315,10 @@ namespace BPASmartClient.FoodStationTest.Model

#region 对象属性声明
public string DeviceName = String.Empty;
public string IpAddress = "172.16.0.200";
/// <summary>
/// ModbusTcp的地址。
/// </summary>
public string IpAddress=> modbusTcp.GetConfigPar().IpAddress;
/// <summary>
/// 设备状态
/// </summary>
@@ -330,7 +328,7 @@ namespace BPASmartClient.FoodStationTest.Model

public ModbusTcp modbusTcp = new ModbusTcp();

public bool IsConnected => modbusTcp.IsReconnect;
public bool IsConnected => modbusTcp.IsConnected();
#endregion

public void Init(string DeviceName)
@@ -407,7 +405,10 @@ namespace BPASmartClient.FoodStationTest.Model
ThreadManage.GetInstance().StopTask($"{DeviceName} 开始监听");
}


/// <summary>
/// 写入重量数据,开始配料。
/// </summary>
/// <param name="Value">配料重量。</param>
public void Start(float Value)
{



+ 0
- 7
BPASmartClient.FoodStationTest/Model/RawMaterial/GlobalData.cs View File

@@ -1,7 +0,0 @@
namespace BPASmartClient.FoodStationTest.Model
{
public class GlobalData
{

}
}

+ 0
- 15
BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeProcess.cs View File

@@ -1,15 +0,0 @@
using Microsoft.Toolkit.Mvvm.ComponentModel;

namespace BPASmartClient.FoodStationTest.Model
{
public class RecipeProcess : ObservableObject
{
public string RawMaterialName { get { return _mRawMaterialName; } set { _mRawMaterialName = value; OnPropertyChanged(); } }
private string _mRawMaterialName;


public int RawMaterialStatus { get { return _mRawMaterialStatus; } set { _mRawMaterialStatus = value; OnPropertyChanged(); } }
private int _mRawMaterialStatus;

}
}

+ 4
- 0
BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs View File

@@ -3,6 +3,10 @@ using System.Collections.ObjectModel;

namespace BPASmartClient.FoodStationTest.Model
{

/// <summary>
/// 远程配方数据。
/// </summary>
public class RemoteRecipeData : ObservableObject
{
/// <summary>


+ 3
- 1
BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeDataColl.cs View File

@@ -2,10 +2,12 @@

namespace BPASmartClient.FoodStationTest.Model
{
/// <summary>
/// 远程配方数据集合。
/// </summary>
public class RemoteRecipeDataColl
{
public ObservableCollection<RemoteRecipeData> Recipes { get; set; } = new ObservableCollection<RemoteRecipeData>();
public int RecipesStatus { get; set; }

}
}

+ 9
- 12
BPASmartClient.FoodStationTest/View/HardwareStatusView.xaml View File

@@ -91,7 +91,7 @@
Foreground="#FF0084FF"
Text=" 号仓" />
</StackPanel>
<StackPanel
Grid.Row="1"
Margin="0,70,0,0"
@@ -121,17 +121,14 @@
<!--#endregion-->

<Grid x:Name="gr" Grid.Row="1">
<pry:ConveyorBelt
Grid.Row="1"
Width="{Binding ElementName=gr, Path=ActualWidth}"
Height="{Binding ElementName=gr, Path=ActualHeight}"
Margin="10,0,400,0"
ConveyorBeltWidth="70"
Direction="0"
StrokeBrush="#00BEFA"
StrokeDashArray="1.5 1.5"
StrokeFillBrush="#00BEFA"
StrokeThickness="2" />
<pry:ConveyBelt2
BeltDashOffset="100"
BeltDashThickess="62"
BeltDirection="0"
BeltHeight="70"
Margin="0,150,0,0"
BeltWidth="{Binding ElementName=gr, Path=ActualWidth}"
IsRun="True" />
</Grid>

<!--#region 底部料仓-->


+ 1
- 1
BPASmartClient.FoodStationTest/View/ManualControlView.xaml View File

@@ -432,7 +432,7 @@
FontSize="16"
Foreground="Aqua"
Text="升降气缸控制" />
<ListView
<ListView VerticalAlignment="Center"
Grid.Row="1"
Background="Transparent"
BorderBrush="#00BEFA"


+ 2
- 26
BPASmartClient.FoodStationTest/View/ManualFlowView.xaml View File

@@ -168,19 +168,7 @@
</StackPanel>
</StackPanel>
<WrapPanel Grid.Row="0">
<TextBlock
Margin="10,0,5,0"
VerticalAlignment="Center"
FontSize="25"
Foreground="#FF2AB2E7"
Text="西门子 连接状态:" />
<TextBlock
Margin="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="25"
Foreground="#FF2AB2E7"
Text="{Binding SiemensIsConnect}" />
<TextBlock
Margin="10,0,5,0"
VerticalAlignment="Center"
@@ -194,19 +182,7 @@
FontSize="25"
Foreground="#FF2AB2E7"
Text="{Binding HKPlcIsConnect}" />
<TextBlock
Margin="10,0,5,0"
VerticalAlignment="Center"
FontSize="25"
Foreground="#FF2AB2E7"
Text="风送plc连接状态:" />
<TextBlock
Margin="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="25"
Foreground="#FF2AB2E7"
Text="{Binding WindSendIsConnect}" />
</WrapPanel>
<WrapPanel Grid.Row="2">
<TextBlock


+ 1
- 10
BPASmartClient.FoodStationTest/View/RecipeReceiveView.xaml View File

@@ -60,16 +60,7 @@
FontSize="20"
Foreground="Aqua"
IsChecked="{Binding NotUseSmallDosing}" />
<CheckBox
x:Name="IsUseWindSend"
Margin="0,0,10,0"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
Content="使用粉料仓配料"
FontFamily="楷体"
FontSize="20"
Foreground="Aqua"
IsChecked="{Binding IsUseWindSendDosing}" />
<CheckBox
x:Name="IsUseStockBin"
VerticalAlignment="Center"


+ 0
- 1
BPASmartClient.FoodStationTest/View/RecipeReceiveView.xaml.cs View File

@@ -11,7 +11,6 @@ namespace BPASmartClient.FoodStationTest.View
public RecipeReceiveView()
{
InitializeComponent();
this.IsUseWindSend.Click += (o, e) => { GVL_SmallStation.GetInstance.IsUseWindSend = (bool)IsUseWindSend.IsChecked; };
this.IsUseStockBin.Click += (o, e) => { GVL_SmallStation.GetInstance.IsUseLocalRecipe = (bool)IsUseStockBin.IsChecked; };
this.NotUseSmallDosing.Click += (o, e) => { GVL_SmallStation.GetInstance.NotUseSmallStation = (bool)NotUseSmallDosing.IsChecked; };



+ 0
- 308
BPASmartClient.FoodStationTest/View/RobotView.xaml View File

@@ -1,308 +0,0 @@
<UserControl x:Class="BPASmartClient.FoodStationTest.View.RobotView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:vm="clr-namespace:BPASmartClient.FoodStationTest.ViewModel"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<Style x:Key="radioButtonStyle" TargetType="RadioButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Name="gr" Opacity="0.8">
<ContentControl
Margin="{TemplateBinding Margin}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="{TemplateBinding Content}"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}" />
<Image
Name="image"
Source="/BPASmartClient.CustomResource;component/Image/边框线.png"
Stretch="Fill" />

</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="False">
<Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/边框线.png" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/透明背景.png" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="gr" Property="Opacity" Value="1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<UserControl.DataContext>
<vm:RobotViewModel/>
</UserControl.DataContext>

<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<!--#region 表格标题栏设置-->
<Grid>
<StackPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人自动运行模式:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAutoMode}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人正在自动运行:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAutoRun}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人停止状态:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsStop}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行正常:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsRun}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行故障:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAlarm}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人在Home点:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsHomed}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行的程序号:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding IsRunProgramNum}"></TextBlock>
</WrapPanel>
<!--<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓空桶完成:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetEmptyBarrelComplete}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放空桶完成:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutEmptyBarrelComplete}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓满桶完成:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetFullBarrelComplete}"></TextBlock>
</WrapPanel>
<WrapPanel>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放满桶完成:"></TextBlock>
<TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutFullBarrelComplete}"></TextBlock>
</WrapPanel>-->
</StackPanel>
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"></RowDefinition>
<RowDefinition Height="7*"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button
Margin="20,15"
Command="{Binding SystemStart}"
Content="启动"
FontSize="40"
Background="LightGreen"></Button>
<Button
Grid.Column="1"
Margin="20,15"
Command="{Binding SystemStop}"
Content="停止"
FontSize="40"
Background="OrangeRed"></Button>
<Button
Grid.Column="2"
Grid.ColumnSpan="2"
Margin="20,15"
Command="{Binding EStopReset}"
Content="急停复位"
FontSize="40"
Background="DodgerBlue"></Button>
</Grid>
</Grid>
<!--<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Button
Margin="20,5"
Command="{Binding AutoMode}"
Content="自动模式"
FontSize="32"
Panel.ZIndex="0"
Style="{StaticResource ImageButtonStyle}"></Button>
<Button
Grid.Column="1"
Margin="20,5"
Command="{Binding TestMode}"
Content="测试模式"
FontSize="32"
Panel.ZIndex="0"
Style="{StaticResource ImageButtonStyle}"></Button>
<Grid Grid.Row="1" Grid.ColumnSpan="2">
<StackPanel Orientation="Vertical">
<WrapPanel Orientation="Horizontal">
<TextBlock Text="机器人正在运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
<TextBlock Text="{Binding IsRunProgramNum}" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBlock>
</WrapPanel>
<WrapPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="机器人需要运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
<TextBox Text="{Binding SetProgramNum}" Width="50" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBox>
<Button FontSize="20" Height="40" Command="{Binding SetProgramNumCommand}" Content="设置" Style="{StaticResource ImageButtonStyle}"></Button>
</WrapPanel>
</StackPanel>
</Grid>
<Button
Grid.Row="2"
Margin="20,5"
Command="{Binding TestRobotRun}"
Content="测试抓桶程序"
FontSize="32"
Style="{StaticResource ImageButtonStyle}"></Button>
</Grid>
--><!--<ListView
Grid.Row="1"
Background="Transparent"
BorderBrush="#00BEFA"
BorderThickness="0"
ItemsSource="{Binding cylinderModels}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid
HorizontalAlignment="Left"
VerticalAlignment="Top"
Columns="8" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Grid
Width="200"
Height="100"
Margin="0,0,0,15"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Aqua"
Text="{Binding Name}" />

<pry:Cylinder
Grid.Row="1"
Grid.ColumnSpan="3"
Width="200"
Height="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
LeftTogIsChecked="{Binding LeftTog}"
RightTogIsChecked="{Binding RightTog}" />

<RadioButton
Grid.Row="2"
Grid.Column="1"
Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="伸出"
Foreground="Aqua"
IsChecked="True"
Style="{StaticResource radioButtonStyle}" />

<RadioButton
Grid.Row="2"
Grid.Column="2"
Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
CommandParameter="{Binding Name}"
Content="缩回"
Foreground="Aqua"
IsChecked="False"
Style="{StaticResource radioButtonStyle}" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>--><!--
<Grid Grid.Row="1" Visibility="Hidden">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Button
Margin="20,5"
Command="{Binding RobotGetEmptyBarrel}"
Content="允许机器人抓空桶"
Style="{StaticResource ImageButtonStyle}"></Button>
</Grid>
<Grid Grid.Column="1">
<Button
Margin="20,5"
Command="{Binding RobotPutEmptyBarrel}"
Content="允许机器人放空桶"
Style="{StaticResource ImageButtonStyle}"></Button>
</Grid>
<Grid Grid.Row="1">
<Button
Margin="20,5"
Command="{Binding RobotGetFullBarrel}"
Content="允许机器人抓满桶"
Style="{StaticResource ImageButtonStyle}"></Button>
</Grid>
<Grid Grid.Row="1" Grid.Column="1">
<Button
Margin="20,5"
Command="{Binding RobotPutFullBarrel}"
Content="允许机器人放满桶"
Style="{StaticResource ImageButtonStyle}"></Button>
</Grid>
</Grid>
</Grid>-->
</Grid>
</UserControl>

+ 0
- 15
BPASmartClient.FoodStationTest/View/RobotView.xaml.cs View File

@@ -1,15 +0,0 @@
using System.Windows.Controls;

namespace BPASmartClient.FoodStationTest.View
{
/// <summary>
/// HKPlcCommMonitor.xaml 的交互逻辑
/// </summary>
public partial class RobotView : UserControl
{
public RobotView()
{
InitializeComponent();
}
}
}

+ 2
- 16
BPASmartClient.FoodStationTest/View/SystemParView.xaml View File

@@ -159,22 +159,8 @@
Margin="10,0,10,0"
HorizontalAlignment="Left"
Orientation="Vertical">
<CheckBox
Margin="0,10,10,0"
VerticalAlignment="Center"
Content="西门子设备连接"
FontFamily="楷体"
FontSize="20"
Foreground="Aqua"
IsChecked="{Binding SiemensConnect}" />
<CheckBox
Margin="0,10,10,0"
VerticalAlignment="Center"
Content="粉料仓设备连接"
FontFamily="楷体"
FontSize="20"
Foreground="Aqua"
IsChecked="{Binding WindSendConnect}" />
<CheckBox
Margin="0,10,10,0"
VerticalAlignment="Center"


+ 0
- 218
BPASmartClient.FoodStationTest/View/WindSendParView.xaml View File

@@ -1,218 +0,0 @@
<UserControl
x:Class="BPASmartClient.FoodStationTest.View.WindSendParView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:BPASmartClient.FoodStationTest.Converter"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.FoodStationTest.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
xmlns:vm="clr-namespace:BPASmartClient.FoodStationTest.ViewModel"
d:DesignHeight="1080"
d:DesignWidth="1920"
mc:Ignorable="d">

<UserControl.DataContext>
<vm:WindSendParViewModel />
</UserControl.DataContext>

<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.FoodStationTest;component/Resource/MyStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>

<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition Height="40" />
<RowDefinition />
</Grid.RowDefinitions>
<!--#region 表格标题栏设置-->
<Grid>
<StackPanel
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<!--<pry:IcoButton
Margin="10"
Command="{Binding UpdateRawMaterial}"
Content="新增数据"
FontSize="28"
Foreground="Aqua"
Style="{StaticResource IcoButtonStyle}" />-->
<Button
Width="150"
Height="50"
Margin="5"
Command="{Binding SaveRawMaterialPara}"
Content="保存参数"
FontSize="28"
Foreground="DeepSkyBlue"
Style="{StaticResource ImageButtonStyle}" />
<!--<pry:IcoButton
Margin="10"
Command="{Binding SaveRawMaterialPara}"
Content="保存参数"
FontSize="28"
Foreground="Aqua"
Style="{StaticResource IcoButtonStyle}" />-->
</StackPanel>

</Grid>
<Grid
Grid.Row="1"
Margin="0,10,0,0"
Background="#ff0C255F">

<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="序号" />

<TextBlock
Grid.Column="1"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="料仓位置" />

<TextBlock
Grid.Column="2"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="原料编号" />

<TextBlock
Grid.Column="3"
FontSize="24"
Style="{StaticResource TitleTextblockStyle}"
Text="原料名称" />

<Border
Grid.Column="0"
Grid.ColumnSpan="4"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,1,1,1" />
<Border
Grid.Column="1"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />
<Border
Grid.Column="3"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />
</Grid>
<Grid Grid.Row="2">
<ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ItemsControl Foreground="DeepSkyBlue" ItemsSource="{Binding WindSendRawMaterial}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Name="gr">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<TextBlock
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding Location}" />

<TextBlock
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding Location}" />

<TextBox
Grid.Column="2"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding RawMaterialName}" />

<TextBlock
Grid.Column="3"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding RawMaterialChineseName}" />

<Border
Grid.Column="0"
Grid.ColumnSpan="4"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,1" />
<Border
Grid.Column="1"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />
<Border
Grid.Column="3"
BorderBrush="{StaticResource bordColor}"
BorderThickness="1,0,1,0" />

<!--<Grid Grid.Column="0" Margin="5">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding Location}" />
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" />

</Grid>
<Grid Grid.Column="1" Margin="5">
<TextBlock
Width="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding Location}"
TextAlignment="Center" />
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" />

</Grid>
<Grid Grid.Column="2" Margin="5">
<TextBox
Name="name"
Width="50"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding RawMaterialName}" />
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
</Grid>
<Grid Grid.Column="3" Margin="5">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding RawMaterialChineseName}" />
<Border BorderThickness="1,0,1,0" Cursor="SizeWE" />
</Grid>-->
</Grid>
<DataTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Grid>
</UserControl>

+ 0
- 16
BPASmartClient.FoodStationTest/View/WindSendParView.xaml.cs View File

@@ -1,16 +0,0 @@
using System.Windows.Controls;

namespace BPASmartClient.FoodStationTest.View
{
/// <summary>
/// DeviceMaterialParView.xaml 的交互逻辑
/// </summary>
public partial class WindSendParView : UserControl
{
public WindSendParView()
{
InitializeComponent();

}
}
}

+ 3
- 3
BPASmartClient.FoodStationTest/ViewModel/ChangeDeviceNameViewModel.cs View File

@@ -39,11 +39,11 @@ namespace BPASmartClient.FoodStationTest.ViewModel
res.RawMaterialName = DeviceName;
DeviceInquire.GetInstance.devices.ElementAt(index).DeviceName = DeviceName;
DeviceInquire.GetInstance.GetDevice(IpAddress).SetDeviceName(DeviceName);//设置PLC名称
for (int i = 0; i < Json<LocaPar>.Data.Recipes.Count; i++)
for (int i = 0; i < Json<LocalPar>.Data.Recipes.Count; i++)
{
for (int m = 0; m < Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
for (int m = 0; m < Json<LocalPar>.Data.Recipes.ElementAt(i).RawMaterials.Count; m++)
{
Json<LocaPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
Json<LocalPar>.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName;
}
}
ActionManage.GetInstance.Send("ChangeDeviceNameViewClose");


+ 2
- 2
BPASmartClient.FoodStationTest/ViewModel/ManualControlViewModel.cs View File

@@ -161,9 +161,9 @@ namespace BPASmartClient.FoodStationTest.ViewModel
}
Thread.Sleep(200);
}), "获取系统状态", true);
if (cylinderModels.Count < 15)
if (cylinderModels.Count < Json<LocalPar>.Data.RawMaterialDeviceNum)
{
for (int i = 0; i < 15; i++)
for (int i = 0; i < Json<LocalPar>.Data.RawMaterialDeviceNum; i++)
{
cylinderModels.Add(new CylinderModel()
{


+ 9
- 9
BPASmartClient.FoodStationTest/ViewModel/NewRecipeViewModel.cs View File

@@ -76,9 +76,9 @@ p:

if (RecipeCode.Length <= 0)//新建配方
{
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName);
var res = Array.FindIndex(Json<LocalPar>.Data.Recipes.ToArray(), p => p.RecipeName == RecipeName);

if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count)
if (res >= 0 && res < Json<LocalPar>.Data.Recipes.Count)
{
ErrorInfo = "该配方已存在,请重新输入";
}
@@ -89,14 +89,14 @@ p:
}
else//修改配方
{
var res = Array.FindIndex(Json<LocaPar>.Data.Recipes.ToArray(), p => p.RecipCode == RecipeCode);
if (res >= 0 && res < Json<LocaPar>.Data.Recipes.Count)
var res = Array.FindIndex(Json<LocalPar>.Data.Recipes.ToArray(), p => p.RecipCode == RecipeCode);
if (res >= 0 && res < Json<LocalPar>.Data.Recipes.Count)
{
Json<LocaPar>.Data.Recipes.ElementAt(res).RecipeName = RecipeName;
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Clear();
Json<LocalPar>.Data.Recipes.ElementAt(res).RecipeName = RecipeName;
Json<LocalPar>.Data.Recipes.ElementAt(res).RawMaterials.Clear();
foreach (var item in RawMaterials)
{
Json<LocaPar>.Data.Recipes.ElementAt(res).RawMaterials.Add(item);
Json<LocalPar>.Data.Recipes.ElementAt(res).RawMaterials.Add(item);
}
}
}
@@ -155,9 +155,9 @@ p:
var dates = date.Split("-").ToList();
StringBuilder sb = new StringBuilder();
dates?.ForEach((item) => { sb.Append(item); });
Json<LocaPar>.Data.Recipes.Add(new RecipeModel()
Json<LocalPar>.Data.Recipes.Add(new RecipeModel()
{
SerialNum = Json<LocaPar>.Data.Recipes.Count + 1,
SerialNum = Json<LocalPar>.Data.Recipes.Count + 1,
RawMaterials = RawMaterials,
RecipCode = sb.ToString(),
RecipeName = RecipeName,


+ 1
- 1
BPASmartClient.FoodStationTest/ViewModel/RecipeControlViewModel.cs View File

@@ -166,7 +166,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel

public RelayCommand<object> ChangeRecipeStateCommand { get; set; }

public static ObservableCollection<RecipeModel> Recipes { get; set; } = Json<LocaPar>.Data.Recipes;
public static ObservableCollection<RecipeModel> Recipes { get; set; } = Json<LocalPar>.Data.Recipes;

public string CurrentRecipeName { get { return _RecipeName; } set { _RecipeName = value; OnPropertyChanged(); } }
private static string _RecipeName;


+ 1
- 2
BPASmartClient.FoodStationTest/ViewModel/RecipeReceiveViewModel.cs View File

@@ -19,7 +19,6 @@ namespace BPASmartClient.FoodStationTest.ViewModel
{
NotUseSmallDosing = GVL_SmallStation.GetInstance.NotUseSmallStation;
IsUseLocalRecipe = GVL_SmallStation.GetInstance.IsUseLocalRecipe;
IsUseWindSendDosing = GVL_SmallStation.GetInstance.IsUseWindSend;
Recipes = Json<LocalRecipeDataColl>.Data.Recipes;

NewRecipe = new RelayCommand(() =>
@@ -116,7 +115,7 @@ go:
RawMaterialLocation = i,
});
}
if (GVL_SmallStation.GetInstance.IsUseWindSend && trayCode == 1)
if (/*GVL_SmallStation.GetInstance.IsUseWindSend &&*/ trayCode == 1)
{
for (int i = 1; i < 6; i++)
{


+ 5
- 5
BPASmartClient.FoodStationTest/ViewModel/RecipeSettingsViewModel.cs View File

@@ -15,7 +15,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel
{
public RecipeSettingsViewModel()
{
Recipes = Json<LocaPar>.Data.Recipes;
Recipes = Json<LocalPar>.Data.Recipes;

NewMaterital = new RelayCommand(() =>
{
@@ -30,7 +30,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel
});
SaveRecipe = new RelayCommand(() =>
{
Json<LocaPar>.Save();
Json<LocalPar>.Save();
MessageNotify.GetInstance.ShowUserLog("保存配方");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"配方保存成功!");
});
@@ -38,9 +38,9 @@ namespace BPASmartClient.FoodStationTest.ViewModel
{
if (o is string str)
{
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
var res = Json<LocalPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
if (res != null)
Json<LocaPar>.Data.Recipes.Remove(res);
Json<LocalPar>.Data.Recipes.Remove(res);
MessageNotify.GetInstance.ShowUserLog($"删除名称——{res.RecipeName}");
}
});
@@ -51,7 +51,7 @@ namespace BPASmartClient.FoodStationTest.ViewModel
{
ActionManage.GetInstance.CancelRegister("Details");
NewRecipeView nrv = new NewRecipeView();
var res = Json<LocaPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
var res = Json<LocalPar>.Data.Recipes.FirstOrDefault(p => p.RecipCode == str);
ActionManage.GetInstance.Send("Details", res);
nrv.ShowDialog();
MessageNotify.GetInstance.ShowUserLog($"编辑配方名称——{res.RecipeName}");


+ 0
- 129
BPASmartClient.FoodStationTest/ViewModel/RobotViewModel.cs View File

@@ -1,129 +0,0 @@
using BPASmartClient.CustomResource.Pages.Model;
using BPASmartClient.CustomResource.UserControls;
using BPASmartClient.CustomResource.UserControls.MessageShow;
using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Threading;

namespace BPASmartClient.FoodStationTest.ViewModel
{
public class RobotViewModel : ObservableObject
{
public RobotViewModel()
{
ThreadManage.GetInstance().StartLong(() =>
{
IsRunProgramNum = GVL_SmallStation.GetInstance.RobotProgramNum;
RobotIsAutoMode = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(2);
RobotIsAutoRun = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(3);
RobotIsStop = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(4);
RobotIsRun = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(5);
RobotIsAlarm = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(6);
RobotIsHomed = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(7);
//RobotGetEmptyBarrelComplete = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(8);
//RobotPutEmptyBarrelComplete = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(9);
//RobotGetFullBarrelComplete = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(10);
//RobotPutFullBarrelComplete = GVL_SmallStation.GetInstance.RobotStatus.GetBitValue(11);

Thread.Sleep(10);

}, "机器人状态", true);
SystemStart = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX0.1");
MessageNotify.GetInstance.ShowUserLog($"手动控制,机器人启动");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"机器人启动,操作完成!");
});
SystemStop = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX0.2");
MessageNotify.GetInstance.ShowUserLog($"手动控制,机器人停止");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"机器人停止,操作完成!");
});
EStopReset = new RelayCommand(() =>
{
ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX0.3");
MessageNotify.GetInstance.ShowUserLog($"手动控制,机器人急停复位");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"机器人急停复位,操作完成!");
});

//TestRobotRun = new RelayCommand(() => {
// ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.4");
//});
//AutoMode = new RelayCommand(() => {
// ActionManage.GetInstance.Send("RobotSendFalseCommand", "DB4.DBX100.3");
//});
//TestMode = new RelayCommand(() => {
// ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.3");
//});

//RobotGetEmptyBarrel = new RelayCommand(() => {
// ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX100.7");
//});
//RobotPutEmptyBarrel = new RelayCommand(() => {
// ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX101.0");
//});
//RobotGetFullBarrel = new RelayCommand(() => {
// ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX101.1");
//});
//RobotPutFullBarrel = new RelayCommand(() => {
// ActionManage.GetInstance.Send("RobotSendTrueCommand", "DB4.DBX101.2");
//});
//SetProgramNumCommand = new RelayCommand(() =>{
// ActionManage.GetInstance.Send("RobotSetProgramNum", SetProgramNum);
//});
}
public RelayCommand SystemStart { get; set; }
public RelayCommand SystemStop { get; set; }
public RelayCommand EStopReset { get; set; }

public RelayCommand TestRobotRun { get; set; }
public RelayCommand AutoMode { get; set; }
public RelayCommand TestMode { get; set; }

public RelayCommand RobotGetEmptyBarrel { get; set; }
public RelayCommand RobotPutEmptyBarrel { get; set; }
public RelayCommand RobotGetFullBarrel { get; set; }
public RelayCommand RobotPutFullBarrel { get; set; }
public RelayCommand SetProgramNumCommand { get; set; }

public static short IsRunProgramNum { get { return _runProgramNum; } set { _runProgramNum = value; OnStaticPropertyChanged(); } }
private static short _runProgramNum;
public short SetProgramNum { get { return _SetProgramNum; } set { _SetProgramNum = value; OnPropertyChanged(); } }
private short _SetProgramNum;

public static bool RobotIsAutoMode { get { return _RobotIsAutoMode; } set { _RobotIsAutoMode = value; OnStaticPropertyChanged(); } }
private static bool _RobotIsAutoMode;
public static bool RobotIsAutoRun { get { return _RobotIsAutoRun; } set { _RobotIsAutoRun = value; OnStaticPropertyChanged(); } }
private static bool _RobotIsAutoRun;
public static bool RobotIsStop { get { return _RobotIsStop; } set { _RobotIsStop = value; OnStaticPropertyChanged(); } }
private static bool _RobotIsStop;
public static bool RobotIsRun { get { return _RobotIsRun; } set { _RobotIsRun = value; OnStaticPropertyChanged(); } }
private static bool _RobotIsRun;
public static bool RobotIsAlarm { get { return _RobotIsAlarm; } set { _RobotIsAlarm = value; OnStaticPropertyChanged(); } }
private static bool _RobotIsAlarm;
public static bool RobotIsHomed { get { return _RobotIsHomed; } set { _RobotIsHomed = value; OnStaticPropertyChanged(); } }
private static bool _RobotIsHomed;
public bool RobotGetEmptyBarrelComplete { get { return _RobotGetEmptyBarrelComplete; } set { _RobotGetEmptyBarrelComplete = value; OnPropertyChanged(); } }
private bool _RobotGetEmptyBarrelComplete;
public bool RobotPutEmptyBarrelComplete { get { return _RobotPutEmptyBarrelComplete; } set { _RobotPutEmptyBarrelComplete = value; OnPropertyChanged(); } }
private bool _RobotPutEmptyBarrelComplete;
public bool RobotGetFullBarrelComplete { get { return _RobotGetFullBarrelComplete; } set { _RobotGetFullBarrelComplete = value; OnPropertyChanged(); } }
private bool _RobotGetFullBarrelComplete;

public bool RobotPutFullBarrelComplete { get { return _RobotPutFullBarrelComplete; } set { _RobotPutFullBarrelComplete = value; OnPropertyChanged(); } }
private bool _RobotPutFullBarrelComplete;


public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
public static void OnStaticPropertyChanged([CallerMemberName] string PropName = "")
{
StaticPropertyChanged?.Invoke(null, new PropertyChangedEventArgs(PropName));
}
}
}

+ 0
- 8
BPASmartClient.FoodStationTest/ViewModel/SystemParViewModel.cs View File

@@ -13,8 +13,6 @@ namespace BPASmartClient.FoodStationTest.ViewModel
{
public SystemParViewModel()
{
SiemensConnect = Json<DevicePar>.Data.deviceConnectPar.SiemensConnect;
WindSendConnect = Json<DevicePar>.Data.deviceConnectPar.WindSendConnect;
HKPlcConnect = Json<DevicePar>.Data.deviceConnectPar.HKPlcConnect;
ShieldStockbinAlarm = Json<DevicePar>.Data.deviceConnectPar.ShieldStockbinAlarm;

@@ -26,8 +24,6 @@ namespace BPASmartClient.FoodStationTest.ViewModel
Axis2Speed = Json<DevicePar>.Data.deviceConnectPar.Axis2Speed;
SaveCommand = new RelayCommand(() =>
{
Json<DevicePar>.Data.deviceConnectPar.SiemensConnect = SiemensConnect;
Json<DevicePar>.Data.deviceConnectPar.WindSendConnect = WindSendConnect;
Json<DevicePar>.Data.deviceConnectPar.HKPlcConnect = HKPlcConnect;
Json<DevicePar>.Data.deviceConnectPar.ShieldStockbinAlarm = ShieldStockbinAlarm;

@@ -59,10 +55,6 @@ namespace BPASmartClient.FoodStationTest.ViewModel

public ConnectParMode CommBaseParModel { get { return Json<DevicePar>.Data.deviceConnectPar; } set { Json<DevicePar>.Data.deviceConnectPar = value; OnPropertyChanged(); } }

public bool SiemensConnect { get { return _mSiemensConnect; } set { _mSiemensConnect = value; OnPropertyChanged(); } }
private bool _mSiemensConnect;
public bool WindSendConnect { get { return _mWindSendConnect; } set { _mWindSendConnect = value; OnPropertyChanged(); } }
private bool _mWindSendConnect;
public bool HKPlcConnect { get { return _mHKPlcConnect; } set { _mHKPlcConnect = value; OnPropertyChanged(); } }
private bool _mHKPlcConnect;
public bool ShieldStockbinAlarm { get { return _mShieldStockbinAlarm; } set { _mShieldStockbinAlarm = value; OnPropertyChanged(); } }


+ 0
- 22
BPASmartClient.FoodStationTest/ViewModel/WindSendParViewModel.cs View File

@@ -1,22 +0,0 @@
using BPASmartClient.FoodStationTest.Model;
using BPASmartClient.Helper;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;

namespace BPASmartClient.FoodStationTest.ViewModel
{
public class WindSendParViewModel : ObservableObject
{
public WindSendParViewModel()
{

SaveRawMaterialPara = new RelayCommand(() =>
{
Json<DevicePar>.Save();
});
}

public RelayCommand SaveRawMaterialPara { get; set; }

}
}

Loading…
Cancel
Save