fix: review fixes — culture-invariant formatting, sealed config, threshold boundary

- Use CultureInfo.InvariantCulture in CoordinateFormatter, SpeedClassifier,
  and CincinnatiPreambleWriter to prevent locale-dependent G-code output
- Make CincinnatiPostConfig sealed per spec
- Fix SpeedClassifier.Classify threshold to >= (matching spec)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 23:45:22 -04:00
parent ca8a0942ab
commit 8efdc8720c
5 changed files with 8 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ namespace OpenNest.Posts.Cincinnati
public string Classify(double contourLength, double sheetDiagonal)
{
var ratio = contourLength / sheetDiagonal;
if (ratio > FastThreshold) return "FAST";
if (ratio >= FastThreshold) return "FAST";
if (ratio <= SlowThreshold) return "SLOW";
return "MEDIUM";
}
@@ -22,7 +22,7 @@ namespace OpenNest.Posts.Cincinnati
{
// Cincinnati convention: no leading zero for values < 1 (e.g., ".8702" not "0.8702")
var rounded = System.Math.Round(value, 4);
var str = rounded.ToString("0.####");
var str = rounded.ToString("0.####", System.Globalization.CultureInfo.InvariantCulture);
if (rounded > 0 && rounded < 1 && str.StartsWith("0."))
return str.Substring(1);
return str;