TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
run_report.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2#pragma once
3// The run report (doc 18 D3, D136): the sections of the route summary that a designer needs to audit a run and that the
4// plain summary does not carry: which rules were read and which were not, and the DRC of the board before and after the
5// route. The report file itself is rendered from the summary alone (report/render.hpp), so every number in it is a
6// field of the JSON.
7#include <string>
8#include <vector>
9
10#include <nlohmann/json.hpp>
11
12#include "model/board.hpp"
13#include "model/rules.hpp"
14
15namespace tmk::report {
16
17// What the router took from the board's project (`board_path` names the .kicad_pcb; the .kicad_pro and .kicad_dru are
18// looked for beside it as io::read_design_rules does): board minimums, net classes with their net counts, custom
19// rules, and everything that could not be read (`rules.warnings`, the rule engine's `engine_warnings` and the board
20// reader's `board.warnings`). Rule 6: what is in `not_read` the route may break.
21nlohmann::json rules_json(const std::string& board_path, const model::Board& board, const model::DesignRules& rules,
22 const std::vector<std::string>& engine_warnings);
23
24// TraceMaker's DRC (KiCad's violation names, doc 03 §6) of the board the router started from and of the board it
25// wrote, by violation type, with what the route added. With `refill` the copper zones of both are refilled first, as
26// `kicad-cli pcb drc --refill-zones` does (the plane tier is judged that way, doc 10 §4). Counts per type, not the
27// instance matching of bench/drc_judge.py: a type whose count did not grow may still hold a new violation that replaced
28// an old one.
29nlohmann::json drc_json(const model::Board& before, const model::Board& after, const model::DesignRules& rules, bool refill);
30
31// True for violation types that routing can cause (bench/drc_judge.py NOT_ROUTING lists the others; unconnected items
32// are counted on their own).
33bool routing_violation(const std::string& type);
34
35} // namespace tmk::report
The board model (design doc 02 §3): every object TraceMaker reads from a .kicad_pcb,...
bool routing_violation(const std::string &type)
True for violation types that routing can cause (bench/drc_judge.py NOT_ROUTING lists the others; unc...
nlohmann::json drc_json(const model::Board &before, const model::Board &after, const model::DesignRules &rules, bool refill)
TraceMaker's DRC (KiCad's violation names, doc 03 §6) of the board the router started from and of the...
nlohmann::json rules_json(const std::string &board_path, const model::Board &board, const model::DesignRules &rules, const std::vector< std::string > &engine_warnings)
What the router took from the board's project (board_path names the .kicad_pcb; the ....
Design rules as KiCad defines them (design doc 08 §3–4): board minimums and net classes from the ....