From 1191bb5cccd5ae7f166d31bdd461b394e90e0ab0 Mon Sep 17 00:00:00 2001 From: taoye Date: Mon, 27 Jun 2022 18:31:58 +0800 Subject: [PATCH] =?UTF-8?q?180=E9=A1=B9=E7=9B=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/View/MainView.xaml | 100 ++++++++++- .../Pages/ViewModel/MainViewModel.cs | 27 ++- BPASmartClient/BPASmartClient.csproj | 1 + FryPot_DosingSystem/App.xaml | 3 +- FryPot_DosingSystem/App.xaml.cs | 163 +++++++++++++++++- .../Control/DosingLogicControl.cs | 103 ++++++----- FryPot_DosingSystem/Helper/HubHelper.cs | 4 +- FryPot_DosingSystem/Model/RecipeManage.cs | 3 +- FryPot_DosingSystem/View/RecipeSetView.xaml | 7 +- SmartClient.sln | 49 +++++- 10 files changed, 400 insertions(+), 60 deletions(-) diff --git a/BPASmartClient.CustomResource/Pages/View/MainView.xaml b/BPASmartClient.CustomResource/Pages/View/MainView.xaml index be782f19..1fed4e8c 100644 --- a/BPASmartClient.CustomResource/Pages/View/MainView.xaml +++ b/BPASmartClient.CustomResource/Pages/View/MainView.xaml @@ -21,6 +21,7 @@ + @@ -280,7 +281,90 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -425,7 +509,19 @@ - + + + + + /// 设备初始化状态 + /// + public bool Status + { + get { return _status; } + set + { + if (value) + { + ActionManage.GetInstance.Send("StartPlcInite"); + } + else + { + ActionManage.GetInstance.Send("EndPlcInite"); + } + _status = value; + OnPropertyChanged(); + } + } + /// + /// 开机自启 + /// + public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } } public RelayCommand NavChangedCommand { get; set; } public FrameworkElement MainContent { get { return _mMainContent; } set { _mMainContent = value; OnPropertyChanged(); } } diff --git a/BPASmartClient/BPASmartClient.csproj b/BPASmartClient/BPASmartClient.csproj index bba8ce8f..76760866 100644 --- a/BPASmartClient/BPASmartClient.csproj +++ b/BPASmartClient/BPASmartClient.csproj @@ -39,6 +39,7 @@ + diff --git a/FryPot_DosingSystem/App.xaml b/FryPot_DosingSystem/App.xaml index e4b7fbc7..b23b0141 100644 --- a/FryPot_DosingSystem/App.xaml +++ b/FryPot_DosingSystem/App.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:FryPot_DosingSystem" xmlns:con="clr-namespace:System.Drawing;assembly=netstandard" xmlns:con1="clr-namespace:BPASmartClient.CustomResource.Converters;assembly=BPASmartClient.CustomResource" - StartupUri="View/MainWindow.xaml"> + > @@ -23,6 +23,7 @@ + diff --git a/FryPot_DosingSystem/App.xaml.cs b/FryPot_DosingSystem/App.xaml.cs index 241366aa..b871a928 100644 --- a/FryPot_DosingSystem/App.xaml.cs +++ b/FryPot_DosingSystem/App.xaml.cs @@ -1,5 +1,12 @@ -using System; +using BPASmartClient.CustomResource.Pages.Enums; +using BPASmartClient.CustomResource.Pages.Model; +using BPASmartClient.CustomResource.Pages.View; +using BPASmartClient.Helper; +using FryPot_DosingSystem.Control; +using FryPot_DosingSystem.Model; +using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Configuration; using System.Data; using System.Linq; @@ -13,5 +20,159 @@ namespace FryPot_DosingSystem /// public partial class App : Application { + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + MenuInite(); + LoginDataInite(); + + MainView mv = new MainView(); + LoginView lv = new LoginView(); + var res = lv.ShowDialog(); + if (res != null && res == true) + { + mv.Show(); + DeviceOperate deviceOperate = DeviceOperate.GetInstance;//开启实时PLC数据读取 + DosingLogicControl logigControl = DosingLogicControl.GetInstance;//开启逻辑控制任务程序 + } + else + mv.Close(); + + } + protected override void OnExit(ExitEventArgs e) + { + base.OnExit(e); + Json.Save(); + MessageLog.GetInstance.LogSave(); + } + private void MenuInite() + { + #region 配方管理菜单 + ObservableCollection RecipeManage = new ObservableCollection(); + RecipeManage.Add(new SubMenumodel() + { + SubMenuName = "配方管理", + SubMenuPermission = new Permission[] { Permission.管理员 }, + AssemblyName = "FryPot_DosingSystem", + ToggleWindowPath = "View.RecipeSetView" + }); + + RecipeManage.Add(new SubMenumodel() + { + SubMenuName = "配方下发", + SubMenuPermission = new Permission[] { Permission.操作员,Permission.管理员 }, + AssemblyName = "FryPot_DosingSystem", + ToggleWindowPath = "View.RecipeSendDownView" + }); + + MenuManage.GetInstance.menuModels.Add(new MenuModel() + { + MainMenuIcon = "", + MainMenuName = "配方管理", + Alias = "Recipe Management", + MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员 }, + subMenumodels = RecipeManage, + }); + #endregion + + #region 消息日志 + ObservableCollection InfoLog = new ObservableCollection(); + InfoLog.Add(new SubMenumodel() + { + SubMenuName = "操作日志", + SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, + AssemblyName = "BPASmartClient.CustomResource", + ToggleWindowPath = "Pages.View.UserLogView" + }); + + InfoLog.Add(new SubMenumodel() + { + SubMenuName = "运行日志", + SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, + AssemblyName = "BPASmartClient.CustomResource", + ToggleWindowPath = "Pages.View.RunLogView" + }); + + InfoLog.Add(new SubMenumodel() + { + SubMenuName = "报警记录", + SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 }, + AssemblyName = "BPASmartClient.CustomResource", + ToggleWindowPath = "Pages.View.AlarmView" + }); + + MenuManage.GetInstance.menuModels.Add(new MenuModel() + { + MainMenuIcon = "", + MainMenuName = "消息日志", + Alias = "Message Log", + MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + subMenumodels = InfoLog, + }); + #endregion + + #region 硬件设备监控 + ObservableCollection DeviceMonitor = new ObservableCollection(); + DeviceMonitor.Add(new SubMenumodel() + { + SubMenuName = "原料设备列表", + SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + AssemblyName = "FryPot_DosingSystem", + ToggleWindowPath = "View.DeviceListView" + }); + + DeviceMonitor.Add(new SubMenumodel() + { + SubMenuName = "设备状态", + SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + AssemblyName = "FryPot_DosingSystem", + ToggleWindowPath = "View.HardWareStatusView" + }); + + + MenuManage.GetInstance.menuModels.Add(new MenuModel() + { + MainMenuIcon = "", + MainMenuName = "设备监控", + Alias = "Device Monitor", + MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + subMenumodels = DeviceMonitor, + }); + #endregion + + #region 用户管理 + ObservableCollection UserManager = new ObservableCollection(); + UserManager.Add(new SubMenumodel() + { + SubMenuName = "用户登录", + SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + AssemblyName = "BPASmartClient.CustomResource", + ToggleWindowPath = "Pages.View.LoginView" + }); + + UserManager.Add(new SubMenumodel() + { + SubMenuName = "密码修改", + SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + AssemblyName = "BPASmartClient.CustomResource", + ToggleWindowPath = "Pages.View.PasswordChangeView" + }); + + + MenuManage.GetInstance.menuModels.Add(new MenuModel() + { + MainMenuIcon = "", + MainMenuName = "用户管理", + Alias = "User Management", + MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 }, + subMenumodels = UserManager, + }); + #endregion + } + private void LoginDataInite() + { + Config.GetInstance.Init();//用户数据初始化 + Json.Read(); + } } } diff --git a/FryPot_DosingSystem/Control/DosingLogicControl.cs b/FryPot_DosingSystem/Control/DosingLogicControl.cs index 829f849c..25486dae 100644 --- a/FryPot_DosingSystem/Control/DosingLogicControl.cs +++ b/FryPot_DosingSystem/Control/DosingLogicControl.cs @@ -1,6 +1,6 @@ using BPASmartClient.AGV; +using BPASmartClient.CustomResource.Pages.Model; using BPASmartClient.Helper; -using BPASmartClient.Message; using FryPot_DosingSystem.Model; using System; using System.Collections.Concurrent; @@ -36,7 +36,7 @@ namespace FryPot_DosingSystem.Control GlobalVariable globalVar; #region 上位机内部变量 - int lineAlarm = 0;//线体故障信号 1:无故障 -1:故障 + //int lineAlarm = 0;//线体故障信号 1:无故障 -1:故障 int FryPotAlarm = 0;//炒锅滚筒故障信号 1:无故障 -1:故障 int ReicpeNum = 0;//记录接收到的配方数 #endregion @@ -66,7 +66,7 @@ namespace FryPot_DosingSystem.Control { if (RTrig.GetInstance("ResetProgram").Start(globalVar.PlcInite == 1))//判断是否初始化 一初始化就重启主任务 { - MessageLog.GetInstance.Show("主任务正在重启"); + MessageLog.GetInstance.ShowRunLog("主任务正在重启"); ThreadManage.GetInstance().StopTask("MainTask", new Action(() => { ThreadManage.GetInstance().StopTask("MainViewReadPlcData", new Action(() => @@ -79,7 +79,7 @@ namespace FryPot_DosingSystem.Control ActionManage.GetInstance.Send("ClearRecipes"); ReadPlcData(); IniteTask(); - MessageLog.GetInstance.Show("主任务重启完成"); + MessageLog.GetInstance.ShowRunLog("主任务重启完成"); })); })); } @@ -127,6 +127,15 @@ namespace FryPot_DosingSystem.Control globalVar.rollerLineThree.StationSeven = data[6]; globalVar.rollerLineThree.StationEight = data[7]; })); + GetAddressData("D2031", new Action((data) => + { + globalVar.rollerLineOne.OutMaterialingSingle = data[3]; + globalVar.rollerLineTwo.OutMaterialingSingle = data[4]; + globalVar.rollerLineThree.OutMaterialingSingle = data[5]; + globalVar.rollerLineOne.OutMaterialingTroubleSingle=data[6]; + globalVar.rollerLineTwo.OutMaterialingTroubleSingle = data[7]; + globalVar.rollerLineThree.OutMaterialingTroubleSingle = data[8]; + })); GetAddressData("D2040", new Action((data) => { globalVar.fryPotOne.InputMaterialRollerRunningSingle = data[0]; @@ -229,7 +238,7 @@ namespace FryPot_DosingSystem.Control { RecipeQuene.Enqueue(recipe); ReicpeNum++; - MessageLog.GetInstance.Show($"接收到{ReicpeNum}个配方"); + MessageLog.GetInstance.ShowRunLog($"接收到{ReicpeNum}个配方"); } } @@ -253,7 +262,7 @@ namespace FryPot_DosingSystem.Control if (RecipeQuene.TryDequeue(out NewRecipeModel result)) { - MessageLog.GetInstance.Show($"开始制作【{result.RecipeName}】 配方"); + MessageLog.GetInstance.ShowRunLog($"开始制作【{result.RecipeName}】 配方"); for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 { //将配方中原料加入新的队列 @@ -290,7 +299,7 @@ namespace FryPot_DosingSystem.Control /// public void AgvLoadRoller() { - lineAlarm = 0; + //lineAlarm = 0; if (InputMaterialQuene.Count > 0) { switch (InputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100) @@ -382,35 +391,35 @@ namespace FryPot_DosingSystem.Control Thread.Sleep(5); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; + MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; case 2: while (globalVar.fryPotTwo.InputMaterialArrivedSingle == 0 || globalVar.fryPotTwo.InputMaterialRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; + MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; case 3: while (globalVar.fryPotThree.InputMaterialArrivedSingle == 0 || globalVar.fryPotThree.InputMaterialRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; + MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; case 4: while (globalVar.fryPotFour.InputMaterialArrivedSingle == 0 || globalVar.fryPotFour.InputMaterialRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; + MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; case 5: while (globalVar.fryPotFive.InputMaterialArrivedSingle == 0 || globalVar.fryPotFive.InputMaterialRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; + MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}已到进料位置,准备倒料"); break; } } @@ -423,19 +432,19 @@ namespace FryPot_DosingSystem.Control { case 1: while (globalVar.fryPotOne.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotOne.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; - } MessageLog.GetInstance.Show($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; + } MessageLog.GetInstance.ShowRunLog($"炒锅【1】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; case 2: while (globalVar.fryPotTwo.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotTwo.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; - } MessageLog.GetInstance.Show($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; + } MessageLog.GetInstance.ShowRunLog($"炒锅【2】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; case 3: while (globalVar.fryPotThree.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotThree.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; - } MessageLog.GetInstance.Show($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; + } MessageLog.GetInstance.ShowRunLog($"炒锅【3】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; case 4: while (globalVar.fryPotFour.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotFour.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; - } MessageLog.GetInstance.Show($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; + } MessageLog.GetInstance.ShowRunLog($"炒锅【4】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; case 5: while (globalVar.fryPotFive.EmptyBarrelArrivedSingle == 0 || globalVar.fryPotFive.EmptyBarrelRollerRunningSingle == 0) { Thread.Sleep(5); if (globalVar.ExitMainTask) return; - } MessageLog.GetInstance.Show($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; + } MessageLog.GetInstance.ShowRunLog($"炒锅【5】原料:{OutputMaterialQuene.ElementAt(0).materialType.MaterialName}空桶到达出桶位置,正在出桶"); break; } } @@ -473,7 +482,7 @@ namespace FryPot_DosingSystem.Control /// public void AgvFromLineOneToFryPot() { - erp: if (lineAlarm == 1)//无故障 + erp: if (globalVar.rollerLineOne.OutMaterialingTroubleSingle==0)//无故障 { while (!agvArriveLine)//等待AGV到线体装料位置 { @@ -498,14 +507,14 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (lineAlarm == -1) + while (globalVar.rollerLineOne.OutMaterialingTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show("线体【1】滚筒故障解除,继续运行"); - lineAlarm = 1; + MessageLog.GetInstance.ShowRunLog("线体【1】滚筒故障解除,继续运行"); +//lineAlarm = 1; goto erp; } } @@ -515,7 +524,7 @@ namespace FryPot_DosingSystem.Control /// public void AgvFromLineTwoToFryPot() { - erp: if (lineAlarm == 1)//无故障 + erp: if (globalVar.rollerLineTwo.OutMaterialingTroubleSingle == 0)//无故障 { while (!agvArriveLine)//等待AGV到线体装料位置 { @@ -540,14 +549,14 @@ namespace FryPot_DosingSystem.Control } else//有故障 { - while (lineAlarm == -1) + while (globalVar.rollerLineTwo.OutMaterialingTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show("线体【2】滚筒故障解除,继续运行"); - lineAlarm = 1; + MessageLog.GetInstance.ShowRunLog("线体【2】滚筒故障解除,继续运行"); + // lineAlarm = 1; goto erp; } } @@ -557,7 +566,7 @@ namespace FryPot_DosingSystem.Control /// public void AgvFromLineThreeToFryPot() { - erp: if (lineAlarm == 1)//无故障 + erp: if (globalVar.rollerLineThree.OutMaterialingTroubleSingle == 0)//无故障 { while (!agvArriveLine)//等待AGV到线体装料位置 { @@ -580,16 +589,16 @@ namespace FryPot_DosingSystem.Control } } - else//有故障 + else //有故障 { - while (lineAlarm == -1) + while (globalVar.rollerLineThree.OutMaterialingTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; } - MessageLog.GetInstance.Show("线体【3】滚筒故障解除,继续运行"); - lineAlarm = 1; + MessageLog.GetInstance.ShowRunLog("线体【3】滚筒故障解除,继续运行"); + // lineAlarm = 1; goto erp; } } @@ -606,16 +615,16 @@ namespace FryPot_DosingSystem.Control return; } AGVHelper.GetInstance.AgvToLineOneLoadRoller(); - MessageLog.GetInstance.Show("AGV去1号线体"); + MessageLog.GetInstance.ShowRunLog("AGV去1号线体"); globalVar.AllowAgvToLineLoadRoller = false; } } else { - MessageLog.GetInstance.ShowEx("警告:滚筒输送线体【1】故障!!!"); - lineAlarm = -1; + MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【1】故障!!!"); + // lineAlarm = -1; } - lineAlarm = 1; + // lineAlarm = 1; } public void AgvToLineTwoLoadRoller() { @@ -630,17 +639,17 @@ namespace FryPot_DosingSystem.Control return; } AGVHelper.GetInstance.AgvToLineTwoLoadRoller(); - MessageLog.GetInstance.Show("AGV去2号线体"); + MessageLog.GetInstance.ShowRunLog("AGV去2号线体"); globalVar.AllowAgvToLineLoadRoller = false; } } else { - MessageLog.GetInstance.ShowEx("警告:滚筒输送线体【2】故障!!!"); - lineAlarm = -1; + MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【2】故障!!!"); + //lineAlarm = -1; } - lineAlarm = 1; + // lineAlarm = 1; } public void AgvToLineThreeLoadRoller() { @@ -655,17 +664,17 @@ namespace FryPot_DosingSystem.Control return; } AGVHelper.GetInstance.AgvToLineThreeLoadRoller(); - MessageLog.GetInstance.Show("AGV去3号线体"); + MessageLog.GetInstance.ShowRunLog("AGV去3号线体"); globalVar.AllowAgvToLineLoadRoller = false; } } else { - MessageLog.GetInstance.ShowEx("警告:滚筒输送线体【3】故障!!!"); - lineAlarm = -1; + MessageLog.GetInstance.ShowRunLog("警告:滚筒输送线体【3】故障!!!"); + // lineAlarm = -1; } - lineAlarm = 1; + // lineAlarm = 1; } /// /// 1号线体数据下发 @@ -827,35 +836,35 @@ namespace FryPot_DosingSystem.Control switch (OutputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100) { case 1: - if (globalVar.fryPotOne.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotOne.RollerTroubleSingle == 1) + if (globalVar.fryPotOne.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotOne.RollerTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; } FryPotAlarm = 1; break; case 2: - if (globalVar.fryPotTwo.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotTwo.RollerTroubleSingle == 1) + if (globalVar.fryPotTwo.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotTwo.RollerTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; } FryPotAlarm = 1; break; case 3: - if (globalVar.fryPotThree.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotThree.RollerTroubleSingle == 1) + if (globalVar.fryPotThree.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotThree.RollerTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; } FryPotAlarm = 1; break; case 4: - if (globalVar.fryPotFour.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFour.RollerTroubleSingle == 1) + if (globalVar.fryPotFour.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFour.RollerTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; } FryPotAlarm = 1; break; case 5: - if (globalVar.fryPotFive.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowEx("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFive.RollerTroubleSingle == 1) + if (globalVar.fryPotFive.RollerTroubleSingle == 1) { FryPotAlarm = -1; MessageLog.GetInstance.ShowRunLog("警告:炒锅【1】输送滚筒发生故障"); } else { FryPotAlarm = 1; } while (globalVar.fryPotFive.RollerTroubleSingle == 1) { Thread.Sleep(50); if (globalVar.ExitMainTask) return; diff --git a/FryPot_DosingSystem/Helper/HubHelper.cs b/FryPot_DosingSystem/Helper/HubHelper.cs index 24be49f2..727fd2ba 100644 --- a/FryPot_DosingSystem/Helper/HubHelper.cs +++ b/FryPot_DosingSystem/Helper/HubHelper.cs @@ -19,12 +19,12 @@ namespace FryPot_DosingSystem.Helper { hubConnection = new HubConnectionBuilder().WithAutomaticReconnect().WithUrl("http://localhost:5175/personhub").Build();//连接 - + //AGV搬运任务上报后执行的委托 hubConnection.On("Report", (s) => { //注册接收消息的委托 }); - + //AGV上下料交互请求执行的委托 hubConnection.On("Upstreamrequest", (s) => { //注册接收消息的委托 diff --git a/FryPot_DosingSystem/Model/RecipeManage.cs b/FryPot_DosingSystem/Model/RecipeManage.cs index 402778f4..b4b29e3d 100644 --- a/FryPot_DosingSystem/Model/RecipeManage.cs +++ b/FryPot_DosingSystem/Model/RecipeManage.cs @@ -10,8 +10,7 @@ namespace FryPot_DosingSystem.Model { internal class RecipeManage:ObservableObject { - //private static RecipeManage _Instance; - //public static RecipeManage GetInstance=>_Instance ?? (_Instance = new RecipeManage()); + public ObservableCollection Recipes { get; set; }=new ObservableCollection(); } } diff --git a/FryPot_DosingSystem/View/RecipeSetView.xaml b/FryPot_DosingSystem/View/RecipeSetView.xaml index 14a9a6e3..ce5cdd80 100644 --- a/FryPot_DosingSystem/View/RecipeSetView.xaml +++ b/FryPot_DosingSystem/View/RecipeSetView.xaml @@ -45,7 +45,7 @@ - + @@ -62,7 +62,7 @@ Command="{Binding NewRecipe}"> - + + diff --git a/SmartClient.sln b/SmartClient.sln index 714c3b0d..ae1e55f5 100644 --- a/SmartClient.sln +++ b/SmartClient.sln @@ -104,7 +104,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_Contai EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.IceMaker", "BPASmartClient.IceMaker\BPASmartClient.IceMaker.csproj", "{F61AC179-156D-4075-BFEB-355862231F48}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BPASmartClient.MorkT_BarCounter", "BPASmartClient.MorkT_BarCounter\BPASmartClient.MorkT_BarCounter.csproj", "{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.MorkT_BarCounter", "BPASmartClient.MorkT_BarCounter\BPASmartClient.MorkT_BarCounter.csproj", "{048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPASmartClient.AgvApi", "BPASmartClient.AgvApi\BPASmartClient.AgvApi.csproj", "{4B25A520-DC6B-4272-8839-E6281DD0D7B8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FryPot_DosingSystem", "FryPot_DosingSystem\FryPot_DosingSystem.csproj", "{7AB88042-3150-47C9-AA15-DF326B5F347D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -980,6 +984,46 @@ Global {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x64.Build.0 = Release|Any CPU {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.ActiveCfg = Release|Any CPU {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD}.Release|x86.Build.0 = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM.ActiveCfg = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM.Build.0 = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|ARM64.Build.0 = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x64.ActiveCfg = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x64.Build.0 = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x86.ActiveCfg = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Debug|x86.Build.0 = Debug|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|Any CPU.Build.0 = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM.ActiveCfg = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM.Build.0 = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM64.ActiveCfg = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|ARM64.Build.0 = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x64.ActiveCfg = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x64.Build.0 = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x86.ActiveCfg = Release|Any CPU + {4B25A520-DC6B-4272-8839-E6281DD0D7B8}.Release|x86.Build.0 = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM.ActiveCfg = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM.Build.0 = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|ARM64.Build.0 = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x64.ActiveCfg = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x64.Build.0 = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Debug|x86.Build.0 = Debug|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|Any CPU.Build.0 = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM.ActiveCfg = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM.Build.0 = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM64.ActiveCfg = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|ARM64.Build.0 = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x64.ActiveCfg = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x64.Build.0 = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x86.ActiveCfg = Release|Any CPU + {7AB88042-3150-47C9-AA15-DF326B5F347D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -993,6 +1037,7 @@ Global {2344EB60-1760-4DF0-961A-FA5BE5BC47CC} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} {202763AA-4C4C-4738-B530-93A9A1ECE578} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} {13C86146-CD3C-4CD3-AB7F-7A155E222832} = {3D1D0E04-03FD-480A-8CF8-6E01A2E28625} + {9FB27073-61A0-4FE3-94DB-5FDDE062332F} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} {0827FA85-8180-4A85-BE58-9483AC4BB3BA} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} {8878BCFD-AC5E-4D84-8C63-CA99DDE036EE} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} {B399BCFF-82E8-4940-9CE5-B7DCDDFDC696} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} @@ -1028,6 +1073,8 @@ Global {3653724D-3683-4722-B978-EB88DD4AE5DB} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} {F61AC179-156D-4075-BFEB-355862231F48} = {666CB1A9-562E-453A-A2C7-FD9D77CFDFDD} {048FED78-4BFA-4FCD-8FF2-905E9CA4D7DD} = {9FB27073-61A0-4FE3-94DB-5FDDE062332F} + {4B25A520-DC6B-4272-8839-E6281DD0D7B8} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} + {7AB88042-3150-47C9-AA15-DF326B5F347D} = {8712125E-14CD-4E1B-A1CE-4BDE03805942} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9AEC9B81-0222-4DE9-B642-D915C29222AC}