TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tmk::app Namespace Reference

Namespaces

namespace  tui

Classes

struct  RouteJob
struct  RouteJobResult

Functions

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.
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).

Function Documentation

◆ bus_report()

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).

◆ default_gpu_device()

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).

◆ defect_kinds()

const std::vector< std::string > & tmk::app::defect_kinds ( )

Defect kinds in a fixed order.

◆ inject_defects()

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).

◆ print_summary()

void tmk::app::print_summary ( const model::Board & b,
const std::string & path )

Prints a human-readable board summary.

◆ resolve_buses()

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.

◆ run_route_job()

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.

◆ write_truth_json()

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.