|
TraceMaker
C++ API of the engine
|
Namespaces | |
| namespace | tui |
Classes | |
| struct | CausesOptions |
| struct | RouteJob |
| struct | RouteJobResult |
Functions | |
| nlohmann::json | classify_open_connections (const std::string &board, const CausesOptions &opt, bool print) |
| Classifies the open connections of board and returns the report (also printed as a table when print). | |
| const std::vector< std::string > & | defect_kinds () |
| Defect kinds in a fixed order. | |
| int | inject_defects (const std::string &in, const std::string &out, const std::string &manifest, const std::string &kind, std::uint64_t seed, int count) |
| Writes out (and a JSON manifest of the injected defects to manifest, if not empty). | |
| void | print_summary (const model::Board &b, const std::string &path) |
| Prints a human-readable board summary. | |
| void | write_truth_json (const model::Board &b, const std::string &out_path, const model::DesignRules *rules=nullptr) |
| Writes the board in the same JSON schema as scripts/kicad_truth.py, for comparison with KiCad. | |
| RouteJobResult | run_route_job (RouteJob job) |
| Reads the board and its rules, routes (a portfolio when more than one variant runs), writes the requested outputs. | |
| RouteJobResult | run_layer_advisor (RouteJob job, std::vector< int > counts) |
| The layer-count advisor (route --try-layers, doc 05 §53, M20 C3): routes the board with each copper layer count in counts, fewest first, and stops at the first that completes (exit code 0: everything routed and, with soft zones, nothing unconnected after the refill). | |
| std::vector< route::BusGroup > | resolve_buses (const model::Board &b, const model::DesignRules &rules, const std::vector< std::string > &specs, bool detect, double skew_mm, std::vector< std::string > *notes=nullptr) |
| Buses (doc 05 §38): the groups specs ("NAME=PATTERN") name on the board, then, with detect, the groups found in the net names that share no net with an earlier group. | |
| nlohmann::json | bus_report (const model::Board &b, const model::DesignRules &rules, const std::vector< std::uint8_t > &joined, const route::BusGroup &g, std::string *line=nullptr) |
| A group measured on the copper of b (joined: route::nets_joined of the same board), as the JSON object of the route summary's buses array and of tracemaker buses --json; line, if given, gets the one-line text form. | |
| int | default_gpu_device (bool use_gpu) |
| The GPU device used for cost-to-go fields: the first listed device, or -1 (none, or use_gpu false). | |
| nlohmann::json tmk::app::bus_report | ( | const model::Board & | b, |
| const model::DesignRules & | rules, | ||
| const std::vector< std::uint8_t > & | joined, | ||
| const route::BusGroup & | g, | ||
| std::string * | line = nullptr ) |
A group measured on the copper of b (joined: route::nets_joined of the same board), as the JSON object of the route summary's buses array and of tracemaker buses --json; line, if given, gets the one-line text form.
Lengths are KiCad's: tracks plus the stackup height of the vias (rules says whether the project counts it).
| nlohmann::json tmk::app::classify_open_connections | ( | const std::string & | board, |
| const CausesOptions & | opt, | ||
| bool | print ) |
Classifies the open connections of board and returns the report (also printed as a table when print).
| int tmk::app::default_gpu_device | ( | bool | use_gpu | ) |
The GPU device used for cost-to-go fields: the first listed device, or -1 (none, or use_gpu false).
| const std::vector< std::string > & tmk::app::defect_kinds | ( | ) |
Defect kinds in a fixed order.
| int tmk::app::inject_defects | ( | const std::string & | in, |
| const std::string & | out, | ||
| const std::string & | manifest, | ||
| const std::string & | kind, | ||
| std::uint64_t | seed, | ||
| int | count ) |
Writes out (and a JSON manifest of the injected defects to manifest, if not empty).
Returns the number of defects injected (fewer than count when the board offers too few candidates).
| void tmk::app::print_summary | ( | const model::Board & | b, |
| const std::string & | path ) |
Prints a human-readable board summary.
| std::vector< route::BusGroup > tmk::app::resolve_buses | ( | const model::Board & | b, |
| const model::DesignRules & | rules, | ||
| const std::vector< std::string > & | specs, | ||
| bool | detect, | ||
| double | skew_mm, | ||
| std::vector< std::string > * | notes = nullptr ) |
Buses (doc 05 §38): the groups specs ("NAME=PATTERN") name on the board, then, with detect, the groups found in the net names that share no net with an earlier group.
Each group gets the skew limit of the board's custom rules, else, for groups from specs, skew_mm (0 = none). notes receives warnings. Throws on a bad spec.
| RouteJobResult tmk::app::run_layer_advisor | ( | RouteJob | job, |
| std::vector< int > | counts ) |
The layer-count advisor (route --try-layers, doc 05 §53, M20 C3): routes the board with each copper layer count in counts, fewest first, and stops at the first that completes (exit code 0: everything routed and, with soft zones, nothing unconnected after the refill).
Its board is written to job.out and its summary returned, with a "layers" object listing every count tried. A count the board cannot take (inner layers that are not empty) is reported and skipped. When none completes, the result of the count that left the fewest connections open is returned (the first such count on a tie).
| RouteJobResult tmk::app::run_route_job | ( | RouteJob | job | ) |
Reads the board and its rules, routes (a portfolio when more than one variant runs), writes the requested outputs.
Throws std::exception on unreadable input.
| void tmk::app::write_truth_json | ( | const model::Board & | b, |
| const std::string & | out_path, | ||
| const model::DesignRules * | rules = nullptr ) |
Writes the board in the same JSON schema as scripts/kicad_truth.py, for comparison with KiCad.