diff --git a/Model/Services/SOCClientService.cs b/Model/Services/SOCClientService.cs index 1e10016..e09f01f 100644 --- a/Model/Services/SOCClientService.cs +++ b/Model/Services/SOCClientService.cs @@ -125,30 +125,32 @@ namespace SparkClient.Model.Services int lightLevel = 0; string halfCircle = string.Empty; // 查询光照度和半圆配置 - string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG WHERE KEY IN ('light_level', 'half_circle')"; + string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG "; DataTable table = DataBaseHelper.ExecuteQuery(sql); if (table == null || table.Rows.Count == 0) { throw new Exception("No data found for the specified keys."); } - + StringBuilder sbParams = new StringBuilder(); foreach (DataRow row in table.Rows) { string key = row["Key"].ToString() ?? string.Empty; string value = row["Value"].ToString() ?? string.Empty; - if (key == "light_level" && int.TryParse(value, out int parsedLightLevel)) - { - lightLevel = parsedLightLevel; // 光照度 - } - else if (key == "half_circle") - { - halfCircle = value; // 半圆 - } + // if (key == "light_level" && int.TryParse(value, out int parsedLightLevel)) + // { + // lightLevel = parsedLightLevel; // 光照度 + // } + // else if (key == "half_circle") + // { + // halfCircle = value; // 半圆 + // } + sbParams.Append($"{key}={value}&"); } - string url = $"{_baseUrl}/collect_images?light_level={lightLevel}&half_circle={halfCircle}"; + // string url = $"{_baseUrl}/collect_images?light_level={lightLevel}&half_circle={halfCircle}"; + string url = $"{_baseUrl}/collect_images?{sbParams.ToString().Substring(0, sbParams.ToString().Length - 1)}"; var response = await SendGetRequestAsync(url); @@ -196,7 +198,7 @@ namespace SparkClient.Model.Services int lightLevel = 0; string halfCircle = string.Empty; // 查询光照度和半圆配置 - string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG WHERE KEY IN ('light_level', 'half_circle')"; + string sql = $"SELECT KEY, VALUE FROM CUTTER_CONFIG "; DataTable table = DataBaseHelper.ExecuteQuery(sql); if (table == null || table.Rows.Count == 0) diff --git a/ViewModel/Grading/DiamondSelectVM.cs b/ViewModel/Grading/DiamondSelectVM.cs index 9c52eae..bb517d7 100644 --- a/ViewModel/Grading/DiamondSelectVM.cs +++ b/ViewModel/Grading/DiamondSelectVM.cs @@ -136,6 +136,7 @@ public class DiamondSelectVM : BaseViewModel new ButtonViewModel() { Text = "P8-P8 Stage 6", ImageSource = bitmap, Type = "ROUND P8 P8 S6", Command = StartGradingCommand, IsFocused = true}, new ButtonViewModel() { Text = "P8-P8 Stage 7", ImageSource = bitmap_p8p8s7, Type = "ROUND P8 P8 S7", Command = StartGradingCommand, IsFocused = true}, new ButtonViewModel() { Text = "P8-P8 Stage 8", ImageSource = bitmap_p8p8s8, Type = "ROUND P8 P8 S8", Command = StartGradingCommand, IsFocused = true}, + new ButtonViewModel() { Text = "P8-P8 Stage 9", ImageSource = bitmap, Type = "ROUND P8 P8 S9", Command = StartGradingCommand, IsFocused = true}, new ButtonViewModel() { Text = "P8-P8", ImageSource = bitmap, Type = "ROUND P8 P8", Command = StartGradingCommand, IsFocused = true}, }; diff --git a/ViewModel/Grading/GradingLoadingVM.cs b/ViewModel/Grading/GradingLoadingVM.cs index da4cf44..8d6df9b 100644 --- a/ViewModel/Grading/GradingLoadingVM.cs +++ b/ViewModel/Grading/GradingLoadingVM.cs @@ -166,6 +166,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable _progressCts.Cancel(); this.Dispose(); _monitorTimer.Dispose(); + SOCClientService.Service.OpenPump(false); return; } _monitorTimer.Change(500, Timeout.Infinite); diff --git a/Views/UserControl/Viewport3D.xaml.cs b/Views/UserControl/Viewport3D.xaml.cs index ffc20a1..95446b9 100644 --- a/Views/UserControl/Viewport3D.xaml.cs +++ b/Views/UserControl/Viewport3D.xaml.cs @@ -106,6 +106,7 @@ public partial class Viewport3D switch (step) { case "S1": + case "S9": case "S4": ViewportManager.DicValueParamToFacet.Add("CROWN_ANGLE", PlaneType.CrownIncomplete); ViewportManager.DicValueParamToFacet.Add("CROWN_HEIGHT", PlaneType.CrownIncomplete); diff --git a/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs b/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs index 5d97594..51633dc 100644 --- a/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs +++ b/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs @@ -2491,6 +2491,7 @@ public class ViewportHelperPro Dictionary> stepPlaneMappings = new() { ["S1"] = new() { PlaneType.CrownIncomplete }, + ["S9"] = new() { PlaneType.CrownIncomplete }, ["S2"] = new() { PlaneType.CrownIncomplete, PlaneType.StarFacet }, ["S3"] = new() { PlaneType.CrownIncomplete, PlaneType.StarFacet }, ["S4"] = new() { PlaneType.CrownIncomplete }, @@ -2512,6 +2513,7 @@ public class ViewportHelperPro Dictionary> stepPlaneMappings = new() { ["S1"] = new (){[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"]}, + ["S9"] = new (){[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"]}, ["S2"] = new() { [PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"], [PlaneType.StarFacet] = ["STAR_ANGLE","STAR"] diff --git a/Views/UserControl/ViewportData/Helper/ViewportManager.cs b/Views/UserControl/ViewportData/Helper/ViewportManager.cs index 7d3a07c..26a7c95 100644 --- a/Views/UserControl/ViewportData/Helper/ViewportManager.cs +++ b/Views/UserControl/ViewportData/Helper/ViewportManager.cs @@ -392,12 +392,16 @@ public class ViewportManager var center = ViewportManager.ModelBounds.Center; var maxDimension = ViewportManager.ModelBounds.Size.Length(); - var distance = maxDimension * 1.2; // 调整相机到模型的距离,保证视野范围内 + var distance = maxDimension * 1.0; // 调整相机到模型的距离,保证视野范围内 var camera = _viewport.Camera as HelixToolkit.Wpf.SharpDX.OrthographicCamera; - camera.Position = new Point3D(center.X, center.Y - distance, center.Z); // 从底部看,Y轴负方向 - camera.UpDirection = new Vector3D(0, 0, -1); - camera.LookDirection = new Vector3D(center.X - camera.Position.X, center.Y - camera.Position.Y, center.Z - camera.Position.Z); + // camera.Position = new Point3D(center.X, center.Y - distance, center.Z); // 从底部看,Y轴负方向 + // camera.UpDirection = new Vector3D(0, 0, -1); + // camera.LookDirection = new Vector3D(center.X - camera.Position.X, center.Y - camera.Position.Y, center.Z - camera.Position.Z); + camera.LookDirection = new Vector3D(0,141.818f,0); + camera.UpDirection = new Vector3D(-1, 0, 0); + camera.Position = new Point3D(0.005f, -139.954f, 0.005f); _viewport.RenderHost.MSAA = MSAALevel.Maximum; + InitMeshLines(); }