From 0f020ea13ea41a21d3b030b8c1c1f1571f498505 Mon Sep 17 00:00:00 2001 From: taoye Date: Mon, 12 Sep 2022 10:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/ViewModel/AlarmViewModel.cs | 3 +++ .../Pages/ViewModel/MainViewModel.cs | 2 +- FryPot_DosingSystem/App.xaml.cs | 1 - FryPot_DosingSystem/Control/DosingLogicControl.cs | 1 - .../Pages => FryPot_DosingSystem}/Model/AlarmInfo.cs | 5 +++-- FryPot_DosingSystem/View/RecipeManageView.xaml.cs | 9 ++++++++- FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) rename {BPASmartClient.CustomResource/Pages => FryPot_DosingSystem}/Model/AlarmInfo.cs (98%) diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs index ef98e9a2..2d017446 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/AlarmViewModel.cs @@ -65,6 +65,9 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel return; } }); + + //AlarmInfos = AlarmHelper.Alarms; + } private void GetHistoryAlarm() diff --git a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs index 38040e65..03cee339 100644 --- a/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs +++ b/BPASmartClient.CustomResource/Pages/ViewModel/MainViewModel.cs @@ -45,7 +45,7 @@ namespace BPASmartClient.CustomResource.Pages.ViewModel private void DoNavChanged(object obj) { - ActionManage.GetInstance.Send("RecipeIsChange"); + if (obj != null && obj is SubMenumodel menumodel) { diff --git a/FryPot_DosingSystem/App.xaml.cs b/FryPot_DosingSystem/App.xaml.cs index 48a9d886..f180caac 100644 --- a/FryPot_DosingSystem/App.xaml.cs +++ b/FryPot_DosingSystem/App.xaml.cs @@ -16,7 +16,6 @@ using System.IO; using System.Linq; using System.Threading.Tasks; using System.Windows; -using AlarmInfo = BPASmartClient.CustomResource.Pages.Model.AlarmInfo; namespace FryPot_DosingSystem { diff --git a/FryPot_DosingSystem/Control/DosingLogicControl.cs b/FryPot_DosingSystem/Control/DosingLogicControl.cs index 0e53d80f..717e6d64 100644 --- a/FryPot_DosingSystem/Control/DosingLogicControl.cs +++ b/FryPot_DosingSystem/Control/DosingLogicControl.cs @@ -1568,7 +1568,6 @@ namespace FryPot_DosingSystem.Control FryPotMonitorManage.GetInstance.fryFive.OilCapacity = globalVar.fryPotFive.OilCapacity; FryPotMonitorManage.GetInstance.fryFive.TotalOilCapactiy += globalVar.fryPotFive.OilCapacity; } - //炒锅状态实时显示 FryPotStatusDisplay(); RollerLineStatusDisplay(); diff --git a/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs b/FryPot_DosingSystem/Model/AlarmInfo.cs similarity index 98% rename from BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs rename to FryPot_DosingSystem/Model/AlarmInfo.cs index ebe66068..6beab0e1 100644 --- a/BPASmartClient.CustomResource/Pages/Model/AlarmInfo.cs +++ b/FryPot_DosingSystem/Model/AlarmInfo.cs @@ -1,10 +1,11 @@ -using System; +using BPASmartClient.CustomResource.Pages.Model; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace BPASmartClient.CustomResource.Pages.Model +namespace FryPot_DosingSystem.Model { public class AlarmInfo { diff --git a/FryPot_DosingSystem/View/RecipeManageView.xaml.cs b/FryPot_DosingSystem/View/RecipeManageView.xaml.cs index 72ef33c1..bac6eff3 100644 --- a/FryPot_DosingSystem/View/RecipeManageView.xaml.cs +++ b/FryPot_DosingSystem/View/RecipeManageView.xaml.cs @@ -1,4 +1,5 @@ -using System; +using BPASmartClient.Helper; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -23,6 +24,12 @@ namespace FryPot_DosingSystem.View public RecipeManageView() { InitializeComponent(); + this.Unloaded += RecipeManageView_Unloaded; + } + + private void RecipeManageView_Unloaded(object sender, RoutedEventArgs e) + { + ActionManage.GetInstance.Send("RecipeIsChange"); } } } diff --git a/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs b/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs index 86734c42..45846932 100644 --- a/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs +++ b/FryPot_DosingSystem/ViewModel/RecipeSetViewModel.cs @@ -54,7 +54,7 @@ namespace FryPot_DosingSystem.ViewModel int count = recipeModels.Count; bool sign = false; ActionManage.GetInstance.CancelRegister("RecipeIsChange"); - ActionManage.GetInstance.Register(new Action(() => + ActionManage.GetInstance.RegisterAsync(new Action(() => { if (!sign) {