Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Quantum.Debug/BankingProfileBrowserCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,15 @@ private static string BuildHtml(
string outputHtmlPath,
JsonElement artifactRoot)
{
string? outputDirectory = Path.GetDirectoryName(outputHtmlPath);
string payloadPathBase = string.IsNullOrEmpty(outputDirectory)
? Environment.CurrentDirectory
: outputDirectory;

var payload = new BankingProfileBrowserPayload
{
SourcePath = ToDisplayPath(Path.GetRelativePath(Environment.CurrentDirectory, diagnosticsJsonPath)),
OutputPath = ToDisplayPath(Path.GetRelativePath(Environment.CurrentDirectory, outputHtmlPath)),
SourcePath = ToDisplayPath(Path.GetRelativePath(payloadPathBase, diagnosticsJsonPath)),
OutputPath = ToDisplayPath(Path.GetRelativePath(payloadPathBase, outputHtmlPath)),
Artifact = artifactRoot
};

Expand Down
18 changes: 18 additions & 0 deletions Quantum.Debug/DebugCommandHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ public static class DebugCommandHelp
"dotnet run --project Quantum.Debug -- debug-viewport-snapshot-v1-from-csv Quantum.Tests/IO/Fixtures/Milestone7.synthetic.straight_line.centerline_frames.csv",
"dotnet run --project Quantum.Debug -- debug-viewport-snapshot-v1-from-csv Quantum.Tests/IO/Fixtures/Milestone7.synthetic.straight_line.centerline_frames.csv artifacts/debug-viewport/Milestone7.synthetic.straight_line.snapshot.json"
}),
new DebugCommandHelpEntry(
name: DebugViewportSnapshotV1FromTrackLayoutPackageV2Command.CommandName,
usage: "debug-viewport-snapshot-v1-from-track-layout-package-v2 <inputJsonPath> [outputJsonPath]",
summary: "Import a TrackLayoutPackageV2 JSON layout and export DebugViewportSnapshotV1 JSON.",
arguments: new[]
{
"inputJsonPath: Required TrackLayoutPackageV2 JSON path.",
"outputJsonPath: Optional JSON output path. Defaults next to the input JSON with " +
DebugViewportSnapshotV1FromTrackLayoutPackageV2Command.DefaultOutputExtension + " appended.",
"The command validates and maps through the TrackLayoutPackageV2 importer, compiles the authored layout, samples backend TrackFrame data, evaluates simple train boxes when the track is long enough, and validates the resulting DebugViewportSnapshotV1 payload.",
"Authored banking uses the existing opt-in BankingProfile sampling path. Authored heartline offsets are represented as diagnostic connector lines because DebugViewportSnapshotV1 has no dedicated heartline layer.",
DebugViewportPreviewIndexNote
},
examples: new[]
{
"dotnet run --project Quantum.Debug -- debug-viewport-snapshot-v1-from-track-layout-package-v2 artifacts/layouts/minimal-v2.json",
"dotnet run --project Quantum.Debug -- debug-viewport-snapshot-v1-from-track-layout-package-v2 artifacts/layouts/minimal-v2.json artifacts/debug-viewport/minimal-v2.snapshot.json"
}),
new DebugCommandHelpEntry(
name: "debug-viewport-snapshot-v1-validate",
usage: "debug-viewport-snapshot-v1-validate <snapshotJsonPath>",
Expand Down
7 changes: 7 additions & 0 deletions Quantum.Debug/DebugCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public enum DebugCommandKind
MeshExportV1Sample,
DebugViewportSnapshotV1,
DebugViewportSnapshotV1FromCsv,
DebugViewportSnapshotV1FromTrackLayoutPackageV2,
DebugViewportSnapshotV1Validate,
DebugViewportSnapshotV1Svg,
DebugViewportSnapshotV1Gallery,
Expand Down Expand Up @@ -85,6 +86,12 @@ public static bool TryParse(
return true;
}

if (string.Equals(args[0], DebugViewportSnapshotV1FromTrackLayoutPackageV2Command.CommandName, StringComparison.OrdinalIgnoreCase))
{
command = DebugCommandKind.DebugViewportSnapshotV1FromTrackLayoutPackageV2;
return true;
}

if (string.Equals(args[0], "debug-viewport-snapshot-v1-validate", StringComparison.OrdinalIgnoreCase))
{
command = DebugCommandKind.DebugViewportSnapshotV1Validate;
Expand Down
Loading
Loading