Forge
csharpdeeb25a2
1using System.Globalization;
2
3namespace CascadeIDE.Services.Presentation;
4
5/// <summary>Triple-zone cockpit on one ultrawide canvas (ADR 0171 P3).</summary>
6public static class PresentationUltrawideCockpitLayoutBuilder
7{
8 public static PresentationMainGridLayoutFrame Build(
9 int totalWidthPx,
10 int minAnchorWidthPx,
11 bool suppressPfdHost,
12 bool suppressMfdHost)
13 {
14 var anchor = Math.Max(320, minAnchorWidthPx);
15 var pfd = suppressPfdHost ? 0 : Math.Min(anchor, totalWidthPx / 5);
16 var mfd = suppressMfdHost ? 0 : Math.Min(anchor, totalWidthPx / 5);
17 var columns = $"{pfd},4,*,4,{mfd}";
18 return new PresentationMainGridLayoutFrame(
19 columns,
20 3,
21 false,
22 Array.Empty<double>(),
23 Array.Empty<PresentationZoneBound>());
24 }
25
26 public static string FormatWeightedTriple(double wP, double wF, double wM) =>
27 $"{FormatWeight(wP)}*,4,{FormatWeight(wF)}*,4,{FormatWeight(wM)}*";
28
29 private static string FormatWeight(double w) => w.ToString("0.########", CultureInfo.InvariantCulture);
30}
31
View only · write via MCP/CIDE