TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
defects.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2#pragma once
3// Deterministic defect injection for DRC parity on broken boards (design doc 03 ยง6, roadmap M2): takes a
4// routed board and adds one kind of defect a given number of times (shorts between nets, dangling tracks and
5// vias, cut connections), so TraceMaker's classification of each defect can be compared with kicad-cli's.
6#include <cstdint>
7#include <string>
8#include <vector>
9
10namespace tmk::app {
11
12// Defect kinds in a fixed order.
13const std::vector<std::string>& defect_kinds();
14
15// Writes `out` (and a JSON manifest of the injected defects to `manifest`, if not empty). Returns the number
16// of defects injected (fewer than `count` when the board offers too few candidates).
17int inject_defects(const std::string& in, const std::string& out, const std::string& manifest, const std::string& kind,
18 std::uint64_t seed, int count);
19
20} // namespace tmk::app
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).
const std::vector< std::string > & defect_kinds()
Defect kinds in a fixed order.