|
KiCad PCB EDA Suite
|
#include <sch_io/diptrace/diptrace_sch_parser.h>#include <algorithm>#include <cctype>#include <cmath>#include <cstdlib>#include <cstring>#include <deque>#include <limits>#include <memory>#include <optional>#include <set>#include <wx/filename.h>#include <wx/log.h>#include <base_units.h>#include <lib_id.h>#include <lib_symbol.h>#include <page_info.h>#include <progress_reporter.h>#include <project.h>#include <reporter.h>#include <sch_bus_entry.h>#include <sch_junction.h>#include <sch_label.h>#include <sch_line.h>#include <sch_pin.h>#include <sch_screen.h>#include <sch_shape.h>#include <sch_sheet.h>#include <sch_sheet_path.h>#include <sch_symbol.h>#include <schematic.h>#include <string_utils.h>#include <wildcards_and_files_ext.h>Go to the source code of this file.
Functions | |
| 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 | libSymbolHasUnit (const LIB_SYMBOL *aLibSymbol, int aUnit) |
| static int | dipTraceMm (double aMm) |
| static VECTOR2I | dipTraceShapePoint (double aXmm, double aYmm) |
| static DCH_SHAPE | makeDipTraceShape (int aKindCode, double aLineWidthMm, std::initializer_list< VECTOR2I > aPoints) |
| static bool | needsStandardThtLedShape (const DCH_COMPONENT &aComp) |
| static std::vector< DCH_SHAPE > | standardThtLedShapes () |
| static bool | isPlausibleNetName (const uint8_t *aData, size_t aPos, size_t aSectionEnd) |
| static KIGFX::COLOR4D | dipTraceSheetShapeColor (const DCH_SHEET_SHAPE &aShape) |
Variables | |
| static constexpr int | V31_CUTOVER = 34 |
| Structural layout version threshold for the .dch schematic format. | |
| static constexpr int | SCHEMATIC_UTF16_STRING_VERSION = V31_CUTOVER |
|
static |
Definition at line 2539 of file diptrace_sch_parser.cpp.
Referenced by dipTraceShapePoint(), and makeDipTraceShape().
|
static |
Definition at line 2545 of file diptrace_sch_parser.cpp.
References dipTraceMm().
Referenced by standardThtLedShapes().
|
static |
Definition at line 3999 of file diptrace_sch_parser.cpp.
References DIPTRACE::DCH_SHEET_SHAPE::color.
Referenced by DIPTRACE::SCH_PARSER::createSheetShapes().
|
static |
Definition at line 3556 of file diptrace_sch_parser.cpp.
References end, flag, DIPTRACE::INT3_BIAS, DIPTRACE::INT4_BIAS, and pad.
Referenced by DIPTRACE::SCH_PARSER::parseWireSection().
|
static |
Definition at line 2527 of file diptrace_sch_parser.cpp.
References LIB_SYMBOL::GetDrawItems().
Referenced by DIPTRACE::SCH_PARSER::populateLibSymbolUnit().
|
static |
Definition at line 2551 of file diptrace_sch_parser.cpp.
References dipTraceMm(), DIPTRACE::DCH_SHAPE::fontX, DIPTRACE::DCH_SHAPE::fontY, DIPTRACE::DCH_SHAPE::kindCode, DIPTRACE::DCH_SHAPE::kindFlag, DIPTRACE::DCH_SHAPE::lineWidth, and DIPTRACE::DCH_SHAPE::points.
Referenced by standardThtLedShapes().
|
static |
Definition at line 2564 of file diptrace_sch_parser.cpp.
References DIPTRACE::DCH_COMPONENT::compName, DIPTRACE::DCH_COMPONENT::libPath, DIPTRACE::DCH_COMPONENT::pins, and DIPTRACE::DCH_COMPONENT::shapes.
Referenced by DIPTRACE::SCH_PARSER::populateLibSymbolUnit().
|
static |
Decode a 4-byte big-endian biased integer from raw data at a given offset.
The bytes are assembled in uint32_t and the bias subtracted in int64 so a value with the high bit set cannot trigger signed-shift or signed-subtraction overflow (UB). Callers must bounds-check aPos+4.
Definition at line 77 of file diptrace_sch_parser.cpp.
References DIPTRACE::INT4_BIAS.
Referenced by DIPTRACE::PCB_PARSER::ApplyPlacementAngles(), decodeMountHoleBlockAt(), DumpComponentRawFields(), DIPTRACE::PCB_PARSER::FindAndParseZones(), DIPTRACE::PCB_PARSER::FindPadsInRegion(), DIPTRACE::PCB_PARSER::FindShapesInChainedBlocks(), DIPTRACE::PCB_PARSER::FindShapesInFontBlocks(), DIPTRACE::PCB_PARSER::FindShapesInRegion(), DIPTRACE::SCH_PARSER::isFontBearingShapeStart(), DIPTRACE::SCH_PARSER::isShapeStart(), DIPTRACE::PCB_PARSER::ParseNetRouting(), DIPTRACE::SCH_PARSER::parseNetSection(), and DIPTRACE::SCH_PARSER::parseOneComponent().
|
static |
Definition at line 2576 of file diptrace_sch_parser.cpp.
References dipTraceShapePoint(), and makeDipTraceShape().
Referenced by DIPTRACE::SCH_PARSER::populateLibSymbolUnit().
|
staticconstexpr |
Definition at line 71 of file diptrace_sch_parser.cpp.
Referenced by DIPTRACE::SCH_PARSER::isComponentHeaderAt(), DIPTRACE::SCH_PARSER::Parse(), and DIPTRACE::SCH_PARSER::parseWireSection().
|
staticconstexpr |
Structural layout version threshold for the .dch schematic format.
Versions below V31_CUTOVER (< 34) have different field layouts in several sections: extra int3 fields, different padding, and alternate single-part encoding. This controls structural byte-layout differences only.
This is independent of schematic string encoding, which switches to UTF-16-BE at v34 while PCB keeps the shared legacy <=37 ASCII threshold.
Definition at line 69 of file diptrace_sch_parser.cpp.
Referenced by DIPTRACE::SCH_PARSER::isFontBearingShapeStart(), DIPTRACE::SCH_PARSER::isShapeStart(), DIPTRACE::SCH_PARSER::parseDisplaySettings(), DIPTRACE::SCH_PARSER::parseEmbeddedPattern(), DIPTRACE::SCH_PARSER::parseNetSection(), DIPTRACE::SCH_PARSER::parseOneComponent(), DIPTRACE::SCH_PARSER::parsePin(), DIPTRACE::SCH_PARSER::parseShape(), and DIPTRACE::SCH_PARSER::parseSheetShapes().