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

HyperX Solver is a command line executable. When HyperX runs Solver to generate margins, it generates an input file and calls this executable. A debugger can call this executable directly to debug custom analysis criteria.

Solver CLI arguments:

HyperX.Solver.exe <input file> <status file> <output file> <working folder> <package cache directory> <input file format> <output file format> <output mode> <run name> <number of threads>

The following pages describe how to debug custom analysis criteria in various environments.

Visual Studio

To debug a HyperX Solver criterion in Visual Studio, follow the instructions on Debugging: Visual Studio.

VS Code

To debug a HyperX Solver criterion in VS Code, follow the instructions on Debugging: VS Code.

Solver CLI Arguments

To generate the Solve CLI arguments from HyperX, the following Python script can be run from the HyperX Script Runner. Copy and paste the script output into the Visual Studio Command-line arguments field or the VS Code launch.json args field to debug the last Solver run of a database.

PrintSolverArgs.py:

import os
def Run(database):
# Build Solver args in required format
working_folder = database.ActiveProject.WorkingFolder
solver_input = os.path.join(working_folder, "Solver", "solver_input.msgpack").replace('\\', '\\\\')
solver_output = solver_input.replace("input", "output")
solver_log = solver_input.replace("input.msgpack", "log.txt")
package_cache = "C:\\\\HyperX\\\\Packages\\\\Cache"
working_folder = working_folder.replace('\\', '\\\\')
args = f'"{solver_input}" "{solver_log}" "{solver_output}" "{working_folder}" "{package_cache}" 3 4 0 "solver run" 1'
print("Solver debug args:")
print(args)

Possible PrintSolverArgs.py Output:

Solver debug args:
"C:\Users<username>\AppData\Local\Programs\HyperX\Project_9C2033E2\Solver\solver_input.msgpack" "C:\Users<username>\AppData\Local\Programs\HyperX\Project_9C2033E2\Solver\solver_log.txt" "C:\Users<username>\AppData\Local\Programs\HyperX\Project_9C2033E2\Solver\solver_output.msgpack" "C:\Users<username>\AppData\Local\Programs\HyperX\Project_9C2033E2" "C:\HyperX\Packages\Cache" 3 4 0 "solver run" 1