From 5e804f7c3c681e878294b8ce3a60dfc281572e6a Mon Sep 17 00:00:00 2001 From: tfarcraw <123211521@163.com> Date: Sat, 11 Jul 2026 02:03:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=A9=E9=98=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLCSharpWpf/App.xaml.cs | 3 +- PLCSharpWpf/Models/DatasContext.cs | 6 + PLCSharpWpf/Models/GlobalModel.cs | 16 + .../VVMs/Homepage/CustomControlConfig.xaml | 41 +-- .../Homepage/TableControl/RangeTable.xaml | 14 +- .../VVMs/MotionController/AxisPoint.cs | 16 +- .../MotionController/AxisPointsConfig.xaml | 210 ------------ .../Config/AxisPointsConfig.xaml | 314 ++++++++++++++++++ .../{ => Config}/AxisPointsConfig.xaml.cs | 4 +- .../{ => Config}/InterpolationConfig.xaml | 2 +- .../{ => Config}/InterpolationConfig.xaml.cs | 4 +- .../VVMs/MotionController/ControllersModel.cs | 301 +++++++++++++++-- PLCSharpWpf/VVMs/MotionController/Matrix.cs | 124 +++++++ 13 files changed, 781 insertions(+), 274 deletions(-) delete mode 100644 PLCSharpWpf/VVMs/MotionController/AxisPointsConfig.xaml create mode 100644 PLCSharpWpf/VVMs/MotionController/Config/AxisPointsConfig.xaml rename PLCSharpWpf/VVMs/MotionController/{ => Config}/AxisPointsConfig.xaml.cs (88%) rename PLCSharpWpf/VVMs/MotionController/{ => Config}/InterpolationConfig.xaml (99%) rename PLCSharpWpf/VVMs/MotionController/{ => Config}/InterpolationConfig.xaml.cs (88%) create mode 100644 PLCSharpWpf/VVMs/MotionController/Matrix.cs diff --git a/PLCSharpWpf/App.xaml.cs b/PLCSharpWpf/App.xaml.cs index 8301618..9aa97b6 100644 --- a/PLCSharpWpf/App.xaml.cs +++ b/PLCSharpWpf/App.xaml.cs @@ -1,4 +1,4 @@ -using DryIoc; +using DryIoc; using Newtonsoft.Json; using PLCSharp.Core.Prism; using PLCSharp.Models; @@ -40,6 +40,7 @@ namespace PLCSharp } //数据库 _ = containerRegistry.RegisterSingleton(); + _ = Container.Resolve(); RegisterEvents(); // 捕获全局异常 LoadConfig(); diff --git a/PLCSharpWpf/Models/DatasContext.cs b/PLCSharpWpf/Models/DatasContext.cs index aca0eae..dd5f279 100644 --- a/PLCSharpWpf/Models/DatasContext.cs +++ b/PLCSharpWpf/Models/DatasContext.cs @@ -77,6 +77,12 @@ namespace PLCSharp.Models /// 轴Points /// public DbSet AxisPoints { get; set; } + + /// + /// 轴Points + /// + public DbSet Matrices { get; set; } + /// /// 插补Groups /// diff --git a/PLCSharpWpf/Models/GlobalModel.cs b/PLCSharpWpf/Models/GlobalModel.cs index 28d1178..d328873 100644 --- a/PLCSharpWpf/Models/GlobalModel.cs +++ b/PLCSharpWpf/Models/GlobalModel.cs @@ -1147,6 +1147,7 @@ namespace PLCSharp.Models VisionsModel.VisionFunctions.Add(itemcopy); } //加载当前配方的点位列表 + ControllersModel.Stop(); ControllersModel.AxisPoints.Clear(); var currRecipeAxisPoints = _DatasContext.AxisPoints.Where(c => c.RecipeID == CurrentRecipe.ID); foreach (var item in currRecipeAxisPoints) @@ -1166,6 +1167,19 @@ namespace PLCSharp.Models if (axisU != null) axisPoint.AxisU = axisU; } + //加载当前西方的矩阵列表 + ControllersModel.Matrices.Clear(); + var currRecipeMatrices = _DatasContext.Matrices.Where(c => c.RecipeID == CurrentRecipe.ID); + foreach (var item in currRecipeMatrices) + { + var matrix = item.DeepCopy(); + ControllersModel.Matrices.Add(matrix); + + ControllersModel.Create(matrix); + + + } + //加载当前配方的插补列表 ControllersModel.InterpolationGroups.Clear(); @@ -1181,6 +1195,8 @@ namespace PLCSharp.Models if (axisY != null) itemcopy.AxisY = axisY; } + ControllersModel.Start(); + //加载当前配方的任务列表 WorkflowsModel.Workflows.Clear(); var currRecipeWorkflows = _DatasContext.Workflows.Where(c => c.RecipeID == CurrentRecipe.ID); diff --git a/PLCSharpWpf/VVMs/Homepage/CustomControlConfig.xaml b/PLCSharpWpf/VVMs/Homepage/CustomControlConfig.xaml index 264075d..dac0f4f 100644 --- a/PLCSharpWpf/VVMs/Homepage/CustomControlConfig.xaml +++ b/PLCSharpWpf/VVMs/Homepage/CustomControlConfig.xaml @@ -15,9 +15,9 @@ @@ -27,17 +27,17 @@ - - + + - - + + - + @@ -50,19 +50,18 @@ - - + + - +