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

Datasheet land-pattern references and the list of brands whose datasheets are trusted (issue #5, docs/05-routing.md §43, D115). More...

#include <string>
#include <vector>
#include "model/board.hpp"

Go to the source code of this file.

Classes

struct  tmk::analysis::RefPad
struct  tmk::analysis::FootprintRef
struct  tmk::analysis::TrustedBrands
 Brands whose datasheets are trusted. More...
struct  tmk::analysis::RefLibrary

Namespaces

namespace  tmk
namespace  tmk::analysis

Functions

RefLibrary tmk::analysis::load_references (const std::string &path, const std::string &trusted_brands_file="")
 path is a directory (every *.json below it, in path order; a trusted_brands.txt beside the references is the trusted list unless one is given) or one JSON file.
TrustedBrands tmk::analysis::load_trusted_brands (const std::string &file)
TrustedBrands tmk::analysis::parse_trusted_brands (const std::string &text, const std::string &source)
std::vector< RefPad > tmk::analysis::pads_from_kicad_mod (const std::string &text)
 The pads of a footprint file (.kicad_mod, or the text of one) in its own frame.
std::string tmk::analysis::normalise_brand (const std::string &brand)
 "Texas Instruments Inc." -> "texas instruments"

Detailed Description

Datasheet land-pattern references and the list of brands whose datasheets are trusted (issue #5, docs/05-routing.md §43, D115).

TraceMaker does not read datasheets: a PDF drawing is not data. A reference is a record somebody made from a datasheet (typed in from its recommended land pattern, or the manufacturer's own KiCad footprint) together with where it came from: the brand, the document, the page. The check (footprint_check.hpp) compares a board's footprints with these records, and only with the ones whose brand is on the trusted list: a record from a source nobody vouched for gives no verdict, it is reported as unverified.

A reference library is a directory (or one file) of JSON: { "format": "tracemaker-footprint-refs/1", "references": [ { "brand": "Example Semiconductor", "part": "EX1234", "package": "SOIC-8", "datasheet": { "document": "EX1234 datasheet", "revision": "C", "page": 21, "figure": "Land pattern", "url": "..." }, "match": { "mpn": ["EX1234*"], "lib_id": ["*SOIC-8*"], "value": ["EX1234"], "ref": ["U*"] }, "pads": [ { "number": "1", "type": "smd", "shape": "rect", "at": [-2.7, -1.905], "size": [1.55, 0.6], "angle": 0 }, ... ] or "footprint": "path/to/RGT0016C.kicad_mod" (relative to the JSON file), "tolerance_mm": { "position": 0.05, "size": 0.05, "drill": 0.05 } } ] } Millimetres, KiCad's y-down footprint frame. Unknown keys are errors (a misspelt tolerance must not be ignored by a verification tool).

Definition in file footprint_ref.hpp.