Forge
csharpdeeb25a2
1#nullable enable
2using CascadeIDE.Models;
3
4namespace CascadeIDE.Cockpit.Cds;
5
6/// <summary>
7/// CDS router for trace-flow channel (ADR 0036 p.2): decides if/where highlights are allowed.
8/// </summary>
9public interface ITraceFlowCdsRouter : ICdsRouter<TraceFlowCdsRouteInput, TraceFlowCdsDecision>
10{
11}
12
13public readonly record struct TraceFlowCdsRouteInput(CockpitSurfaceState Cds, string MapLevel);
14public readonly record struct TraceFlowCdsDecision(bool Enabled, string ZoneId, string DetailLevel);
15
16public sealed class TraceFlowCdsRouter : ITraceFlowCdsRouter
17{
18 public TraceFlowCdsDecision Route(TraceFlowCdsRouteInput input)
19 {
20 var level = CodeNavigationMapLevelKind.Normalize(input.MapLevel);
21 var enabled = level == CodeNavigationMapLevelKind.ControlFlow && input.Cds.Zones.PfdVisible;
22 return new TraceFlowCdsDecision(
23 Enabled: enabled,
24 ZoneId: enabled ? "pfd" : "none",
25 DetailLevel: enabled ? "normal" : "off");
26 }
27}
28
View only · write via MCP/CIDE