合并
This commit is contained in:
parent
3057f34cda
commit
452ed85339
@ -26,10 +26,12 @@ namespace Views.JumpRope
|
||||
{
|
||||
private Main _mainWin => Application.Current.MainWindow as Main;
|
||||
private GroupJumpRopeContext _groupJumpRopeContext;
|
||||
UserControl newPage = null;
|
||||
public TrainingRecords()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += UserControl_Loaded;
|
||||
_groupJumpRopeContext = new GroupJumpRopeContext();
|
||||
LoadData();
|
||||
}
|
||||
|
||||
@ -37,6 +39,7 @@ namespace Views.JumpRope
|
||||
{
|
||||
Utils.PlayBackgroundMusic("homeprojectselected.mp3", true);
|
||||
_mainWin.HumanFrameUpdated += OnHumanFrameUpdated;
|
||||
_mainWin.WebcamClient.StartExtract();
|
||||
}
|
||||
|
||||
private void OnHumanFrameUpdated(object sender, List<Human> humans)
|
||||
@ -48,13 +51,17 @@ namespace Views.JumpRope
|
||||
int leftWaving = DetectLeftHandRaise(humans);
|
||||
if (leftWaving == 5)
|
||||
{
|
||||
_mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
|
||||
_mainWin.WebcamClient.StopExtract();
|
||||
|
||||
// 举左手逻辑,例如结束动画或退出
|
||||
var newPage = new Home();
|
||||
//_mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
|
||||
if(newPage == null)
|
||||
{
|
||||
newPage = new Home();
|
||||
_mainWin?.SwitchPageWithMaskAnimation(newPage, true);
|
||||
}
|
||||
// 举左手逻辑,例如结束动画或退出
|
||||
|
||||
//return;
|
||||
//_mainWin.WebcamClient.StopExtract();
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
@ -66,7 +73,6 @@ namespace Views.JumpRope
|
||||
|
||||
public void LoadData()
|
||||
{
|
||||
_groupJumpRopeContext = new GroupJumpRopeContext();
|
||||
ShowRankingBoard(_groupJumpRopeContext.UpdateRankList());
|
||||
}
|
||||
public void ShowRankingBoard(List<RankItem> list)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user