|
KiCad PCB EDA Suite
|
ORCAD_CONVERTER turns a parsed ORCAD_DESIGN into KiCad schematic objects. More...
#include <cstdint>#include <map>#include <memory>#include <set>#include <string>#include <tuple>#include <utility>#include <vector>#include <wx/string.h>#include <math/box2.h>#include <math/vector2d.h>#include <gal/color4d.h>#include <eda_shape.h>#include <sch_io/orcad/orcad_records.h>Go to the source code of this file.
Classes | |
| struct | ORCAD_ORIENT_ENTRY |
| One entry of the 8-orientation placement table. More... | |
| class | ORCAD_CONVERTER |
| Builds the KiCad schematic from a parsed OrCAD design. More... | |
| struct | ORCAD_CONVERTER::UNIT_INFO |
| One unit of an emitted multi-unit symbol. More... | |
| struct | ORCAD_CONVERTER::LIB_ENTRY |
| One emitted KiCad lib symbol (possibly multi-unit). More... | |
| struct | ORCAD_CONVERTER::OFFPAGE_NET |
| One resolved off-page connector: index into page.offpage, net, pin position. More... | |
Functions | |
| KIGFX::COLOR4D | OrcadColor (int aColorIndex) |
| int | OrcadLineWidthIu (int aWidth) |
| LINE_STYLE | OrcadLineStyle (int aStyle) |
| FILL_T | OrcadFillType (int aFillStyle, int aHatchStyle) |
| int | OrcadPageOrder (wxString &aName) |
| Return a numeric page prefix (or -1); strip only the "N - title" convention. | |
| VECTOR2I | OrcadDbuToIu (int aX, int aY) |
| int | OrcadOrientOf (int aRotation, bool aMirror) |
| Compose the 3-bit orientation code from the rotation bits and mirror bit. | |
| int | OrcadOrientDim (int aSelector, int aWidth, int aHeight) |
| VECTOR2I | OrcadOrientOffset (int aOrient, int aWidth, int aHeight) |
| Bbox re-anchoring offset for the given orientation and body size (DBU). | |
| VECTOR2I | OrcadTransformPoint (int aOrient, int aWidth, int aHeight, int aBaseX, int aBaseY, int aPx, int aPy) |
| Absolute canvas position (DBU) of symbol-space point (aPx, aPy) for an instance with transform base (aBaseX, aBaseY), orientation aOrient and body size (aWidth, aHeight). | |
Variables | |
| constexpr int | ORCAD_IU_PER_DBU = 2540 |
| Schematic internal units per OrCAD DBU: 10 mil * 254 IU/mil. | |
| constexpr ORCAD_ORIENT_ENTRY | ORCAD_ORIENT_TABLE [8] |
| Orientation table, indexed by the 3-bit orientation code. | |
ORCAD_CONVERTER turns a parsed ORCAD_DESIGN into KiCad schematic objects.
The class is implemented across two translation units:
Each private method below is tagged with the translation unit that implements it. Only these two files may define ORCAD_CONVERTER members.
Coordinate model: 1 OrCAD DBU = 10 mil, Y down on both sides, so IU = DBU * 2540 with no axis flip anywhere: KiCad's in-memory LIB_SYMBOL space is Y-down like the canvas (only the .kicad_sch writer flips symbol bodies into the file's Y-up space), so cache definition coordinates are used unchanged. Electrical points land on a 100-mil grid natively.
Definition in file orcad_converter.h.
| KIGFX::COLOR4D OrcadColor | ( | int | aColorIndex | ) |
Definition at line 145 of file orcad_converter_sheet.cpp.
References KIGFX::COLOR4D::UNSPECIFIED.
Referenced by ORCAD_CONVERTER::addSymbolPrimitive(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ORCAD_CONVERTER::placeBusEntries(), ORCAD_CONVERTER::placeGraphics(), ORCAD_CONVERTER::placeOffpageConnectors(), ORCAD_CONVERTER::placePorts(), ORCAD_CONVERTER::placeSymbolFields(), and ORCAD_CONVERTER::placeWires().
|
inline |
Definition at line 88 of file orcad_converter.h.
References ORCAD_IU_PER_DBU.
Referenced by ORCAD_CONVERTER::Convert(), ORCAD_CONVERTER::placeBusEntries(), ORCAD_CONVERTER::placeGraphics(), ORCAD_CONVERTER::placeInstance(), ORCAD_CONVERTER::placeJunctions(), ORCAD_CONVERTER::placeNoConnects(), ORCAD_CONVERTER::placeOffpageConnectors(), ORCAD_CONVERTER::placePorts(), ORCAD_CONVERTER::placePowerSymbol(), ORCAD_CONVERTER::placeSymbolFields(), and ORCAD_CONVERTER::placeWires().
| FILL_T OrcadFillType | ( | int | aFillStyle, |
| int | aHatchStyle ) |
Definition at line 91 of file orcad_converter_symbols.cpp.
References CROSS_HATCH, FILLED_WITH_BG_BODYCOLOR, HATCH, NO_FILL, and REVERSE_HATCH.
Referenced by ORCAD_CONVERTER::addSymbolPrimitive(), and BOOST_AUTO_TEST_CASE().
| LINE_STYLE OrcadLineStyle | ( | int | aStyle | ) |
Definition at line 67 of file orcad_converter_symbols.cpp.
References DASH, DASHDOT, DASHDOTDOT, DEFAULT, DOT, and SOLID.
Referenced by BOOST_AUTO_TEST_CASE(), ORCAD_CONVERTER::placeGraphics(), and ORCAD_CONVERTER::placeWires().
| int OrcadLineWidthIu | ( | int | aWidth | ) |
Definition at line 82 of file orcad_converter_symbols.cpp.
References schIUScale.
Referenced by BOOST_AUTO_TEST_CASE(), ORCAD_CONVERTER::placeGraphics(), and ORCAD_CONVERTER::placeWires().
|
inline |
Definition at line 151 of file orcad_converter.h.
Referenced by OrcadOrientOffset().
|
inline |
Compose the 3-bit orientation code from the rotation bits and mirror bit.
Definition at line 145 of file orcad_converter.h.
Referenced by ORCAD_CONVERTER::applyTitleBlock(), ORCAD_CONVERTER::graphicPinPos(), ORCAD_CONVERTER::pickVariant(), ORCAD_CONVERTER::placeInstance(), ORCAD_CONVERTER::placePowerSymbol(), and ORCAD_CONVERTER::synthesizeSymbol().
|
inline |
Bbox re-anchoring offset for the given orientation and body size (DBU).
Definition at line 158 of file orcad_converter.h.
References ORCAD_ORIENT_TABLE, OrcadOrientDim(), ORCAD_ORIENT_ENTRY::txSel, and ORCAD_ORIENT_ENTRY::tySel.
Referenced by OrcadTransformPoint(), ORCAD_CONVERTER::placeInstance(), ORCAD_CONVERTER::placePowerSymbol(), and ORCAD_CONVERTER::synthesizeSymbol().
| int OrcadPageOrder | ( | wxString & | aName | ) |
Return a numeric page prefix (or -1); strip only the "N - title" convention.
Definition at line 197 of file orcad_converter_sheet.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and ORCAD_CONVERTER::Convert().
|
inline |
Absolute canvas position (DBU) of symbol-space point (aPx, aPy) for an instance with transform base (aBaseX, aBaseY), orientation aOrient and body size (aWidth, aHeight).
For placed parts the base is the instance anchor; for power/off-page/port symbols it is the placed bbox min corner, NOT the anchor.
Definition at line 172 of file orcad_converter.h.
References ORCAD_ORIENT_ENTRY::a, ORCAD_ORIENT_ENTRY::b, ORCAD_ORIENT_ENTRY::c, ORCAD_ORIENT_ENTRY::d, ORCAD_ORIENT_TABLE, OrcadOrientOffset(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ORCAD_CONVERTER::graphicPinPos(), ORCAD_CONVERTER::pickVariant(), ORCAD_CONVERTER::placeDefinitionImages(), ORCAD_CONVERTER::placeDefinitionVectors(), ORCAD_CONVERTER::placeInstance(), and ORCAD_CONVERTER::placeSymbolFields().
|
inlineconstexpr |
Schematic internal units per OrCAD DBU: 10 mil * 254 IU/mil.
Definition at line 80 of file orcad_converter.h.
Referenced by ORCAD_CONVERTER::addSymbolPin(), ORCAD_CONVERTER::addSymbolPrimitive(), ORCAD_CONVERTER::kicadSymbolFor(), OrcadDbuToIu(), ORCAD_CONVERTER::placeBitmap(), ORCAD_CONVERTER::placeBusEntries(), and ORCAD_CONVERTER::placeSymbolFields().
|
inlineconstexpr |
Orientation table, indexed by the 3-bit orientation code.
KiCad angle/mirror pairs and bbox anchor offsets:
ori : (angle, mirror) offset(w, h) matrix (a b c d) 0 : ( 0, -) (0, 0) ( 1 0 0 1) 1 : ( 90, -) (0, w) ( 0 1 -1 0) 2 : (180, -) (w, h) (-1 0 0 -1) 3 : (270, -) (h, 0) ( 0 -1 1 0) 4 : ( 0, y) (w, 0) (-1 0 0 1) 5 : ( 90, x) (0, 0) ( 0 1 1 0) 6 : ( 0, x) (0, h) ( 1 0 0 -1) 7 : (270, x) (h, w) ( 0 -1 -1 0)
Definition at line 132 of file orcad_converter.h.
Referenced by OrcadOrientOffset(), OrcadTransformPoint(), ORCAD_CONVERTER::placeBitmap(), ORCAD_CONVERTER::placeSymbolFields(), and ORCAD_CONVERTER::synthesizeSymbol().