From c55ef570482a6f0951d5f511489d05b93b86b2e4 Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Tue, 21 Oct 2025 17:48:10 +0800 Subject: [PATCH] rankList --- .../Dto/GroupJumpRopeContext.cs | 4 +++- .../Views/JumpRope/TrainingRecords.xaml.cs | 24 +++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs b/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs index 4c7b8df..e21485a 100644 --- a/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs +++ b/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs @@ -13,7 +13,7 @@ namespace Dto public class GroupJumpRopeContext { // 静态字段,保存排名列表 - //public static List RankList { get; set; } = new List(); + public static List RankList { get; set; } = new List(); public List<(double XNorm, double YNorm)> CirclePositions { get; private set; } public List UserList { get; private set; } public List UserNumberList { get; private set; } @@ -59,6 +59,8 @@ namespace Dto }) .ToList(); + RankList = rankList; + return rankList; } } diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs index e9335ec..f945952 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs @@ -31,7 +31,7 @@ namespace Views.JumpRope { InitializeComponent(); Loaded += UserControl_Loaded; - _groupJumpRopeContext = new GroupJumpRopeContext(); + //_groupJumpRopeContext = new GroupJumpRopeContext(); LoadData(); } @@ -52,13 +52,13 @@ namespace Views.JumpRope if (leftWaving == 5) { //_mainWin.HumanFrameUpdated -= OnHumanFrameUpdated; - if(newPage == null) + if (newPage == null) { - newPage = new Home(); + newPage = new Home(); _mainWin?.SwitchPageWithMaskAnimation(newPage, true); } // 举左手逻辑,例如结束动画或退出 - + //return; //_mainWin.WebcamClient.StopExtract(); } @@ -73,19 +73,19 @@ namespace Views.JumpRope public void LoadData() { - ShowRankingBoard(_groupJumpRopeContext.UpdateRankList()); + ShowRankingBoard(GroupJumpRopeContext.RankList); } public void ShowRankingBoard(List list) { - + var scoreGrid = FindName("ScoreGrid") as Grid; - if(list.Count <= 0) return; + if (list.Count <= 0) return; name1.Text = list[0].Name; - name2.Text = list[1].Name ; - name3.Text = list[2].Name ; - number1.Text = list[0].Number.ToString() ; - number2.Text = list[1].Number.ToString() ; - number3.Text = list[2].Number.ToString() ; + name2.Text = list[1].Name; + name3.Text = list[2].Name; + number1.Text = list[0].Number.ToString(); + number2.Text = list[1].Number.ToString(); + number3.Text = list[2].Number.ToString(); foreach (var item in list) { var grid = new Grid