|
KiCad PCB EDA Suite
|
Parser for DipTrace binary .dip board files. More...
#include <diptrace/diptrace_pcb_parser.h>#include <board.h>#include <board_design_settings.h>#include <board_stackup_manager/board_stackup.h>#include <netclass.h>#include <footprint.h>#include <pad.h>#include <pcb_shape.h>#include <pcb_text.h>#include <pcb_track.h>#include <zone.h>#include <netinfo.h>#include <ki_exception.h>#include <layer_ids.h>#include <base_units.h>#include <string_utils.h>#include <project/net_settings.h>#include <stroke_params.h>#include <wx/log.h>#include <trace_helpers.h>#include <array>#include <algorithm>#include <cctype>#include <cstdlib>#include <cstring>#include <map>#include <set>#include <tuple>#include <unordered_set>Go to the source code of this file.
Functions | |
| static uint32_t | ReadColorPacked (BINARY_READER &aReader) |
| Read a 3-byte RGB color from the reader and return it packed as 0x00RRGGBB. | |
| static int | ReadInt3At (const uint8_t *aData, size_t aPos) |
| Decode a 3-byte big-endian biased integer from raw data at a given offset. | |
| static int | ReadInt4At (const uint8_t *aData, size_t aPos) |
| Decode a 4-byte big-endian biased integer from raw data at a given offset. | |
| static bool | FindComponentRotation (const uint8_t *aData, size_t aDataSize, size_t aBoundaryOffset, int &aQuarterTurns) |
| Recover a placed component's rotation, expressed in 90-degree quarter turns. | |
| static bool | EnvFlagEnabled (const char *aVarName) |
| static bool | ShouldDumpPadPostBlock (const wxString &aRefdes) |
| static bool | ShouldDumpPadGap (const wxString &aRefdes) |
| static bool | ShouldDumpComponentHeader (const wxString &aRefdes) |
| static bool | ShouldDumpFootprintOrientation (const wxString &aRefdes) |
| static bool | ShouldDumpNets () |
| static bool | ShouldDumpZones () |
| static void | DumpComponentHeader (const DT_COMPONENT &aComp, int aFieldA, int aFieldB, int aFieldC, int aFieldD, int aFieldE, int aFieldF, uint8_t aSep1, uint8_t aSep2, uint8_t aSep3) |
| static int32_t | ReadRawLE32 (const uint8_t *aData, size_t aPos) |
| static float | ReadRawLEFloat32 (const uint8_t *aData, size_t aPos) |
| static wxString | BytesToHex (const uint8_t *aData, size_t aLen) |
| static void | DumpComponentRawFields (const DT_COMPONENT &aComp, const uint8_t *aData, size_t aPosXPos, size_t aPosYPos, size_t aRotPos, size_t aFieldCPos, size_t aFieldDPos) |
| static bool | IsAngleLikeCode (int aValue) |
| static void | DumpComponentBinaryScan (const DT_COMPONENT &aComp, const uint8_t *aData, size_t aDataSize) |
| static void | DumpPadPostBlock (const DT_COMPONENT &aComp, const DT_PAD &aPad, const uint8_t *aData, size_t aPostDimPos, size_t aPostDimSize) |
| static void | DumpPadGap (const DT_COMPONENT &aComp, const uint8_t *aData, size_t aGapStart, size_t aGapEnd) |
| static void | DumpComponentTail (const DT_COMPONENT &aComp, const uint8_t *aData, size_t aTailStart, int aVisibility, uint8_t aSideFlag1, uint8_t aSideFlag2, int aOrderIdx, int aRefdesYOffset, int aValueYOffset, uint8_t aHasOffset, uint8_t aTailTerm) |
| static void | DumpRulesetBlock (int aRuleSetIndex, const wxString &aRuleSetName, int aBlockIndex, const std::array< int, 26 > &aValues) |
| static void | DumpZoneHeader (int aZoneIndex, size_t aHeaderPos, const uint8_t *aData, int aFieldA, int aFlags1, int aFlags2, int aFlags3, int aMinWidth, int aClearance, int aMinimumArea, int aSeparator, int aLayer, int aFieldB, int aVtxCount, const wxString &aNetName) |
| static void | DumpZoneGap (int aZoneIndex, size_t aGapStart, size_t aGapEnd, const uint8_t *aData) |
| static void | DumpZoneTail (int aZoneIndex, size_t aTailStart, size_t aSearchEnd, const uint8_t *aData) |
| static size_t | StringFieldSize (const uint8_t *aData, size_t aDataSize, size_t aPos, int aVersion) |
| Compute the total byte length of a DipTrace string field at a given offset without allocating a wxString. | |
| static bool | decodeMountHoleBlockAt (const uint8_t *aData, size_t aBlockStart, size_t aSearchEnd, std::vector< DT_MOUNT_HOLE > &aHoles) |
Variables | |
| static const uint8_t | BOUNDARY_STD [] |
| Component boundary pattern: int3(0) int3(-1) int3(-1) int4(0) | |
| static const uint8_t | BOUNDARY_ALT [] |
| Alternate boundary pattern: int3(0) int3(0) int3(0) int4(0) – v41 nameplate files. | |
| static constexpr size_t | BOUNDARY_CORE_LEN = 13 |
| static const uint8_t | BOARD_SETTINGS_FONT_MARKER [] |
| Board settings font marker: int3(4), int3(4), int3(0) | |
| static const uint8_t | TEXT_SECTION_ZEROS [] |
| Text section zeros: 3x int3(0) | |
| static const uint8_t | NET_SENTINEL [] |
| Net record sentinel: int3(0) int3(-1) int3(-1) This 9-byte pattern appears immediately before each net record's index field. | |
| static constexpr size_t | NET_SENTINEL_LEN = 9 |
| static const uint8_t | CHAIN_HEADER [] |
| Track chain header pattern: 3 zero bytes + int3(-1) | |
| static constexpr size_t | CHAIN_HEADER_LEN = 6 |
| static constexpr size_t | TRACK_NODE_SIZE = 41 |
| Track node record size in bytes. | |
| static constexpr int | ZONE_FONT_PREAMBLE_TAIL = -20000 |
| Zone section preamble constant: int4(-20000), the last field of the font block. | |
| static constexpr size_t | NOT_FOUND = std::string::npos |
| Sentinel for "not found" in pattern searches. | |
| static constexpr int | FONT_BLOCK_SHAPE_VERSION = 46 |
| First version that stores per-component shape data in font (Tahoma) blocks rather than contiguous fixed-size shape records. | |
| static const uint8_t | TAHOMA_FONT_PATTERN [] |
| UTF-16BE pattern for the string "Tahoma" as stored in v46+ component font blocks. | |
| static constexpr size_t | TAHOMA_FONT_PATTERN_LEN = 14 |
| static constexpr size_t | FONT_BLOCK_HEADER_SIZE = 25 |
| Size of the fixed metadata header following the font string in each font block. | |
| static constexpr size_t | FONT_PREAMBLE_LABEL_OFFSET = 163 |
| v46+ font-shape preamble (between the pad region end and the first font block). | |
| static constexpr size_t | FONT_PREAMBLE_FIXED_SIZE = 165 |
| static constexpr size_t | FONT_BLOCK_FIXED_SIZE = 72 |
| Fixed framing of each v46+ font-shape block, excluding its variable parts: Tahoma(14) + meta(25) + int3 shapeType(3) + trailer(28) + uint16 label count(2) = 72 bytes; the variable parts are 8 bytes per coordinate point and 2 bytes per trailing label char. | |
| static constexpr size_t | FONT_BLOCK_TRAILER_SIZE = 28 |
| static constexpr size_t | COMPONENT_TAIL_SIZE = 37 |
| Size of the fixed-layout component tail found at the end of every component region. | |
| static const uint8_t | COMPONENT_TAIL_PATTERN [] |
| The component tail starts with int3(0) + int4(0) + int4(0) = 11 constant bytes. | |
| static constexpr size_t | COMPONENT_TAIL_PATTERN_LEN = 11 |
| static constexpr size_t | PAD_PRE_HEADER_SIZE = 14 |
| Pad record layout constants. | |
| static constexpr size_t | PAD_DIMENSIONS_SIZE = 16 |
| static constexpr size_t | PAD_HEADER_PREAMBLE_UTF16 = 74 |
| Fixed byte preamble between the component header strings and the first pad record. | |
| static constexpr size_t | PAD_HEADER_PREAMBLE_ASCII = 76 |
| static constexpr size_t | PAD_POST_DIM_FIXED_SIZE = 36 |
| static constexpr size_t | PAD_POST_DIM_HEADER = 11 |
| static constexpr size_t | PAD_POST_DIM_TAIL = 25 |
| static constexpr size_t | PAD_POLYGON_VERTEX_SIZE = 8 |
| static constexpr int | PAD_MAX_NET_INDEX = 10000 |
| Upper bound for a plausible pad net index, used as a chain-walk desync guard. | |
| static constexpr int | FP_SHAPE_COUNT_OFFSET = 71 |
| Shape count (int3) is at this offset past the end of the pad region. | |
| static constexpr int | FP_SHAPE_DATA_OFFSET = 74 |
| Shape record data starts at this offset past the end of the pad region. | |
| static constexpr int | FP_SHAPE_RECORD_SIZE_V37 = 62 |
| Record size for v37 (legacy) format. | |
| static constexpr int | FP_SHAPE_RECORD_SIZE_V45 = 60 |
| Record size for v45+ format. | |
| static constexpr int | FP_CHAIN_SHAPE_COUNT_OFFSET = 69 |
| v46+ chained-shape block layout used by some footprints (e.g. TO-92 in PCB_6). | |
| static constexpr int | FP_CHAIN_SHAPE_DATA_OFFSET = 72 |
| static constexpr int | FP_CHAIN_SHAPE_RECORD_SIZE = 76 |
| static constexpr int | FP_CHAIN_SHAPE_WIDTH_OFFSET = 37 |
| static constexpr int | FP_CHAIN_SHAPE_TYPE_OFFSET = 41 |
| static constexpr int | FP_CHAIN_SHAPE_X1_OFFSET = 44 |
| static constexpr int | FP_CHAIN_SHAPE_Y1_OFFSET = 48 |
| static constexpr int | FP_CHAIN_SHAPE_X2_OFFSET = 52 |
| static constexpr int | FP_CHAIN_SHAPE_Y2_OFFSET = 56 |
| static constexpr int | FP_CHAIN_SHAPE_X3_OFFSET = 60 |
| static constexpr int | FP_CHAIN_SHAPE_Y3_OFFSET = 64 |
| static constexpr int | FP_CHAIN_TYPE_LINE = 2 |
| static constexpr int | FP_CHAIN_TYPE_ARC = 3 |
| static constexpr int | FP_CHAIN_MOUNT_HOLE_OFFSET = 44 |
| static constexpr int | FP_SHAPE_NORM_RANGE = 10000 |
| Normalized coordinate range used by DipTrace shape records. | |
| static constexpr int | FP_SHAPE_DEFAULT_WIDTH = -10000 |
| Sentinel value for "use default line width" in shape width field. | |
| static constexpr int | DT_FP_LAYER_TOP_SILK = 0 |
| DipTrace footprint-graphic layer enum (int3 stored 5 bytes ahead of each shape's font block). | |
| static constexpr int | DT_FP_LAYER_TOP_ASSY = 1 |
| static constexpr int | DT_FP_LAYER_TOP_MASK = 2 |
| static constexpr int | DT_FP_LAYER_TOP_PASTE = 3 |
| static constexpr int | DT_FP_LAYER_TOP_KEEPOUT = 9 |
| static constexpr int | DT_FP_LAYER_TOP_COURTYARD = 16 |
| static constexpr int | DT_FP_LAYER_TOP_OUTLINE = 18 |
| static constexpr size_t | MOUNT_HOLE_HEADER_SIZE = 20 |
| Hole block header: int3(hole_count + 2) + byte(flag) + 4 * int4(0) | |
| static constexpr size_t | MOUNT_HOLE_RECORD_SIZE = 18 |
| Per-hole record: byte + byte + int4(x) + int4(y) + int4(outer_diam) + int4(drill_diam) | |
| static constexpr size_t | MOUNT_HOLE_TERM_SIZE = 2 |
| Hole block terminator bytes: 0x00 0x00. | |
| static constexpr size_t | MOUNT_HOLE_TRAILER_SIZE = 16 |
| Zero trailer following the hole block in observed v54 files. | |
Parser for DipTrace binary .dip board files.
Translates the DipTrace binary format into KiCad BOARD objects. Based on reverse-engineered format specification. Tested against DipTrace format versions 37, 39, 41, 45, 46, 49, 54, 58, and 60.
Definition in file diptrace_pcb_parser.cpp.
|
static |
Definition at line 472 of file diptrace_pcb_parser.cpp.
Referenced by DumpComponentBinaryScan(), DumpComponentRawFields(), DumpComponentTail(), DumpPadGap(), DumpPadPostBlock(), DumpZoneGap(), DumpZoneHeader(), DumpZoneTail(), and DIPTRACE::PCB_PARSER::ParseComponentTail().
|
static |
Definition at line 2481 of file diptrace_pcb_parser.cpp.
References std::abs(), DIPTRACE::DT_MOUNT_HOLE::drillDiameter, MOUNT_HOLE_HEADER_SIZE, MOUNT_HOLE_RECORD_SIZE, MOUNT_HOLE_TERM_SIZE, MOUNT_HOLE_TRAILER_SIZE, DIPTRACE::DT_MOUNT_HOLE::outerDiameter, ReadInt3At(), ReadInt4At(), DIPTRACE::DT_MOUNT_HOLE::x, and DIPTRACE::DT_MOUNT_HOLE::y.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion().
|
static |
Definition at line 507 of file diptrace_pcb_parser.cpp.
References DIPTRACE::DT_COMPONENT::boundaryOffset, BytesToHex(), EnvFlagEnabled(), DIPTRACE::DT_COMPONENT::headerEndOffset, IsAngleLikeCode(), DIPTRACE::DT_COMPONENT::patternName, ReadInt3At(), ReadInt4At(), ReadRawLE32(), DIPTRACE::DT_COMPONENT::refdes, DIPTRACE::DT_COMPONENT::regionEndOffset, ShouldDumpComponentHeader(), DIPTRACE::DT_COMPONENT::stringStartOffset, and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseComponents().
|
static |
Definition at line 395 of file diptrace_pcb_parser.cpp.
References DIPTRACE::DT_COMPONENT::bboxHeight, DIPTRACE::DT_COMPONENT::bboxWidth, DIPTRACE::DT_COMPONENT::boundaryOffset, DIPTRACE::DT_COMPONENT::flags, DIPTRACE::DT_COMPONENT::hasPlacementQuarterTurns, DIPTRACE::DT_COMPONENT::headerEndOffset, DIPTRACE::DT_COMPONENT::layer, DIPTRACE::DT_COMPONENT::libraryPath, DIPTRACE::DT_COMPONENT::patternName, DIPTRACE::DT_COMPONENT::placementQuarterTurns, DIPTRACE::DT_COMPONENT::positionX, DIPTRACE::DT_COMPONENT::positionY, DIPTRACE::DT_COMPONENT::refdes, DIPTRACE::DT_COMPONENT::regionEndOffset, DIPTRACE::DT_COMPONENT::rotation, ShouldDumpComponentHeader(), DIPTRACE::DT_COMPONENT::stringStartOffset, traceDiptraceIo, and DIPTRACE::DT_COMPONENT::value.
Referenced by DIPTRACE::PCB_PARSER::ParseSingleComponent().
|
static |
Definition at line 446 of file diptrace_pcb_parser.cpp.
References BytesToHex(), ReadInt4At(), ReadRawLE32(), ReadRawLEFloat32(), DIPTRACE::DT_COMPONENT::refdes, ShouldDumpComponentHeader(), and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::ParseSingleComponent().
|
static |
Definition at line 637 of file diptrace_pcb_parser.cpp.
References BytesToHex(), COMPONENT_TAIL_SIZE, DIPTRACE::DT_COMPONENT::refdes, ShouldDumpComponentHeader(), and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::ParseComponentTail().
|
static |
Definition at line 588 of file diptrace_pcb_parser.cpp.
References BytesToHex(), ReadInt3At(), ReadInt4At(), DIPTRACE::DT_COMPONENT::refdes, ShouldDumpPadGap(), and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
static |
Definition at line 560 of file diptrace_pcb_parser.cpp.
References BytesToHex(), DIPTRACE::DT_PAD::drillHeight, DIPTRACE::DT_PAD::drillWidth, DIPTRACE::DT_PAD::height, DIPTRACE::DT_PAD::index, DIPTRACE::DT_PAD::label, DIPTRACE::DT_PAD::mountType, DIPTRACE::DT_PAD::netIndex, DIPTRACE::DT_PAD::number, DIPTRACE::DT_PAD::orientClass, ReadInt3At(), ReadInt4At(), DIPTRACE::DT_COMPONENT::refdes, ShouldDumpPadPostBlock(), traceDiptraceIo, DIPTRACE::DT_PAD::width, DIPTRACE::DT_PAD::x, and DIPTRACE::DT_PAD::y.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
static |
Definition at line 657 of file diptrace_pcb_parser.cpp.
References EnvFlagEnabled(), and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::ParseDesignRules().
|
static |
Definition at line 697 of file diptrace_pcb_parser.cpp.
References BytesToHex(), ReadInt3At(), ReadInt4At(), ShouldDumpZones(), and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseZones().
|
static |
Definition at line 678 of file diptrace_pcb_parser.cpp.
References BytesToHex(), ShouldDumpZones(), and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseZones().
|
static |
Definition at line 737 of file diptrace_pcb_parser.cpp.
References BytesToHex(), ReadInt3At(), ReadInt4At(), ShouldDumpZones(), and traceDiptraceIo.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseZones().
|
static |
Definition at line 288 of file diptrace_pcb_parser.cpp.
Referenced by DumpComponentBinaryScan(), DumpRulesetBlock(), DIPTRACE::PCB_PARSER::ParseDesignRules(), ShouldDumpComponentHeader(), ShouldDumpFootprintOrientation(), ShouldDumpNets(), ShouldDumpPadGap(), ShouldDumpPadPostBlock(), and ShouldDumpZones().
|
static |
Recover a placed component's rotation, expressed in 90-degree quarter turns.
DipTrace does not store the rotation inside the component geometry record; pads and footprint shapes are serialized in their canonical (unrotated) frame. The placement angle lives in a small per-component metadata block that precedes the boundary core by a variable distance. The block is anchored by the component Id (a biased int3), recognised here by its structural neighbourhood: a 28-byte zero run (int3(0) x4 followed by int4(0) x4) sits 7 bytes after the Id, and an int3(-1) sentinel sits 3 bytes before it. The rotation quarter-turn count is the biased int3 stored 6 bytes before the Id. The count is cumulative and may exceed three full turns; callers reduce it modulo four.
Definition at line 247 of file diptrace_pcb_parser.cpp.
References ReadInt3At().
Referenced by DIPTRACE::PCB_PARSER::ParseSingleComponent().
|
static |
Definition at line 489 of file diptrace_pcb_parser.cpp.
References std::abs().
Referenced by DumpComponentBinaryScan().
|
static |
Read a 3-byte RGB color from the reader and return it packed as 0x00RRGGBB.
Definition at line 198 of file diptrace_pcb_parser.cpp.
References DIPTRACE::BINARY_READER::ReadColor().
Referenced by DIPTRACE::PCB_PARSER::FindAndParseTextObjects(), DIPTRACE::PCB_PARSER::ParseLayers(), and DIPTRACE::PCB_PARSER::ParseTextRecords().
|
static |
Decode a 3-byte big-endian biased integer from raw data at a given offset.
Definition at line 211 of file diptrace_pcb_parser.cpp.
References DIPTRACE::INT3_BIAS.
Referenced by decodeMountHoleBlockAt(), DumpComponentBinaryScan(), DumpPadGap(), DumpPadPostBlock(), DumpZoneGap(), DumpZoneTail(), DIPTRACE::PCB_PARSER::FieldWalkComponentBoundaries(), DIPTRACE::PCB_PARSER::FindAndParseNets(), DIPTRACE::PCB_PARSER::FindAndParseZones(), FindComponentRotation(), DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), DIPTRACE::PCB_PARSER::FindPadsInRegion(), DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks(), DIPTRACE::PCB_PARSER::FindShapesInFontBlocks(), DIPTRACE::PCB_PARSER::FindShapesInRegion(), DIPTRACE::PCB_PARSER::ParseNetRouting(), and StringFieldSize().
|
static |
Decode a 4-byte big-endian biased integer from raw data at a given offset.
Definition at line 222 of file diptrace_pcb_parser.cpp.
References DIPTRACE::INT4_BIAS.
Referenced by DIPTRACE::PCB_PARSER::ApplyPlacementAngles(), decodeMountHoleBlockAt(), DumpComponentBinaryScan(), DumpComponentRawFields(), DumpPadGap(), DumpPadPostBlock(), DumpZoneGap(), DumpZoneTail(), DIPTRACE::PCB_PARSER::FindAndParseZones(), DIPTRACE::PCB_PARSER::FindPadsInRegion(), DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks(), DIPTRACE::PCB_PARSER::FindShapesInFontBlocks(), DIPTRACE::PCB_PARSER::FindShapesInRegion(), and DIPTRACE::PCB_PARSER::ParseNetRouting().
|
static |
Definition at line 421 of file diptrace_pcb_parser.cpp.
Referenced by DumpComponentBinaryScan(), and DumpComponentRawFields().
|
static |
Definition at line 431 of file diptrace_pcb_parser.cpp.
Referenced by DumpComponentRawFields().
|
static |
Definition at line 340 of file diptrace_pcb_parser.cpp.
References EnvFlagEnabled(), and filter.
Referenced by DumpComponentBinaryScan(), DumpComponentHeader(), DumpComponentRawFields(), DumpComponentTail(), DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::ParseComponentTail().
|
static |
Definition at line 362 of file diptrace_pcb_parser.cpp.
References EnvFlagEnabled(), and filter.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
static |
Definition at line 383 of file diptrace_pcb_parser.cpp.
References EnvFlagEnabled().
Referenced by DIPTRACE::PCB_PARSER::FindAndParseNets().
|
static |
Definition at line 318 of file diptrace_pcb_parser.cpp.
References EnvFlagEnabled(), and filter.
Referenced by DumpPadGap().
|
static |
Definition at line 296 of file diptrace_pcb_parser.cpp.
References EnvFlagEnabled(), and filter.
Referenced by DumpPadPostBlock().
|
static |
Definition at line 389 of file diptrace_pcb_parser.cpp.
References EnvFlagEnabled().
Referenced by DumpZoneGap(), DumpZoneHeader(), DumpZoneTail(), and DIPTRACE::PCB_PARSER::FindAndParseZones().
|
static |
Compute the total byte length of a DipTrace string field at a given offset without allocating a wxString.
Returns 0 if the field cannot be read.
Definition at line 781 of file diptrace_pcb_parser.cpp.
References DIPTRACE::LEGACY_STRING_VERSION, DIPTRACE::MAX_STRING_CHARS, and ReadInt3At().
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
static |
Board settings font marker: int3(4), int3(4), int3(0)
Definition at line 91 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseComponents().
|
static |
Alternate boundary pattern: int3(0) int3(0) int3(0) int4(0) – v41 nameplate files.
Definition at line 81 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FieldWalkComponentBoundaries(), and DIPTRACE::PCB_PARSER::FindAndParseComponents().
|
staticconstexpr |
Definition at line 88 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FieldWalkComponentBoundaries(), and DIPTRACE::PCB_PARSER::FindAndParseComponents().
|
static |
Component boundary pattern: int3(0) int3(-1) int3(-1) int4(0)
Definition at line 73 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FieldWalkComponentBoundaries(), and DIPTRACE::PCB_PARSER::FindAndParseComponents().
|
static |
Track chain header pattern: 3 zero bytes + int3(-1)
Definition at line 115 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::ParseNetRouting().
|
staticconstexpr |
Definition at line 120 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::ParseNetRouting().
|
static |
The component tail starts with int3(0) + int4(0) + int4(0) = 11 constant bytes.
Definition at line 167 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::ParseComponentTail().
|
staticconstexpr |
Definition at line 173 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::ParseComponentTail().
|
staticconstexpr |
Size of the fixed-layout component tail found at the end of every component region.
Contains text positioning data (refdes/value Y offsets and visibility flags).
Definition at line 164 of file diptrace_pcb_parser.cpp.
Referenced by DumpComponentTail(), DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::ParseComponentTail().
|
staticconstexpr |
Definition at line 2456 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
Definition at line 2460 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
Definition at line 2459 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
Definition at line 2457 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
Definition at line 2461 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
Definition at line 2458 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
DipTrace footprint-graphic layer enum (int3 stored 5 bytes ahead of each shape's font block).
Definition at line 2455 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
Fixed framing of each v46+ font-shape block, excluding its variable parts: Tahoma(14) + meta(25) + int3 shapeType(3) + trailer(28) + uint16 label count(2) = 72 bytes; the variable parts are 8 bytes per coordinate point and 2 bytes per trailing label char.
Definition at line 159 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInFontBlocks().
|
staticconstexpr |
Size of the fixed metadata header following the font string in each font block.
Layout: flag(1) + fontSize(int3) + fontH(int4) + fontW(int4)
Definition at line 148 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInFontBlocks().
|
staticconstexpr |
First version that stores per-component shape data in font (Tahoma) blocks rather than contiguous fixed-size shape records.
Definition at line 133 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInRegion().
|
staticconstexpr |
Definition at line 160 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInFontBlocks().
|
staticconstexpr |
Definition at line 154 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInFontBlocks().
|
staticconstexpr |
v46+ font-shape preamble (between the pad region end and the first font block).
The first 163 bytes are fixed; a trailing uint16-counted UTF-16 group label follows, so the first block sits at padRegionEnd + 165 + 2 * (label char count read at padRegionEnd + 163).
Definition at line 153 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInFontBlocks().
|
staticconstexpr |
Definition at line 2446 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion().
|
staticconstexpr |
v46+ chained-shape block layout used by some footprints (e.g. TO-92 in PCB_6).
Definition at line 2433 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2434 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2435 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2437 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2436 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2438 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2440 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2442 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2439 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2441 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2443 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2445 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Definition at line 2444 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks().
|
staticconstexpr |
Shape count (int3) is at this offset past the end of the pad region.
Definition at line 2421 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInRegion().
|
staticconstexpr |
Shape record data starts at this offset past the end of the pad region.
Definition at line 2424 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInRegion().
|
staticconstexpr |
Sentinel value for "use default line width" in shape width field.
Definition at line 2452 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint().
|
staticconstexpr |
Normalized coordinate range used by DipTrace shape records.
Definition at line 2449 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::CreateFootprint(), DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks(), and DIPTRACE::PCB_PARSER::FindShapesInFontBlocks().
|
staticconstexpr |
Record size for v37 (legacy) format.
Definition at line 2427 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInRegion().
|
staticconstexpr |
Record size for v45+ format.
Definition at line 2430 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), and DIPTRACE::PCB_PARSER::FindShapesInRegion().
|
staticconstexpr |
Hole block header: int3(hole_count + 2) + byte(flag) + 4 * int4(0)
Definition at line 2469 of file diptrace_pcb_parser.cpp.
Referenced by decodeMountHoleBlockAt().
|
staticconstexpr |
Per-hole record: byte + byte + int4(x) + int4(y) + int4(outer_diam) + int4(drill_diam)
Definition at line 2472 of file diptrace_pcb_parser.cpp.
Referenced by decodeMountHoleBlockAt().
|
staticconstexpr |
Hole block terminator bytes: 0x00 0x00.
Definition at line 2475 of file diptrace_pcb_parser.cpp.
Referenced by decodeMountHoleBlockAt().
|
staticconstexpr |
Zero trailer following the hole block in observed v54 files.
Definition at line 2478 of file diptrace_pcb_parser.cpp.
Referenced by decodeMountHoleBlockAt().
|
static |
Net record sentinel: int3(0) int3(-1) int3(-1) This 9-byte pattern appears immediately before each net record's index field.
Definition at line 106 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseNets(), and DIPTRACE::PCB_PARSER::ParseNetRouting().
|
staticconstexpr |
Definition at line 112 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseNets(), and DIPTRACE::PCB_PARSER::ParseNetRouting().
|
staticconstexpr |
Sentinel for "not found" in pattern searches.
Definition at line 129 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseComponents(), DIPTRACE::PCB_PARSER::FindAndParseTextObjects(), DIPTRACE::PCB_PARSER::FindAndParseZones(), and DIPTRACE::PCB_PARSER::ParsePostComponentSections().
|
staticconstexpr |
Definition at line 177 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Definition at line 182 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Fixed byte preamble between the component header strings and the first pad record.
Verified constant across the corpus per string-format family.
Definition at line 181 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Upper bound for a plausible pad net index, used as a chain-walk desync guard.
DipTrace net indices run 0..netCount-1 (or -1 for unconnected); nets are parsed after components, so this must comfortably exceed the largest board's net count (the reference board has 568) without admitting the multi-million garbage a desynced read would produce.
Definition at line 192 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Definition at line 186 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Definition at line 183 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Definition at line 184 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Definition at line 185 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
staticconstexpr |
Pad record layout constants.
Definition at line 176 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindPadsInRegion().
|
static |
UTF-16BE pattern for the string "Tahoma" as stored in v46+ component font blocks.
Format: uint16(6) + 6 UTF-16BE code units = 14 bytes total.
Definition at line 137 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInFontBlocks(), and DIPTRACE::SCH_PARSER::isFontBearingShapeStart().
|
staticconstexpr |
Definition at line 143 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindShapesInFontBlocks().
|
static |
Text section zeros: 3x int3(0)
Definition at line 98 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseTextObjects().
|
staticconstexpr |
Track node record size in bytes.
Definition at line 123 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::ParseNetRouting().
|
staticconstexpr |
Zone section preamble constant: int4(-20000), the last field of the font block.
Definition at line 126 of file diptrace_pcb_parser.cpp.
Referenced by DIPTRACE::PCB_PARSER::FindAndParseZones().