From 8862bb27b3de0e7d5268842c71975403c2bd6433 Mon Sep 17 00:00:00 2001 From: ltx <1006158920@qq.com> Date: Tue, 27 Jan 2026 14:48:00 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DBContext/AppDbContext.cs | 3 +- AiSportsMicrospaceDB/Entities/GroupPoints.cs | 44 +++++++++++++++++++ .../PublishProfiles/FolderProfile.pubxml | 3 +- .../Views/JumpRope/GroupJumpRope.xaml.cs | 21 ++++++--- .../Views/JumpRope/MusicJumpRope.xaml.cs | 2 +- .../Views/JumpingJack/BambooDragonfly.xaml.cs | 2 +- .../Views/SquatFu/WhackAMole.xaml.cs | 2 +- .../Wpf_AiSportsMicrospace.csproj | 1 + 8 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 AiSportsMicrospaceDB/Entities/GroupPoints.cs diff --git a/AiSportsMicrospaceDB/DBContext/AppDbContext.cs b/AiSportsMicrospaceDB/DBContext/AppDbContext.cs index 97b1724..678f127 100644 --- a/AiSportsMicrospaceDB/DBContext/AppDbContext.cs +++ b/AiSportsMicrospaceDB/DBContext/AppDbContext.cs @@ -18,7 +18,8 @@ namespace AiSportsMicrospaceDB.DBContext public DbSet BasicConfig { get; set; } - public DbSet SixGroupPoints { get; set; } + //public DbSet SixGroupPoints { get; set; } + public DbSet GroupPoints { get; set; } public DbSet JumpLongPoints { get; set; } public DbSet AppVersion { get; set; } public DbSet DeviceAssocSchool { get; set; } diff --git a/AiSportsMicrospaceDB/Entities/GroupPoints.cs b/AiSportsMicrospaceDB/Entities/GroupPoints.cs new file mode 100644 index 0000000..f0afc52 --- /dev/null +++ b/AiSportsMicrospaceDB/Entities/GroupPoints.cs @@ -0,0 +1,44 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AiSportsMicrospaceDB.Entities +{ + + [Table("GroupPoints")] + public class GroupPoints { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Display(Description = "主键Id")] + [Comment("Id")] + public int? Id { get; set; } + + /// + ///设备编号 + /// + [Display(Name = "设备编号")] + [Comment("设备编号")] + [Column(TypeName = "nvarchar(100)")] + public string Code { get; set; } + + public Point Point1 { get; set; } + public Point Point2 { get; set; } + public Point Point3 { get; set; } + public Point Point4 { get; set; } + public Point? Point5 { get; set; } + public Point? Point6 { get; set; } + public Point? Point7 { get; set; } + public Point? Point8 { get; set; } + public Point? Point9 { get; set; } + public Point? Point10 { get; set; } + public Point? ControlPoint { get; set; } + public Point? AreaSize { get; set; } + public int? KeyPointIndex { get; set; } + } +} diff --git a/Wpf_AiSportsMicrospace/Properties/PublishProfiles/FolderProfile.pubxml b/Wpf_AiSportsMicrospace/Properties/PublishProfiles/FolderProfile.pubxml index 303eda9..dcfe296 100644 --- a/Wpf_AiSportsMicrospace/Properties/PublishProfiles/FolderProfile.pubxml +++ b/Wpf_AiSportsMicrospace/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,12 +4,13 @@ Release Any CPU - C:\Users\tangl\Desktop\exe + C:\Users\19304\Desktop\作品 FileSystem <_TargetId>Folder win-x64 false false false + net8.0-windows \ No newline at end of file diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs index edacff9..21001b3 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/GroupJumpRope.xaml.cs @@ -82,14 +82,18 @@ namespace Wpf_AiSportsMicrospace.Views var app = (App)Application.Current; using var scope = App.AppHost.Services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); - var cfg = await db.SixGroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); + //var cfg = await db.SixGroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); + var cfg = await db.GroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); //var pointlist = JsonSerializer.Deserialize>(cfg!.PointsJson); - - List<(double XNorm, double YNorm)> pointlist = + if(cfg != null) + { + List<(double XNorm, double YNorm)> pointlist = [(cfg.Point1.X, cfg.Point1.Y),(cfg.Point2.X, cfg.Point2.Y), (cfg.Point3.X, cfg.Point3.Y), (cfg.Point4.X, cfg.Point4.Y), (cfg.Point5.X, cfg.Point5.Y),(cfg.Point6.X, cfg.Point6.Y)]; - _groupJumpRopeContext.CirclePositions = pointlist; + _groupJumpRopeContext.CirclePositions = pointlist; + + } DrawCirclesWithText(); @@ -457,7 +461,14 @@ namespace Wpf_AiSportsMicrospace.Views for (int i = 0; i < _groupJumpRopeContext.CirclePositions.Count; i++) { - var pos = _groupJumpRopeContext.CirclePositions[i]; + List<(double XNorm, double YNorm)> llist = [(0.21, 0.88), + (0.36, 0.58), + (0.50, 0.88), + (0.64, 0.58), + (0.78, 0.88), + (0.92, 0.58)]; + var pos = llist[i]; + double x = pos.XNorm * imgWidth; double y = pos.YNorm * imgHeight; diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs index abf25e2..fb71beb 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs @@ -89,7 +89,7 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope var app = (App)Application.Current; using var scope = App.AppHost.Services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); - var cfg = await db.SixGroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); + var cfg = await db.GroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); //var pointlist = JsonSerializer.Deserialize>(cfg!.PointsJson); List<(double XNorm, double YNorm)> pointlist = [(cfg.Point3.X, cfg.Point3.Y), (cfg.Point5.X, cfg.Point5.Y)]; diff --git a/Wpf_AiSportsMicrospace/Views/JumpingJack/BambooDragonfly.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpingJack/BambooDragonfly.xaml.cs index 916a2c9..3a518f0 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpingJack/BambooDragonfly.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpingJack/BambooDragonfly.xaml.cs @@ -67,7 +67,7 @@ namespace Views.JumpingJack var app = (App)Application.Current; using var scope = App.AppHost.Services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); - var cfg = await db.SixGroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); + var cfg = await db.GroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); //var pointlist = JsonSerializer.Deserialize>(cfg!.PointsJson); List<(double XNorm, double YNorm)> pointlist = diff --git a/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs b/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs index 9e589c1..04dec12 100644 --- a/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/SquatFu/WhackAMole.xaml.cs @@ -60,7 +60,7 @@ namespace Views.SquatFu var app = (App)Application.Current; using var scope = App.AppHost.Services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService(); - var cfg = await db.SixGroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); + var cfg = await db.GroupPoints.FirstOrDefaultAsync(x => x.Code == AppSettings.Code); //var pointlist = JsonSerializer.Deserialize>(cfg!.PointsJson); List<(double XNorm, double YNorm)> pointlist = diff --git a/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj b/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj index 3c31460..9354ca6 100644 --- a/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj +++ b/Wpf_AiSportsMicrospace/Wpf_AiSportsMicrospace.csproj @@ -6,6 +6,7 @@ enable enable true + False