fix: update PlateView fill path and sync stats with preview

- Route best-result updates to progress form preview in
  PlateView.FillWithProgress (Ctrl+F path) — was still using
  the old SetStationaryParts approach
- Only update results stats (parts, density, area) when
  IsOverallBest so they match the preview display

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 20:56:41 -04:00
parent 21a5d3b026
commit 036f723876
2 changed files with 23 additions and 11 deletions
+11 -8
View File
@@ -71,17 +71,20 @@ namespace OpenNest.Forms
}
phaseStepper.ActivePhase = progress.Phase;
SetValueWithFlash(plateValue, progress.PlateNumber.ToString());
SetValueWithFlash(partsValue, progress.BestPartCount.ToString());
var densityText = progress.BestDensity.ToString("P1");
var densityFlashColor = GetDensityColor(progress.BestDensity);
SetValueWithFlash(densityValue, densityText, densityFlashColor);
densityBar.Value = progress.BestDensity;
if (progress.IsOverallBest)
{
SetValueWithFlash(partsValue, progress.BestPartCount.ToString());
SetValueWithFlash(nestedAreaValue,
$"{progress.NestedWidth:F1} x {progress.NestedLength:F1} ({progress.NestedArea:F1} sq in)");
var densityText = progress.BestDensity.ToString("P1");
var densityFlashColor = GetDensityColor(progress.BestDensity);
SetValueWithFlash(densityValue, densityText, densityFlashColor);
densityBar.Value = progress.BestDensity;
SetValueWithFlash(nestedAreaValue,
$"{progress.NestedWidth:F1} x {progress.NestedLength:F1} ({progress.NestedArea:F1} sq in)");
}
descriptionValue.Text = !string.IsNullOrEmpty(progress.Description)
? progress.Description