TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
detect.hpp File Reference

Category detection and role binding (design doc 15 §3): each footprint is scored against every category's detectors (integer weights, confidence = min(100, sum)); a category instance is the anchor footprint plus the parts, pads and nets that play each role. More...

#include <string>
#include <string_view>
#include <vector>
#include <nlohmann/json.hpp>
#include "crules/catalogue.hpp"
#include "crules/overrides.hpp"
#include "crules/topology.hpp"
#include "model/board.hpp"

Go to the source code of this file.

Classes

struct  tmk::crules::Role
struct  tmk::crules::RuleOverride
 What the user override file (doc 15 §6.3) changed for one rule of one instance. More...
struct  tmk::crules::Instance
struct  tmk::crules::Detection

Namespaces

namespace  tmk
namespace  tmk::crules

Functions

const nlohmann::ordered_json & tmk::crules::rule_params (const Instance &in, const RuleSpec &r)
 The parameters of rule r for instance in: the catalogue's, or the user's after set entries (doc 15 §6.3).
Detection tmk::crules::detect (const model::Board &b, const Catalogue &cat, const Overrides *ov=nullptr)
 With ov (the user override file, doc 15 §3.5 level 1): references are checked against the board (throws on unknown ones); deny removes a category from a part (listed as possible, so a competing category can win); assert forces one (confidence 100, wins conflicts; bound by the category's binder, or to the anchor alone when the binder rejects the part); disable and set are attached to the instances: entries for one reference (@REF) take precedence over global ones, and among equals the later entry wins.

Variables

constexpr int tmk::crules::kNoPinNameCap = 60
 Confidence cap when the board carries no pad pin names (KiCad 5 files): doc 15 §3.6.
constexpr int tmk::crules::kPossibleMin = 20
 Instances below this confidence are not even listed as "possible" (they would list every J* and U*).

Detailed Description

Category detection and role binding (design doc 15 §3): each footprint is scored against every category's detectors (integer weights, confidence = min(100, sum)); a category instance is the anchor footprint plus the parts, pads and nets that play each role.

Pure function of the board, the catalogue and the user override file; output in catalogue order, then natural reference order (doc 15 §2.4).

Definition in file detect.hpp.