From 0e846b372ab5d9f594a58cadf95bade76a1aba24 Mon Sep 17 00:00:00 2001 From: "liulb@mesnac.com" Date: Sat, 13 Jan 2024 22:51:14 +0800 Subject: [PATCH] new --- .../Aucma.Core.Palletiz.csproj | 3 - .../Aucma.Core.Palletiz.csproj.user | 9 - .../ViewModels/IndexPageViewModel.cs | 18 +- .../ViewModels/MainWindowViewModel.cs | 64 +++ .../ViewModels/SplitPlanViewModel.cs | 16 +- Aucma.Core.Palletiz/Views/IndexPageView.xaml | 13 +- Aucma.Core.Palletiz/Views/MainWindow.xaml | 19 +- .../Views/PalletizPageView.xaml | 447 ++++-------------- Aucma.Core.Palletiz/Views/PlanPageView.xaml | 89 ---- .../Views/PlanPageView.xaml.cs | 30 -- .../Views/QuantityIssuedView.xaml | 111 ----- .../Views/QuantityIssuedView.xaml.cs | 24 - .../Views/SearchCriteriaView.xaml | 107 ----- .../Views/SearchCriteriaView.xaml.cs | 17 - Aucma.Core.Palletiz/Views/SplitPlanView.xaml | 4 +- .../Views/StatisticsPageView.xaml | 44 +- Aucma.Core.PrintTo/Assets/Images/Icon.png | Bin 0 -> 1153 bytes .../Assets/Images/background.jpg | Bin 0 -> 111693 bytes Aucma.Core.PrintTo/Aucma.Core.PrintTo.csproj | 4 + .../ViewModels/MainWindowViewModel.cs | 71 ++- Aucma.Core.PrintTo/Views/IndexPageView.xaml | 42 +- Aucma.Core.PrintTo/Views/MainWindow.xaml | 69 +-- Aucma.Core.RunPlc/RunPlcService.cs | 4 +- .../Views/IndexPageView.xaml | 4 +- Aucma.Core.SheetMetal/Views/MainWindow.xaml | 1 - 25 files changed, 333 insertions(+), 877 deletions(-) delete mode 100644 Aucma.Core.Palletiz/Views/PlanPageView.xaml delete mode 100644 Aucma.Core.Palletiz/Views/PlanPageView.xaml.cs delete mode 100644 Aucma.Core.Palletiz/Views/QuantityIssuedView.xaml delete mode 100644 Aucma.Core.Palletiz/Views/QuantityIssuedView.xaml.cs delete mode 100644 Aucma.Core.Palletiz/Views/SearchCriteriaView.xaml delete mode 100644 Aucma.Core.Palletiz/Views/SearchCriteriaView.xaml.cs create mode 100644 Aucma.Core.PrintTo/Assets/Images/Icon.png create mode 100644 Aucma.Core.PrintTo/Assets/Images/background.jpg diff --git a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj index 7eee96de..9caaaa5b 100644 --- a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj +++ b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj @@ -81,9 +81,6 @@ Code - - Code - Code diff --git a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user index 43c13b1d..00d9b561 100644 --- a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user +++ b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user @@ -7,9 +7,6 @@ - - Designer - Designer @@ -19,12 +16,6 @@ Designer - - Designer - - - Designer - Designer diff --git a/Aucma.Core.Palletiz/ViewModels/IndexPageViewModel.cs b/Aucma.Core.Palletiz/ViewModels/IndexPageViewModel.cs index 5537a641..59ca6381 100644 --- a/Aucma.Core.Palletiz/ViewModels/IndexPageViewModel.cs +++ b/Aucma.Core.Palletiz/ViewModels/IndexPageViewModel.cs @@ -85,15 +85,16 @@ namespace Aucma.Core.Palletiz.ViewModels { ChartValues achievement = new ChartValues(); Random random = new Random(); - for (int i = 0; i < 2; i++) - { - achievement.Add(random.Next(1, 50)); - } + //for (int i = 0; i < 2; i++) + //{ + // achievement.Add(random.Next(1, 50)); + //} var column = new ColumnSeries(); column.DataLabels = true; column.Title = "小时产量"; column.Values = achievement; + column.ScalesYAt = 0; column.Foreground = Brushes.White; ModelStatistics.Add(column); @@ -109,13 +110,14 @@ namespace Aucma.Core.Palletiz.ViewModels ChartValues achievement2 = new ChartValues(); Random random2 = new Random(); - for (int i = 0; i < 5; i++) - { - achievement2.Add(random2.Next(0, 30)); - } + //for (int i = 0; i < 5; i++) + //{ + // achievement2.Add(random2.Next(0, 30)); + //} var column2 = new ColumnSeries(); column2.DataLabels = true; column2.Title = "型号统计"; + column2.ScalesYAt = 0; column2.Values = achievement2; column2.Foreground = Brushes.White; diff --git a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs index 10d4d689..fb555eb6 100644 --- a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs +++ b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs @@ -11,6 +11,10 @@ using Admin.Core.Common; using Aucma.Core.PLc; using Aucma.Core.Scanner; using System.Linq; +using System.Windows.Threading; +using System.Threading.Tasks; +using Admin.Core.IService; +using Microsoft.Extensions.DependencyInjection; namespace Aucma.Core.Palletiz.ViewModels { @@ -20,10 +24,19 @@ namespace Aucma.Core.Palletiz.ViewModels private IndexPageView firstPage = new IndexPageView();//首页 private StatisticsPageView recordPage = new StatisticsPageView(); private PalletizPageView palletizPage = new PalletizPageView(); + + ISysUserInfoServices _sysUserInfoServices; public MainWindowViewModel() { + _sysUserInfoServices = App.ServiceProvider.GetService(); UserContent = firstPage; init(); + Task.Run(async () => + { + await RefreshTeamTime();//班组时间 + }); + + } public void init() @@ -34,6 +47,11 @@ namespace Aucma.Core.Palletiz.ViewModels timer.AutoReset = true; timer.Enabled = true; timer.Start(); + + DispatcherTimer timer2 = new DispatcherTimer(); + timer2.Interval = new TimeSpan(0, 0, 1); //间隔1秒 + timer2.Tick += new EventHandler(timer_Tick); + timer2.Start(); } #region 设备状态刷新 @@ -368,5 +386,51 @@ namespace Aucma.Core.Palletiz.ViewModels } #endregion + #region 刷新时间 + + public string _currentDateTime; + public string CurrentDateTime + { + get => _currentDateTime; + set => SetProperty(ref _currentDateTime, value); + } + #endregion + + #region 班组信息 + /// + /// 班组信息 + /// + public string _teamName; + public string TeamName + { + get => _teamName; + set => SetProperty(ref _teamName, value); + } + #endregion + + public async Task RefreshTeamTime() + { + while (true) + { + var list = await _sysUserInfoServices.GetTeamData(); + if (list != null && list.Count > 0) + { + var sysUserInfo = list.First(); + TeamName = $"{sysUserInfo.TeamName}({list.Min(d => d.StartTime).ToString("HH:mm")}~{list.Max(d => d.EndTime).ToString("HH:mm")})"; + //TeamName = $"{sysUserInfo.TeamName}"; + } + Thread.Sleep(5000); + } + } + + void timer_Tick(object sender, EventArgs e) + { + System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => + { + CurrentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + + })); + + } } } diff --git a/Aucma.Core.Palletiz/ViewModels/SplitPlanViewModel.cs b/Aucma.Core.Palletiz/ViewModels/SplitPlanViewModel.cs index d4cc2f4b..da9f4b2d 100644 --- a/Aucma.Core.Palletiz/ViewModels/SplitPlanViewModel.cs +++ b/Aucma.Core.Palletiz/ViewModels/SplitPlanViewModel.cs @@ -273,12 +273,12 @@ namespace Aucma.Core.Palletiz.ViewModels [RelayCommand] public async Task SearchCriteriaSet() { - SearchCriteriaView searchCriteriaWindow = new SearchCriteriaView(); - bool? dialogResult = searchCriteriaWindow.ShowDialog(); - if (dialogResult == false) // 用户点击了“取消”按钮或关闭窗口 - { + //SearchCriteriaView searchCriteriaWindow = new SearchCriteriaView(); + //bool? dialogResult = searchCriteriaWindow.ShowDialog(); + //if (dialogResult == false) // 用户点击了“取消”按钮或关闭窗口 + //{ await LoadData(); - } + //} } #endregion @@ -324,9 +324,9 @@ namespace Aucma.Core.Palletiz.ViewModels var info = SelectedDataItem as ProductPlanInfoModel; if (info != null) { - info.PlanType = _radioButtonStatus; - QuantityIssuedView quantityIssuedWindow = new QuantityIssuedView(info, ObjId); - quantityIssuedWindow.ShowDialog(); + //info.PlanType = _radioButtonStatus; + //QuantityIssuedView quantityIssuedWindow = new QuantityIssuedView(info, ObjId); + //quantityIssuedWindow.ShowDialog(); } } diff --git a/Aucma.Core.Palletiz/Views/IndexPageView.xaml b/Aucma.Core.Palletiz/Views/IndexPageView.xaml index 09449a38..c8055788 100644 --- a/Aucma.Core.Palletiz/Views/IndexPageView.xaml +++ b/Aucma.Core.Palletiz/Views/IndexPageView.xaml @@ -159,13 +159,6 @@ - @@ -202,7 +195,7 @@ - + @@ -225,7 +218,7 @@ - + @@ -233,7 +226,7 @@ - + diff --git a/Aucma.Core.Palletiz/Views/MainWindow.xaml b/Aucma.Core.Palletiz/Views/MainWindow.xaml index 0be308b1..e2383798 100644 --- a/Aucma.Core.Palletiz/Views/MainWindow.xaml +++ b/Aucma.Core.Palletiz/Views/MainWindow.xaml @@ -34,17 +34,16 @@ - - + - - - - - - - + + + + + + + + diff --git a/Aucma.Core.Palletiz/Views/PalletizPageView.xaml b/Aucma.Core.Palletiz/Views/PalletizPageView.xaml index c78d9da3..9c673f2f 100644 --- a/Aucma.Core.Palletiz/Views/PalletizPageView.xaml +++ b/Aucma.Core.Palletiz/Views/PalletizPageView.xaml @@ -6,366 +6,99 @@ xmlns:local="clr-namespace:Aucma.Core.Palletiz.Views" mc:Ignorable="d" Background="#1152AC" d:DesignHeight="1080" d:DesignWidth="1920"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -