From 54498f2e56a28a963d1bb10ef2aae79404ad02e0 Mon Sep 17 00:00:00 2001 From: ZhaoGang <15196688790@163.com> Date: Fri, 9 Jun 2023 17:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=96=B0=E5=A2=9E=E9=85=8D=E6=96=99?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F=E5=81=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BPASmartClient.FoodStationTest/App.config | 9 - BPASmartClient.FoodStationTest/App.xaml.cs | 28 +- .../BPASmartClient.FoodStationTest.csproj | 11 +- .../Converter/DataTableRedundantConverter.cs | 0 .../{Model => }/Converter/RunStatusConvert.cs | 0 .../Model/GVL/GVL.cs | 6 - .../Model/GVL/ReadSmallMaterial.cs | 111 ------- .../Model/GVL/WriteSmallMaterial.cs | 179 ---------- .../Model/GVL_SmallStation.cs | 5 - .../Model/HK_PLC/HKDeviceRead.cs | 10 - .../Model/HK_PLC/HKPlcCommAddress.cs | 134 -------- .../Model/HK_PLC/PlcManualComm.cs | 12 - .../Model/Par/ConnectParMode.cs | 5 +- .../Model/{RawMaterial => Par}/LocaPar.cs | 10 +- .../Model/ProcessControl.cs | 38 ++- .../Model/RawMaterial/ActionMenu.cs | 22 -- .../Model/RawMaterial/ConveyorServer.cs | 10 - .../Model/RawMaterial/CylinderStatusModel.cs | 22 -- .../Model/RawMaterial/DeviceAddress.cs | 3 + .../Model/RawMaterial/DeviceInquire.cs | 33 +- .../Model/RawMaterial/GlobalData.cs | 7 - .../Model/RawMaterial/RecipeProcess.cs | 15 - .../Model/Recipe/RemoteRecipeData.cs | 4 + .../Model/Recipe/RemoteRecipeDataColl.cs | 4 +- .../View/HardwareStatusView.xaml | 21 +- .../View/ManualControlView.xaml | 2 +- .../View/ManualFlowView.xaml | 28 +- .../View/RecipeReceiveView.xaml | 11 +- .../View/RecipeReceiveView.xaml.cs | 1 - .../View/RobotView.xaml | 308 ------------------ .../View/RobotView.xaml.cs | 15 - .../View/SystemParView.xaml | 18 +- .../View/WindSendParView.xaml | 218 ------------- .../View/WindSendParView.xaml.cs | 16 - .../ViewModel/ChangeDeviceNameViewModel.cs | 6 +- .../ViewModel/ManualControlViewModel.cs | 4 +- .../ViewModel/NewRecipeViewModel.cs | 18 +- .../ViewModel/RecipeControlViewModel.cs | 2 +- .../ViewModel/RecipeReceiveViewModel.cs | 3 +- .../ViewModel/RecipeSettingsViewModel.cs | 10 +- .../ViewModel/RobotViewModel.cs | 129 -------- .../ViewModel/SystemParViewModel.cs | 8 - .../ViewModel/WindSendParViewModel.cs | 22 -- 43 files changed, 105 insertions(+), 1413 deletions(-) delete mode 100644 BPASmartClient.FoodStationTest/App.config rename BPASmartClient.FoodStationTest/{Model => }/Converter/DataTableRedundantConverter.cs (100%) rename BPASmartClient.FoodStationTest/{Model => }/Converter/RunStatusConvert.cs (100%) delete mode 100644 BPASmartClient.FoodStationTest/Model/GVL/GVL.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/GVL/ReadSmallMaterial.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/GVL/WriteSmallMaterial.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceRead.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/HK_PLC/HKPlcCommAddress.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/HK_PLC/PlcManualComm.cs rename BPASmartClient.FoodStationTest/Model/{RawMaterial => Par}/LocaPar.cs (60%) delete mode 100644 BPASmartClient.FoodStationTest/Model/RawMaterial/ActionMenu.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/RawMaterial/ConveyorServer.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/RawMaterial/CylinderStatusModel.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/RawMaterial/GlobalData.cs delete mode 100644 BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeProcess.cs delete mode 100644 BPASmartClient.FoodStationTest/View/RobotView.xaml delete mode 100644 BPASmartClient.FoodStationTest/View/RobotView.xaml.cs delete mode 100644 BPASmartClient.FoodStationTest/View/WindSendParView.xaml delete mode 100644 BPASmartClient.FoodStationTest/View/WindSendParView.xaml.cs delete mode 100644 BPASmartClient.FoodStationTest/ViewModel/RobotViewModel.cs delete mode 100644 BPASmartClient.FoodStationTest/ViewModel/WindSendParViewModel.cs diff --git a/BPASmartClient.FoodStationTest/App.config b/BPASmartClient.FoodStationTest/App.config deleted file mode 100644 index a50b26f3..00000000 --- a/BPASmartClient.FoodStationTest/App.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/BPASmartClient.FoodStationTest/App.xaml.cs b/BPASmartClient.FoodStationTest/App.xaml.cs index bd3ba7a8..082df6f2 100644 --- a/BPASmartClient.FoodStationTest/App.xaml.cs +++ b/BPASmartClient.FoodStationTest/App.xaml.cs @@ -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.Data.RecipeDosingCompleNum; + GVL_SmallStation.GetInstance.RecipeDosingCompleNum = Json.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.Data.RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum; - Json.Save(); + Json.Data.RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum; + Json.Save(); Json.Save(); Json.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.Read(); + Json.Read(); Json.Read(); Json.Read(); Json.Read(); diff --git a/BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj b/BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj index abe64643..d2dee7d7 100644 --- a/BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj +++ b/BPASmartClient.FoodStationTest/BPASmartClient.FoodStationTest.csproj @@ -16,7 +16,7 @@ - + @@ -30,9 +30,6 @@ Code - - Code - Code @@ -81,9 +78,6 @@ $(DefaultXamlRuntime) - - $(DefaultXamlRuntime) - $(DefaultXamlRuntime) @@ -93,9 +87,6 @@ $(DefaultXamlRuntime) - - $(DefaultXamlRuntime) - diff --git a/BPASmartClient.FoodStationTest/Model/Converter/DataTableRedundantConverter.cs b/BPASmartClient.FoodStationTest/Converter/DataTableRedundantConverter.cs similarity index 100% rename from BPASmartClient.FoodStationTest/Model/Converter/DataTableRedundantConverter.cs rename to BPASmartClient.FoodStationTest/Converter/DataTableRedundantConverter.cs diff --git a/BPASmartClient.FoodStationTest/Model/Converter/RunStatusConvert.cs b/BPASmartClient.FoodStationTest/Converter/RunStatusConvert.cs similarity index 100% rename from BPASmartClient.FoodStationTest/Model/Converter/RunStatusConvert.cs rename to BPASmartClient.FoodStationTest/Converter/RunStatusConvert.cs diff --git a/BPASmartClient.FoodStationTest/Model/GVL/GVL.cs b/BPASmartClient.FoodStationTest/Model/GVL/GVL.cs deleted file mode 100644 index e918fcf4..00000000 --- a/BPASmartClient.FoodStationTest/Model/GVL/GVL.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace BPASmartClient.FoodStationTest.Model.GVL -{ - public class GVL - { - } -} diff --git a/BPASmartClient.FoodStationTest/Model/GVL/ReadSmallMaterial.cs b/BPASmartClient.FoodStationTest/Model/GVL/ReadSmallMaterial.cs deleted file mode 100644 index 70702c4c..00000000 --- a/BPASmartClient.FoodStationTest/Model/GVL/ReadSmallMaterial.cs +++ /dev/null @@ -1,111 +0,0 @@ -namespace BPASmartClient.FoodStationTest.Model.GVL -{ - public class ReadSmallMaterial - { - /// - /// PLC到上位机心跳 - /// - 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; } - /// - /// 1#托盘工位占用 - /// - public bool Tray1BeOccupied { get; set; } - /// - /// 2#托盘工位占用 - /// - public bool Tray2BeOccupied { get; set; } - /// - /// 1#托盘工位配料完成 - /// - public bool Tray1MaterialFinish { get; set; } - /// - /// 2#托盘工位配料完成 - /// - public bool Tray2MaterialFinish { get; set; } - /// - /// 接收托盘1配方数据完成 - /// - public bool Tray1ReceiveFinish { get; set; } - /// - /// 接收托盘2配方数据完成 - /// - public bool Tray2ReceiveFinish { get; set; } - - public int Reserve1 { get; set; } - public int Receive2 { get; set; } - /// - /// 托盘1_1#桶位置反馈 - /// - public float Tray1Barrel1Location { get; set; } - /// - /// 托盘1_2#桶位置反馈 - /// - public float Tray1Barrel2Location { get; set; } - /// - /// 托盘1_3#桶位置反馈 - /// - public float Tray1Barrel3Location { get; set; } - /// - /// 托盘1_4#桶位置反馈 - /// - public float Tray1Barrel4Location { get; set; } - /// - /// 托盘2_1#桶位置反馈 - /// - public float Tray2Barrel1Location { get; set; } - /// - /// 托盘2_2#桶位置反馈 - /// - public float Tray2Barrel2Location { get; set; } - /// - /// 托盘2_3#桶位置反馈 - /// - public float Tray2Barrel3Location { get; set; } - /// - /// 托盘2_4#桶位置反馈 - /// - public float Tray2Barrel4Location { get; set; } - - public int Reserve3 { get; set; } - public int Receive4 { get; set; } - /// - /// 托盘1_1#桶允许配料 - /// - public float Tray1Barrel1AllowDosing { get; set; } - /// - /// 托盘1_2#桶允许配料 - /// - public float Tray1Barrel2AllowDosing { get; set; } - /// - /// 托盘1_3#桶允许配料 - /// - public float Tray1Barrel3AllowDosing { get; set; } - /// - /// 托盘1_4#桶允许配料 - /// - public float Tray1Barrel4AllowDosing { get; set; } - /// - /// 托盘2_1#桶允许配料 - /// - public float Tray2Barrel1AllowDosing { get; set; } - /// - /// 托盘2_2#桶允许配料 - /// - public float Tray2Barrel2AllowDosing { get; set; } - /// - /// 托盘2_3#桶允许配料 - /// - public float Tray2Barrel3AllowDosing { get; set; } - /// - /// 托盘2_4#桶允许配料 - /// - public float Tray2Barrel4AllowDosing { get; set; } - - } -} diff --git a/BPASmartClient.FoodStationTest/Model/GVL/WriteSmallMaterial.cs b/BPASmartClient.FoodStationTest/Model/GVL/WriteSmallMaterial.cs deleted file mode 100644 index 6db4ed80..00000000 --- a/BPASmartClient.FoodStationTest/Model/GVL/WriteSmallMaterial.cs +++ /dev/null @@ -1,179 +0,0 @@ -namespace BPASmartClient.FoodStationTest.Model.GVL -{ - public class WriteSmallMaterial - { - /// - /// PLC到上位机心跳 - /// - 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; } - /// - /// 下发配方到托盘1 - /// - public bool Tray1IssueRecipe { get; set; } - /// - /// 下发配方到托盘2 - /// - 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; - } -} diff --git a/BPASmartClient.FoodStationTest/Model/GVL_SmallStation.cs b/BPASmartClient.FoodStationTest/Model/GVL_SmallStation.cs index 875b839a..01dbeb0d 100644 --- a/BPASmartClient.FoodStationTest/Model/GVL_SmallStation.cs +++ b/BPASmartClient.FoodStationTest/Model/GVL_SmallStation.cs @@ -228,11 +228,6 @@ namespace BPASmartClient.FoodStationTest.Model public bool[] StockInDosingComple { get; set; } = new bool[15]; - [VarComm("Global", "是否使用粉仓配料")] - /// - /// 是否使用粉仓配料 - /// - public bool IsUseWindSend { get; set; } = false; [VarComm("Global", "粉仓正在配料")] /// diff --git a/BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceRead.cs b/BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceRead.cs deleted file mode 100644 index c1e9e2d5..00000000 --- a/BPASmartClient.FoodStationTest/Model/HK_PLC/HKDeviceRead.cs +++ /dev/null @@ -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; } - } -} diff --git a/BPASmartClient.FoodStationTest/Model/HK_PLC/HKPlcCommAddress.cs b/BPASmartClient.FoodStationTest/Model/HK_PLC/HKPlcCommAddress.cs deleted file mode 100644 index 307d24f2..00000000 --- a/BPASmartClient.FoodStationTest/Model/HK_PLC/HKPlcCommAddress.cs +++ /dev/null @@ -1,134 +0,0 @@ -namespace BPASmartClient.FoodStationTest.Model.HK_PLC -{ - public class HKPlcCommAddress - { - #region 海科PLC ==> 上位机 - /// - /// 是否允许配料 - /// - public static string IsAllowDosing { get; set; } = ""; - /// - /// 当前料仓位置 - /// - public static string StockBinLocation { get; set; } = ""; - /// - /// 当前料仓的状态(0:无意义,1:到达接料位置) - /// - public static string StockState { get; set; } = ""; - #endregion - - #region 上位机 ==> 海科PLC - /// - /// 料仓位置(配置该配方,所需要多个原料桶,每个原料桶有多个料仓位置) - /// - public static string StockBinLocationToPLC { get; set; } = ""; - /// - /// 对应桶号 - /// - public static string BarrelNumToPLC { get; set; } = ""; - /// - /// 当前配料机配料完成 - /// - public static string SingleDosingFinishToPLC { get; set; } = ""; - /// - /// 当前配料料仓的位置 - /// - public static string SingleStockBinLocationToPLC { get; set; } = ""; - - public static string RecipeDosingFinish { get; set; } = ""; - #endregion - - #region AGV进出站1 - /// - /// Agv送货 进站申请 - /// - public static string DeliveryAGVApply { get; set; } = "DB3.DBX0.1"; - /// - /// Agv送货 进站申请 - /// - public static string DeliveryAGVIsApply { get; set; } = ""; - /// - /// Agv送货 进站顶升申请 - /// - public static string DeliveryAGVApplyJack { get; set; } = ""; - /// - /// Agv送货 进站顶升申请 - /// - public static string DeliveryAGVIsApplyJack { get; set; } = ""; - /// - /// Agv送货 送货完成 - /// - public static string DeliveryAGVFinsih { get; set; } = ""; - /// - /// Agv送货 工位上有货架 - /// - public static string StationHaveCargo { get; set; } = ""; - /// - /// Agv送货 进站申请 - /// - public static string PickAGVApply { get; set; } = ""; - /// - /// Agv送货 进站申请 - /// - public static string PickAGVIsApply { get; set; } = ""; - /// - /// Agv送货 取货架完成 - /// - public static string PickCargoAGVFinish { get; set; } = ""; - /// - /// Agv送货 取料完成 - /// - public static string PickAGVFinish { get; set; } = ""; - /// - /// 工位上是否有小车 - /// - public static string StationIsExistTray { get; set; } = ""; - #endregion - #region AGV进出站2 - /// - /// Agv送货 进站申请 - /// - public static string DeliveryAGVApplyStation2 { get; set; } = ""; - /// - /// Agv送货 进站申请 - /// - public static string DeliveryAGVIsApplyStation2 { get; set; } = ""; - /// - /// Agv送货 进站顶升申请 - /// - public static string DeliveryAGVApplyJackStation2 { get; set; } = ""; - /// - /// Agv送货 进站顶升申请 - /// - public static string DeliveryAGVIsApplyJackStation2 { get; set; } = ""; - /// - /// Agv送货 送货完成 - /// - public static string DeliveryAGVFinsihStation2 { get; set; } = ""; - /// - /// Agv送货 工位上有货架 - /// - public static string StationHaveCargoStation2 { get; set; } = ""; - /// - /// Agv送货 进站申请 - /// - public static string PickAGVApplyStation2 { get; set; } = ""; - /// - /// Agv送货 进站申请 - /// - public static string PickAGVIsApplyStation2 { get; set; } = ""; - /// - /// Agv送货 取货架完成 - /// - public static string PickCargoAGVFinishStation2 { get; set; } = ""; - /// - /// Agv送货 取料完成 - /// - public static string PickAGVFinishStation2 { get; set; } = ""; - /// - /// 工位上是否有货架 - /// - public static string StationIsExistTrayStation2 { get; set; } = ""; - #endregion - } -} diff --git a/BPASmartClient.FoodStationTest/Model/HK_PLC/PlcManualComm.cs b/BPASmartClient.FoodStationTest/Model/HK_PLC/PlcManualComm.cs deleted file mode 100644 index b4747cfd..00000000 --- a/BPASmartClient.FoodStationTest/Model/HK_PLC/PlcManualComm.cs +++ /dev/null @@ -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; } - - } -} diff --git a/BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs b/BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs index c6c57767..05580961 100644 --- a/BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs +++ b/BPASmartClient.FoodStationTest/Model/Par/ConnectParMode.cs @@ -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(); } } diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/LocaPar.cs b/BPASmartClient.FoodStationTest/Model/Par/LocaPar.cs similarity index 60% rename from BPASmartClient.FoodStationTest/Model/RawMaterial/LocaPar.cs rename to BPASmartClient.FoodStationTest/Model/Par/LocaPar.cs index 0599917b..9728d0d8 100644 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/LocaPar.cs +++ b/BPASmartClient.FoodStationTest/Model/Par/LocaPar.cs @@ -2,12 +2,20 @@ namespace BPASmartClient.FoodStationTest.Model { - public class LocaPar + public class LocalPar { public ObservableCollection Recipes { get; set; } = new ObservableCollection(); + /// /// 配方完成数目。 /// public int RecipeDosingCompleNum { get; set; } = 0; + + /// + /// 味魔方数量,每个项目应该固定的。 + /// + public int RawMaterialDeviceNum { get; } = 6; + + public string HK_PLC_IP { get; } } } diff --git a/BPASmartClient.FoodStationTest/Model/ProcessControl.cs b/BPASmartClient.FoodStationTest/Model/ProcessControl.cs index 24223fef..8b7ecaeb 100644 --- a/BPASmartClient.FoodStationTest/Model/ProcessControl.cs +++ b/BPASmartClient.FoodStationTest/Model/ProcessControl.cs @@ -41,9 +41,6 @@ namespace BPASmartClient.FoodStationTest.Model /// public Dictionary> RecipeQueueTray { get; set; } = new Dictionary>(); - public ConcurrentQueue RecipeQueueTray2 = new ConcurrentQueue(); - - 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.Data.HK_PLC_IP; public void Init() { - RecipeQueueTray.TryAdd(0, new ConcurrentQueue()); - RecipeQueueTray.TryAdd(1, new ConcurrentQueue()); - RecipeQueueTray.TryAdd(2, new ConcurrentQueue()); - RecipeQueueTray.TryAdd(3, new ConcurrentQueue()); - RecipeQueueTray.TryAdd(4, new ConcurrentQueue()); + //初始化物料集合。 + for (int i = 0; i < 5; i++) + { + RecipeQueueTray.TryAdd(i, new ConcurrentQueue()); + } + 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("DB45.DBX0.0").Content; - if (DeviceInquire.GetInstance.devices.Count < 15 && HKDevice.IsConnected && Json.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.Data.RawMaterialDeviceNum && HKDevice.IsConnected + && Json.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 } } + /// + /// 复位所有料仓。 + /// private void StockBinInit() { - for (int i = 1; i < 16; i++) + for (int i = 1; i <= Json.Data.RawMaterialDeviceNum; i++) { if (DeviceInquire.GetInstance.GetDevice(i).deviceStatus.RunStatus == 3) { @@ -703,7 +707,7 @@ namespace BPASmartClient.FoodStationTest.Model } } /// - /// PLC的DB3变量列表 + /// PLC的DB3变量列表。初始化PLC读取DB块变量以及流程变量数据。 /// public void PlcVarMonitor() { @@ -743,6 +747,9 @@ namespace BPASmartClient.FoodStationTest.Model } } } + /// + /// 注册需要用到的委托,主要是用于手动控制的。 + /// public void RegisterInit() { //手动控制气缸 DB5.DBX0.0~DB5.DBX4.5 @@ -1107,6 +1114,9 @@ namespace BPASmartClient.FoodStationTest.Model }), "RobotSetProgramNum", true); } + /// + /// 连接海科PLC,并开启重连线程。 + /// public void DeviceConnect() { try diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/ActionMenu.cs b/BPASmartClient.FoodStationTest/Model/RawMaterial/ActionMenu.cs deleted file mode 100644 index d383bb1d..00000000 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/ActionMenu.cs +++ /dev/null @@ -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; - - - } -} diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/ConveyorServer.cs b/BPASmartClient.FoodStationTest/Model/RawMaterial/ConveyorServer.cs deleted file mode 100644 index 0fca193d..00000000 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/ConveyorServer.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace BPASmartClient.FoodStationTest.Model -{ - public class ConveyorServer - { - public ConveyorServer() - { - - } - } -} diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/CylinderStatusModel.cs b/BPASmartClient.FoodStationTest/Model/RawMaterial/CylinderStatusModel.cs deleted file mode 100644 index 5c77f971..00000000 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/CylinderStatusModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Toolkit.Mvvm.ComponentModel; - -namespace BPASmartClient.FoodStationTest.Model -{ - public class CylinderStatusModel : ObservableObject - { - /// - /// 气缸原点信号 - /// - public bool HomeStatus { get { return _mHomeStatus; } set { _mHomeStatus = value; OnPropertyChanged(); } } - private bool _mHomeStatus; - - /// - /// 气缸到位信号 - /// - public bool InPlace { get { return _mInPlace; } set { _mInPlace = value; OnPropertyChanged(); } } - private bool _mInPlace; - - - - } -} diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceAddress.cs b/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceAddress.cs index 42c831d6..48214906 100644 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceAddress.cs +++ b/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceAddress.cs @@ -1,5 +1,8 @@ namespace BPASmartClient.FoodStationTest.Model { + /// + /// 味魔法通讯地址。 + /// public class DeviceAddress { /// diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs b/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs index bd98dd2d..e424e9b2 100644 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs +++ b/BPASmartClient.FoodStationTest/Model/RawMaterial/DeviceInquire.cs @@ -20,6 +20,7 @@ namespace BPASmartClient.FoodStationTest.Model public static DeviceInquire GetInstance => _Instance ?? (_Instance = new DeviceInquire()); private DeviceInquire() { } + //代码片段。 string IPSegment = "107.107.2."; ConcurrentDictionary DeviceLists = new ConcurrentDictionary(); @@ -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.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.Data.Recipes.Count; i++) + for (int i = 0; i < Json.Data.Recipes.Count; i++) { - for (int m = 0; m < Json.Data.Recipes.ElementAt(i).RawMaterials.Count; m++) + for (int m = 0; m < Json.Data.Recipes.ElementAt(i).RawMaterials.Count; m++) { - if (Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip) + if (Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).DeviceIp == ip) { - Json.Data.Recipes.ElementAt(i).RawMaterials.ElementAt(m).RawMaterialName = DeviceName; + Json.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"; + /// + /// ModbusTcp的地址。 + /// + public string IpAddress=> modbusTcp.GetConfigPar().IpAddress; /// /// 设备状态 /// @@ -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} 开始监听"); } - + /// + /// 写入重量数据,开始配料。 + /// + /// 配料重量。 public void Start(float Value) { diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/GlobalData.cs b/BPASmartClient.FoodStationTest/Model/RawMaterial/GlobalData.cs deleted file mode 100644 index f29e3e2f..00000000 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/GlobalData.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace BPASmartClient.FoodStationTest.Model -{ - public class GlobalData - { - - } -} diff --git a/BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeProcess.cs b/BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeProcess.cs deleted file mode 100644 index 695340f8..00000000 --- a/BPASmartClient.FoodStationTest/Model/RawMaterial/RecipeProcess.cs +++ /dev/null @@ -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; - - } -} diff --git a/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs b/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs index cbc58eb3..fb0dae1a 100644 --- a/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs +++ b/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeData.cs @@ -3,6 +3,10 @@ using System.Collections.ObjectModel; namespace BPASmartClient.FoodStationTest.Model { + + /// + /// 远程配方数据。 + /// public class RemoteRecipeData : ObservableObject { /// diff --git a/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeDataColl.cs b/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeDataColl.cs index fbfd101c..003dd88c 100644 --- a/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeDataColl.cs +++ b/BPASmartClient.FoodStationTest/Model/Recipe/RemoteRecipeDataColl.cs @@ -2,10 +2,12 @@ namespace BPASmartClient.FoodStationTest.Model { + /// + /// 远程配方数据集合。 + /// public class RemoteRecipeDataColl { public ObservableCollection Recipes { get; set; } = new ObservableCollection(); - public int RecipesStatus { get; set; } } } diff --git a/BPASmartClient.FoodStationTest/View/HardwareStatusView.xaml b/BPASmartClient.FoodStationTest/View/HardwareStatusView.xaml index 96133824..9692a5c6 100644 --- a/BPASmartClient.FoodStationTest/View/HardwareStatusView.xaml +++ b/BPASmartClient.FoodStationTest/View/HardwareStatusView.xaml @@ -91,7 +91,7 @@ Foreground="#FF0084FF" Text=" 号仓" /> - + - + diff --git a/BPASmartClient.FoodStationTest/View/ManualControlView.xaml b/BPASmartClient.FoodStationTest/View/ManualControlView.xaml index 8c36c644..a04890f1 100644 --- a/BPASmartClient.FoodStationTest/View/ManualControlView.xaml +++ b/BPASmartClient.FoodStationTest/View/ManualControlView.xaml @@ -432,7 +432,7 @@ FontSize="16" Foreground="Aqua" Text="升降气缸控制" /> - - - + - - + - + { 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; }; diff --git a/BPASmartClient.FoodStationTest/View/RobotView.xaml b/BPASmartClient.FoodStationTest/View/RobotView.xaml deleted file mode 100644 index c499d9e1..00000000 --- a/BPASmartClient.FoodStationTest/View/RobotView.xaml +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/BPASmartClient.FoodStationTest/View/RobotView.xaml.cs b/BPASmartClient.FoodStationTest/View/RobotView.xaml.cs deleted file mode 100644 index 89f2b7b4..00000000 --- a/BPASmartClient.FoodStationTest/View/RobotView.xaml.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Controls; - -namespace BPASmartClient.FoodStationTest.View -{ - /// - /// HKPlcCommMonitor.xaml 的交互逻辑 - /// - public partial class RobotView : UserControl - { - public RobotView() - { - InitializeComponent(); - } - } -} diff --git a/BPASmartClient.FoodStationTest/View/SystemParView.xaml b/BPASmartClient.FoodStationTest/View/SystemParView.xaml index 9cf29ee0..b72c39fc 100644 --- a/BPASmartClient.FoodStationTest/View/SystemParView.xaml +++ b/BPASmartClient.FoodStationTest/View/SystemParView.xaml @@ -159,22 +159,8 @@ Margin="10,0,10,0" HorizontalAlignment="Left" Orientation="Vertical"> - - + + - - - - - - - - - - - - - - - - - - - - - - - -