|
KiCad PCB EDA Suite
|
Namespaces | |
| namespace | DRW_ITEM |
| namespace | DRW_ITEM_V2022 |
| namespace | DRW_TAG |
Classes | |
| struct | ARC |
| Arc as center, radius and angles. More... | |
| struct | ARC_POINT |
| A polyline point that may instead be an arc segment. More... | |
| struct | ARC_VERTEX |
| One board-outline vertex triplet: [i32 X, i32 Y, i32 attr] where attr -1 is a plain corner and attr >= 0 is the arc-parameter ordinal. More... | |
| struct | ATTRIBUTE |
| struct | BIN_NET_CLASS_DEF |
| A PADS net class recovered from the binary design-rule graph. More... | |
| class | BINARY_CURSOR |
| Bounds-checked little-endian read cursor over a PADS binary buffer. More... | |
| class | BINARY_PARSER |
Reader for the PADS PowerPCB binary .pcb format. More... | |
| struct | BOARD_ITEM |
| struct | CLUSTER |
| struct | COPPER_SHAPE |
| Standalone copper area from the LINES section (type=COPPER), not part of a pour. More... | |
| struct | DECAL_ITEM |
| struct | DECAL_PAD |
| struct | DESIGN_RULES |
| struct | DIFF_PAIR_DEF |
| struct | DIMENSION |
| struct | FILE_HEADER |
| struct | GATE_DEF |
| struct | GATE_PIN |
| struct | GRAPHIC_LINE |
| Non-electrical drawing item from the LINES section (type=LINES). More... | |
| struct | JUMPER_DEF |
| struct | JUMPER_MARKER |
| struct | KEEPOUT |
| struct | LAYER_INFO |
| struct | LINE |
| struct | NET |
| struct | NET_CLASS_DEF |
| struct | NET_CLASS_RULE_EDGE |
| One type-66 net-class rule edge: its owner pointer, rule-detail page, full rule pointer (declaration order within a page), layer and file offset. More... | |
| struct | NET_PIN |
| struct | PAD_STACK_LAYER |
| class | PADS_SDB |
The parsed container of a PADS .pcb file: header, the section directory, and the coordinate system. More... | |
| struct | PADSTACK_LAYOUT |
| struct | PARAMETERS |
| class | PARSER |
| struct | PART |
| struct | PART_CLUSTER |
| A PADS part cluster (named group of parts). More... | |
| struct | PART_DECAL |
| struct | PART_TYPE |
| struct | POINT |
| struct | POLYLINE |
| A polyline that may contain arc segments, used for board outlines and graphics. More... | |
| struct | POUR |
| struct | REUSE_BLOCK |
| A reuse block definition containing parts and routes that can be instantiated. More... | |
| struct | REUSE_INSTANCE |
| struct | REUSE_NET |
| struct | ROUTE |
| class | SDB_COORDS |
| The per-axis coordinate origin and the design <-> raw transform. More... | |
| struct | SDB_FOOTER_ERROR |
| Where a footer check failed and what was wrong with it. More... | |
| class | SDB_RECORD |
| A bounds-checked reader positioned at one record inside a buffer. More... | |
| struct | SDB_SECTION |
The PADS PowerPCB .pcb file is a serialized snapshot of PADS' in-memory SDB (System DataBase) object store. More... | |
| struct | SIGPIN |
| struct | TEARDROP |
| struct | TERMINAL |
| struct | TEST_POINT |
| struct | TEXT |
| struct | TRACK |
| struct | VIA |
| struct | VIA_DEF |
Functions | |
| std::optional< SDB_FOOTER_ERROR > | CheckSdbFooter (const std::vector< uint8_t > &aData, size_t aFooterStart, const char *aGuid, size_t aGuidLen) |
Check a PADS SDB footer at aFooterStart: the ASCII GUID followed by an absolute back-pointer to the serialized container-item array. | |
| void | ValidateSdbFooter (const std::vector< uint8_t > &aData, size_t aFooterStart, const char *aGuid, size_t aGuidLen) |
| As CheckSdbFooter, throwing a bare IO_ERROR on failure. | |
| uint8_t | getU8 (const std::vector< uint8_t > &aData, size_t aOffset) |
| Little-endian byte assembly with no bounds checking. | |
| uint16_t | getU16LE (const std::vector< uint8_t > &aData, size_t aOffset) |
| uint32_t | getU32LE (const std::vector< uint8_t > &aData, size_t aOffset) |
| double | getF64LE (const std::vector< uint8_t > &aData, size_t aOffset) |
| float | getF32LE (const std::vector< uint8_t > &aData, size_t aOffset) |
| bool | ReadFileHeader (const wxString &aFileName, std::vector< uint8_t > &aOut, size_t aCount) |
Read at most aCount leading bytes of aFileName into aOut, which is sized to what was actually read. | |
| bool | ReadFileToBuffer (const wxString &aFileName, std::vector< uint8_t > &aOut) |
Read an entire file into aOut. | |
| std::string | readFixedStringRaw (const std::vector< uint8_t > &aData, size_t aOffset, size_t aMaxLen) |
Read a NUL-terminated fixed-width field starting at aOffset, scanning at most aMaxLen bytes, WITHOUT trimming. | |
| std::string | readFixedString (const std::vector< uint8_t > &aData, size_t aOffset, size_t aMaxLen) |
| As readFixedStringRaw, then trim trailing spaces. | |
| bool | HasSdbMagic (const std::vector< uint8_t > &aData, uint8_t aMagic1) |
| Check the PADS SDB container magic, a leading 0x00 followed by a format-specific second byte. | |
| static const PADSTACK_LAYOUT & | padstackLayout (uint16_t aVersion) |
| static void | logParsePhase (const char *aWhat, std::chrono::steady_clock::time_point aStart) |
| Enabled by setting KICAD_PADS_PROFILE. | |
| static void | logResolvedBase (int aSection, const char *aWhat, size_t aResolved, uint32_t aPhysical) |
| Report a structurally derived physical section base for cross-checking the Kaitai grammar. | |
| static bool | viaRecordValid (const BINARY_CURSOR &aCur, size_t aTypeByte) |
| static ARC | deriveArc (const SDB_RECORD &aArcRecord, const ARC_VERTEX &aStart, const ARC_VERTEX &aEnd, double aOriginX, double aOriginY) |
| bool | IsThermalReliefPadRow (const PAD_STACK_LAYER &aLayer) |
| RT and ST rows carry a plane's thermal-relief spoke pattern rather than the pad's own copper. | |
| bool | IsAntiPadRow (const PAD_STACK_LAYER &aLayer) |
| RA and SA rows carry a plane's anti-pad clearance rather than the pad's own copper. | |
| bool | IsCopperPadRow (const PAD_STACK_LAYER &aLayer) |
| True when the row describes pad or via copper. | |
| static std::vector< std::string > | expandShortcutPattern (const std::string &aPattern) |
| Expand a shortcut format string like "PRE{n1-n2}" into individual names. | |
| static std::string | normalizeNetName (const std::string &aNetName) |
Variables | |
| constexpr uint16_t | SDB_RECORD_SENTINEL = 0xFFFE |
| constexpr double | SDB_BASIC_PER_MIL = 38100.0 |
| static const std::map< uint8_t, std::string > | PAD_SHAPE_NAMES |
| static constexpr int | DECAL_NAME_OFFSET = 44 |
| Rotation between the physical section cursor and the logical record base. | |
| static constexpr int | VIA_TYPE = 0x0E |
| static const char | FOOTER_GUID [] = "{2FE18320-6448-11d1-A412-000000000000}" |
| static constexpr size_t | FOOTER_GUID_LEN = 38 |
|
strong |
| Enumerator | |
|---|---|
| ALL | |
| ROUTE | |
| VIA | |
| COPPER | |
| PLACEMENT | |
Definition at line 640 of file pads_parser.h.
|
strong |
| Enumerator | |
|---|---|
| SOLID | |
| DASHED | |
| DOTTED | |
| DASH_DOTTED | |
| DASH_DOUBLE_DOTTED | |
Definition at line 495 of file pads_parser.h.
|
strong |
| Enumerator | |
|---|---|
| PCB | |
| LIB_LINE | Library line items (drafting) |
| LIB_SCH_DECAL | |
| LIB_PCB_DECAL | Library footprints. |
| LIB_PART_TYPE | |
Definition at line 93 of file pads_parser.h.
|
strong |
| Enumerator | |
|---|---|
| UNKNOWN | |
| ROUTING | |
| PLANE | |
| MIXED | |
| UNASSIGNED | |
| SOLDER_MASK | |
| PASTE_MASK | |
| SILK_SCREEN | |
| ASSEMBLY | |
| DOCUMENTATION | |
| DRILL | |
Definition at line 549 of file pads_parser.h.
|
strong |
| Enumerator | |
|---|---|
| UNDEFINED | U. |
| SOURCE | S. |
| BIDIRECTIONAL | B. |
| OPEN_COLLECTOR | C, open collector or or-tieable source. |
| TRISTATE | T. |
| LOAD | L. |
| TERMINATOR | Z. |
| POWER | P. |
| GROUND | G. |
Definition at line 421 of file pads_parser.h.
|
strong |
| Enumerator | |
|---|---|
| SOLID | POUROUT, POLY. |
| HATCHED | HATOUT. |
| VOIDOUT | |
Definition at line 340 of file pads_parser.h.
|
strong |
Named section indices into the PADS binary section directory.
Each enumerator's value IS the directory index, so a section constant reads as its role rather than a bare integer.
Definition at line 46 of file pads_binary_parser.h.
|
strong |
| Enumerator | |
|---|---|
| NONE | |
| PAD | PADTHERM. |
| VIA | VIATHERM. |
Definition at line 347 of file pads_parser.h.
|
strong |
| Enumerator | |
|---|---|
| MILS | |
| METRIC | |
| INCHES | |
Definition at line 33 of file pads_parser.h.
|
strong |
| Enumerator | |
|---|---|
| THROUGH | Spans all copper layers. |
| BLIND | Surface to inner layer. |
| BURIED | Inner layers only. |
| MICROVIA | Single-layer blind, typically HDI. |
Definition at line 308 of file pads_parser.h.
| std::optional< SDB_FOOTER_ERROR > PADS_IO::CheckSdbFooter | ( | const std::vector< uint8_t > & | aData, |
| size_t | aFooterStart, | ||
| const char * | aGuid, | ||
| size_t | aGuidLen ) |
Check a PADS SDB footer at aFooterStart: the ASCII GUID followed by an absolute back-pointer to the serialized container-item array.
Returns the failing offset and reason, or an empty optional when the footer is well formed. The GUID differs per format, so the caller supplies it. Reporting rather than throwing keeps the offset with the check that knows it, so callers need not re-derive which check tripped.
Definition at line 31 of file pads_binary_utils.cpp.
References getU32LE().
Referenced by ValidateSdbFooter(), and PADS_SCH_BINARY::PADS_SCH_SDB::verifyFooter().
|
static |
Definition at line 3175 of file pads_binary_parser.cpp.
References EDA_ANGLE::AsDegrees(), PADS_IO::ARC::cx, DEGREES_T, PADS_IO::SDB_RECORD::I32(), M_PI, EDA_ANGLE::Normalize180(), PADS_IO::ARC_VERTEX::x, and PADS_IO::ARC_VERTEX::y.
Referenced by PADS_IO::BINARY_PARSER::parseBoardOutlineDirect(), and PADS_IO::BINARY_PARSER::parseGraphicLines().
|
static |
Expand a shortcut format string like "PRE{n1-n2}" into individual names.
Format: PREFIX{start-end} expands to PREFIX+start, PREFIX+(start+1), ..., PREFIX+end Example: "C{2-5}" expands to ["C2", "C3", "C4", "C5"]
| aPattern | The pattern string to expand |
Definition at line 63 of file pads_parser.cpp.
References std::abs(), end, PADS_COMMON::ParseInt(), result, and tracePadsIo.
Referenced by PADS_IO::PARSER::parseSectionPARTS().
|
inline |
Definition at line 89 of file pads_binary_utils.h.
References getU32LE().
Referenced by PADS_IO::BINARY_CURSOR::F32At().
|
inline |
Definition at line 75 of file pads_binary_utils.h.
Referenced by PADS_IO::BINARY_CURSOR::F64At().
|
inline |
Definition at line 59 of file pads_binary_utils.h.
Referenced by PADS_IO::BINARY_PARSER::IsBinaryPadsFile(), and PADS_IO::BINARY_CURSOR::U16At().
|
inline |
Definition at line 66 of file pads_binary_utils.h.
Referenced by CheckSdbFooter(), getF32LE(), and PADS_IO::BINARY_CURSOR::U32At().
|
inline |
Little-endian byte assembly with no bounds checking.
Callers that need a bounds-checked policy wrap these.
Definition at line 53 of file pads_binary_utils.h.
Referenced by PADS_IO::BINARY_CURSOR::U8At().
|
inline |
Check the PADS SDB container magic, a leading 0x00 followed by a format-specific second byte.
The version word at +2 is range-checked by the caller because the supported version set differs per format.
Definition at line 192 of file pads_binary_utils.h.
Referenced by PADS_SCH_BINARY::PADS_SCH_SDB::HasFamilyMagic(), PADS_IO::PADS_SDB::HasMagic(), and PADS_IO::BINARY_PARSER::IsBinaryPadsFile().
| bool PADS_IO::IsAntiPadRow | ( | const PAD_STACK_LAYER & | aLayer | ) |
RA and SA rows carry a plane's anti-pad clearance rather than the pad's own copper.
Definition at line 42 of file pads_parser.cpp.
References PADS_IO::PAD_STACK_LAYER::shape.
Referenced by PCB_IO_PADS_BINARY::buildPad(), IsCopperPadRow(), and PCB_IO_PADS::loadFootprints().
| bool PADS_IO::IsCopperPadRow | ( | const PAD_STACK_LAYER & | aLayer | ) |
True when the row describes pad or via copper.
Relief and anti-pad rows share the layer ordinals of the copper rows they qualify, so every consumer of a padstack has to skip them.
Definition at line 48 of file pads_parser.cpp.
References IsAntiPadRow(), and IsThermalReliefPadRow().
Referenced by PCB_IO_PADS_BINARY::buildPad(), PCB_IO_PADS::loadFootprints(), and PCB_IO_PADS_BINARY::loadTracksAndVias().
| bool PADS_IO::IsThermalReliefPadRow | ( | const PAD_STACK_LAYER & | aLayer | ) |
RT and ST rows carry a plane's thermal-relief spoke pattern rather than the pad's own copper.
Definition at line 36 of file pads_parser.cpp.
References PADS_IO::PAD_STACK_LAYER::shape.
Referenced by PCB_IO_PADS_BINARY::buildPad(), IsCopperPadRow(), and PCB_IO_PADS::loadFootprints().
|
static |
Enabled by setting KICAD_PADS_PROFILE.
Definition at line 192 of file pads_binary_parser.cpp.
|
static |
Report a structurally derived physical section base for cross-checking the Kaitai grammar.
Enabled by setting KICAD_PADS_SECBASE.
Definition at line 675 of file pads_binary_parser.cpp.
Referenced by PADS_IO::BINARY_PARSER::decodeViaLocations(), and PADS_IO::BINARY_PARSER::parseNetConnectionsNew().
|
static |
Definition at line 116 of file pads_parser.cpp.
Referenced by PADS_IO::PARSER::parseSectionLINES(), and PADS_IO::PARSER::parseSectionPOUR().
|
static |
Definition at line 72 of file pads_binary_parser.cpp.
Referenced by PADS_IO::BINARY_PARSER::parsePadStacks().
|
inline |
Read at most aCount leading bytes of aFileName into aOut, which is sized to what was actually read.
Returns false on open error. Format probes use this so recognizing a file does not cost a full read of it.
Definition at line 104 of file pads_binary_utils.h.
Referenced by PADS_IO::BINARY_PARSER::IsBinaryPadsFile(), and SCH_IO_PADS::isBinarySchematicFile().
|
inline |
Read an entire file into aOut.
Returns false on open error or short read.
Definition at line 122 of file pads_binary_utils.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PADS_IO::BINARY_PARSER::Parse(), and PADS_SCH_BINARY::PADS_SCH_BINARY_READER::ReadFile().
|
inline |
As readFixedStringRaw, then trim trailing spaces.
Definition at line 174 of file pads_binary_utils.h.
References readFixedStringRaw().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and PADS_IO::BINARY_CURSOR::StringAt().
|
inline |
Read a NUL-terminated fixed-width field starting at aOffset, scanning at most aMaxLen bytes, WITHOUT trimming.
Returns an empty string when the field contains a control byte. High bytes are kept because PADS names use a legacy 8-bit code page; decode them with PADS_COMMON::ConvertText. Use this where the field is compared byte-for-byte; use readFixedString to trim.
Definition at line 149 of file pads_binary_utils.h.
Referenced by readFixedString().
| void PADS_IO::ValidateSdbFooter | ( | const std::vector< uint8_t > & | aData, |
| size_t | aFooterStart, | ||
| const char * | aGuid, | ||
| size_t | aGuidLen ) |
As CheckSdbFooter, throwing a bare IO_ERROR on failure.
For callers that do not annotate their diagnostics with a file offset.
Definition at line 54 of file pads_binary_utils.cpp.
References CheckSdbFooter(), and THROW_IO_ERROR.
Referenced by BOOST_AUTO_TEST_CASE(), and PADS_IO::PADS_SDB::verifyFooter().
|
static |
Definition at line 2092 of file pads_binary_parser.cpp.
References PADS_IO::BINARY_CURSOR::U8At().
Referenced by PADS_IO::BINARY_PARSER::decodeViaLocations().
|
staticconstexpr |
Rotation between the physical section cursor and the logical record base.
Definition at line 671 of file pads_binary_parser.cpp.
Referenced by PADS_IO::BINARY_PARSER::parsePartTypeTable().
|
static |
Definition at line 33 of file pads_sdb.cpp.
Referenced by PADS_IO::PADS_SDB::verifyFooter().
|
staticconstexpr |
Definition at line 34 of file pads_sdb.cpp.
Referenced by PADS_IO::PADS_SDB::verifyFooter().
|
static |
Definition at line 48 of file pads_binary_parser.cpp.
Referenced by PADS_IO::BINARY_PARSER::parsePadStacks().
|
constexpr |
Definition at line 47 of file pads_binary_utils.h.
Referenced by PCB_IO_PADS_BINARY::buildPad(), and PADS_IO::BINARY_PARSER::parsePadStacks().
|
constexpr |
Definition at line 44 of file pads_binary_utils.h.
Referenced by PADS_IO::BINARY_PARSER::parseDecalNameTable(), and PADS_IO::BINARY_PARSER::parseDecalNameTableOld().
|
staticconstexpr |
Definition at line 2089 of file pads_binary_parser.cpp.