HyperX.Solver.Api
The HyperX Solver Application Programming Interface
Loading...
Searching...
No Matches
Debugging: VS Code

The following steps describe how to debug custom analysis criteria using VS Code.

  1. Open the folder containing your criteria in VS Code.
  2. Create a file named launch.json in a folder called .vscode at the root of the criterion folder.

    {
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Launch Solver",
    "type": "coreclr",
    "request": "launch",
    "program": "<InstallDir>\\Executable\\Solver\\HyperX.Solver.exe",
    "args": [
    "<input file>",
    "<status file>",
    "<output file>",
    "<working folder>",
    "<package cache directory>",
    "<input file format>",
    "<output file format>",
    "<output mode>",
    "<run name>",
    "<number of threads>"
    ],
    "cwd": "<InstallDir>\\Executable\\Solver",
    "console": "integratedTerminal"
    }
    ]
    }
    Note
    The C# VS Code extension is required for the coreclr debug configuration type.
  3. Set the program (executable path) to: <InstallDir>\Executable\Solver\HyperX.Solver.exe
  4. Enter the args (command-line arguments):

    • <input file> — Path to the solver_input.msgpack file ("<ProjectWorkingFolder>\Solver\solver_input.msgpack")
    • <status file> — Path to your solver_log.txt file ("<ProjectWorkingFolder>\Solver\solver_log.txt")
    • <output file> — Path to your solver_output.msgpack file ("<ProjectWorkingFolder>\Solver\solver_output.msgpack")
    • <working folder> — Path to your overall temp directory ("<ProjectWorkingFolder>")
    • <package cache directory> — Path to your package cache directory ("C:\HyperX\Packages\Cache")
    • <input file format> — Specifies the input file format. Must be set to: 3 (MessagePack)
    • <output file format> — Specifies the output file format. Must be set to: 4 (SQL)
    • <output mode> — Specifies the output mode: 0 (Overwrite) or 1 (Append)
    • <run name> — User-defined name for the Solver run
    • <number of threads> — Number of threads to use (must be ≥ 1)
    Note
    See how to generate the Solver CLI arguments from the HyperX Script Runner.
  5. Set the cwd (working directory) to: <InstallDir>\Executable\Solver
  6. Set a break point in your criterion. For example, break once execution enters the Analyze function.

    Step 1 Image

  7. From the Run and Debug side bar, select the Launch Solver debug configuration.

    Step 2 Image

  8. Start debugging. Once the breakpoint is hit, use the Run and Debug side bar or the Debug Console to inspect variables or test commands. For example, the input analyzable's concept and children cross-sections can be output to the terminal using Console.Write(input.Analyzable.DrawAll()).

    Step 3 Image