From ad713cfe8f0dcaecf326ff712eb7fc02206d2ba9 Mon Sep 17 00:00:00 2001 From: ltx <1006158920@qq.com> Date: Wed, 21 Jan 2026 17:51:29 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=E5=A4=9A=E4=BA=BA=E8=B7=B3?= =?UTF-8?q?=E7=BB=B3=E7=82=B9=E4=BD=8D=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AiSportsMicrospaceDB/Entities/BasicConfig.cs | 9 + Wpf_AiSportsMicrospace/Views/Home.xaml | 24 +- Wpf_AiSportsMicrospace/Views/Home.xaml.cs | 23 +- .../Views/Setting/MultiJumpRope.xaml | 170 +++ .../Views/Setting/MultiJumpRope.xaml.cs | 995 ++++++++++++++++++ 5 files changed, 1204 insertions(+), 17 deletions(-) create mode 100644 Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml create mode 100644 Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml.cs diff --git a/AiSportsMicrospaceDB/Entities/BasicConfig.cs b/AiSportsMicrospaceDB/Entities/BasicConfig.cs index 020f307..66caec5 100644 --- a/AiSportsMicrospaceDB/Entities/BasicConfig.cs +++ b/AiSportsMicrospaceDB/Entities/BasicConfig.cs @@ -59,5 +59,14 @@ namespace AiSportsMicrospaceDB.Entities [Comment("端口")] [Column(TypeName = "nvarchar(20)")] public string Port { get; set; } + + + /// + ///端口 + /// + [Display(Name = "运动角宽度")] + [Comment("运动角宽度")] + [Column(TypeName = "int")] + public int HomeWidth { get; set; } } } diff --git a/Wpf_AiSportsMicrospace/Views/Home.xaml b/Wpf_AiSportsMicrospace/Views/Home.xaml index 9a09fd5..a240baf 100644 --- a/Wpf_AiSportsMicrospace/Views/Home.xaml +++ b/Wpf_AiSportsMicrospace/Views/Home.xaml @@ -110,7 +110,7 @@ - + @@ -124,28 +124,36 @@ + + + + + - - + + - + - + + + + - - + + - + \ No newline at end of file diff --git a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs index 1e0b2b2..b231490 100644 --- a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs @@ -89,7 +89,7 @@ namespace Wpf_AiSportsMicrospace coverFlow.SelectedIndex = 0; Loaded += Window_Loaded; Unloaded += Home_Unloaded; - + Load_Base(); Utils.PlayBackgroundMusic("homeprojectselected.mp3", true); } @@ -105,7 +105,6 @@ namespace Wpf_AiSportsMicrospace _mainWin.WebcamClient.StartExtract(); Utils.PreloadGifs(); - Load_Base(); } private void Home_Unloaded(object sender, RoutedEventArgs e) { @@ -291,7 +290,7 @@ namespace Wpf_AiSportsMicrospace var baseData = await db.BasicConfig.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); if (baseData == null) { - baseData = new BasicConfig { Code = AppSettings.Code, Host = host.Text, UserName = name.Text, Password = password.Text }; + baseData = new BasicConfig { Code = AppSettings.Code, Host = host.Text, UserName = name.Text, Password = password.Text , HomeWidth = int.Parse(homeWidth.Text)}; db.BasicConfig.Add(baseData); db.SaveChanges(); } @@ -300,6 +299,7 @@ namespace Wpf_AiSportsMicrospace host.Text = baseData.Host; name.Text = baseData.UserName; password.Text = baseData.Password; + homeWidth.Text = baseData.HomeWidth.ToString(); } } @@ -317,7 +317,8 @@ namespace Wpf_AiSportsMicrospace Code = AppSettings.Code, Host = host.Text, UserName = name.Text, - Password = password.Text + Password = password.Text, + HomeWidth = int.Parse(homeWidth.Text) }); } else @@ -325,6 +326,7 @@ namespace Wpf_AiSportsMicrospace baseData.Host = host.Text; baseData.UserName = name.Text; baseData.Password = password.Text; + baseData.HomeWidth = int.Parse(homeWidth.Text); db.BasicConfig.Update(baseData); } db.SaveChanges(); @@ -336,11 +338,14 @@ namespace Wpf_AiSportsMicrospace //多人跳绳 private void GoRopeSet(object sender, RoutedEventArgs e) { - var app = (App)Application.Current; - using var scope = App.AppHost.Services.CreateScope(); - var db = scope.ServiceProvider.GetRequiredService(); - var mainWindow = new MainWindow(db); - mainWindow.Show(); + //var app = (App)Application.Current; + //using var scope = App.AppHost.Services.CreateScope(); + //var db = scope.ServiceProvider.GetRequiredService(); + //var mainWindow = new MainWindow(db); + //mainWindow.Show(); + + var mainWin = Application.Current.MainWindow as Main; + mainWin.SwitchPageWithMaskAnimation(new MultiJumpRope(), true); } //跳远 diff --git a/Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml b/Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml new file mode 100644 index 0000000..d96763f --- /dev/null +++ b/Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +