This commit is contained in:
tanglong 2025-10-14 16:11:12 +08:00
parent 694b046e50
commit 8ab511e961
2 changed files with 9 additions and 13 deletions

View File

@ -56,7 +56,7 @@ namespace Wpf_AiSportsMicrospace.Common
{
try
{
_webcamClient = WebcamClient.CreateRTSP("192.168.3.64", "admin", "yd708090", 554u);
_webcamClient = WebcamClient.CreateRTSP("172.17.30.64", "admin", "yd708090", 554u);
}
catch (Exception)
{

View File

@ -44,14 +44,14 @@ namespace Wpf_AiSportsMicrospace.Views
private List<SportBase> sports = new();
private List<TextBlock> circleTexts = new();
private List<SportUserItem> userList = new();
private List<string> userNumberList = ["0", "0", "0", "0", "0", "0", "0"];
private List<string> userNumberList = ["0", "0", "0", "0", "0", "0"];
private double[] circlePositionsX = { 0.07, 0.21, 0.36, 0.50, 0.64, 0.78, 0.92 };
private Main _mainWin => Application.Current.MainWindow as Main;
private List<(double XNorm, double YNorm)> circlePositions = new();
private MediaPlayer _mediaPlayer = new MediaPlayer();
private bool IsGameStarted = false;
List<string> _useName = ["四号位", "一号位", "五号位", "二号位", "六号位", "三号位", "七号位",];
List<string> _useName = ["一号位", "五号位", "二号位", "六号位", "三号位", "七号位",];
public GroupJumpRope()
{
InitializeComponent();
@ -356,8 +356,8 @@ namespace Wpf_AiSportsMicrospace.Views
double circleX = circlePositions[circleIndex].XNorm;
double circleY = circlePositions[circleIndex].YNorm;
double radiusNormX = 0.073;
double radiusNormY = 0.135;
double radiusNormX = 0.07;
double radiusNormY = 0.14;
Human inCircleHuman = null;
bool isOut = false;
@ -388,7 +388,6 @@ namespace Wpf_AiSportsMicrospace.Views
{
inCircleHuman = hu;
}
}
if (isOut)
@ -399,7 +398,6 @@ namespace Wpf_AiSportsMicrospace.Views
//{
// userList[circleIndex].ImageState = "1";
//}
// 检查当前编号是否未变化超过 2 秒
if (userNumberList[circleIndex] == userList[circleIndex].NumberText)
{
@ -426,7 +424,6 @@ namespace Wpf_AiSportsMicrospace.Views
return inCircleHuman;
}
private void DrawCirclesWithText()
{
userBox.Children.Clear();
@ -441,13 +438,13 @@ namespace Wpf_AiSportsMicrospace.Views
// 每个圆的位置X 和 Y 都归一化 0~1
circlePositions = new List<(double XNorm, double YNorm)>
{
(0.07, 0.58),
//(0.07, 0.58),
(0.21, 0.88 ),
(0.36, 0.58 ),
(0.36, 0.68 ),
(0.50, 0.88),
(0.64, 0.58 ),
(0.64, 0.68 ),
(0.78, 0.88),
(0.92, 0.58 )
(0.92, 0.68 )
};
for (int i = 0; i < circlePositions.Count; i++)
@ -474,7 +471,6 @@ namespace Wpf_AiSportsMicrospace.Views
currentItem.ImageState = "2";
}
};
sport.PointThreshold = 0.03f;
sport.Start();
sports.Add(sport);
}