diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs index 3400745..59851fd 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs @@ -332,7 +332,6 @@ namespace Wpf_AiSportsMicrospace.Views return (int)WavingAction.Raising; // 倒计时中 } - private void ResetRaiseState() { _raiseStartTime = null; @@ -404,7 +403,7 @@ namespace Wpf_AiSportsMicrospace.Views var elapsed = (DateTime.Now - lastTime).TotalSeconds; - if (elapsed >1) + if (elapsed > 0.8) { // 2 秒未变化,更新状态为禁止 userList[circleIndex].ImageState = "1"; @@ -419,10 +418,6 @@ namespace Wpf_AiSportsMicrospace.Views _lastJumpUpdateTime[circleIndex] = DateTime.Now; } } - //else if - // (inCircleHuman != null) userList[circleIndex].ImageState = "1"; - //else - // userList[circleIndex].ImageState = "1"; return inCircleHuman; } @@ -469,7 +464,11 @@ namespace Wpf_AiSportsMicrospace.Views sport.OnTicked += (count, times) => { currentItem.ImageState = "2"; - currentItem.NumberText = count.ToString(); + + Application.Current.Dispatcher.BeginInvoke(() => + { + currentItem.NumberText = count.ToString(); + }); }; sport.Start(); diff --git a/Wpf_AiSportsMicrospace/Views/Main.xaml.cs b/Wpf_AiSportsMicrospace/Views/Main.xaml.cs index 1798983..be63a00 100644 --- a/Wpf_AiSportsMicrospace/Views/Main.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Main.xaml.cs @@ -97,7 +97,6 @@ namespace Wpf_AiSportsMicrospace.Views { HumanFrameUpdated?.Invoke(this, humans); }); - } catch (Exception ex) {