37#include <nlohmann/json.hpp>
72 std::vector<std::pair<std::string, std::string>>
priority;
106 std::map<std::string, std::string>
net;
107 std::map<std::string, std::string>
part;
The board model (design doc 02 §3): every object TraceMaker reads from a .kicad_pcb,...
constexpr std::size_t kMaxFirstNets
Upper bounds on what one file may ask for (an advisor is not trusted to be sensible,...
constexpr int kDefaultVariants
Advice load_advice_file(const std::string &path)
Reads a file (size-limited); throws on a missing file or a syntax or content error.
constexpr std::size_t kMaxRegions
constexpr std::size_t kMaxRegionNets
nlohmann::json advice_schema()
The hint types an advisor may use, as JSON (goes into the stuck report so an advisor adapts to the en...
void unalias(Advice &a, const AliasMap &m)
constexpr int kMaxVariants
Advice parse_advice(std::string_view json_text, const std::string &source="advice")
Parses and validates the text of an advice file. Throws std::runtime_error naming source and the entr...
constexpr std::size_t kMaxPriority
Applied apply_advice(const Advice &a, const model::Board &b)
check_advice_refs, then the RouterOptions::AdviceSet: layer masks and costs, and for each region a ru...
constexpr std::size_t kMaxPolygon
nlohmann::json advice_to_json(const Advice &a)
The advice as JSON, with the board's real names: what is saved beside the output so that --advice FIL...
void check_advice_refs(const Advice &a, const model::Board &b, std::vector< std::string > *warnings=nullptr)
Checks every name against the board: nets, pads (REF.NUM, on one net), copper layers.
constexpr std::size_t kMaxNote
Integer-nanometre points and KiCad-compatible rotation.
TraceMaker's detailed router, version 1 (roadmap M4; design doc 05 §2, §5).
Design rules as KiCad defines them (design doc 08 §3–4): board minimums and net classes from the ....
std::vector< std::pair< std::string, double > > layer_cost
std::vector< std::string > first_nets
std::string source
file name, for messages
std::vector< Region > regions
std::vector< std::string > no_tracks
copper layer names
std::vector< std::pair< std::string, std::string > > priority
"REF.NUM" pairs
Aliases for net names and part references (a redacted stuck report): the advice an advisor writes use...
std::map< std::string, std::string > part
alias -> reference
std::map< std::string, std::string > net
alias -> net name
What the router is given for an advice file, and what each hint became (for the log,...
std::vector< std::string > warnings
route::RouterOptions::AdviceSet set
nlohmann::json report
{"source", "note", "hints": [{"kind", "text", "applied"}], "variants"}
std::string where
"regions[2]" in messages
std::vector< std::string > avoid_nets
these nets may not enter
std::vector< std::string > reserve_for
only these nets may enter
std::string name
"" = numbered
std::vector< std::string > layers
copper layer names; empty = every copper layer
std::vector< geom::Point > polygon
nm, the board file's axes
Hints from an advice file (src/advice, doc 17).