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 @@ - - + + - +