diff --git a/App.config b/App.config index c53de5d..276f379 100644 --- a/App.config +++ b/App.config @@ -18,7 +18,7 @@ - + diff --git a/Resource/Images/UIResource/Diamond/round_P8-P8-S1.png b/Resource/Images/UIResource/Diamond/round_P8-P8-S1.png new file mode 100644 index 0000000..00d4a99 Binary files /dev/null and b/Resource/Images/UIResource/Diamond/round_P8-P8-S1.png differ diff --git a/Resource/Images/UIResource/Diamond/round_P8-P8-S2.png b/Resource/Images/UIResource/Diamond/round_P8-P8-S2.png new file mode 100644 index 0000000..51bef5f Binary files /dev/null and b/Resource/Images/UIResource/Diamond/round_P8-P8-S2.png differ diff --git a/Resource/Images/UIResource/Diamond/round_P8-P8-S7.png b/Resource/Images/UIResource/Diamond/round_P8-P8-S7.png new file mode 100644 index 0000000..bc030a4 Binary files /dev/null and b/Resource/Images/UIResource/Diamond/round_P8-P8-S7.png differ diff --git a/Resource/Images/UIResource/Diamond/round_P8-P8-S8.png b/Resource/Images/UIResource/Diamond/round_P8-P8-S8.png new file mode 100644 index 0000000..a9918e3 Binary files /dev/null and b/Resource/Images/UIResource/Diamond/round_P8-P8-S8.png differ diff --git a/Resource/Images/UIResource/Diamond/round_P8-P8.png b/Resource/Images/UIResource/Diamond/round_P8-P8.png new file mode 100644 index 0000000..f120c6c Binary files /dev/null and b/Resource/Images/UIResource/Diamond/round_P8-P8.png differ diff --git a/SparkClient.csproj b/SparkClient.csproj index 751fa00..e17ea37 100644 --- a/SparkClient.csproj +++ b/SparkClient.csproj @@ -79,6 +79,10 @@ + + + + @@ -226,6 +230,12 @@ + + + + + + diff --git a/ViewModel/Grading/DiamondSelectVM.cs b/ViewModel/Grading/DiamondSelectVM.cs index d0bd4ac..85e2e71 100644 --- a/ViewModel/Grading/DiamondSelectVM.cs +++ b/ViewModel/Grading/DiamondSelectVM.cs @@ -120,17 +120,21 @@ public class DiamondSelectVM : BaseViewModel tempButtons2.Add(button); }else if (Common.RunMode == 1) { - var bitmap = new BitmapImage(new Uri("pack://application:,,,/Resource/Images/UIResource/round_P8-P8.png", UriKind.RelativeOrAbsolute)); + var bitmap = new BitmapImage(new Uri("pack://application:,,,/Resource/Images/UIResource/Diamond/round_P8-P8.png", UriKind.RelativeOrAbsolute)); + var bitmap_p8p8s1 = new BitmapImage(new Uri("pack://application:,,,/Resource/Images/UIResource/Diamond/round_P8-P8-S1.png", UriKind.RelativeOrAbsolute)); + var bitmap_p8p8s2 = new BitmapImage(new Uri("pack://application:,,,/Resource/Images/UIResource/Diamond/round_P8-P8-S2.png", UriKind.RelativeOrAbsolute)); + var bitmap_p8p8s7 = new BitmapImage(new Uri("pack://application:,,,/Resource/Images/UIResource/Diamond/round_P8-P8-S7.png", UriKind.RelativeOrAbsolute)); + var bitmap_p8p8s8 = new BitmapImage(new Uri("pack://application:,,,/Resource/Images/UIResource/Diamond/round_P8-P8-S8.png", UriKind.RelativeOrAbsolute)); List listBtn = new List() { - new ButtonViewModel() { Text = "P8-P8 Stage 1", ImageSource = bitmap, Type = "ROUND P8 P8 S1", Command = StartGradingCommand, IsFocused = true}, - new ButtonViewModel() { Text = "P8-P8 Stage 2", ImageSource = bitmap, Type = "ROUND P8 P8 S2", Command = StartGradingCommand, IsFocused = true}, + new ButtonViewModel() { Text = "P8-P8 Stage 1", ImageSource = bitmap_p8p8s1, Type = "ROUND P8 P8 S1", Command = StartGradingCommand, IsFocused = true}, + new ButtonViewModel() { Text = "P8-P8 Stage 2", ImageSource = bitmap_p8p8s2, Type = "ROUND P8 P8 S2", Command = StartGradingCommand, IsFocused = true}, new ButtonViewModel() { Text = "P8-P8 Stage 3", ImageSource = bitmap, Type = "ROUND P8 P8 S3", Command = StartGradingCommand, IsFocused = true}, new ButtonViewModel() { Text = "P8-P8 Stage 4", ImageSource = bitmap, Type = "ROUND P8 P8 S4", Command = StartGradingCommand, IsFocused = true}, new ButtonViewModel() { Text = "P8-P8 Stage 5", ImageSource = bitmap, Type = "ROUND P8 P8 S5", Command = StartGradingCommand, IsFocused = true}, 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, Type = "ROUND P8 P8 S7", Command = StartGradingCommand, IsFocused = true}, - new ButtonViewModel() { Text = "P8-P8 Stage 8", ImageSource = bitmap, Type = "ROUND P8 P8 S8", 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", ImageSource = bitmap, Type = "ROUND P8 P8", Command = StartGradingCommand, IsFocused = true}, }; diff --git a/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs b/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs index 4e33340..b4e7ad5 100644 --- a/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs +++ b/Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs @@ -1066,7 +1066,7 @@ public class ViewportHelperPro if (valKey.IsNullOrEmpty()) { //显示两个值 - var param = new List { "CROWN_ANGLE", "CROWN_HEIGHT" }; + var param = GetAlgorithmParam(step, selFacetType); StringBuilder sbShowText = new StringBuilder(); foreach (var p in param) @@ -1080,7 +1080,7 @@ public class ViewportHelperPro sbShowText.Append($" {facetIndex}"); result.Add(DisplayText3D(sbShowText.ToString(), - new Vector3(facetTextPoint.X, facetTextPoint.Y - 0.4f, facetTextPoint.Z))); + new Vector3(facetTextPoint.X, facetTextPoint.Y + DisplacementCalculations(selFacetType), facetTextPoint.Z))); } else { @@ -2450,7 +2450,7 @@ public class ViewportHelperPro private static bool FactoryShowTextCheck(string diamondType, PlaneType planeType) { Dictionary> stepPlaneMappings = new() - { + { ["S1"] = new() { PlaneType.CrownIncomplete }, ["S2"] = new() { PlaneType.CrownIncomplete, PlaneType.StarFacet }, ["S3"] = new() { PlaneType.CrownIncomplete, PlaneType.StarFacet }, @@ -2459,7 +2459,7 @@ public class ViewportHelperPro ["S6"] = new() { PlaneType.PavilionIncomplete }, ["S7"] = new() { PlaneType.PavilionIncomplete, PlaneType.CrownIncomplete }, ["S8"] = new() { PlaneType.PavilionIncomplete, PlaneType.CrownIncomplete } - }; + }; var endType = diamondType.Split(' ').LastOrDefault(); if (string.IsNullOrEmpty(endType) || !stepPlaneMappings.TryGetValue(endType, out var allowedTypes)) { @@ -2467,5 +2467,69 @@ public class ViewportHelperPro } return allowedTypes.Contains(planeType); } + + private static string[] GetAlgorithmParam(string diamondType, PlaneType planeType) + { + Dictionary> stepPlaneMappings = new() + { + ["S1"] = new (){[PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"]}, + ["S2"] = new() { + [PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"], + [PlaneType.StarFacet] = ["STAR_ANGLE","STAR"] + }, + ["S3"] = new() + { + [PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"], + [PlaneType.UpperGirdleFacet] = ["UPPER_HALF_ANGLE"] + }, + ["S4"] = new() + { + [PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"] + }, + ["S5"] = new() + { + [PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"] + }, + ["S6"] = new() + { + [PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"] + }, + ["S7"] = new() + { + [PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"], + [PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"] + }, + ["S8"] = new() + { + [PlaneType.PavilionIncomplete] = ["PAV_ANGLE", "PAV_DEPTH"], + [PlaneType.CrownIncomplete] = ["CROWN_ANGLE", "CROWN_HEIGHT"] + } + }; + if (stepPlaneMappings.ContainsKey(diamondType) ) + { + var pts = stepPlaneMappings[diamondType]; + if (pts.ContainsKey(planeType)) + { + return pts[planeType]; + } + } + + return []; + } + + private static float DisplacementCalculations(PlaneType planeType, float vol = 0.4f) + { + switch (planeType) + { + case PlaneType.StarFacet: + case PlaneType.CrownIncomplete: + case PlaneType.UpperGirdleFacet: + case PlaneType.UpperMainFacet: + case PlaneType.Crown: + return vol * -1; + } + + return vol * 1; + } }