|
KiCad PCB EDA Suite
|
Reader for TARGET 3001! More...
Classes | |
| struct | ARC |
| Stroked arc or circle. The base position is the start point. More... | |
| struct | COMPONENT |
| struct | DISC |
| Filled disc centred on the base position. More... | |
| struct | DRC_MARKER |
| struct | ELEMENT |
| One element of any class. More... | |
| struct | ELEMENT_BASE |
| Fields shared by every drawable element. More... | |
| struct | FIDUCIAL |
| class | FONTS |
| Maps TARGET 3001! More... | |
| struct | LINE |
| struct | PACKAGE |
| Footprint placement. Pads and graphics of the footprint are stored in board coordinates. More... | |
| struct | PAD |
| struct | PADSTACK_DEF |
| Project padstack; the board layers a pad exists on and how far it grows on each. More... | |
| struct | PIN |
| Schematic pin. The base position is the connection point; the pin extends along direction. More... | |
| struct | PROJECT |
| struct | PROJECT_SETTINGS |
| Settings that the importers use. The rest of the settings block is validated and skipped. More... | |
| struct | RECTANGLE |
| Filled rectangle anchored at a corner (the base position); sizes are signed. More... | |
| struct | SIGNAL |
| struct | SPLINE |
| Quadratic Bezier from the base position to the end point. More... | |
| struct | SYMBOL |
| One schematic gate of a component. Children are already in sheet coordinates. More... | |
| struct | TEXT |
| struct | TRIANGLE |
| Filled triangle given by three absolute corners (the first is the base position). More... | |
Enumerations | |
| enum class | ELEMENT_TYPE : uint8_t { LINE = 1 , PIN = 2 , PAD = 3 , TRIANGLE = 4 , RECTANGLE = 5 , ARC = 6 , DISC = 7 , TEXT = 8 , FIDUCIAL = 9 , COMPONENT = 10 , SYMBOL = 11 , PACKAGE = 12 , SIGNAL = 13 , SPLINE = 14 , DRC_MARKER = 15 , LIST = 16 , LAYER_FUNCTIONS = 17 , NONE = 255 } |
| Element class tags as stored in the file. More... | |
| enum class | PAD_SHAPE : uint8_t { ROUND = 0 , OCTAGON = 1 , RECTANGLE = 2 , OVAL = 3 , POLYGON = 4 } |
| enum class | FIDUCIAL_KIND : uint8_t { CROSSHAIR_RINGS = 0 , TRIANGLE_DIAMETER = 1 , PAIRED_SECTORS = 2 , FILLED_CIRCLE = 3 } |
| Drawing of a fiducial mark. More... | |
| enum class | TEXT_FUNCTION : uint8_t { LITERAL = 0 , REFERENCE = 1 , VALUE = 2 , GATE_NAME = 3 , SIGNAL_NAME = 4 , PIN_NAME = 5 , CHANGE_DATE = 11 , CHANGE_TIME = 12 , OUTPUT_DATE = 13 , OUTPUT_TIME = 14 , SCALE = 15 , PROJECT_NAME = 16 , SHEET_NUMBER = 100 , FILE_NAME = 103 , PAGE_NAME = 105 } |
| enum class | TEXT_LANGUAGE : uint8_t { GERMAN = 0 , ENGLISH = 1 , FRENCH = 2 } |
| enum class | LAYER_FUNCTION : uint8_t { COPPER_BOTTOM = 0 , COPPER_INSIDE = 1 , COPPER_TOP = 2 , POSITION_BOTTOM = 3 , POSITION_TOP = 4 , DELETION_BOTTOM = 5 , DELETION_INSIDE = 6 , DELETION_TOP = 7 , AREA_BOTTOM = 8 , AREA_INSIDE = 9 , AREA_TOP = 10 , MASK_BOTTOM = 11 , MASK_TOP = 12 , DRILL_PLAN = 13 , PASTE_BOTTOM = 14 , PASTE_TOP = 15 , GOLD_BOTTOM = 16 , GOLD_TOP = 17 , GLUE_BOTTOM = 18 , GLUE_TOP = 19 , DIMENSIONING = 20 , OUTLINE = 21 , MILLING = 22 , PAD_NUMBERS = 23 , OTHER = 24 , AIR_WIRES = 25 , NAMES_TOP = 41 , VALUES_TOP = 42 , NAMES_BOTTOM = 43 , VALUES_BOTTOM = 44 } |
| Board layer function codes stored per layer in the project header. More... | |
Functions | |
| wxString | PadNumber (const ELEMENT &aPad) |
| Number of a pad element in KiCad, its PADNAME when present, else its stored number. | |
| PROJECT | ParseBuffer (const std::vector< uint8_t > &aData) |
| Parse a project held in memory. | |
| PROJECT | ParseFile (const wxString &aFileName) |
| Parse a complete .T3001 file. | |
| bool | LooksLikeProject (const wxString &aFileName) |
| Cheap check used by the plugin managers: the extension matches and the header is plausible. | |
| wxString | ToWx (const std::string &aRaw) |
| Convert a stored ANSI string to a wxString. | |
Variables | |
| constexpr int | SCHEMATIC_LAYER_BASE = 100 |
| First layer number used for schematic sheets; sheet N (1-based) is layer 100 + N. | |
| constexpr int | SCHEMATIC_SHEET_COUNT = 100 |
| Sheets occupy layers 101 to 200. | |
| constexpr int | ALL_COPPER_LAYER = 100 |
| Board elements on this layer exist on every copper layer. | |
| constexpr int | BOARD_LAYER_COUNT = 100 |
| Board layers 0..99 carry a per-project function; 100 and above have fixed meanings. | |
| constexpr int | FIRST_PADSTACK_LAYER = 101 |
| A pad on board layer FIRST_PADSTACK_LAYER + n takes its layers from project padstack n. | |
| constexpr uint8_t | NO_ASSOCIATION = 255 |
| Layer association value for a layer that belongs to no copper layer. | |
Reader for TARGET 3001!
project files (.T3001).
A project is one little-endian stream with no container framing: a version word, a header, four element trees (signals, components, free schematic items, free board items) and the project settings. Every element is a one-byte class tag followed by that class's body, and lists are elements too, so the trees form a single recursive grammar. The layout is documented in target3001.ksy next to this file; this parser is a transcription of it.
Coordinates are nanometres with Y pointing up. Schematic items live on layers 101 and up, one per sheet; board items use the board layer numbers.
|
strong |
Element class tags as stored in the file.
| Enumerator | |
|---|---|
| LINE | |
| PIN | |
| PAD | |
| TRIANGLE | |
| RECTANGLE | |
| ARC | |
| DISC | |
| TEXT | |
| FIDUCIAL | |
| COMPONENT | |
| SYMBOL | |
| PACKAGE | |
| SIGNAL | |
| SPLINE | |
| DRC_MARKER | |
| LIST | |
| LAYER_FUNCTIONS | |
| NONE | |
Definition at line 52 of file target3001_parser.h.
|
strong |
Drawing of a fiducial mark.
| Enumerator | |
|---|---|
| CROSSHAIR_RINGS | cross and rings at 1, 2/3 and 1/3 of the outer centreline radius |
| TRIANGLE_DIAMETER | |
| PAIRED_SECTORS | |
| FILLED_CIRCLE | solid disc of the outer radius |
Definition at line 215 of file target3001_parser.h.
|
strong |
Board layer function codes stored per layer in the project header.
Definition at line 417 of file target3001_parser.h.
|
strong |
| Enumerator | |
|---|---|
| ROUND | |
| OCTAGON | |
| RECTANGLE | |
| OVAL | |
| POLYGON | vertices in the POLY_PAD property |
Definition at line 143 of file target3001_parser.h.
|
strong |
| Enumerator | |
|---|---|
| LITERAL | |
| REFERENCE | |
| VALUE | |
| GATE_NAME | |
| SIGNAL_NAME | |
| PIN_NAME | |
| CHANGE_DATE | |
| CHANGE_TIME | |
| OUTPUT_DATE | |
| OUTPUT_TIME | |
| SCALE | |
| PROJECT_NAME | |
| SHEET_NUMBER | |
| FILE_NAME | |
| PAGE_NAME | |
Definition at line 245 of file target3001_parser.h.
|
strong |
| Enumerator | |
|---|---|
| GERMAN | |
| ENGLISH | |
| FRENCH | |
Definition at line 265 of file target3001_parser.h.
| bool TARGET3001::LooksLikeProject | ( | const wxString & | aFileName | ) |
Cheap check used by the plugin managers: the extension matches and the header is plausible.
Definition at line 1101 of file target3001_parser.cpp.
Referenced by PCB_IO_TARGET3001::CanReadBoard(), and SCH_IO_TARGET3001::CanReadSchematicFile().
| wxString TARGET3001::PadNumber | ( | const ELEMENT & | aPad | ) |
Number of a pad element in KiCad, its PADNAME when present, else its stored number.
Definition at line 1061 of file target3001_parser.cpp.
References TARGET3001::ELEMENT::base, TARGET3001::ELEMENT_BASE::FindProp(), name, TARGET3001::PAD::number, TARGET3001::ELEMENT::pad, and ToWx().
Referenced by TARGET3001_PCB_BUILDER::addPad().
| PROJECT TARGET3001::ParseBuffer | ( | const std::vector< uint8_t > & | aData | ) |
Parse a project held in memory.
Definition at line 1073 of file target3001_parser.cpp.
Referenced by ParseFile().
| PROJECT TARGET3001::ParseFile | ( | const wxString & | aFileName | ) |
Parse a complete .T3001 file.
The whole stream must be consumed exactly.
| IO_ERROR | when the file cannot be read, is password protected, or does not match the layout. |
Definition at line 1080 of file target3001_parser.cpp.
References _, ParseBuffer(), project, and THROW_IO_ERROR.
Referenced by PCB_IO_TARGET3001::loadBoard(), and SCH_IO_TARGET3001::LoadSchematicFile().
| wxString TARGET3001::ToWx | ( | const std::string & | aRaw | ) |
Convert a stored ANSI string to a wxString.
Definition at line 1125 of file target3001_parser.cpp.
Referenced by TARGET3001::FONTS::Apply(), TARGET3001::PROJECT::ApplyTextLanguage(), TARGET3001::FONTS::applyTrueType(), TARGET3001::PROJECT::FindProperty(), TARGET3001::ELEMENT_BASE::FlagProp(), TARGET3001::PROJECT::FunctionText(), and PadNumber().
|
constexpr |
Board elements on this layer exist on every copper layer.
Definition at line 82 of file target3001_parser.h.
|
constexpr |
Board layers 0..99 carry a per-project function; 100 and above have fixed meanings.
Definition at line 385 of file target3001_parser.h.
Referenced by TARGET3001_PCB_BUILDER::addPadstackCuts(), and TARGET3001_PCB_BUILDER::padstackLayers().
|
constexpr |
A pad on board layer FIRST_PADSTACK_LAYER + n takes its layers from project padstack n.
Definition at line 389 of file target3001_parser.h.
Referenced by TARGET3001_PCB_BUILDER::addPad(), TARGET3001_PCB_BUILDER::addVia(), and TARGET3001_PCB_BUILDER::padstackLayers().
|
constexpr |
Layer association value for a layer that belongs to no copper layer.
Definition at line 452 of file target3001_parser.h.
|
constexpr |
First layer number used for schematic sheets; sheet N (1-based) is layer 100 + N.
Definition at line 76 of file target3001_parser.h.
Referenced by TARGET3001_SCH_BUILDER::sheetOf().
|
constexpr |
Sheets occupy layers 101 to 200.
Definition at line 79 of file target3001_parser.h.
Referenced by TARGET3001_SCH_BUILDER::sheetOf().