diff --git a/Wpf_AiSportsMicrospace/Common/AppSettings.cs b/Wpf_AiSportsMicrospace/Common/AppSettings.cs index 7f7c25e..a21ae74 100644 --- a/Wpf_AiSportsMicrospace/Common/AppSettings.cs +++ b/Wpf_AiSportsMicrospace/Common/AppSettings.cs @@ -38,7 +38,7 @@ namespace Common if (groupData != null) { ControlPoint = groupData.ControlPoint; - AreaSize = groupData.AreaSize?? new Point { X = 150, Y = 75 }; + AreaSize = groupData.AreaSize?? new Point { X = 150, Y = 100 }; } else { diff --git a/Wpf_AiSportsMicrospace/Common/SportOperate.cs b/Wpf_AiSportsMicrospace/Common/SportOperate.cs index c26f2fa..d3e8a4a 100644 --- a/Wpf_AiSportsMicrospace/Common/SportOperate.cs +++ b/Wpf_AiSportsMicrospace/Common/SportOperate.cs @@ -181,8 +181,6 @@ namespace Wpf_AiSportsMicrospace.Common return (int)WavingAction.Raising; } - - /// /// 验证左手动作(目前只有举手) /// diff --git a/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs b/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs index 02f3249..859702e 100644 --- a/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs +++ b/Wpf_AiSportsMicrospace/Dto/GroupJumpRopeContext.cs @@ -20,7 +20,7 @@ namespace Dto public List Sports { get; private set; } public List UseNameList { get; private set; } = new() { - "游客-A", "游客-B", "游客-C", "游客-D", "游客-E", "游客-F" + "游客-A", "游客-B", "游客-C", "游客-D", "游客-E", "游客-F", "游客-G", "游客-H", "游客-J", "游客-K" }; public GroupJumpRopeContext() { diff --git a/Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml.cs index cc647c8..46b751a 100644 --- a/Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Setting/MultiJumpRope.xaml.cs @@ -32,8 +32,8 @@ namespace Wpf_AiSportsMicrospace.Views private Ellipse _draggedEllipse; private double _dragStartY; private double _originalY; - private double _dragStartX; - private double _originalX; + private double _dragStartX; + private double _originalX; /// /// 点位数据列表 @@ -122,7 +122,7 @@ namespace Wpf_AiSportsMicrospace.Views var app = (App)Application.Current; using var scope = App.AppHost.Services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); - + // 获取场地宽度配置 var baseConfig = await db.BasicConfig.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); if (baseConfig == null) @@ -242,7 +242,7 @@ namespace Wpf_AiSportsMicrospace.Views if (child is Ellipse || child is Border || child is Line) { var element = child as FrameworkElement; - if (element?.Name != "ConnectionLine" && + if (element?.Name != "ConnectionLine" && element?.Name != "PointsContainer" && element?.Name != "CoordinateDisplay") { @@ -285,8 +285,8 @@ namespace Wpf_AiSportsMicrospace.Views if (xProp != null && yProp != null) { - point.X = (double)(xProp.GetValue(dbPoint) ?? 0) ; - point.Y = (double)(yProp.GetValue(dbPoint) ?? 0) ; + point.X = (double)(xProp.GetValue(dbPoint) ?? 0); + point.Y = (double)(yProp.GetValue(dbPoint) ?? 0); } } } @@ -679,7 +679,7 @@ namespace Wpf_AiSportsMicrospace.Views _originalX = point.X; _originalY = point.Y; } - + _draggedEllipse.CaptureMouse(); @@ -841,14 +841,14 @@ namespace Wpf_AiSportsMicrospace.Views /// private void UpdateLabelPosition(JumpRopePoint point) { - - var labelBorder = MainCanvas.Children.OfType().FirstOrDefault(e => e.Name == $"label{point.Id}"); - if (labelBorder != null) - { - Canvas.SetLeft(labelBorder, point.X - PointRadiusX); - Canvas.SetTop(labelBorder, point.Y - PointRadiusY); - } + var labelBorder = MainCanvas.Children.OfType().FirstOrDefault(e => e.Name == $"label{point.Id}"); + + if (labelBorder != null) + { + Canvas.SetLeft(labelBorder, point.X - PointRadiusX); + Canvas.SetTop(labelBorder, point.Y - PointRadiusY); + } } /// @@ -1101,9 +1101,11 @@ namespace Wpf_AiSportsMicrospace.Views if (pointProperty != null) { // 创建 Point 实例并保存 - var pointInstance = Activator.CreateInstance(pointType, point.X , point.Y ); - var pointNew = new AiSportsMicrospaceDB.Entities.Point { - X =point.X ,Y= point.Y + var pointInstance = Activator.CreateInstance(pointType, point.X, point.Y); + var pointNew = new AiSportsMicrospaceDB.Entities.Point + { + X = point.X, + Y = point.Y }; pointProperty.SetValue(pointsData, pointNew); } @@ -1115,8 +1117,8 @@ namespace Wpf_AiSportsMicrospace.Views var controlPoint = typeof(GroupPoints).GetProperty("ControlPoint"); var controlPointNew = new AiSportsMicrospaceDB.Entities.Point { - X = _points[_keyPointIndex].X , - Y = _points[_keyPointIndex].Y + X = _points[_keyPointIndex - 1].X, + Y = _points[_keyPointIndex - 1].Y }; if (keyPointProperty != null) {