KiCad PCB EDA Suite
Loading...
Searching...
No Matches
orcad_converter.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * Based on the dsn2kicad reference implementation and on OrCAD file format
7 * documentation from the OpenOrCadParser project (MIT licensed).
8 *
9 * This program is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
45
46#ifndef ORCAD_CONVERTER_H_
47#define ORCAD_CONVERTER_H_
48
49#include <cstdint>
50#include <map>
51#include <memory>
52#include <set>
53#include <string>
54#include <tuple>
55#include <utility>
56#include <vector>
57
58#include <wx/string.h>
59
60#include <math/box2.h>
61#include <math/vector2d.h>
62#include <gal/color4d.h>
63#include <eda_shape.h>
64
66
67class LIB_SYMBOL;
68class EDA_TEXT;
70class REPORTER;
71class SCHEMATIC;
72class SCH_SCREEN;
73class SCH_SHEET;
74class SCH_SHEET_PATH;
75class SCH_SYMBOL;
76class wxMemoryBuffer;
77
78
80inline constexpr int ORCAD_IU_PER_DBU = 2540;
81
82KIGFX::COLOR4D OrcadColor( int aColorIndex );
83int OrcadLineWidthIu( int aWidth );
84LINE_STYLE OrcadLineStyle( int aStyle );
85FILL_T OrcadFillType( int aFillStyle, int aHatchStyle );
86int OrcadPageOrder( wxString& aName );
87
88inline VECTOR2I OrcadDbuToIu( int aX, int aY )
89{
90 return VECTOR2I( aX * ORCAD_IU_PER_DBU, aY * ORCAD_IU_PER_DBU );
91}
92
93
107{
108 int angle;
109 char mirror;
110 int8_t txSel;
111 int8_t tySel;
112 int8_t a;
113 int8_t b;
114 int8_t c;
115 int8_t d;
116};
117
133 { 0, 0, 0, 0, 1, 0, 0, 1 },
134 { 90, 0, 0, 1, 0, 1, -1, 0 },
135 { 180, 0, 1, 2, -1, 0, 0, -1 },
136 { 270, 0, 2, 0, 0, -1, 1, 0 },
137 { 0, 'y', 1, 0, -1, 0, 0, 1 },
138 { 90, 'x', 0, 0, 0, 1, 1, 0 },
139 { 0, 'x', 0, 2, 1, 0, 0, -1 },
140 { 270, 'x', 2, 1, 0, -1, -1, 0 }
141};
142
143
145inline int OrcadOrientOf( int aRotation, bool aMirror )
146{
147 return ( aRotation & 3 ) | ( aMirror ? 0x4 : 0 );
148}
149
150
151inline int OrcadOrientDim( int aSelector, int aWidth, int aHeight )
152{
153 return aSelector == 1 ? aWidth : aSelector == 2 ? aHeight : 0;
154}
155
156
158inline VECTOR2I OrcadOrientOffset( int aOrient, int aWidth, int aHeight )
159{
160 const ORCAD_ORIENT_ENTRY& e = ORCAD_ORIENT_TABLE[aOrient & 7];
161 return VECTOR2I( OrcadOrientDim( e.txSel, aWidth, aHeight ),
162 OrcadOrientDim( e.tySel, aWidth, aHeight ) );
163}
164
165
172inline VECTOR2I OrcadTransformPoint( int aOrient, int aWidth, int aHeight, int aBaseX, int aBaseY,
173 int aPx, int aPy )
174{
175 const ORCAD_ORIENT_ENTRY& e = ORCAD_ORIENT_TABLE[aOrient & 7];
176 VECTOR2I t = OrcadOrientOffset( aOrient, aWidth, aHeight );
177
178 return VECTOR2I( aBaseX + t.x + e.a * aPx + e.b * aPy,
179 aBaseY + t.y + e.c * aPx + e.d * aPy );
180}
181
182
199{
200public:
208 ORCAD_CONVERTER( ORCAD_DESIGN& aDesign, SCHEMATIC* aSchematic, REPORTER* aReporter,
209 PROGRESS_REPORTER* aProgressReporter = nullptr );
210
213
233 SCH_SHEET* Convert( SCH_SHEET* aRootSheet );
234
241 std::vector<LIB_SYMBOL*> BuildSymbolLibrary();
242
244 static constexpr const char* LIB_NICK = "orcad_import";
245
246private:
247 // -- shared bookkeeping types ---------------------------------------------------
248
251 {
252 std::string letter;
253 const ORCAD_SYMBOL_DEF* symbol = nullptr;
254 std::vector<std::string> pinNumbers;
255 };
256
259 {
260 std::string name;
261 std::vector<UNIT_INFO> units;
262 bool isPower = false;
263 std::string powerNet;
264 std::string refPrefix = "U";
265 std::string footprint;
266 std::unique_ptr<LIB_SYMBOL> kicadSymbol;
267 };
268
271 {
272 int index = 0;
273 std::string net;
274 int x = 0;
275 int y = 0;
276 };
277
279 using PKG_KEY = std::tuple<std::string, std::string, int>;
280
281 // -- constants (calibrated; do not change) ----------------------------------------
282
284 static constexpr int PIN_LEN_DBU = 10;
285
289 static constexpr int MARGIN_L_DBU = 60;
290 static constexpr int MARGIN_T_DBU = 60;
291 static constexpr int MARGIN_R_DBU = 60;
292 static constexpr int MARGIN_B_DBU = 100;
293
294 // -- reporting [orcad_converter_sheet.cpp] ------------------------------------------
295
297 void warn( const wxString& aMsg );
298
300 void note( const wxString& aMsg );
301
302 // ================================================================================
303 // implemented in orcad_converter_symbols.cpp
304 // ================================================================================
305
311 void prepareSymbols();
312
323 ORCAD_SYMBOL_DEF synthesizeSymbol( const std::string& aPkgName,
324 const std::vector<const ORCAD_PLACED_INSTANCE*>& aInstances ) const;
325
331 std::string unitLetter( const ORCAD_PLACED_INSTANCE& aInst ) const;
332
339 std::pair<const ORCAD_SYMBOL_DEF*, int> pickVariant( const ORCAD_PLACED_INSTANCE& aInst ) const;
340
352 std::pair<std::string, int> libForInstance( const ORCAD_PLACED_INSTANCE& aInst );
353
363 std::string powerLibFor( const std::string& aSymbolName, const std::string& aNetName );
364
374 LIB_SYMBOL* kicadSymbolFor( const std::string& aLibName );
375
382 void addSymbolPrimitive( LIB_SYMBOL* aSymbol, const ORCAD_PRIMITIVE& aPrim, int aUnit, int aColor, int aOffsetX = 0,
383 int aOffsetY = 0 );
384
386 void addSymbolArc( LIB_SYMBOL* aSymbol, const ORCAD_PRIMITIVE& aPrim, int aUnit, int aColor, int aOffsetX = 0,
387 int aOffsetY = 0 );
388
397 void addSymbolPin( LIB_SYMBOL* aSymbol, const ORCAD_SYMBOL_PIN& aPin, const wxString& aNumber,
398 int aUnit, bool aPower, const std::string& aNameOverride );
399
408 void placeInstance( ORCAD_RAW_PAGE& aPage, const ORCAD_PLACED_INSTANCE& aInst,
409 SCH_SCREEN* aScreen, const SCH_SHEET_PATH& aSheetPath );
410
416 wxString resolveReference( const ORCAD_PLACED_INSTANCE& aInst ) const;
417
425 void placePowerSymbol( ORCAD_RAW_PAGE& aPage, const ORCAD_GRAPHIC_INST& aInst,
426 const std::string& aNet, SCH_SCREEN* aScreen,
427 const SCH_SHEET_PATH& aSheetPath );
428
448 void placeSymbolFields( SCH_SYMBOL* aSymbol, const ORCAD_PLACED_INSTANCE& aInst,
449 const ORCAD_SYMBOL_DEF& aDef, int aOrient, const std::string& aValue,
450 const std::string& aFootprint );
451
460 static int toKicadOrientation( int aOrient );
461
468 void computeFontBaseline();
469
471 int fontHeightDbu( int aFontIdx ) const;
472
478 int textSizeIU( int aFontIdx ) const;
479
480 void applyFont( EDA_TEXT* aText, int aFontIdx ) const;
481
483 static std::string SymbolId( const std::string& aName );
484
485 // ================================================================================
486 // implemented in orcad_converter_sheet.cpp
487 // ================================================================================
488
494 void convertPage( ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen,
495 const SCH_SHEET_PATH& aSheetPath );
496
502 static wxString MakePageFileName( int aPageIndex, const std::string& aPageName );
503
513 void applyPageSettings( ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
514
523 static BOX2I pageExtentDbu( const ORCAD_RAW_PAGE& aPage );
524
531 static void offsetPage( ORCAD_RAW_PAGE& aPage, int aDx, int aDy );
532
538 void applyTitleBlock( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
539
541 void buildNetLookup( const ORCAD_RAW_PAGE& aPage );
542
548 std::string netAt( const ORCAD_RAW_PAGE& aPage, int aX, int aY ) const;
549
555 std::string powerNet( const ORCAD_RAW_PAGE& aPage, const ORCAD_GRAPHIC_INST& aInst ) const;
556
563 VECTOR2I graphicPinPos( const ORCAD_GRAPHIC_INST& aInst ) const;
564
566 std::vector<OFFPAGE_NET> offpageNets( const ORCAD_RAW_PAGE& aPage ) const;
567
576 std::vector<VECTOR2I> computeJunctions( const ORCAD_RAW_PAGE& aPage ) const;
577
579 void placeJunctions( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
580
587 void placeWires( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
588
590 void placeBusEntries( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
591
593 void placeNoConnects( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
594
602 void placeOffpageConnectors( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
603
610 void placePorts( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen, bool aHierarchical );
611
619 void placeGraphics( const ORCAD_RAW_PAGE& aPage, SCH_SCREEN* aScreen );
620
629 void placeBitmap( const ORCAD_PRIMITIVE& aPrim, SCH_SCREEN* aScreen, int aOrient = 0 );
630
631 void placeDefinitionImages( const ORCAD_SYMBOL_DEF& aDefinition, int aBaseX, int aBaseY, int aOrient,
632 SCH_SCREEN* aScreen );
633
634 void placeDefinitionVectors( const ORCAD_SYMBOL_DEF& aDefinition, int aBaseX, int aBaseY, int aOrient,
635 SCH_SCREEN* aScreen );
636
645 static bool MakeBmpFromDib( const std::vector<uint8_t>& aDib, wxMemoryBuffer& aOut );
646
648 static VECTOR2I snapToWire( int aX, int aY, const ORCAD_WIRE& aWire );
649
651 static bool onSegment( int aX, int aY, const ORCAD_WIRE& aWire );
652
657 static wxString SanitizeFileName( const std::string& aName );
658
659private:
665
666 std::map<std::string, LIB_ENTRY> m_libSymbols;
667 std::map<PKG_KEY, std::pair<std::string, int>> m_pkgToLib;
670
674 const std::map<uint32_t, std::string>* m_currentOccRefs = nullptr;
675
677 std::set<wxString> m_usedSheetNames;
678
680 std::map<std::pair<int, int>, std::vector<const ORCAD_WIRE*>> m_wireEndpoints;
681};
682
683#endif // ORCAD_CONVERTER_H_
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:89
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
Define a library symbol object.
Definition lib_symbol.h:114
void placePowerSymbol(ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst, const std::string &aNet, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath)
Place one power symbol: transform base = placed bbox min corner (fall back to the anchor when the bbo...
void placeJunctions(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
Append computed junctions as SCH_JUNCTION items.
std::vector< VECTOR2I > computeJunctions(const ORCAD_RAW_PAGE &aPage) const
Junction points (DBU) from wire geometry + shared net ids.
void prepareSymbols()
Pre-pass over all pages: synthesize placeholder definitions for symbols absent from the cache (one no...
void computeFontBaseline()
Find the design's dominant text height (most frequent font height over all alias and display-prop fon...
std::vector< OFFPAGE_NET > offpageNets(const ORCAD_RAW_PAGE &aPage) const
Resolve every off-page connector on the page to (index, net, pin position).
std::string netAt(const ORCAD_RAW_PAGE &aPage, int aX, int aY) const
Net name at a point: first a wire with an endpoint here whose id is in the page net table; then any w...
static constexpr int MARGIN_B_DBU
PROGRESS_REPORTER * m_progressReporter
SCH_SHEET * Convert(SCH_SHEET *aRootSheet)
Populate the schematic.
void buildNetLookup(const ORCAD_RAW_PAGE &aPage)
Rebuild m_wireEndpoints for a page (both endpoints of every wire).
void convertPage(ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath)
Convert one page onto a screen: applyTitleBlock(), buildNetLookup(), then junctions,...
std::pair< std::string, int > libForInstance(const ORCAD_PLACED_INSTANCE &aInst)
Resolve/register the emitted lib symbol and unit number for a placed part.
static constexpr int PIN_LEN_DBU
Standard OrCAD pin length used for synthesized placeholder pins, DBU.
static constexpr int MARGIN_R_DBU
std::pair< const ORCAD_SYMBOL_DEF *, int > pickVariant(const ORCAD_PLACED_INSTANCE &aInst) const
The cache may hold several stale library versions of one symbol name; pick the variant whose transfor...
const std::map< uint32_t, std::string > * m_currentOccRefs
Occurrence reference designators of the scope currently being converted; set per page so a child sche...
VECTOR2I graphicPinPos(const ORCAD_GRAPHIC_INST &aInst) const
Absolute connection point (DBU) of a GraphicInst-derived instance (power symbol / off-page connector ...
void applyPageSettings(ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
Fit the page and set the screen's PAGE_INFO.
ORCAD_CONVERTER(ORCAD_DESIGN &aDesign, SCHEMATIC *aSchematic, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter=nullptr)
static bool onSegment(int aX, int aY, const ORCAD_WIRE &aWire)
True when the point lies strictly INSIDE (not at an endpoint of) an H/V wire.
void placeBitmap(const ORCAD_PRIMITIVE &aPrim, SCH_SCREEN *aScreen, int aOrient=0)
One image primitive -> SCH_BITMAP centered on the primitive's page extent, scaled from its native pix...
~ORCAD_CONVERTER()
Out-of-line: LIB_ENTRY holds LIB_SYMBOL by unique_ptr. [orcad_converter_sheet.cpp].
SCH_SHEET * m_rootSheet
static wxString MakePageFileName(int aPageIndex, const std::string &aPageName)
"P%02d_<pagename>.kicad_sch" (1-based index), sanitized: control characters and the characters <>:"/|...
LIB_SYMBOL * kicadSymbolFor(const std::string &aLibName)
Return the fully built KiCad LIB_SYMBOL for a registered LIB_ENTRY, building and caching it on first ...
void addSymbolPin(LIB_SYMBOL *aSymbol, const ORCAD_SYMBOL_PIN &aPin, const wxString &aNumber, int aUnit, bool aPower, const std::string &aNameOverride)
Add one pin: position = hot point, length = |start - hot|, orientation from the start-relative-to-hot...
static BOX2I pageExtentDbu(const ORCAD_RAW_PAGE &aPage)
Bounding box (DBU) of everything drawable on the page: wire ends, instance placed bboxes + T0x10 pin ...
std::map< PKG_KEY, std::pair< std::string, int > > m_pkgToLib
void note(const wxString &aMsg)
Fact about the source design (not a conversion problem): RPT_SEVERITY_INFO.
void placeInstance(ORCAD_RAW_PAGE &aPage, const ORCAD_PLACED_INSTANCE &aInst, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath)
Place one part instance on a screen: SCH_SYMBOL from the built LIB_SYMBOL (flattened-copy constructor...
ORCAD_DESIGN & m_design
int m_fontBaselineDbu
dominant text height; 0 = none
void placeSymbolFields(SCH_SYMBOL *aSymbol, const ORCAD_PLACED_INSTANCE &aInst, const ORCAD_SYMBOL_DEF &aDef, int aOrient, const std::string &aValue, const std::string &aFootprint)
KiCad-style field placement for a placed part, always reading horizontally (fields rotate with the sy...
std::set< wxString > m_usedSheetNames
Lower-cased sheet names already emitted, to keep sibling sheet names unique.
void addSymbolArc(LIB_SYMBOL *aSymbol, const ORCAD_PRIMITIVE &aPrim, int aUnit, int aColor, int aOffsetX=0, int aOffsetY=0)
Polyline approximation of an arc primitive. Helper of addSymbolPrimitive().
int textSizeIU(int aFontIdx) const
Text size in IU for a font reference: 1.27 mm when the height is unknown; with a baseline,...
void placeWires(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
Wires/buses as SCH_LINE on LAYER_WIRE / LAYER_BUS, plus a local SCH_LABEL per wire alias: anchor snap...
std::map< std::string, LIB_ENTRY > m_libSymbols
keyed by emitted lib name
void applyFont(EDA_TEXT *aText, int aFontIdx) const
static int toKicadOrientation(int aOrient)
Map an orientation code to the composed SYMBOL_ORIENTATION_T value for SCH_SYMBOL::SetOrientation(): ...
int m_powerCount
"#PWR%04d" counter
void applyTitleBlock(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
Fill the screen TITLE_BLOCK from the first page title block carrying properties: Title,...
void placeDefinitionImages(const ORCAD_SYMBOL_DEF &aDefinition, int aBaseX, int aBaseY, int aOrient, SCH_SCREEN *aScreen)
wxString resolveReference(const ORCAD_PLACED_INSTANCE &aInst) const
Resolve a placed instance's reference designator, falling back to the Hierarchy-stream occurrence des...
static void offsetPage(ORCAD_RAW_PAGE &aPage, int aDx, int aDy)
Shift every drawable coordinate on the page by (aDx, aDy) DBU: wires and their aliases,...
std::string unitLetter(const ORCAD_PLACED_INSTANCE &aInst) const
Unit discriminator of an instance: the part of pkgName between the package base name and the '....
static std::string SymbolId(const std::string &aName)
LIB_ID-safe symbol name: ':', '"', '/' and whitespace runs -> '_'; "SYM" if empty.
void addSymbolPrimitive(LIB_SYMBOL *aSymbol, const ORCAD_PRIMITIVE &aPrim, int aUnit, int aColor, int aOffsetX=0, int aOffsetY=0)
Add one body primitive to a LIB_SYMBOL unit on LAYER_DEVICE.
ORCAD_SYMBOL_DEF synthesizeSymbol(const std::string &aPkgName, const std::vector< const ORCAD_PLACED_INSTANCE * > &aInstances) const
Best-effort placeholder for a cache-less symbol, built from the instances' T0x10 absolute pin records...
int fontHeightDbu(int aFontIdx) const
|lfHeight| of a 1-based font index; 0 for invalid/default indices.
void placeOffpageConnectors(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
SCH_GLOBALLABEL per resolved off-page connector, at the connection point; an unconnected connector (e...
static constexpr int MARGIN_T_DBU
SCHEMATIC * m_schematic
void placeGraphics(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
Free page graphics from the nested primitives of each Graphic*Inst (the outer record itself is not dr...
std::string powerLibFor(const std::string &aSymbolName, const std::string &aNetName)
Resolve/register the power lib symbol for a power-symbol instance.
void warn(const wxString &aMsg)
Conversion problem: REPORTER at RPT_SEVERITY_WARNING.
void placeDefinitionVectors(const ORCAD_SYMBOL_DEF &aDefinition, int aBaseX, int aBaseY, int aOrient, SCH_SCREEN *aScreen)
REPORTER * m_reporter
void placeNoConnects(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
SCH_NO_CONNECT per ERC object, at the object's anchor.
std::vector< LIB_SYMBOL * > BuildSymbolLibrary()
Build KiCad library symbols from the design cache and packages alone (no schematic pages),...
void placePorts(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, bool aHierarchical)
SCH_HIERLABEL per port on a hierarchical child page, otherwise SCH_GLOBALLABEL.
static constexpr const char * LIB_NICK
Symbol library nickname used in every emitted LIB_ID.
static VECTOR2I snapToWire(int aX, int aY, const ORCAD_WIRE &aWire)
Closest point (DBU) on a wire segment to (aX, aY); exact for H/V wires.
static constexpr int MARGIN_L_DBU
Page content margins, DBU.
std::string powerNet(const ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst) const
Net stamped by a power-symbol instance: the net of the wire its pin touches (authoritative — ports ca...
std::map< std::pair< int, int >, std::vector< const ORCAD_WIRE * > > m_wireEndpoints
Per-page wire lookup: endpoint -> wires ending there. Rebuilt by buildNetLookup().
void placeBusEntries(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
SCH_BUS_WIRE_ENTRY per bus entry (position x1,y1; size x2-x1, y2-y1).
std::tuple< std::string, std::string, int > PKG_KEY
(sourcePackage-or-pkgName, pkgName, variant index) -> (lib name, unit number).
static wxString SanitizeFileName(const std::string &aName)
Filesystem-safe name: control characters and <>:"/|?
static bool MakeBmpFromDib(const std::vector< uint8_t > &aDib, wxMemoryBuffer &aOut)
Synthesize a .BMP in front of a raw DIB (BITMAPINFOHEADER + optional palette + pixels): pixel data of...
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:72
Holds all the data relating to one schematic.
Definition schematic.h:90
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition sch_sheet.h:44
Schematic symbol object.
Definition sch_symbol.h:69
FILL_T
Definition eda_shape.h:59
constexpr ORCAD_ORIENT_ENTRY ORCAD_ORIENT_TABLE[8]
Orientation table, indexed by the 3-bit orientation code.
VECTOR2I OrcadDbuToIu(int aX, int aY)
FILL_T OrcadFillType(int aFillStyle, int aHatchStyle)
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 (...
int OrcadOrientDim(int aSelector, int aWidth, int aHeight)
int OrcadLineWidthIu(int aWidth)
int OrcadPageOrder(wxString &aName)
Return a numeric page prefix (or -1); strip only the "N - title" convention.
KIGFX::COLOR4D OrcadColor(int aColorIndex)
int OrcadOrientOf(int aRotation, bool aMirror)
Compose the 3-bit orientation code from the rotation bits and mirror bit.
constexpr int ORCAD_IU_PER_DBU
Schematic internal units per OrCAD DBU: 10 mil * 254 IU/mil.
LINE_STYLE OrcadLineStyle(int aStyle)
VECTOR2I OrcadOrientOffset(int aOrient, int aWidth, int aHeight)
Bbox re-anchoring offset for the given orientation and body size (DBU).
Plain data records produced by the OrCAD Capture DSN stream parsers and consumed by ORCAD_CONVERTER.
LINE_STYLE
Dashed line types.
One emitted KiCad lib symbol (possibly multi-unit).
std::string name
lib item name (no nickname)
std::unique_ptr< LIB_SYMBOL > kicadSymbol
built lazily by kicadSymbolFor()
std::string footprint
bool isPower
std::vector< UNIT_INFO > units
sorted by letter; unit numbers are 1-based indices
std::string refPrefix
std::string powerNet
power symbols are keyed by NET name
One resolved off-page connector: index into page.offpage, net, pin position.
One unit of an emitted multi-unit symbol.
const ORCAD_SYMBOL_DEF * symbol
std::vector< std::string > pinNumbers
device pin-number map for this unit
std::string letter
unit discriminator, e.g. "A", "-16", "B:Convert"
Everything parsed from one .DSN, as handed to ORCAD_CONVERTER.
Shared body of Port / Global / OffPageConnector / TitleBlock / ERCObject and the Graphic*Inst shapes ...
One entry of the 8-orientation placement table.
char mirror
0 = none, 'x' or 'y' = KiCad mirror axis
int8_t tySel
Y offset selector.
int8_t c
int8_t a
int angle
KiCad placement angle in degrees (0/90/180/270, CCW)
int8_t d
int8_t txSel
X offset selector.
int8_t b
A placed part instance on a page (structure type 13).
One graphic primitive of a symbol body or nested page graphic.
One parsed 'Views/<folder>/Pages/<page>' stream, raw structure lists in stream order.
A symbol definition from the design Cache (LibraryPart / GlobalSymbol / PortSymbol / OffPageSymbol / ...
One pin of a symbol definition (structure types 26/27).
One wire or bus segment.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683