diff --git a/OpenNest/Controls/PhaseStepperControl.cs b/OpenNest/Controls/PhaseStepperControl.cs index a0f8e92..7e4a0ee 100644 --- a/OpenNest/Controls/PhaseStepperControl.cs +++ b/OpenNest/Controls/PhaseStepperControl.cs @@ -59,16 +59,6 @@ namespace OpenNest.Controls } } - private static string GetDisplayName(NestPhase phase) - { - switch (phase) - { - case NestPhase.RectBestFit: return "BestFit"; - case NestPhase.Nfp: return "NFP"; - default: return phase.ToString(); - } - } - protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); @@ -134,7 +124,7 @@ namespace OpenNest.Controls } // Label - var label = GetDisplayName(phase); + var label = phase.ShortName(); var font = isVisited || isActive ? BoldLabelFont : LabelFont; var brush = isVisited || isActive ? activeTextBrush : pendingTextBrush; var labelSize = g.MeasureString(label, font); diff --git a/OpenNest/Forms/NestProgressForm.cs b/OpenNest/Forms/NestProgressForm.cs index d95e856..ec3fd12 100644 --- a/OpenNest/Forms/NestProgressForm.cs +++ b/OpenNest/Forms/NestProgressForm.cs @@ -73,7 +73,7 @@ namespace OpenNest.Forms descriptionValue.Text = !string.IsNullOrEmpty(progress.Description) ? progress.Description - : FormatPhase(progress.Phase); + : progress.Phase.DisplayName(); } public void ShowCompleted() @@ -196,18 +196,5 @@ namespace OpenNest.Forms return DensityMidColor; return DensityHighColor; } - - private static string FormatPhase(NestPhase phase) - { - switch (phase) - { - case NestPhase.Linear: return "Trying rotations..."; - case NestPhase.RectBestFit: return "Trying best fit..."; - case NestPhase.Pairs: return "Trying pairs..."; - case NestPhase.Extents: return "Trying extents..."; - case NestPhase.Nfp: return "Trying NFP..."; - default: return phase.ToString(); - } - } } }