feat factory stage 2

master
Tongg 9 months ago
parent 232d81f61b
commit 93f7836aaf
  1. 6
      ViewModel/Grading/DiamondSelectVM.cs
  2. 9
      Views/UserControl/Viewport3D.xaml.cs
  3. 23
      Views/UserControl/ViewportData/Helper/ViewportHelperPro.cs

@ -122,9 +122,9 @@ public class DiamondSelectVM : BaseViewModel
{
var bitmap = new BitmapImage(new Uri("pack://application:,,,/Resource/Images/UIResource/round_P8-P8.png", UriKind.RelativeOrAbsolute));
ButtonViewModel button1 = new ButtonViewModel() { Text = "P8-P8 Stage 1", ImageSource = bitmap, Type = "ROUND P8 P8 S1", Command = StartGradingCommand, IsFocused = true};
ButtonViewModel button2 = new ButtonViewModel() { Text = "P8-P8 Stage 2", ImageSource = bitmap, Type = "ROUND P8 P8 S2", Command = StartGradingCommand, IsFocused = true};
ButtonViewModel button3 = new ButtonViewModel() { Text = "P8-P8 Stage 3", ImageSource = bitmap, Type = "ROUND P8 P8 S3", Command = StartGradingCommand, IsFocused = true};
ButtonViewModel button4 = new ButtonViewModel() { Text = "P8-P8 Stage 4", ImageSource = bitmap, Type = "ROUND P8 P8 S4", Command = StartGradingCommand, IsFocused = true};
ButtonViewModel button2 = new ButtonViewModel() { Text = "P8-P8 Stage 2", ImageSource = bitmap, Type = "ROUND P8 P8 S1 S2", Command = StartGradingCommand, IsFocused = true};
ButtonViewModel button3 = new ButtonViewModel() { Text = "P8-P8 Stage 3", ImageSource = bitmap, Type = "ROUND P8 P8 S1 S2 S3", Command = StartGradingCommand, IsFocused = true};
ButtonViewModel button4 = new ButtonViewModel() { Text = "P8-P8 Stage 4", ImageSource = bitmap, Type = "ROUND P8 P8 S1 S2 S3 S4", Command = StartGradingCommand, IsFocused = true};
ButtonViewModel button5 = new ButtonViewModel() { Text = "P8-P8", ImageSource = bitmap, Type = "ROUND P8 P8", Command = StartGradingCommand, IsFocused = true};
tempButtons2.Add(button1);
tempButtons2.Add(button2);

@ -90,13 +90,20 @@ public partial class Viewport3D
ContextMenu.Items.Remove(ViewportRightMenuShowDefectFace);
ViewportRightMenuShowLighting.IsChecked = false; //关灯
if ("S1".Equals(step))
if (ViewportManager.DiamondType.Split(" ").Contains("S1"))
{
//有效数据
ViewportManager.DicValueParamToFacet.Clear();
ViewportManager.DicValueParamToFacet.Add("CROWN_ANGLE", PlaneType.CrownIncomplete);
ViewportManager.DicValueParamToFacet.Add("CROWN_HEIGHT", PlaneType.CrownIncomplete);
}
if (ViewportManager.DiamondType.Split(" ").Contains("S2"))
{
//有效数据
ViewportManager.DicValueParamToFacet.Clear();
ViewportManager.DicValueParamToFacet.Add("STAR_ANGLE", PlaneType.StarFacet);
ViewportManager.DicValueParamToFacet.Add("STAR", PlaneType.StarFacet);
}
}

@ -1037,7 +1037,7 @@ public class ViewportHelperPro
var selFacetType = entities.First().PlaneType;
string step = ViewportManager.DiamondType.Split(" ").Last();
if ("S1".Equals(step) && selFacetType == PlaneType.CrownIncomplete)
if (FactoryShowTextCheck(ViewportManager.DiamondType, selFacetType))
{
try
{
@ -2447,5 +2447,26 @@ public class ViewportHelperPro
}
#endregion
private static bool FactoryShowTextCheck(string diamondType, PlaneType planeType)
{
string[] diamondTypes = diamondType.Split(" ");
string endType = diamondTypes.Last();
if ("S2".Equals(endType))
{
if (diamondTypes.Contains("S1"))
{
if (planeType == PlaneType.CrownIncomplete || planeType == PlaneType.StarFacet)
return true;
}
}
if ("S1".Equals(endType))
{
if (planeType == PlaneType.CrownIncomplete)
return true;
}
return false;
}
}

Loading…
Cancel
Save