feat: v1.0.20250401 -> Select diamond page optimize And Model data optimize

master
Tongg 9 months ago
parent f96cd17ef0
commit ebf186cb2b
  1. 2
      App.config
  2. BIN
      Resource/Images/UIResource/Diamond/round_P8-P8-S1.png
  3. BIN
      Resource/Images/UIResource/Diamond/round_P8-P8-S2.png
  4. BIN
      Resource/Images/UIResource/Diamond/round_P8-P8-S7.png
  5. BIN
      Resource/Images/UIResource/Diamond/round_P8-P8-S8.png
  6. BIN
      Resource/Images/UIResource/Diamond/round_P8-P8.png
  7. 10
      SparkClient.csproj
  8. 14
      ViewModel/Grading/DiamondSelectVM.cs
  9. 68
      Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs

@ -18,7 +18,7 @@
<add key="ProgressTime" value="50000"/>
<add key="RunModel" value="0" />
<add key="AppVersion" value="1.0.20250325" />
<add key="AppVersion" value="1.0.20250401" />
</appSettings>
<connectionStrings>
<add name="" connectionString=""/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@ -79,6 +79,10 @@
<None Remove="Resource\Images\homebg.png" />
<Resource Include="Resource\Images\UIResource\Cushion.png" />
<Resource Include="Resource\Images\UIResource\Cushion_select.png" />
<Resource Include="Resource\Images\UIResource\Diamond\round_P8-P8-S1.png" />
<Resource Include="Resource\Images\UIResource\Diamond\round_P8-P8-S2.png" />
<Resource Include="Resource\Images\UIResource\Diamond\round_P8-P8-S7.png" />
<Resource Include="Resource\Images\UIResource\Diamond\round_P8-P8.png" />
<Resource Include="Resource\Images\UIResource\Emerald.png" />
<Resource Include="Resource\Images\UIResource\Emerald_select.png" />
<Resource Include="Resource\Images\UIResource\Heart.png" />
@ -226,6 +230,12 @@
</None>
<None Remove="Resource\Images\UIResource\cut_mst_dtl.png" />
<Resource Include="Resource\Images\UIResource\cut_mst_dtl.png" />
<None Remove="Resource\Images\UserControl\Diamond\round_P8-P8.png" />
<None Remove="Resource\Images\UserControl\Diamond\round_P8-P8-S1.png" />
<None Remove="Resource\Images\UserControl\Diamond\round_P8-P8-S2.png" />
<None Remove="Resource\Images\UserControl\Diamond\round_P8-P8-S7.png" />
<None Remove="Resource\Images\UIResource\Diamond\round_P8-P8-S8.png" />
<Resource Include="Resource\Images\UIResource\Diamond\round_P8-P8-S8.png" />
</ItemGroup>
<ItemGroup>

@ -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<ButtonViewModel> listBtn = new List<ButtonViewModel>()
{
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},
};

@ -1066,7 +1066,7 @@ public class ViewportHelperPro
if (valKey.IsNullOrEmpty())
{
//显示两个值
var param = new List<string> { "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
{
@ -2467,5 +2467,69 @@ public class ViewportHelperPro
}
return allowedTypes.Contains(planeType);
}
private static string[] GetAlgorithmParam(string diamondType, PlaneType planeType)
{
Dictionary<string, Dictionary<PlaneType, string[]>> 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;
}
}

Loading…
Cancel
Save