Compare commits
1 Commits
dev
...
Branch_5d8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8862bb27b3 |
@ -18,7 +18,8 @@ namespace AiSportsMicrospaceDB.DBContext
|
||||
|
||||
public DbSet<BasicConfig> BasicConfig { get; set; }
|
||||
|
||||
public DbSet<SixGroupPoints> SixGroupPoints { get; set; }
|
||||
//public DbSet<SixGroupPoints> SixGroupPoints { get; set; }
|
||||
public DbSet<GroupPoints> GroupPoints { get; set; }
|
||||
public DbSet<JumpLongPoints> JumpLongPoints { get; set; }
|
||||
public DbSet<AppVersion> AppVersion { get; set; }
|
||||
public DbSet<DeviceAssocSchool> DeviceAssocSchool { get; set; }
|
||||
|
||||
44
AiSportsMicrospaceDB/Entities/GroupPoints.cs
Normal file
44
AiSportsMicrospaceDB/Entities/GroupPoints.cs
Normal file
@ -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; }
|
||||
|
||||
/// <summary>
|
||||
///设备编号
|
||||
/// </summary>
|
||||
[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; }
|
||||
}
|
||||
}
|
||||
@ -4,12 +4,13 @@
|
||||
<PropertyGroup>
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Any CPU</Platform>
|
||||
<PublishDir>C:\Users\tangl\Desktop\exe</PublishDir>
|
||||
<PublishDir>C:\Users\19304\Desktop\作品</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>false</SelfContained>
|
||||
<PublishSingleFile>false</PublishSingleFile>
|
||||
<PublishReadyToRun>false</PublishReadyToRun>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@ -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<AppDbContext>();
|
||||
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<List<(double, double)>>(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;
|
||||
|
||||
|
||||
@ -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<AppDbContext>();
|
||||
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<List<(double, double)>>(cfg!.PointsJson);
|
||||
|
||||
List<(double XNorm, double YNorm)> pointlist = [(cfg.Point3.X, cfg.Point3.Y), (cfg.Point5.X, cfg.Point5.Y)];
|
||||
|
||||
@ -67,7 +67,7 @@ namespace Views.JumpingJack
|
||||
var app = (App)Application.Current;
|
||||
using var scope = App.AppHost.Services.CreateScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
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<List<(double, double)>>(cfg!.PointsJson);
|
||||
|
||||
List<(double XNorm, double YNorm)> pointlist =
|
||||
|
||||
@ -60,7 +60,7 @@ namespace Views.SquatFu
|
||||
var app = (App)Application.Current;
|
||||
using var scope = App.AppHost.Services.CreateScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
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<List<(double, double)>>(cfg!.PointsJson);
|
||||
|
||||
List<(double XNorm, double YNorm)> pointlist =
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user