From 5c0b58f0a8a14e9c39600f8bfa03d7cfa0daeccf Mon Sep 17 00:00:00 2001 From: liuwf Date: Thu, 7 Mar 2024 09:51:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=8F=91=E6=B3=A1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=A1=A8=E7=95=8C=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.Core.Repository/BASE/BaseRepository.cs | 3 ++- .../ViewModels/FoamMonitorPageViewModel.cs | 20 +++++++++++-------- .../Views/FoamMonitorPageView.xaml | 8 ++++---- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Admin.Core.Repository/BASE/BaseRepository.cs b/Admin.Core.Repository/BASE/BaseRepository.cs index 56917d10..3030a8be 100644 --- a/Admin.Core.Repository/BASE/BaseRepository.cs +++ b/Admin.Core.Repository/BASE/BaseRepository.cs @@ -61,6 +61,7 @@ namespace Admin.Core.Repository { try { + if (_db.CopyNew().Ado.IsValidConnection()) { @@ -75,7 +76,7 @@ namespace Admin.Core.Repository } catch (Exception ex) { - + Console.WriteLine(_db+":"+ex.ToString()); Console.WriteLine(ex.ToString()); return false; } diff --git a/Aucma.Core.BoxFoam/ViewModels/FoamMonitorPageViewModel.cs b/Aucma.Core.BoxFoam/ViewModels/FoamMonitorPageViewModel.cs index 89d9dc47..ece0ce51 100644 --- a/Aucma.Core.BoxFoam/ViewModels/FoamMonitorPageViewModel.cs +++ b/Aucma.Core.BoxFoam/ViewModels/FoamMonitorPageViewModel.cs @@ -22,6 +22,7 @@ using Admin.Core.Model; using System.Threading; using Aucma.Core.HwPLc; using Admin.Core.Model.ViewModels; +using System.Windows; namespace Aucma.Core.BoxFoam.ViewModels { @@ -84,17 +85,20 @@ namespace Aucma.Core.BoxFoam.ViewModels { try { - if (ProductionHourList!=null && ProductionHourList.Count>0) + Application.Current.Dispatcher.Invoke(() => { - ProductionHourList.Clear(); - } - ProductionHourList = new List(); + + List xList = new List(); List listTime = _baseBomInfoServices.getWorkTime().Result; foreach (WorkTime time in listTime) { - ProductionHourList.Add(time.hourTime); + xList.Add(time.hourTime); } - + //if (ProductionHourList != null && ProductionHourList.Count > 0) + //{ + // ProductionHourList.Clear(); + //} + ProductionHourList = xList; // 货道列表 List list = _boxFoamDataServices.QueryAsync(x => x.ProductLineCode.Equals("CX_02") && x.StationCode == "1005").Result; @@ -176,9 +180,9 @@ namespace Aucma.Core.BoxFoam.ViewModels #endregion } + }); + - - } catch (Exception ex) { diff --git a/Aucma.Core.BoxFoam/Views/FoamMonitorPageView.xaml b/Aucma.Core.BoxFoam/Views/FoamMonitorPageView.xaml index ca1c2df6..64ccd279 100644 --- a/Aucma.Core.BoxFoam/Views/FoamMonitorPageView.xaml +++ b/Aucma.Core.BoxFoam/Views/FoamMonitorPageView.xaml @@ -410,8 +410,8 @@ - - + + @@ -419,7 +419,7 @@ - + @@ -444,7 +444,7 @@ - +