This commit is contained in:
tanglong 2026-02-03 15:06:36 +08:00
parent c61c3c8a98
commit 6e508d3185
4 changed files with 23 additions and 23 deletions

View File

@ -38,7 +38,7 @@ namespace Common
if (groupData != null) if (groupData != null)
{ {
ControlPoint = groupData.ControlPoint; ControlPoint = groupData.ControlPoint;
AreaSize = groupData.AreaSize?? new Point { X = 150, Y = 75 }; AreaSize = groupData.AreaSize?? new Point { X = 150, Y = 100 };
} }
else else
{ {

View File

@ -181,8 +181,6 @@ namespace Wpf_AiSportsMicrospace.Common
return (int)WavingAction.Raising; return (int)WavingAction.Raising;
} }
/// <summary> /// <summary>
/// 验证左手动作(目前只有举手) /// 验证左手动作(目前只有举手)
/// </summary> /// </summary>

View File

@ -20,7 +20,7 @@ namespace Dto
public List<SportBase> Sports { get; private set; } public List<SportBase> Sports { get; private set; }
public List<string> UseNameList { get; private set; } = new() public List<string> UseNameList { get; private set; } = new()
{ {
"游客-A", "游客-B", "游客-C", "游客-D", "游客-E", "游客-F" "游客-A", "游客-B", "游客-C", "游客-D", "游客-E", "游客-F", "游客-G", "游客-H", "游客-J", "游客-K"
}; };
public GroupJumpRopeContext() public GroupJumpRopeContext()
{ {

View File

@ -32,8 +32,8 @@ namespace Wpf_AiSportsMicrospace.Views
private Ellipse _draggedEllipse; private Ellipse _draggedEllipse;
private double _dragStartY; private double _dragStartY;
private double _originalY; private double _originalY;
private double _dragStartX; private double _dragStartX;
private double _originalX; private double _originalX;
/// <summary> /// <summary>
/// 点位数据列表 /// 点位数据列表
@ -122,7 +122,7 @@ namespace Wpf_AiSportsMicrospace.Views
var app = (App)Application.Current; var app = (App)Application.Current;
using var scope = App.AppHost.Services.CreateScope(); using var scope = App.AppHost.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>(); var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
// 获取场地宽度配置 // 获取场地宽度配置
var baseConfig = await db.BasicConfig.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); var baseConfig = await db.BasicConfig.FirstOrDefaultAsync(x => x.Code == AppSettings.Code);
if (baseConfig == null) if (baseConfig == null)
@ -242,7 +242,7 @@ namespace Wpf_AiSportsMicrospace.Views
if (child is Ellipse || child is Border || child is Line) if (child is Ellipse || child is Border || child is Line)
{ {
var element = child as FrameworkElement; var element = child as FrameworkElement;
if (element?.Name != "ConnectionLine" && if (element?.Name != "ConnectionLine" &&
element?.Name != "PointsContainer" && element?.Name != "PointsContainer" &&
element?.Name != "CoordinateDisplay") element?.Name != "CoordinateDisplay")
{ {
@ -285,8 +285,8 @@ namespace Wpf_AiSportsMicrospace.Views
if (xProp != null && yProp != null) if (xProp != null && yProp != null)
{ {
point.X = (double)(xProp.GetValue(dbPoint) ?? 0) ; point.X = (double)(xProp.GetValue(dbPoint) ?? 0);
point.Y = (double)(yProp.GetValue(dbPoint) ?? 0) ; point.Y = (double)(yProp.GetValue(dbPoint) ?? 0);
} }
} }
} }
@ -679,7 +679,7 @@ namespace Wpf_AiSportsMicrospace.Views
_originalX = point.X; _originalX = point.X;
_originalY = point.Y; _originalY = point.Y;
} }
_draggedEllipse.CaptureMouse(); _draggedEllipse.CaptureMouse();
@ -841,14 +841,14 @@ namespace Wpf_AiSportsMicrospace.Views
/// </summary> /// </summary>
private void UpdateLabelPosition(JumpRopePoint point) private void UpdateLabelPosition(JumpRopePoint point)
{ {
var labelBorder = MainCanvas.Children.OfType<Border>().FirstOrDefault(e => e.Name == $"label{point.Id}");
if (labelBorder != null) var labelBorder = MainCanvas.Children.OfType<Border>().FirstOrDefault(e => e.Name == $"label{point.Id}");
{
Canvas.SetLeft(labelBorder, point.X - PointRadiusX); if (labelBorder != null)
Canvas.SetTop(labelBorder, point.Y - PointRadiusY); {
} Canvas.SetLeft(labelBorder, point.X - PointRadiusX);
Canvas.SetTop(labelBorder, point.Y - PointRadiusY);
}
} }
/// <summary> /// <summary>
@ -1101,9 +1101,11 @@ namespace Wpf_AiSportsMicrospace.Views
if (pointProperty != null) if (pointProperty != null)
{ {
// 创建 Point 实例并保存 // 创建 Point 实例并保存
var pointInstance = Activator.CreateInstance(pointType, point.X , point.Y ); var pointInstance = Activator.CreateInstance(pointType, point.X, point.Y);
var pointNew = new AiSportsMicrospaceDB.Entities.Point { var pointNew = new AiSportsMicrospaceDB.Entities.Point
X =point.X ,Y= point.Y {
X = point.X,
Y = point.Y
}; };
pointProperty.SetValue(pointsData, pointNew); pointProperty.SetValue(pointsData, pointNew);
} }
@ -1115,8 +1117,8 @@ namespace Wpf_AiSportsMicrospace.Views
var controlPoint = typeof(GroupPoints).GetProperty("ControlPoint"); var controlPoint = typeof(GroupPoints).GetProperty("ControlPoint");
var controlPointNew = new AiSportsMicrospaceDB.Entities.Point var controlPointNew = new AiSportsMicrospaceDB.Entities.Point
{ {
X = _points[_keyPointIndex].X , X = _points[_keyPointIndex - 1].X,
Y = _points[_keyPointIndex].Y Y = _points[_keyPointIndex - 1].Y
}; };
if (keyPointProperty != null) if (keyPointProperty != null)
{ {