![]() |
KiCad PCB EDA Suite
|
Helper functions and common structures for CADSTAR PCB and Schematic archive files. More...
#include <cadstar_archive_parser.h>
Classes | |
struct | ATTRCOL |
struct | ATTRCOLORS |
struct | ATTRIBUTE_LOCATION |
struct | ATTRIBUTE_VALUE |
struct | ATTRNAME |
NOTE from CADSTAR help: To convert a Part Definition Attribute into a hyperlink, prefix the attribute name with "Link ". More... | |
struct | CADSTAR_NETCLASS |
struct | CODEDEFS |
struct | CUTOUT |
Represents a cutout in a closed shape (e.g. More... | |
struct | DFLTSETTINGS |
struct | DOCUMENTATION_SYMBOL |
struct | EVALUE |
Represents a floating value in E notation. More... | |
struct | FIGURE |
struct | FONT |
struct | FORMAT |
struct | GRID |
struct | GRIDS |
struct | GROUP |
struct | HATCH |
struct | HATCHCODE |
struct | HEADER |
struct | LINECODE |
struct | LONGPOINT |
struct | NET |
struct | PARSER |
struct | PARSER_CONTEXT |
struct | PART |
struct | PARTNAMECOL |
struct | PARTS |
struct | POINT |
Represents a point in x,y coordinates. More... | |
struct | REUSEBLOCK |
struct | REUSEBLOCKREF |
References an element from a design reuse block. More... | |
struct | ROUTECODE |
struct | ROUTEREASSIGN |
struct | SETTINGS |
struct | SHAPE |
struct | SPCCLASSNAME |
struct | SYMDEF |
struct | TEXT |
struct | TEXT_LOCATION |
Corresponds to CADSTAR "origin". More... | |
struct | TEXTCODE |
struct | TIMESTAMP |
struct | VARIANT |
< Nodename = "VARIANT" or "VMASTER" (master variant More... | |
struct | VARIANT_HIERARCHY |
struct | VERTEX |
Represents a vertex in a shape. More... | |
Public Member Functions | |
CADSTAR_ARCHIVE_PARSER () | |
Static Public Member Functions | |
static wxString | ParseTextFields (const wxString &aTextString, PARSER_CONTEXT *aParserContext) |
Replaces CADSTAR fields for the equivalent in KiCad and stores the field values in aParserContext. More... | |
static UNITS | ParseUnits (XNODE *aNode) |
static ANGUNITS | ParseAngunits (XNODE *aNode) |
static ALIGNMENT | ParseAlignment (XNODE *aNode) |
static JUSTIFICATION | ParseJustification (XNODE *aNode) |
static READABILITY | ParseReadability (XNODE *aNode) |
static SWAP_RULE | ParseSwapRule (XNODE *aNode) |
static void | InsertAttributeAtEnd (XNODE *aNode, wxString aValue) |
static XNODE * | LoadArchiveFile (const wxString &aFileName, const wxString &aFileTypeIdentifier, PROGRESS_REPORTER *aProgressReporter=nullptr) |
Reads a CADSTAR Archive file (S-parameter format) More... | |
static bool | IsValidAttribute (wxXmlAttribute *aAttribute) |
static wxString | GetXmlAttributeIDString (XNODE *aNode, unsigned int aID, bool aIsRequired=true) |
static long | GetXmlAttributeIDLong (XNODE *aNode, unsigned int aID, bool aIsRequired=true) |
static void | CheckNoChildNodes (XNODE *aNode) |
static void | CheckNoNextNodes (XNODE *aNode) |
static void | ParseChildEValue (XNODE *aNode, PARSER_CONTEXT *aContext, EVALUE &aValueToParse) |
static std::vector< POINT > | ParseAllChildPoints (XNODE *aNode, PARSER_CONTEXT *aContext, bool aTestAllChildNodes=false, int aExpectedNumPoints=UNDEFINED_VALUE) |
if no children are present, it just returns an empty vector (without throwing an exception) More... | |
static std::vector< VERTEX > | ParseAllChildVertices (XNODE *aNode, PARSER_CONTEXT *aContext, bool aTestAllChildNodes=false) |
if no children are present, it just returns an empty vector (without throwing an exception) More... | |
static std::vector< CUTOUT > | ParseAllChildCutouts (XNODE *aNode, PARSER_CONTEXT *aContext, bool aTestAllChildNodes=false) |
if no children are present, it just returns an empty vector (without throwing an exception) More... | |
static long | GetNumberOfChildNodes (XNODE *aNode) |
static long | GetNumberOfStepsForReporting (XNODE *aRootNode, std::vector< wxString > aSubNodeChildrenToCount) |
static wxString | HandleTextOverbar (wxString aCadstarString) |
Convert a string with CADSTAR overbar characters to equivalent in KiCad. More... | |
static void | FixTextPositionNoAlignment (EDA_TEXT *aKiCadTextItem) |
Corrects the position of a text element that had NO_ALIGNMENT in CADSTAR. More... | |
static wxString | generateLibName (const wxString &aRefName, const wxString &aAlternateName) |
Static Public Attributes | |
static const long | UNDEFINED_VALUE = -1 |
static const double | TXT_HEIGHT_RATIO = ( 24.0 - 5.0 ) / 24.0 |
CADSTAR fonts are drawn on a 24x24 integer matrix, where the each axis goes from 0 to 24. More... | |
static const std::map< TEXT_FIELD_NAME, wxString > | CADSTAR_TO_KICAD_FIELDS |
Map between CADSTAR fields and KiCad text variables. More... | |
static const long | FONT_NORMAL = 400 |
static const long | FONT_BOLD = 700 |
Protected Member Functions | |
void | checkPoint () |
Updates m_progressReporter or throws if user cancelled. More... | |
Protected Attributes | |
PARSER_CONTEXT | m_context |
PROGRESS_REPORTER * | m_progressReporter |
Helper functions and common structures for CADSTAR PCB and Schematic archive files.
Definition at line 86 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_ID |
Definition at line 100 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::COLOR_ID |
Definition at line 114 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL_ID |
Definition at line 113 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::FIGURE_ID |
Definition at line 108 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::GATE_ID |
Definition at line 103 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::GROUP_ID |
Definition at line 109 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::HATCHCODE_ID |
Definition at line 93 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::LAYER_ID |
ID of a Sheet (if schematic) or board Layer (if PCB)
Definition at line 98 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::LINECODE_ID |
Definition at line 92 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::NET_ID |
Definition at line 111 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::NETCLASS_ID |
Definition at line 95 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::NETELEMENT_ID |
Definition at line 112 of file cadstar_archive_parser.h.
typedef long CADSTAR_ARCHIVE_PARSER::PART_DEFINITION_PIN_ID |
Pin identifier in the part definition.
Definition at line 105 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::PART_ID |
Definition at line 102 of file cadstar_archive_parser.h.
typedef long CADSTAR_ARCHIVE_PARSER::PART_PIN_ID |
Pin identifier in the part.
Definition at line 106 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::REUSEBLOCK_ID |
Definition at line 110 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::ROUTECODE_ID |
Definition at line 94 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::SPACING_CLASS_ID |
Definition at line 96 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::SYMDEF_ID |
Definition at line 101 of file cadstar_archive_parser.h.
typedef long CADSTAR_ARCHIVE_PARSER::TERMINAL_ID |
Terminal is the pin identifier in the schematic.
Definition at line 104 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::TEXT_ID |
Definition at line 107 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::TEXTCODE_ID |
Definition at line 97 of file cadstar_archive_parser.h.
typedef wxString CADSTAR_ARCHIVE_PARSER::VARIANT_ID |
Definition at line 99 of file cadstar_archive_parser.h.
|
strong |
From CADSTAR Help: "Text Alignment enables you to define the position of an alignment origin for all text items in CADSTAR.
The alignment origin is a point on or within the text boundary and defines how the text is displayed.
For example, with an alignment of bottom-right the origin will be positioned at the bottom right of the text boundary. This makes it easier to right-align several text items regardless of the length of text displayed.
Text Alignment applies to all CADSTAR text. [...]
Note: Unaligned text operates in the way CADSTAR text always has. In most cases this behaves as Bottom Left alignment, but there are a few exceptions, e.g. pin names. Also unaligned multiline text has an origin Bottom Left of the first line."
See also JUSTIFICATION
Enumerator | |
---|---|
NO_ALIGNMENT | NO_ALIGNMENT has different meaning depending on the object type. |
TOPLEFT | |
TOPCENTER | |
TOPRIGHT | |
CENTERLEFT | |
CENTERCENTER | |
CENTERRIGHT | |
BOTTOMLEFT | |
BOTTOMCENTER | |
BOTTOMRIGHT |
Definition at line 576 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
DEGREES | |
RADIANS |
Definition at line 486 of file cadstar_archive_parser.h.
|
strong |
Definition at line 630 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
BOTH | From CADSTAR Help: Assigned to both Schematic symbols and PCB components, and displayed on Schematic and PCB designs. |
COMPONENT | From CADSTAR Help: Assigned to PCB components and displayed on PCB designs. |
PART_DEFINITION | From CADSTAR Help: Assigned to Parts library Definitions and displayed by the Library searcher. |
PART_LIBRARY | From CADSTAR Help: Only used by non-Cadstar applications. |
SYMBOL | From CADSTAR Help: Assigned to Schematic Symbols and displayed on Schematic Designs. |
UNDEFINED | Note: It seems that some attribute have no "ATTRUSAGE" defined. It appears that the attributes that fall under this category are the ones associated with the design itself (i.e. not inherited from the library) |
Definition at line 653 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
FRACTIONALGRID | Param1 = Units, Param2 = Divisor. The grid is equal in X and Y dimensions with a step size equal to Param1/Param2 |
STEPGRID | Param1 = X Step, Param2 = Y Step. A standard x,y grid. |
Definition at line 496 of file cadstar_archive_parser.h.
|
strong |
From CADSTAR Help: "Multi Line Text can also be justified as Left, Centre or Right.
This does not affect the text alignment. Note: Justification of single line text has no effect."
This only affects multiline text
See also ALIGNMENT
Enumerator | |
---|---|
LEFT | |
CENTER | |
RIGHT |
Definition at line 602 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
SOLID | |
DASH | |
DASHDOT | |
DASHDOTDOT | |
DOT |
Definition at line 280 of file cadstar_archive_parser.h.
|
strong |
Sets the readability direction of text.
From CADSTAR Help: "Horizontal text will always be displayed from left to right (i.e. never upside down). Vertical text can be set as readable from either the left or right edge of the design."
I.e. Vertical text can either be rotated 90 degrees clockwise or 90 degrees anticlockwise from horizontal. This does not impact vertical text
Enumerator | |
---|---|
BOTTOM_TO_TOP | When text is vertical, show it rotated 90 degrees anticlockwise. |
TOP_TO_BOTTOM | When text is vertical, show it rotated 90 degrees clockwise. |
Definition at line 620 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
HUNDREDTH_MICRON |
Definition at line 242 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
OPENSHAPE | Unfilled open shape. Cannot have cutouts. |
OUTLINE | Unfilled closed shape. |
SOLID | Filled closed shape (solid fill). |
HATCHED | Filled closed shape (hatch fill). |
Definition at line 450 of file cadstar_archive_parser.h.
|
strong |
Corresponds to "Display when" Item property.
From CADSTAR Help: "This parameter enables you to make the visibility of a component outline/area (or an area of component copper, or a string of component text) dependent on the current mirror status of the component.
For example, you may require a string of component text to be displayed only when the component is mirrored."
Enumerator | |
---|---|
NO_SWAP | Display when Unmirrored. |
USE_SWAP_LAYER | Display when Mirrored. |
BOTH | Always display (Mirrored and Unmirrored) |
Definition at line 810 of file cadstar_archive_parser.h.
|
strong |
These are special fields in text objects enclosed between the tokens '<@' and '>' such as <@[FIELD_NAME][FIELD_VALUE]>.
For example: "<@DESIGN TITLEProject [email protected]>"
Definition at line 135 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
DESIGN | Inherits from design units (assumed Assignments->Technology->Units) |
THOU | |
INCH | |
MICROMETRE | |
MM | |
CENTIMETER | |
METER |
Definition at line 471 of file cadstar_archive_parser.h.
|
strong |
Enumerator | |
---|---|
POINT | |
CLOCKWISE_ARC | |
CLOCKWISE_SEMICIRCLE | |
ANTICLOCKWISE_ARC | |
ANTICLOCKWISE_SEMICIRCLE |
Definition at line 416 of file cadstar_archive_parser.h.
|
inline |
Definition at line 89 of file cadstar_archive_parser.h.
References m_progressReporter.
|
static |
aNode |
IO_ERROR | if a child node was found |
Definition at line 2465 of file cadstar_archive_parser.cpp.
References XNODE::GetChildren(), and THROW_UNKNOWN_NODE_IO_ERROR.
Referenced by CADSTAR_PCB_ARCHIVE_PARSER::LAYERDEFS::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPACINGCODE::REASSIGN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_COPPER::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PAD_EXITS::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNORDER::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNWIDTH::Parse(), CADSTAR_ARCHIVE_PARSER::REUSEBLOCKREF::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::PIN::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::GATE::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::PIN_EQUIVALENCE::Parse(), and CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::SWAP_GATE::Parse().
|
static |
aNode |
IO_ERROR | if a node adjacent to aNode was found |
Definition at line 2472 of file cadstar_archive_parser.cpp.
References XNODE::GetNext(), XNODE::GetParent(), and THROW_UNKNOWN_NODE_IO_ERROR.
Referenced by CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMBOLVARIANT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADREASSIGN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::VIAREASSIGN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYERPAIR::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::TEXTFORMAT::Parse().
|
protected |
Updates m_progressReporter or throws if user cancelled.
Definition at line 2645 of file cadstar_archive_parser.cpp.
References _, PROGRESS_REPORTER::AdvanceProgress(), PROGRESS_REPORTER::KeepRefreshing(), m_progressReporter, and THROW_IO_ERROR.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::calculateZonePriorities(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), CADSTAR_PCB_ARCHIVE_LOADER::loadCoppers(), CADSTAR_SCH_ARCHIVE_LOADER::loadPartsLibrary(), CADSTAR_SCH_ARCHIVE_PARSER::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::Parse().
|
static |
Corrects the position of a text element that had NO_ALIGNMENT in CADSTAR.
Assumes that the provided text element has been initialised with a position and orientation.
aKiCadTextItem | a Kicad item to correct |
Definition at line 2617 of file cadstar_archive_parser.cpp.
References EDA_TEXT::GetInterline(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngleDegrees(), LIB_FIELD_T, LIB_TEXT_T, EDA_TEXT::Offset(), RotatePoint(), text, and EDA_ITEM::Type().
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), and CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText().
|
inlinestatic |
Definition at line 1402 of file cadstar_archive_parser.h.
Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().
|
static |
Definition at line 2575 of file cadstar_archive_parser.cpp.
References XNODE::GetChildren(), and XNODE::GetNext().
Referenced by GetNumberOfStepsForReporting().
|
static |
Definition at line 2587 of file cadstar_archive_parser.cpp.
References XNODE::GetChildren(), XNODE::GetNext(), and GetNumberOfChildNodes().
Referenced by CADSTAR_SCH_ARCHIVE_PARSER::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::Parse().
|
static |
aNode | |
aID | |
aIsRequired | Prevents exception throwing if false. |
IO_ERROR | if attribute does not exist |
Definition at line 2447 of file cadstar_archive_parser.cpp.
References GetXmlAttributeIDString(), THROW_PARSING_IO_ERROR, and UNDEFINED_VALUE.
Referenced by CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::PIN_NUM_LABEL_LOC::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPREASSIGN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPPERCODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMATTR::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPACINGCODE::REASSIGN::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMPINNAME_LABEL::Parse(), CADSTAR_ARCHIVE_PARSER::FORMAT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPACINGCODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::PIN_NUM::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::Parse(), CADSTAR_ARCHIVE_PARSER::HATCH::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Parse(), CADSTAR_ARCHIVE_PARSER::FONT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::VIACODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYERPAIR::Parse(), CADSTAR_ARCHIVE_PARSER::TEXTCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPCCLASSSPACE::Parse(), CADSTAR_ARCHIVE_PARSER::ROUTEREASSIGN::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::SYM_TERM::Parse(), CADSTAR_ARCHIVE_PARSER::ROUTECODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BLOCK_TERM::Parse(), CADSTAR_ARCHIVE_PARSER::POINT::Parse(), CADSTAR_ARCHIVE_PARSER::LONGPOINT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TECHNOLOGY_SECTION::Parse(), CADSTAR_ARCHIVE_PARSER::GRID::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_PAD::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::TEXTFORMAT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::EXTENSION_LINE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::LINE::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNORDER::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNWIDTH::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SYMDEF_PCB::Parse(), CADSTAR_ARCHIVE_PARSER::REUSEBLOCK::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PIN_ATTRIBUTE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADEXCEPTION::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::PIN::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::GATE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::COPPER_TERMINAL::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::ROUTE_VERTEX::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::PIN::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::POURING::Parse(), CADSTAR_ARCHIVE_PARSER::PART::PART_PIN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPPER::NETREF::COPPER_TERM::Parse(), CADSTAR_ARCHIVE_PARSER::PART::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DRILL_TABLE::Parse(), CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Parse(), CADSTAR_ARCHIVE_PARSER::SETTINGS::ParseSubNode(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseSubNode(), CADSTAR_ARCHIVE_PARSER::SYMDEF::ParseSubNode(), and CADSTAR_ARCHIVE_PARSER::NET::ParseSubNode().
|
static |
aNode | |
aID | |
aIsRequired | Prevents exception throwing if false. |
IO_ERROR | if attribute does not exist |
Definition at line 2428 of file cadstar_archive_parser.cpp.
References THROW_MISSING_PARAMETER_IO_ERROR.
Referenced by CADSTAR_ARCHIVE_PARSER::PART::GetPinType(), GetXmlAttributeIDLong(), CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::PIN_NUM_LABEL_LOC::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SHEETS::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYERDEFS::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::COMP::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPREASSIGN::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::PARTREF::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPPERCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPACINGCODE::REASSIGN::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMPINNAME_LABEL::Parse(), CADSTAR_ARCHIVE_PARSER::FORMAT::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMBOLVARIANT::Parse(), CADSTAR_ARCHIVE_PARSER::TIMESTAMP::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SIGNALREFERENCELINK::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPACINGCODE::Parse(), CADSTAR_ARCHIVE_PARSER::HEADER::Parse(), CADSTAR_ARCHIVE_PARSER::VARIANT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADREASSIGN::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::Parse(), CADSTAR_ARCHIVE_PARSER::LINECODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SIGLOC::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Parse(), CADSTAR_ARCHIVE_PARSER::HATCHCODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::BUS::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::VIAREASSIGN::Parse(), CADSTAR_ARCHIVE_PARSER::FONT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::VIACODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::BLOCK::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYERPAIR::Parse(), CADSTAR_ARCHIVE_PARSER::TEXTCODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::JUNCTION_SCH::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::SPCCLASSSPACE::Parse(), CADSTAR_ARCHIVE_PARSER::ROUTEREASSIGN::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::SYM_TERM::Parse(), CADSTAR_ARCHIVE_PARSER::ROUTECODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BUS_TERM::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::RULESET::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::BLOCK_TERM::Parse(), CADSTAR_ARCHIVE_PARSER::EVALUE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::DANGLER::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_COPPER::Parse(), CADSTAR_ARCHIVE_PARSER::SHAPE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse(), CADSTAR_ARCHIVE_PARSER::GRID::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_PAD::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::ARROW::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::TEXTFORMAT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::EXTENSION_LINE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::LINE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::Parse(), CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::Parse(), CADSTAR_ARCHIVE_PARSER::SPCCLASSNAME::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Parse(), CADSTAR_ARCHIVE_PARSER::REUSEBLOCK::Parse(), CADSTAR_ARCHIVE_PARSER::REUSEBLOCKREF::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse(), CADSTAR_ARCHIVE_PARSER::GROUP::Parse(), CADSTAR_ARCHIVE_PARSER::FIGURE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADEXCEPTION::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TRUNK::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::PIN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::JUNCTION_PCB::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::GATE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::VIA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::COPPER_TERMINAL::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::ROUTE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::NET_PCB::CONNECTION_PCB::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::PIN::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::SWAP_GROUP::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::POURING::Parse(), CADSTAR_ARCHIVE_PARSER::PART::PART_PIN::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::Parse(), CADSTAR_ARCHIVE_PARSER::PART::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPPER::NETREF::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COPPER::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DRILL_TABLE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYOUT::Parse(), CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Parse(), CADSTAR_ARCHIVE_PARSER::DFLTSETTINGS::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRCOL::Parse(), CADSTAR_ARCHIVE_PARSER::PARTNAMECOL::Parse(), ParseAlignment(), ParseAngunits(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseIdentifiers(), CADSTAR_ARCHIVE_PARSER::SYMDEF::ParseIdentifiers(), CADSTAR_ARCHIVE_PARSER::NET::JUNCTION::ParseIdentifiers(), CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::ParseIdentifiers(), CADSTAR_ARCHIVE_PARSER::NET::ParseIdentifiers(), ParseJustification(), ParseReadability(), CADSTAR_ARCHIVE_PARSER::NET::JUNCTION::ParseSubNode(), CADSTAR_ARCHIVE_PARSER::NET::CONNECTION::ParseSubNode(), CADSTAR_ARCHIVE_PARSER::NET::ParseSubNode(), ParseSwapRule(), CADSTAR_PCB_ARCHIVE_PARSER::ParseTestlandSide(), and ParseUnits().
|
static |
Convert a string with CADSTAR overbar characters to equivalent in KiCad.
aCadstarString | Input string |
Definition at line 2607 of file cadstar_archive_parser.cpp.
References ConvertToNewOverbarNotation().
Referenced by CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), CADSTAR_SCH_ARCHIVE_LOADER::loadBusses(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), and CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary().
|
static |
Definition at line 2297 of file cadstar_archive_parser.cpp.
References Format().
Referenced by LoadArchiveFile().
|
static |
aAttribute |
Definition at line 2422 of file cadstar_archive_parser.cpp.
Referenced by CADSTAR_PCB_ARCHIVE_PARSER::LAYERDEFS::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_COPPER::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PAD_EXITS::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse(), CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::PIN_EQUIVALENCE::Parse(), and CADSTAR_ARCHIVE_PARSER::PART::DEFINITION::SWAP_GATE::Parse().
|
static |
Reads a CADSTAR Archive file (S-parameter format)
aFileName | |
aFileTypeIdentifier | Identifier of the first node in the file to check against. E.g. "CADSTARPCB" |
aProgressReporter | Pointer to a Progress Reporter to report progress to. |
IO_ERROR |
Definition at line 2318 of file cadstar_archive_parser.cpp.
References _, DSNLEXER::CurText(), DSN_EOF, DSN_LEFT, DSN_RIGHT, Format(), XNODE::GetParent(), InsertAttributeAtEnd(), PROGRESS_REPORTER::KeepRefreshing(), DSNLEXER::NextTok(), PROGRESS_REPORTER::SetCurrentProgress(), and THROW_IO_ERROR.
Referenced by CADSTAR_SCH_ARCHIVE_PARSER::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::Parse().
|
static |
Definition at line 937 of file cadstar_archive_parser.cpp.
References BOTTOMCENTER, BOTTOMLEFT, BOTTOMRIGHT, CENTERCENTER, CENTERLEFT, CENTERRIGHT, GetXmlAttributeIDString(), NO_ALIGNMENT, THROW_UNKNOWN_PARAMETER_IO_ERROR, TOPCENTER, TOPLEFT, and TOPRIGHT.
Referenced by CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT::Parse(), and CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseSubNode().
|
static |
if no children are present, it just returns an empty vector (without throwing an exception)
aNode | containing a series of CUTOUT objects |
aTestAllChildNodes | |
aExpectedNumPoints | if -1, this is check is disabled |
IO_ERROR | if one of the following: |
Definition at line 2549 of file cadstar_archive_parser.cpp.
References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::CUTOUT::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.
Referenced by CADSTAR_ARCHIVE_PARSER::SHAPE::Parse().
|
static |
if no children are present, it just returns an empty vector (without throwing an exception)
aNode | containing a series of POINT objects |
aTestAllChildNodes | |
aExpectedNumPoints | if UNDEFINED_VALUE (i.e. -1), this is check is disabled |
IO_ERROR | if one of the following: |
Definition at line 2489 of file cadstar_archive_parser.cpp.
References _, Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::POINT::Parse(), THROW_IO_ERROR, THROW_UNKNOWN_NODE_IO_ERROR, and UNDEFINED_VALUE.
Referenced by CADSTAR_SCH_ARCHIVE_PARSER::NET_SCH::CONNECTION_SCH::Parse(), CADSTAR_ARCHIVE_PARSER::VERTEX::Parse(), and CADSTAR_ARCHIVE_PARSER::SETTINGS::ParseSubNode().
|
static |
if no children are present, it just returns an empty vector (without throwing an exception)
aNode | containing a series of VERTEX objects |
aTestAllChildNodes | |
aExpectedNumPoints | if -1, this is check is disabled |
IO_ERROR | if one of the following: |
Definition at line 2523 of file cadstar_archive_parser.cpp.
References XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::VERTEX::IsVertex(), CADSTAR_ARCHIVE_PARSER::VERTEX::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.
Referenced by CADSTAR_ARCHIVE_PARSER::CUTOUT::Parse(), and CADSTAR_ARCHIVE_PARSER::SHAPE::Parse().
|
static |
Definition at line 576 of file cadstar_archive_parser.cpp.
References DEGREES, GetXmlAttributeIDString(), RADIANS, and THROW_UNKNOWN_PARAMETER_IO_ERROR.
Referenced by CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse().
|
static |
aNode | with a child node containing an EVALUE |
aValueToParse |
Definition at line 2479 of file cadstar_archive_parser.cpp.
References XNODE::GetChildren(), CADSTAR_ARCHIVE_PARSER::EVALUE::Parse(), and THROW_UNKNOWN_NODE_IO_ERROR.
Referenced by CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Parse().
|
static |
Definition at line 969 of file cadstar_archive_parser.cpp.
References CENTER, GetXmlAttributeIDString(), LEFT, RIGHT, and THROW_UNKNOWN_PARAMETER_IO_ERROR.
Referenced by CADSTAR_ARCHIVE_PARSER::TEXT_LOCATION::Parse(), CADSTAR_ARCHIVE_PARSER::TEXT::Parse(), and CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_LOCATION::ParseSubNode().
|
static |
Definition at line 988 of file cadstar_archive_parser.cpp.
References BOTTOM_TO_TOP, GetXmlAttributeIDString(), THROW_UNKNOWN_PARAMETER_IO_ERROR, and TOP_TO_BOTTOM.
Referenced by CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::DRILL_TABLE::Parse(), and CADSTAR_ARCHIVE_PARSER::DOCUMENTATION_SYMBOL::Parse().
|
static |
Definition at line 1400 of file cadstar_archive_parser.cpp.
References GetXmlAttributeIDString(), NO_SWAP, THROW_UNKNOWN_PARAMETER_IO_ERROR, and USE_SWAP_LAYER.
Referenced by CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_COPPER::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse(), CADSTAR_ARCHIVE_PARSER::FIGURE::Parse(), and CADSTAR_ARCHIVE_PARSER::TEXT::Parse().
|
static |
Replaces CADSTAR fields for the equivalent in KiCad and stores the field values in aParserContext.
aTextString | Text string to parse |
aParserContext | PARSER_CONTEXT in which to store the values of the found fields |
Definition at line 743 of file cadstar_archive_parser.cpp.
References CADSTAR_TO_KICAD_FIELDS, COMPANY_NAME, CURRENT_USER, DATE, DESIGN_TITLE, DISTANCE, CADSTAR_ARCHIVE_PARSER::PARSER_CONTEXT::FilenamesToTextMap, Format(), FROM_FILE, HYPERLINK, CADSTAR_ARCHIVE_PARSER::PARSER_CONTEXT::InconsistentTextFields, KI_FALLTHROUGH, LONG_JOBNAME, MACHINE_NAME, NONE, NUM_OF_SHEETS, REG_USER, SHEET_NAME, SHEET_NUMBER, SHORT_JOBNAME, CADSTAR_ARCHIVE_PARSER::PARSER_CONTEXT::TextFieldToValuesMap, CADSTAR_ARCHIVE_PARSER::PARSER_CONTEXT::TextToHyperlinksMap, TIME, UNITS_ABBREV, UNITS_FULL, UNITS_SHORT, VARIANT_DESCRIPTION, and VARIANT_NAME.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), and CADSTAR_ARCHIVE_PARSER::TEXT::Parse().
|
static |
Definition at line 549 of file cadstar_archive_parser.cpp.
References CENTIMETER, DESIGN, GetXmlAttributeIDString(), INCH, METER, MICROMETRE, MM, THOU, and THROW_UNKNOWN_PARAMETER_IO_ERROR.
Referenced by CADSTAR_PCB_ARCHIVE_PARSER::DIMENSION::Parse(), and CADSTAR_ARCHIVE_PARSER::SETTINGS::ParseSubNode().
|
static |
Map between CADSTAR fields and KiCad text variables.
This is used as a lookup table when parsing CADSTAR text fields. Most variables have a similar name in KiCad as in CADSTAR.
Definition at line 164 of file cadstar_archive_parser.h.
Referenced by CADSTAR_SCH_ARCHIVE_LOADER::loadTextVariables(), CADSTAR_PCB_ARCHIVE_LOADER::loadTextVariables(), and ParseTextFields().
|
static |
Definition at line 322 of file cadstar_archive_parser.h.
Referenced by CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings().
|
static |
Definition at line 321 of file cadstar_archive_parser.h.
|
protected |
Definition at line 1413 of file cadstar_archive_parser.h.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), CADSTAR_SCH_ARCHIVE_LOADER::loadTextVariables(), CADSTAR_PCB_ARCHIVE_LOADER::loadTextVariables(), CADSTAR_SCH_ARCHIVE_PARSER::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::Parse().
|
protected |
Definition at line 1414 of file cadstar_archive_parser.h.
Referenced by CADSTAR_ARCHIVE_PARSER(), CADSTAR_PCB_ARCHIVE_LOADER::CADSTAR_PCB_ARCHIVE_LOADER(), CADSTAR_SCH_ARCHIVE_LOADER::CADSTAR_SCH_ARCHIVE_LOADER(), checkPoint(), CADSTAR_PCB_ARCHIVE_LOADER::Load(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), CADSTAR_SCH_ARCHIVE_PARSER::Parse(), and CADSTAR_PCB_ARCHIVE_PARSER::Parse().
|
static |
CADSTAR fonts are drawn on a 24x24 integer matrix, where the each axis goes from 0 to 24.
The characters can each specify a width of between 12 and 24, but the height is fixed at 24.
The default CADSTAR font uses y=5 as the starting point for capital letters, leaving space for the tails of letters such as "g", "p", "y", "q", etc.
The font height in CADSTAR corresponds to the full 24 point height. In KiCad it only corresponds to the height above the guide line, meaning the overall text height will be larger in KiCad.
Definition at line 129 of file cadstar_archive_parser.h.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarText(), and CADSTAR_SCH_ARCHIVE_LOADER::getTextHeightFromTextCode().
|
static |
Definition at line 116 of file cadstar_archive_parser.h.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), GetXmlAttributeIDLong(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates(), CADSTAR_ARCHIVE_PARSER::VERTEX::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::TEMPLATE::POURING::Parse(), and ParseAllChildPoints().