KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ORCAD_CONVERTER Class Reference

#include <orcad_converter.h>

Classes

struct  INTERFACE_LABEL_SOURCE
 
struct  LIB_ENTRY
 One emitted KiCad lib symbol (possibly multi-unit). More...
 
struct  NET_LABEL_INTENT
 
struct  OFFPAGE_NET
 One resolved off-page connector: index into page.offpage, net, pin position. More...
 
struct  PLACED_PACKAGE_UNIT
 
struct  SOURCE_PIN_IDENTITY
 
struct  UNIT_INFO
 – shared bookkeeping types ------------------------------------------------— More...
 

Public Member Functions

 ORCAD_CONVERTER (ORCAD_DESIGN &aDesign, SCHEMATIC *aSchematic, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter=nullptr)
 aDesign is mutated and must outlive the converter.
 
 ~ORCAD_CONVERTER ()
 Out-of-line: LIB_ENTRY holds LIB_SYMBOL by unique_ptr.
 
SCH_SHEETConvert (SCH_SHEET *aRootSheet)
 aRootSheet must have a screen and be registered on the schematic.
 
std::vector< LIB_SYMBOL * > BuildSymbolLibrary ()
 The caller owns the returned library symbols.
 

Static Public Attributes

static constexpr const char * LIB_NICK = "orcad_import"
 Symbol library nickname used in every emitted LIB_ID.
 

Private Types

using PKG_KEY = std::tuple<std::string, std::string, int, std::string>
 (sourcePackage-or-pkgName, pkgName, variant index, unit discriminator) -> (lib name, unit number).
 

Private Member Functions

void warn (const wxString &aMsg)
 – reporting [orcad_converter_sheet.cpp] ---------------------------------------—
 
void note (const wxString &aMsg)
 Fact about the source design (not a conversion problem): RPT_SEVERITY_INFO.
 
void prepareGlobalNetNames ()
 Capture net names ignore case; KiCad net names do not.
 
std::string canonicalGlobalNetName (const std::string &aName) const
 Return the design-wide spelling selected by prepareGlobalNetNames().
 
std::string effectiveInterfaceNetName (const std::string &aName) const
 
std::string occurrenceElectricalNetName (uint32_t aOccurrenceId, const std::string &aName) const
 
bool isPowerNetName (const std::string &aName) const
 
bool isOffpageNetName (const std::string &aName) const
 
void prepareSymbols ()
 
ORCAD_SYMBOL_DEF synthesizeSymbol (const std::string &aPkgName, const std::vector< const ORCAD_PLACED_INSTANCE * > &aInstances) const
 Use placed pin positions to keep uncached symbols connected.
 
std::string unitLetter (const ORCAD_PLACED_INSTANCE &aInst) const
 The unit key includes a non-Normal view so DeMorgan graphics remain distinct.
 
std::pair< const ORCAD_SYMBOL_DEF *, int > pickVariant (const ORCAD_PLACED_INSTANCE &aInst) const
 Match cached variants to placed pin positions; use the first entry if none matches.
 
std::pair< std::string, int > libForInstance (const ORCAD_PLACED_INSTANCE &aInst, const PKG_KEY **aSourceUnit=nullptr)
 Returns the registered library name and unit number.
 
void finalizeNativePowerPackages ()
 
std::optional< uint32_t > occurrenceNetIdFor (const std::string *aName) const
 Return the occurrence net id owning aName, which the table identifies by address.
 
void finishConversion ()
 Run the shared finalization sequence that ends every conversion entry point.
 
std::string powerLibFor (const std::string &aSymbolName, const std::string &aNetName)
 Key power symbols by net name because users can rename their ports.
 
LIB_SYMBOLkicadSymbolFor (const std::string &aLibName)
 
void addSymbolPrimitive (LIB_SYMBOL *aSymbol, const ORCAD_PRIMITIVE &aPrim, int aUnit, int aColor, int aOffsetX=0, int aOffsetY=0)
 
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.
 
void addSymbolPin (LIB_SYMBOL *aSymbol, const ORCAD_SYMBOL_PIN &aPin, const wxString &aNumber, int aUnit, bool aPower, const std::string &aNameOverride, bool aNameVisible, bool aShowPinNumbers, bool aNumberVisible, const BOX2I *aBodyBox, bool aHidden=false, bool aExplicitNet=false)
 
void placeInstance (ORCAD_RAW_PAGE &aPage, const ORCAD_PLACED_INSTANCE &aInst, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath)
 
wxString resolveReference (const ORCAD_PLACED_INSTANCE &aInst) const
 Use the occurrence reference when the instance has an unannotated template.
 
void placePowerSymbol (ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst, const std::string &aNet, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath)
 
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)
 
const ORCAD_PACKAGEpackageFor (const ORCAD_PLACED_INSTANCE &aInst) const
 The cache package backing a placement, or nullptr when the design has none.
 
std::map< std::string, std::string > effectiveProps (const ORCAD_PLACED_INSTANCE &aInst, const ORCAD_SYMBOL_DEF &aDef) const
 Empty package and placement values must not clear a library property.
 
void computeFontBaseline ()
 
int displayFontId (const ORCAD_DISPLAY_PROP &aProp) const
 
bool displayUsesTemplateFont (const ORCAD_DISPLAY_PROP &aProp) const
 
int wireAliasFontId (const ORCAD_ALIAS &aAlias) const
 
int textBaselineOffset (int aTextSize, int aFontIdx, bool aTemplateFont=true) const
 
int resolveFontIndex (int aFontIdx) const
 Resolve a Design Template font ID to its 1-based LOGFONT index.
 
int fontHeightDbu (int aFontIdx, bool aTemplateFont=true) const
 |lfHeight| of a Design Template font ID; ID 0 selects the template default.
 
int textSizeIU (int aFontIdx, bool aTemplateFont=true) const
 
VECTOR2I textSize (int aFontIdx, bool aTemplateFont=true) const
 Preserve an explicit LOGFONT width while retaining natural font aspect when it is zero.
 
void applyFont (EDA_TEXT *aText, int aFontIdx, bool aTemplateFont=true) const
 
void applyMultilineSpacing (SCH_TEXT *aText, int aFontIdx, bool aTemplateFont=true) const
 
void convertPage (ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath, bool aContainerPage=false, bool aSharedFolderPage=false)
 
void placeHierarchicalBlockFields (SCH_SHEET *aSheet, const ORCAD_DRAWN_INSTANCE &aBlock, const std::string &aChildFolder)
 
void placeHierarchicalBlockPinFill (SCH_SCREEN *aScreen, SCH_SHEET_PIN *aPin)
 
void appendNetIntent (SCH_SCREEN *aScreen, SCH_LABEL *aLabel, bool aExplicitName, uint32_t aNetId=0)
 
void minimizeNetLabels ()
 
void finalizeNetNames ()
 
void recordNetNameMap ()
 
void convertUnreferencedPages ()
 
KIID deterministicUuid (const std::string &aRole, size_t aOrdinal) const
 
void appendPageItem (SCH_SCREEN *aScreen, SCH_ITEM *aItem)
 
void assignPageItemUuids (size_t aPageOrdinal)
 
void applyPageSettings (ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
 Shift content on the 10-DBU grid to preserve connectivity.
 
void placePageFrame (const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
 
void applyTitleBlock (const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
 
void buildNetLookup (const ORCAD_RAW_PAGE &aPage)
 Rebuild m_wireEndpoints for a page (both endpoints of every wire).
 
std::string netAt (const ORCAD_RAW_PAGE &aPage, int aX, int aY) const
 Prefer endpoint nets, then intersecting wires, then endpoint aliases.
 
std::string powerNet (const ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst) const
 
VECTOR2I graphicPinPos (const ORCAD_GRAPHIC_INST &aInst) const
 Use the transformed cache pin position, or the instance anchor if no pin is available.
 
VECTOR2I namedGraphicPinPos (const ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst) const
 Graphic-symbol connection point, corrected to a nearby endpoint of its named wire.
 
VECTOR2I powerPinPos (const ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst) const
 Power-symbol connection point, corrected to a nearby endpoint of its named wire.
 
std::vector< int > placedStackedPinOffsets (const ORCAD_PLACED_INSTANCE &aInstance) const
 
VECTOR2I placedPinElectricalPosition (const ORCAD_PLACED_INSTANCE &aInstance, size_t aPinIndex) const
 
bool hasImplicitPowerPinName (const ORCAD_PLACED_INSTANCE &aInstance, size_t aPinIndex, const std::string &aNetName) const
 
std::vector< OFFPAGE_NEToffpageNets (const ORCAD_RAW_PAGE &aPage) const
 Resolve every off-page connector on the page to (index, net, pin position).
 
std::vector< VECTOR2IcomputeJunctions (const ORCAD_RAW_PAGE &aPage) const
 Use both geometry and net IDs; a crossing alone does not create a junction.
 
void placeJunctions (const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
 Append computed junctions as SCH_JUNCTION items.
 
void placeWires (const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, bool aHierarchical, bool aNestedHierarchy, bool aSharedFolderPage)
 
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).
 
void placeGraphicDisplayText (const ORCAD_GRAPHIC_INST &aGraphic, const ORCAD_DISPLAY_PROP &aDisplay, const std::string &aText, SCH_SCREEN *aScreen)
 One displayed property attached to a placed page symbol, preserving source text geometry.
 
void placeOffpageConnectors (const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath, bool aHierarchical)
 Keep computed intersheet references hidden; display the stored OrCAD IREF text.
 
void placePorts (const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, bool aHierarchical)
 
void placeGraphics (const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
 
void placeBitmap (const ORCAD_PRIMITIVE &aPrim, SCH_SCREEN *aScreen, int aOrient=0, bool *aUsedEmbeddedEmf=nullptr)
 Skip undecodable images with a warning.
 
void placeDefinitionImages (const ORCAD_SYMBOL_DEF &aDefinition, int aBaseX, int aBaseY, int aOrient, SCH_SCREEN *aScreen)
 
void placeDefinitionVectors (const ORCAD_SYMBOL_DEF &aDefinition, int aBaseX, int aBaseY, int aOrient, SCH_SCREEN *aScreen, double aTextScaleX=1.0, double aTextScaleY=1.0, bool aUseGenericTextBaseline=false, const std::string &aTextFaceOverride={})
 
void rememberInterfaceLabelSource (SCH_SCREEN *aScreen, SCH_LABEL_BASE *aLabel, const std::vector< SEG > &aSourceWires)
 

Static Private Member Functions

static int toKicadOrientation (int aOrient)
 
static std::string SymbolId (const std::string &aName)
 LIB_ID-safe symbol name: ':', '"', '/' and whitespace runs -> '_'; "SYM" if empty.
 
static wxString MakePageFileName (int aPageIndex, const std::string &aPageName)
 
static BOX2I pageExtentDbu (const ORCAD_RAW_PAGE &aPage)
 Free graphics use nested primitive bounds; their outer boxes do not describe page coordinates.
 
static void offsetPage (ORCAD_RAW_PAGE &aPage, int aDx, int aDy)
 aDx and aDy must be multiples of the 10-DBU grid.
 
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 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.
 
static wxString SanitizeFileName (const std::string &aName)
 

Private Attributes

ORCAD_DESIGNm_design
 
SCHEMATICm_schematic
 
REPORTERm_reporter
 
PROGRESS_REPORTERm_progressReporter
 
SCH_SHEETm_rootSheet
 
std::map< std::string, LIB_ENTRYm_libSymbols
 keyed by emitted lib name
 
std::map< PKG_KEY, std::pair< std::string, int > > m_pkgToLib
 
std::map< PKG_KEY, std::pair< std::string, int > > m_preparedPkgToLib
 
std::map< std::string, std::vector< UNIT_INFO > > m_preparedLibUnits
 
std::vector< PLACED_PACKAGE_UNITm_placedPackageUnits
 
std::set< std::string > m_nativePowerFamilies
 
std::map< std::string, std::string > m_globalNetNames
 
std::map< std::string, std::string > m_globalNetAliases
 
std::set< std::string > m_powerNetNames
 
std::set< std::string > m_offpageNetNames
 
std::set< std::string > m_connectedBlockInterfaceNames
 
std::map< std::string, size_t > m_occurrenceNetNameScopeCounts
 
std::map< std::string, size_t > m_occurrenceNetNameMinDepth
 
int m_powerCount
 "#PWR%04d" counter
 
int m_fontBaselineDbu
 dominant text height; 0 = none
 
size_t m_pageOrdinal = 0
 
size_t m_screenOrdinal = 1
 
SCH_SCREENm_pageItemScreen = nullptr
 
std::vector< SCH_ITEM * > m_pageItems
 
const std::map< uint32_t, std::string > * m_currentOccRefs = nullptr
 Per-page occurrence references distinguish repeated child schematics.
 
const std::map< uint32_t, std::string > * m_currentOccUnitRefs = nullptr
 
const std::map< uint32_t, std::map< std::string, std::string > > * m_currentOccProps = nullptr
 
const std::map< uint32_t, std::string > * m_currentOccNetNames = nullptr
 
std::string m_currentFlatNetSuffix
 
bool m_scopeNamedFlatNets = false
 
bool m_scopeGeneratedFlatNets = false
 
std::map< std::string, std::string > m_currentUnconnectedInterfaceNetNames
 
std::map< std::string, std::string > m_currentInterfaceNetAliases
 
std::map< std::string, std::string > m_currentOccurrenceNetAliases
 
std::set< std::string > m_currentConnectorInterfaceNetAliases
 
std::set< const ORCAD_PIN_INST * > m_currentImplicitPowerPins
 
std::map< std::string, std::map< std::string, std::string > > m_hierBusNamesByScreen
 
std::vector< INTERFACE_LABEL_SOURCEm_interfaceLabelSources
 
std::vector< NET_LABEL_INTENTm_netLabelIntents
 
std::map< SCH_LABEL_BASE *, std::pair< SCH_SCREEN *, uint32_t > > m_labelSourceNets
 
std::map< SCH_SCREEN *, const ORCAD_RAW_PAGE * > m_sourcePages
 
std::map< std::pair< SCH_SCREEN *, uint32_t >, std::vector< SCH_ITEM * > > m_sourceNetItems
 
std::map< std::pair< SCH_SCREEN *, uint32_t >, std::set< std::string > > m_sourceNetNames
 
std::map< std::pair< SCH_SCREEN *, uint32_t >, std::string > m_sourceGeneratedNetNames
 
std::map< SCH_SYMBOL *, std::vector< SOURCE_PIN_IDENTITY > > m_sourcePinIdentities
 
std::map< SCH_SYMBOL *, const ORCAD_PLACED_INSTANCE * > m_sourceInstances
 
std::map< SCH_SCREEN *, std::vector< wxString > > m_sourceOccurrences
 
std::map< std::tuple< SCH_SCREEN *, const ORCAD_PLACED_INSTANCE *, size_t >, std::pair< uint32_t, std::string > > m_wirelessNetNames
 
std::set< wxString > m_usedSheetNames
 Lower-cased sheet names already emitted, to keep sibling sheet names unique.
 
std::map< std::pair< int, int >, std::vector< const ORCAD_WIRE * > > m_wireEndpoints
 Per-page wire lookup: endpoint -> wires ending there.
 

Static Private Attributes

static constexpr int PIN_LEN_DBU = 10
 – constants (calibrated; do not change) -------------------------------------—
 
static constexpr int MARGIN_L_DBU = 60
 Page margins in DBU leave room for the KiCad frame and title block.
 
static constexpr int MARGIN_T_DBU = 60
 
static constexpr int MARGIN_R_DBU = 60
 
static constexpr int MARGIN_B_DBU = 100
 

Detailed Description

Definition at line 148 of file orcad_converter.h.

Member Typedef Documentation

◆ PKG_KEY

using ORCAD_CONVERTER::PKG_KEY = std::tuple<std::string, std::string, int, std::string>
private

(sourcePackage-or-pkgName, pkgName, variant index, unit discriminator) -> (lib name, unit number).

Definition at line 207 of file orcad_converter.h.

Constructor & Destructor Documentation

◆ ORCAD_CONVERTER()

ORCAD_CONVERTER::ORCAD_CONVERTER ( ORCAD_DESIGN & aDesign,
SCHEMATIC * aSchematic,
REPORTER * aReporter,
PROGRESS_REPORTER * aProgressReporter = nullptr )

aDesign is mutated and must outlive the converter.

Definition at line 364 of file orcad_converter_sheet.cpp.

References m_design, m_fontBaselineDbu, m_powerCount, m_progressReporter, m_reporter, m_rootSheet, and m_schematic.

◆ ~ORCAD_CONVERTER()

ORCAD_CONVERTER::~ORCAD_CONVERTER ( )
default

Member Function Documentation

◆ addSymbolArc()

void ORCAD_CONVERTER::addSymbolArc ( LIB_SYMBOL * aSymbol,
const ORCAD_PRIMITIVE & aPrim,
int aUnit,
int aColor,
int aOffsetX = 0,
int aOffsetY = 0 )
private

◆ addSymbolPin()

◆ addSymbolPrimitive()

◆ appendNetIntent()

void ORCAD_CONVERTER::appendNetIntent ( SCH_SCREEN * aScreen,
SCH_LABEL * aLabel,
bool aExplicitName,
uint32_t aNetId = 0 )
private

◆ appendPageItem()

◆ applyFont()

◆ applyMultilineSpacing()

void ORCAD_CONVERTER::applyMultilineSpacing ( SCH_TEXT * aText,
int aFontIdx,
bool aTemplateFont = true ) const
private

◆ applyPageSettings()

◆ applyTitleBlock()

◆ assignPageItemUuids()

void ORCAD_CONVERTER::assignPageItemUuids ( size_t aPageOrdinal)
private

◆ buildNetLookup()

void ORCAD_CONVERTER::buildNetLookup ( const ORCAD_RAW_PAGE & aPage)
private

Rebuild m_wireEndpoints for a page (both endpoints of every wire).

Definition at line 5037 of file orcad_converter_sheet.cpp.

References m_wireEndpoints, ORCAD_RAW_PAGE::wires, ORCAD_WIRE::x1, ORCAD_WIRE::x2, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.

Referenced by Convert(), and convertPage().

◆ BuildSymbolLibrary()

◆ canonicalGlobalNetName()

std::string ORCAD_CONVERTER::canonicalGlobalNetName ( const std::string & aName) const
private

Return the design-wide spelling selected by prepareGlobalNetNames().

Definition at line 518 of file orcad_converter_sheet.cpp.

References m_globalNetAliases, m_globalNetNames, and name.

Referenced by Convert(), effectiveInterfaceNetName(), placeOffpageConnectors(), placePorts(), placePowerSymbol(), and placeWires().

◆ computeFontBaseline()

◆ computeJunctions()

std::vector< VECTOR2I > ORCAD_CONVERTER::computeJunctions ( const ORCAD_RAW_PAGE & aPage) const
private

◆ Convert()

SCH_SHEET * ORCAD_CONVERTER::Convert ( SCH_SHEET * aRootSheet)

aRootSheet must have a screen and be registered on the schematic.

Cancellation throws IO_ERROR.

Definition at line 1161 of file orcad_converter_sheet.cpp.

References A4, std::abs(), SCH_SHEET::AddPin(), ORCAD_WIRE::aliases, SCH_SCREEN::Append(), appendPageItem(), applyPageSettings(), KIID::AsStdString(), ORCAD_OCC_SCOPE::blocks, ORCAD_RAW_PAGE::blocks, BOTTOM, buildNetLookup(), busNetAt(), canonicalGlobalNetName(), ORCAD_OCC_BLOCK::childFolder, connectedBusName(), convertPage(), ORCAD_DRAWN_INSTANCE::dbId, ORCAD_WIRE::dbId, deterministicUuid(), distance(), SCH_SHEET_PATH::empty(), finishConversion(), flatNetSuffix(), FromOrcadString(), SCH_SHEET::GetField(), SCH_SHEET::GetScreen(), SCH_SCREEN::GetUuid(), ORCAD_RAW_PAGE::globals, ORCAD_DRAWN_INSTANCE::h, hierarchicalPinShape(), ORCAD_WIRE::id, ORCAD_WIRE::isBus, isOffpageNetName(), isPowerNetName(), L_BIDI, LEFT, ORCAD_GRAPHIC_INST::logicalName, m_connectedBlockInterfaceNames, m_currentConnectorInterfaceNetAliases, m_currentFlatNetSuffix, m_currentInterfaceNetAliases, m_currentOccNetNames, m_currentOccProps, m_currentOccRefs, m_currentOccUnitRefs, m_currentOccurrenceNetAliases, m_currentUnconnectedInterfaceNetNames, m_design, m_globalNetAliases, m_hierBusNamesByScreen, m_occurrenceNetNameMinDepth, m_occurrenceNetNameScopeCounts, m_progressReporter, m_rootSheet, m_schematic, m_scopeGeneratedFlatNets, m_scopeNamedFlatNets, m_screenOrdinal, m_usedSheetNames, EDA_ITEM::m_Uuid, MakePageFileName(), name, ORCAD_ALIAS::name, ORCAD_BLOCK_PIN::name, ORCAD_RAW_PAGE::name, ORCAD_RAW_PAGE::netAliases, ORCAD_RAW_PAGE::netmap, ORCAD_OCC_SCOPE::netNames, ORCAD_RAW_PAGE::offpage, OrcadDbuToIu(), ORCAD_OCC_SCOPE::partProps, ORCAD_OCC_SCOPE::partRefs, ORCAD_OCC_SCOPE::partUnitRefs, path, pin, ORCAD_DRAWN_INSTANCE::pins, ORCAD_PLACED_INSTANCE::pins, placeHierarchicalBlockFields(), placeHierarchicalBlockPinFill(), ORCAD_RAW_PAGE::ports, ORCAD_BLOCK_PIN::portType, powerNet(), prepareGlobalNetNames(), prepareSymbols(), ORCAD_DRAWN_INSTANCE::props, SCH_SHEET_PATH::push_back(), rawPointOnSegment(), ORCAD_DRAWN_INSTANCE::reference, ORCAD_PLACED_INSTANCE::reference, result, RIGHT, schIUScale, ORCAD_OCC_BLOCK::scope, scopedHierBusName(), scopedHierBusRange(), SCH_SHEET::SetExcludedFromBoard(), SCH_SCREEN::SetFileName(), SCH_SHEET_PATH::SetPageNumber(), SCH_SCREEN::SetPageSettings(), SCH_SHEET::SetScreen(), SCH_LABEL_BASE::SetShape(), SCH_FIELD::SetText(), SHEET_FILENAME, SHEET_NAME, ORCAD_RAW_PAGE::sourcePageCount, ORCAD_RAW_PAGE::sourcePageNumber, ORCAD_OCC_BLOCK::targetDbId, TOP, ORCAD_DRAWN_INSTANCE::w, ORCAD_RAW_PAGE::wires, ORCAD_BLOCK_PIN::x, VECTOR2< T >::x, ORCAD_DRAWN_INSTANCE::x1, ORCAD_BLOCK_PIN::y, VECTOR2< T >::y, and ORCAD_DRAWN_INSTANCE::y1.

Referenced by BOOST_AUTO_TEST_CASE(), convertRawDesign(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ convertPage()

◆ convertUnreferencedPages()

◆ deterministicUuid()

KIID ORCAD_CONVERTER::deterministicUuid ( const std::string & aRole,
size_t aOrdinal ) const
private

◆ displayFontId()

◆ displayUsesTemplateFont()

bool ORCAD_CONVERTER::displayUsesTemplateFont ( const ORCAD_DISPLAY_PROP & aProp) const
private

◆ effectiveInterfaceNetName()

std::string ORCAD_CONVERTER::effectiveInterfaceNetName ( const std::string & aName) const
private

Definition at line 538 of file orcad_converter_sheet.cpp.

References canonicalGlobalNetName(), m_currentInterfaceNetAliases, and name.

Referenced by placePorts(), and placeWires().

◆ effectiveProps()

std::map< std::string, std::string > ORCAD_CONVERTER::effectiveProps ( const ORCAD_PLACED_INSTANCE & aInst,
const ORCAD_SYMBOL_DEF & aDef ) const
private

Empty package and placement values must not clear a library property.

Definition at line 1443 of file orcad_converter_symbols.cpp.

References ORCAD_PLACED_INSTANCE::dbId, m_currentOccProps, name, overlay, packageFor(), ORCAD_PLACED_INSTANCE::props, and ORCAD_SYMBOL_DEF::props.

Referenced by placeInstance(), and placeSymbolFields().

◆ finalizeNativePowerPackages()

◆ finalizeNetNames()

◆ finishConversion()

void ORCAD_CONVERTER::finishConversion ( )
private

Run the shared finalization sequence that ends every conversion entry point.

Definition at line 4044 of file orcad_converter_sheet.cpp.

References convertUnreferencedPages(), finalizeNativePowerPackages(), and finalizeNetNames().

Referenced by Convert().

◆ fontHeightDbu()

int ORCAD_CONVERTER::fontHeightDbu ( int aFontIdx,
bool aTemplateFont = true ) const
private

|lfHeight| of a Design Template font ID; ID 0 selects the template default.

Definition at line 3800 of file orcad_converter_symbols.cpp.

References std::abs(), m_design, and resolveFontIndex().

Referenced by applyMultilineSpacing(), computeFontBaseline(), and textSizeIU().

◆ graphicPinPos()

◆ hasImplicitPowerPinName()

bool ORCAD_CONVERTER::hasImplicitPowerPinName ( const ORCAD_PLACED_INSTANCE & aInstance,
size_t aPinIndex,
const std::string & aNetName ) const
private

◆ isOffpageNetName()

bool ORCAD_CONVERTER::isOffpageNetName ( const std::string & aName) const
private

Definition at line 606 of file orcad_converter_sheet.cpp.

References m_offpageNetNames.

Referenced by Convert(), and placeWires().

◆ isPowerNetName()

bool ORCAD_CONVERTER::isPowerNetName ( const std::string & aName) const
private

Definition at line 618 of file orcad_converter_sheet.cpp.

References m_powerNetNames.

Referenced by Convert(), and placeWires().

◆ kicadSymbolFor()

◆ libForInstance()

◆ MakePageFileName()

wxString ORCAD_CONVERTER::MakePageFileName ( int aPageIndex,
const std::string & aPageName )
staticprivate

◆ minimizeNetLabels()

◆ namedGraphicPinPos()

VECTOR2I ORCAD_CONVERTER::namedGraphicPinPos ( const ORCAD_RAW_PAGE & aPage,
const ORCAD_GRAPHIC_INST & aInst ) const
private

Graphic-symbol connection point, corrected to a nearby endpoint of its named wire.

Definition at line 5564 of file orcad_converter_sheet.cpp.

References graphicPinPos(), ORCAD_GRAPHIC_INST::logicalName, and name.

Referenced by placePorts(), placeWires(), and powerPinPos().

◆ netAt()

std::string ORCAD_CONVERTER::netAt ( const ORCAD_RAW_PAGE & aPage,
int aX,
int aY ) const
private

Prefer endpoint nets, then intersecting wires, then endpoint aliases.

Definition at line 5049 of file orcad_converter_sheet.cpp.

References empty(), m_wireEndpoints, name, ORCAD_ALIAS::name, ORCAD_RAW_PAGE::netAliases, ORCAD_RAW_PAGE::netmap, onSegment(), and ORCAD_RAW_PAGE::wires.

Referenced by powerNet().

◆ note()

void ORCAD_CONVERTER::note ( const wxString & aMsg)
private

Fact about the source design (not a conversion problem): RPT_SEVERITY_INFO.

Definition at line 443 of file orcad_converter_sheet.cpp.

References m_reporter, and RPT_SEVERITY_INFO.

Referenced by placeInstance(), placeOffpageConnectors(), and prepareSymbols().

◆ occurrenceElectricalNetName()

std::string ORCAD_CONVERTER::occurrenceElectricalNetName ( uint32_t aOccurrenceId,
const std::string & aName ) const
private

◆ occurrenceNetIdFor()

std::optional< uint32_t > ORCAD_CONVERTER::occurrenceNetIdFor ( const std::string * aName) const
private

Return the occurrence net id owning aName, which the table identifies by address.

Definition at line 3651 of file orcad_converter_sheet.cpp.

References m_currentOccNetNames.

Referenced by powerNet().

◆ offpageNets()

std::vector< ORCAD_CONVERTER::OFFPAGE_NET > ORCAD_CONVERTER::offpageNets ( const ORCAD_RAW_PAGE & aPage) const
private

Resolve every off-page connector on the page to (index, net, pin position).

Definition at line 5759 of file orcad_converter_sheet.cpp.

References ORCAD_WIRE::dbId, ORCAD_WIRE::id, ORCAD_RAW_PAGE::instances, m_currentOccNetNames, ORCAD_RAW_PAGE::netAliases, ORCAD_RAW_PAGE::netmap, pin, rawPointOnSegment(), and ORCAD_RAW_PAGE::wires.

Referenced by placeOffpageConnectors().

◆ offsetPage()

◆ onSegment()

bool ORCAD_CONVERTER::onSegment ( int aX,
int aY,
const ORCAD_WIRE & aWire )
staticprivate

True when the point lies strictly INSIDE (not at an endpoint of) an H/V wire.

Definition at line 8733 of file orcad_converter_sheet.cpp.

References ORCAD_WIRE::x1, ORCAD_WIRE::x2, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.

Referenced by computeJunctions(), netAt(), placeWires(), powerNet(), and recordNetNameMap().

◆ packageFor()

◆ pageExtentDbu()

◆ pickVariant()

std::pair< const ORCAD_SYMBOL_DEF *, int > ORCAD_CONVERTER::pickVariant ( const ORCAD_PLACED_INSTANCE & aInst) const
private

◆ placeBitmap()

◆ placeBusEntries()

◆ placeDefinitionImages()

void ORCAD_CONVERTER::placeDefinitionImages ( const ORCAD_SYMBOL_DEF & aDefinition,
int aBaseX,
int aBaseY,
int aOrient,
SCH_SCREEN * aScreen )
private

◆ placeDefinitionVectors()

◆ placedPinElectricalPosition()

VECTOR2I ORCAD_CONVERTER::placedPinElectricalPosition ( const ORCAD_PLACED_INSTANCE & aInstance,
size_t aPinIndex ) const
private

◆ placedStackedPinOffsets()

std::vector< int > ORCAD_CONVERTER::placedStackedPinOffsets ( const ORCAD_PLACED_INSTANCE & aInstance) const
private

◆ placeGraphicDisplayText()

◆ placeGraphics()

void ORCAD_CONVERTER::placeGraphics ( const ORCAD_RAW_PAGE & aPage,
SCH_SCREEN * aScreen )
private

Definition at line 8194 of file orcad_converter_sheet.cpp.

References std::abs(), ANGLE_VERTICAL, appendPageItem(), applyFont(), applyMultilineSpacing(), ARC, BEZIER, ORCAD_FONT::bold, ORCAD_PRIMITIVE::children, ORCAD_GRAPHIC_INST::color, ELLIPSE, ORCAD_PRIMITIVE::end, ORCAD_FONT::face, ORCAD_PRIMITIVE::fillStyle, ORCAD_PRIMITIVE::fontIdx, FromOrcadString(), KIFONT::FONT::GetFont(), SCH_TEXT::GetOffsetToMatchSCH_FIELD(), SCH_TEXT::GetPosition(), SCH_TEXT::GetSchematicTextOffset(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_TOP, ORCAD_RAW_PAGE::graphics, GROUP_PRIM, ORCAD_FONT::height, IMAGE, ORCAD_PRIMITIVE::kind, KiROUND(), LAYER_NOTES, LINE, ORCAD_PRIMITIVE::lineStyle, ORCAD_PRIMITIVE::lineWidth, m_design, M_PI, ORCAD_GRAPHIC_INST::nested, NO_FILL, ORCAD_ST_GRAPHIC_OLE_INST, OrcadColor(), OrcadDbuToIu(), OrcadLineStyle(), OrcadLineWidthIu(), OrcadPageGraphicLineWidthIu(), OrcadTextBaselineOffset(), placeBitmap(), ORCAD_PRIMITIVE::points, POLYGON, POLYLINE, ORCAD_SYMBOL_DEF::primitives, RECTANGLE, ORCAD_GRAPHIC_INST::rotation, EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFillMode(), EDA_TEXT::SetMultilineAllowed(), SCH_SHAPE::SetPosition(), SCH_TEXT::SetPosition(), SCH_SHAPE::SetStroke(), ORCAD_PRIMITIVE::start, TEXT, text, ORCAD_PRIMITIVE::text, textBaselineOffset(), ORCAD_PRIMITIVE::textBoundsStart, ORCAD_GRAPHIC_INST::textFaceOverride, ORCAD_GRAPHIC_INST::textScaleX, ORCAD_GRAPHIC_INST::textScaleY, textSize(), ORCAD_GRAPHIC_INST::typeId, KIGFX::COLOR4D::UNSPECIFIED, ORCAD_GRAPHIC_INST::useGenericTextBaseline, ORCAD_GRAPHIC_INST::useSymbolLineWidths, ORCAD_FONT::width, ORCAD_POINT::x, VECTOR2< T >::x, ORCAD_PRIMITIVE::x1, ORCAD_PRIMITIVE::x2, ORCAD_POINT::y, VECTOR2< T >::y, ORCAD_PRIMITIVE::y1, and ORCAD_PRIMITIVE::y2.

Referenced by placeDefinitionVectors().

◆ placeHierarchicalBlockFields()

◆ placeHierarchicalBlockPinFill()

◆ placeInstance()

void ORCAD_CONVERTER::placeInstance ( ORCAD_RAW_PAGE & aPage,
const ORCAD_PLACED_INSTANCE & aInst,
SCH_SCREEN * aScreen,
const SCH_SHEET_PATH & aSheetPath )
private

Definition at line 2796 of file orcad_converter_symbols.cpp.

References _, std::abs(), ANGLE_HORIZONTAL, ANGLE_VERTICAL, appendPageItem(), ORCAD_SYMBOL_DEF::bbox, BOX2< Vec >::Centre(), CIRCLE, correction, SHAPE_LINE_CHAIN::CPoints(), ORCAD_PLACED_INSTANCE::dbId, delta, effectiveProps(), LIB_ID::FixIllegalChars(), ORCAD_CONVERTER::LIB_ENTRY::footprint, FromOrcadString(), LIB_SYMBOL::GetDrawItems(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetFields(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPins(), EDA_SHAPE::GetPolyShape(), SCH_SHAPE::GetPosition(), EDA_SHAPE::GetRadius(), BOX2< Vec >::GetRight(), EDA_SHAPE::GetShape(), SYMBOL::GetTransform(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_CENTER, ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::ignored, index, TRANSFORM::InverseTransform(), isInstalledPropertyName(), EDA_TEXT::IsVisible(), kicadSymbolFor(), LAYER_DEVICE, LAYER_PINNAM, LAYER_PINNUM, LIB_NICK, libForInstance(), ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::libraryPin, m_currentOccProps, m_currentOccRefs, m_libSymbols, m_nativePowerFamilies, m_placedPackageUnits, m_preparedLibUnits, m_preparedPkgToLib, m_sourceInstances, m_sourcePinIdentities, ORCAD_PLACED_INSTANCE::mirror, ORCAD_CONVERTER::LIB_ENTRY::name, ORCAD_RAW_PAGE::name, note(), ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::number, ORCAD_IU_PER_DBU, OrcadDbuToIu(), OrcadOrientOf(), OrcadOrientOffset(), OrcadTextBaselineOffset(), SHAPE_POLY_SET::Outline(), pin, ORCAD_CONVERTER::UNIT_INFO::pinIgnore, ORCAD_CONVERTER::UNIT_INFO::pinNumbers, ORCAD_PLACED_INSTANCE::pins, ORCAD_SYMBOL_DEF::pins, placeDefinitionImages(), placedPinElectricalPosition(), placeSymbolFields(), POLY, ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::position, radius, ORCAD_PLACED_INSTANCE::reference, resolveReference(), ORCAD_PLACED_INSTANCE::rotation, SCH_SHAPE_T, SCH_TEXT_T, SCH_SYMBOL::SetDNP(), SCH_SYMBOL::SetExcludedFromBoard(), SCH_SYMBOL::SetOrientation(), SCH_SYMBOL::SetRef(), SCH_FIELD::SetText(), SCH_SYMBOL::SetUnitSelection(), MULTIVECTOR< T, FIRST_TYPE_VAL, LAST_TYPE_VAL >::sort(), ORCAD_CONVERTER::UNIT_INFO::symbol, ORCAD_SYMBOL_DEF::synthesized, text, toKicadOrientation(), TRANSFORM::TransformCoordinate(), ORCAD_CONVERTER::LIB_ENTRY::units, VALUE, ORCAD_PLACED_INSTANCE::value, warn(), ORCAD_PLACED_INSTANCE::x, VECTOR2< T >::x, ORCAD_BBOX::x1, ORCAD_BBOX::x2, ORCAD_PLACED_INSTANCE::y, VECTOR2< T >::y, ORCAD_BBOX::y1, TRANSFORM::y1, and ORCAD_BBOX::y2.

◆ placeJunctions()

void ORCAD_CONVERTER::placeJunctions ( const ORCAD_RAW_PAGE & aPage,
SCH_SCREEN * aScreen )
private

Append computed junctions as SCH_JUNCTION items.

Definition at line 6037 of file orcad_converter_sheet.cpp.

References appendPageItem(), computeJunctions(), and OrcadDbuToIu().

Referenced by convertPage().

◆ placeOffpageConnectors()

◆ placePageFrame()

◆ placePorts()

◆ placePowerSymbol()

void ORCAD_CONVERTER::placePowerSymbol ( ORCAD_RAW_PAGE & aPage,
const ORCAD_GRAPHIC_INST & aInst,
const std::string & aNet,
SCH_SCREEN * aScreen,
const SCH_SHEET_PATH & aSheetPath )
private

Definition at line 3134 of file orcad_converter_symbols.cpp.

References SCH_SYMBOL::AddField(), ANGLE_HORIZONTAL, ANGLE_VERTICAL, appendPageItem(), applyFont(), ORCAD_GRAPHIC_INST::bbox, ORCAD_SYMBOL_DEF::bbox, canonicalGlobalNetName(), DATASHEET, displayFontId(), ORCAD_GRAPHIC_INST::displayProps, displayUsesTemplateFont(), LIB_ID::FixIllegalChars(), FOOTPRINT, FromOrcadString(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetPosition(), SYMBOL::GetTransform(), GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_TOP, kicadSymbolFor(), LIB_NICK, ORCAD_GRAPHIC_INST::logicalName, m_libSymbols, m_powerCount, ORCAD_GRAPHIC_INST::mirror, ORCAD_GRAPHIC_INST::name, OrcadColor(), OrcadDbuToIu(), OrcadDisplayPropShowsName(), OrcadDisplayPropVisible(), OrcadOrientOf(), OrcadOrientOffset(), powerLibFor(), powerPinPos(), ORCAD_GRAPHIC_INST::props, REFERENCE, ORCAD_GRAPHIC_INST::rotation, SCH_FIELD::SetEffectiveHorizJustify(), SCH_FIELD::SetEffectiveVertJustify(), SCH_FIELD::SetNameShown(), SCH_SYMBOL::SetOrientation(), SCH_FIELD::SetPosition(), SCH_SYMBOL::SetPosition(), SCH_SYMBOL::SetRef(), SCH_FIELD::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextColor(), EDA_TEXT::SetTextSize(), SCH_SYMBOL::SetUnitSelection(), SCH_SYMBOL::SetValueFieldText(), EDA_TEXT::SetVisible(), textBaselineOffset(), textSize(), textSizeIU(), toKicadOrientation(), ORCAD_CONVERTER::LIB_ENTRY::units, USER, VALUE, ORCAD_GRAPHIC_INST::x, VECTOR2< T >::x, ORCAD_BBOX::x1, ORCAD_BBOX::x2, ORCAD_GRAPHIC_INST::y, VECTOR2< T >::y, ORCAD_BBOX::y1, TRANSFORM::y1, and ORCAD_BBOX::y2.

◆ placeSymbolFields()

void ORCAD_CONVERTER::placeSymbolFields ( SCH_SYMBOL * aSymbol,
const ORCAD_PLACED_INSTANCE & aInst,
const ORCAD_SYMBOL_DEF & aDef,
int aOrient,
const std::string & aValue,
const std::string & aFootprint )
private

Definition at line 3246 of file orcad_converter_symbols.cpp.

References std::abs(), SCH_SYMBOL::AddField(), ANGLE_HORIZONTAL, ANGLE_VERTICAL, appendPageItem(), applyFont(), ORCAD_SYMBOL_DEF::bbox, ORCAD_DISPLAY_PROP::color, DATASHEET, ORCAD_PLACED_INSTANCE::dbId, DESCRIPTION, displayFontId(), ORCAD_PLACED_INSTANCE::displayProps, displayUsesTemplateFont(), effectiveProps(), FOOTPRINT, FromOrcadString(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetFields(), SCH_FIELD::GetPosition(), SCH_SYMBOL::GetPosition(), SCH_FIELD::GetText(), EDA_TEXT::GetTextSize(), SYMBOL::GetTransform(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_V_ALIGN_TOP, EDA_TEXT::IsVisible(), LAYER_NOTES, m_currentOccUnitRefs, m_pageItemScreen, ORCAD_DISPLAY_PROP::name, ORCAD_IU_PER_DBU, ORCAD_ORIENT_TABLE, OrcadColor(), OrcadDbuToIu(), OrcadDisplayPropShowsName(), OrcadDisplayPropShowsValue(), OrcadDisplayPropVisible(), OrcadTransformPoint(), ORCAD_PLACED_INSTANCE::pins, ORCAD_SYMBOL_DEF::pins, propertyNamesEqual(), REFERENCE, ORCAD_PLACED_INSTANCE::reference, SCH_SYMBOL::RemoveField(), resolveReference(), ORCAD_DISPLAY_PROP::rotation, SCH_FIELD::SetEffectiveHorizJustify(), SCH_FIELD::SetEffectiveVertJustify(), SCH_SYMBOL::SetFootprintFieldText(), EDA_TEXT::SetHorizJustify(), SCH_FIELD::SetNameShown(), SCH_FIELD::SetPosition(), SCH_FIELD::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextColor(), EDA_TEXT::SetTextSize(), SCH_SYMBOL::SetValueFieldText(), EDA_TEXT::SetVisible(), text, textBaselineOffset(), textSize(), textSizeIU(), ORCAD_PLACED_INSTANCE::unitIndex, unitLetter(), USER, VALUE, ORCAD_PLACED_INSTANCE::value, ORCAD_DISPLAY_PROP::x, ORCAD_PLACED_INSTANCE::x, VECTOR2< T >::x, ORCAD_BBOX::x1, ORCAD_BBOX::x2, ORCAD_DISPLAY_PROP::y, ORCAD_PLACED_INSTANCE::y, VECTOR2< T >::y, ORCAD_BBOX::y1, TRANSFORM::y1, and ORCAD_BBOX::y2.

Referenced by placeInstance().

◆ placeWires()

◆ powerLibFor()

std::string ORCAD_CONVERTER::powerLibFor ( const std::string & aSymbolName,
const std::string & aNetName )
private

◆ powerNet()

◆ powerPinPos()

VECTOR2I ORCAD_CONVERTER::powerPinPos ( const ORCAD_RAW_PAGE & aPage,
const ORCAD_GRAPHIC_INST & aInst ) const
private

◆ prepareGlobalNetNames()

void ORCAD_CONVERTER::prepareGlobalNetNames ( )
private

Capture net names ignore case; KiCad net names do not.

Use one spelling for each global net.

Definition at line 450 of file orcad_converter_sheet.cpp.

References ORCAD_GRAPHIC_INST::logicalName, m_design, m_globalNetNames, m_offpageNetNames, m_powerNetNames, name, ORCAD_GRAPHIC_INST::name, and ORCAD_GRAPHIC_INST::props.

Referenced by Convert().

◆ prepareSymbols()

◆ recordNetNameMap()

void ORCAD_CONVERTER::recordNetNameMap ( )
private

Definition at line 3670 of file orcad_converter_sheet.cpp.

References _, SCH_CONNECTION::AllMembers(), KIID::AsStdString(), BUS, SCH_CONNECTION::BusCode(), SCH_ITEM::Connection(), ORCAD_WIRE::dbId, IMPORT_NET_MAP::entries, FromOrcadString(), IMPORT_NET_MAP_ENTRY::generatedName, SCH_ITEM::GetBodyStyle(), SCH_PIN::GetLibPin(), SCH_PIN::GetName(), SCH_PIN::GetOrientation(), SCH_ITEM::GetParentSymbol(), SCH_SYMBOL::GetPins(), SCH_PIN::GetPosition(), SCH_SYMBOL::GetRef(), SCH_PIN::GetType(), SCH_ITEM::GetUnit(), SCH_SYMBOL::GetUnitSelection(), SCH_SCREEN::GetUuid(), group, ORCAD_WIRE::id, ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::ignored, index, SCH_CONNECTION::IsBus(), ORCAD_WIRE::isBus, SCH_CONNECTION::IsNet(), ORCAD_PIN_INST::IsNoConnect(), SCH_SCREEN::Items(), IMPORT_NET_MAP_ENTRY::itemUuids, left, ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::libraryPin, m_hierBusNamesByScreen, m_schematic, m_sourceGeneratedNetNames, m_sourceInstances, m_sourceNetItems, m_sourceNetNames, m_sourceOccurrences, m_sourcePages, m_sourcePinIdentities, EDA_ITEM::m_Uuid, m_wirelessNetNames, SCH_CONNECTION::Name(), name, IMPORT_NET_MAP_ENTRY::nameAtImport, SCH_CONNECTION::NetCode(), NO_CONNECT, ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::number, IMPORT_NET_MAP_ENTRY::occurrence, EE_RTREE::OfType(), onSegment(), IMPORT_NET_MAP_ENTRY::originalName, pin, ORCAD_PLACED_INSTANCE::pins, ORCAD_CONVERTER::SOURCE_PIN_IDENTITY::position, alg::remove_duplicates(), RESOLVED, right, SCH_PIN_T, SCH_SYMBOL_T, scopedHierBusMember(), IMPORT_NET_MAP_ENTRY::sourceNetId, SPLIT, IMPORT_NET_MAP_ENTRY::status, IMPORT_NET_MAP_ENTRY::terminals, UNCONNECTED, IMPORT_NET_MAP_ENTRY::view, warn(), ORCAD_PIN_INST::wordA, ORCAD_PIN_INST::wordB, ORCAD_PIN_INST::x, VECTOR2< T >::x, ORCAD_PIN_INST::y, and VECTOR2< T >::y.

Referenced by finalizeNetNames().

◆ rememberInterfaceLabelSource()

void ORCAD_CONVERTER::rememberInterfaceLabelSource ( SCH_SCREEN * aScreen,
SCH_LABEL_BASE * aLabel,
const std::vector< SEG > & aSourceWires )
private

◆ resolveFontIndex()

int ORCAD_CONVERTER::resolveFontIndex ( int aFontIdx) const
private

Resolve a Design Template font ID to its 1-based LOGFONT index.

Definition at line 3778 of file orcad_converter_symbols.cpp.

References m_design.

Referenced by addSymbolPin(), applyFont(), displayFontId(), fontHeightDbu(), textBaselineOffset(), textSize(), and textSizeIU().

◆ resolveReference()

wxString ORCAD_CONVERTER::resolveReference ( const ORCAD_PLACED_INSTANCE & aInst) const
private

Use the occurrence reference when the instance has an unannotated template.

Definition at line 3108 of file orcad_converter_symbols.cpp.

References ORCAD_PLACED_INSTANCE::dbId, FromOrcadString(), m_currentOccRefs, and ORCAD_PLACED_INSTANCE::reference.

Referenced by placeInstance(), and placeSymbolFields().

◆ SanitizeFileName()

wxString ORCAD_CONVERTER::SanitizeFileName ( const std::string & aName)
staticprivate

Definition at line 4345 of file orcad_converter_sheet.cpp.

References FromOrcadString().

Referenced by MakePageFileName().

◆ snapToWire()

VECTOR2I ORCAD_CONVERTER::snapToWire ( int aX,
int aY,
const ORCAD_WIRE & aWire )
staticprivate

Closest point (DBU) on a wire segment to (aX, aY); exact for H/V wires.

Definition at line 8710 of file orcad_converter_sheet.cpp.

References KiROUND(), ORCAD_WIRE::x1, ORCAD_WIRE::x2, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.

◆ SymbolId()

std::string ORCAD_CONVERTER::SymbolId ( const std::string & aName)
staticprivate

LIB_ID-safe symbol name: ':', '"', '/' and whitespace runs -> '_'; "SYM" if empty.

Definition at line 3937 of file orcad_converter_symbols.cpp.

Referenced by BuildSymbolLibrary(), and powerLibFor().

◆ synthesizeSymbol()

◆ textBaselineOffset()

int ORCAD_CONVERTER::textBaselineOffset ( int aTextSize,
int aFontIdx,
bool aTemplateFont = true ) const
private

◆ textSize()

VECTOR2I ORCAD_CONVERTER::textSize ( int aFontIdx,
bool aTemplateFont = true ) const
private

◆ textSizeIU()

int ORCAD_CONVERTER::textSizeIU ( int aFontIdx,
bool aTemplateFont = true ) const
private

◆ toKicadOrientation()

int ORCAD_CONVERTER::toKicadOrientation ( int aOrient)
staticprivate

◆ unitLetter()

std::string ORCAD_CONVERTER::unitLetter ( const ORCAD_PLACED_INSTANCE & aInst) const
private

The unit key includes a non-Normal view so DeMorgan graphics remain distinct.

Definition at line 1200 of file orcad_converter_symbols.cpp.

References ORCAD_PLACED_INSTANCE::pkgName, ORCAD_PLACED_INSTANCE::props, and ORCAD_PLACED_INSTANCE::sourcePackage.

Referenced by libForInstance(), and placeSymbolFields().

◆ warn()

void ORCAD_CONVERTER::warn ( const wxString & aMsg)
private

– reporting [orcad_converter_sheet.cpp] ---------------------------------------—

Conversion problem: REPORTER at RPT_SEVERITY_WARNING.

Definition at line 436 of file orcad_converter_sheet.cpp.

References m_reporter, and RPT_SEVERITY_WARNING.

Referenced by BuildSymbolLibrary(), finalizeNativePowerPackages(), libForInstance(), placeBitmap(), placeInstance(), and recordNetNameMap().

◆ wireAliasFontId()

int ORCAD_CONVERTER::wireAliasFontId ( const ORCAD_ALIAS & aAlias) const
private

Definition at line 3745 of file orcad_converter_symbols.cpp.

References ORCAD_ALIAS::fontIdx, and m_design.

Referenced by computeFontBaseline().

Member Data Documentation

◆ LIB_NICK

const char* ORCAD_CONVERTER::LIB_NICK = "orcad_import"
staticconstexpr

Symbol library nickname used in every emitted LIB_ID.

Definition at line 165 of file orcad_converter.h.

Referenced by finalizeNativePowerPackages(), kicadSymbolFor(), placeInstance(), and placePowerSymbol().

◆ m_connectedBlockInterfaceNames

std::set<std::string> ORCAD_CONVERTER::m_connectedBlockInterfaceNames
private

Definition at line 464 of file orcad_converter.h.

Referenced by Convert().

◆ m_currentConnectorInterfaceNetAliases

std::set<std::string> ORCAD_CONVERTER::m_currentConnectorInterfaceNetAliases
private

Definition at line 485 of file orcad_converter.h.

Referenced by Convert(), and convertUnreferencedPages().

◆ m_currentFlatNetSuffix

std::string ORCAD_CONVERTER::m_currentFlatNetSuffix
private

Definition at line 479 of file orcad_converter.h.

Referenced by Convert(), and convertUnreferencedPages().

◆ m_currentImplicitPowerPins

std::set<const ORCAD_PIN_INST*> ORCAD_CONVERTER::m_currentImplicitPowerPins
private

Definition at line 486 of file orcad_converter.h.

◆ m_currentInterfaceNetAliases

std::map<std::string, std::string> ORCAD_CONVERTER::m_currentInterfaceNetAliases
private

◆ m_currentOccNetNames

const std::map<uint32_t, std::string>* ORCAD_CONVERTER::m_currentOccNetNames = nullptr
private

◆ m_currentOccProps

const std::map<uint32_t, std::map<std::string, std::string> >* ORCAD_CONVERTER::m_currentOccProps = nullptr
private

◆ m_currentOccRefs

const std::map<uint32_t, std::string>* ORCAD_CONVERTER::m_currentOccRefs = nullptr
private

Per-page occurrence references distinguish repeated child schematics.

Null means no occurrence tree.

Definition at line 475 of file orcad_converter.h.

Referenced by Convert(), convertPage(), convertUnreferencedPages(), placeInstance(), and resolveReference().

◆ m_currentOccUnitRefs

const std::map<uint32_t, std::string>* ORCAD_CONVERTER::m_currentOccUnitRefs = nullptr
private

◆ m_currentOccurrenceNetAliases

std::map<std::string, std::string> ORCAD_CONVERTER::m_currentOccurrenceNetAliases
private

◆ m_currentUnconnectedInterfaceNetNames

std::map<std::string, std::string> ORCAD_CONVERTER::m_currentUnconnectedInterfaceNetNames
private

Definition at line 482 of file orcad_converter.h.

Referenced by Convert(), and convertUnreferencedPages().

◆ m_design

◆ m_fontBaselineDbu

int ORCAD_CONVERTER::m_fontBaselineDbu
private

dominant text height; 0 = none

Definition at line 468 of file orcad_converter.h.

Referenced by computeFontBaseline(), and ORCAD_CONVERTER().

◆ m_globalNetAliases

std::map<std::string, std::string> ORCAD_CONVERTER::m_globalNetAliases
private

Definition at line 461 of file orcad_converter.h.

Referenced by canonicalGlobalNetName(), and Convert().

◆ m_globalNetNames

std::map<std::string, std::string> ORCAD_CONVERTER::m_globalNetNames
private

Definition at line 460 of file orcad_converter.h.

Referenced by canonicalGlobalNetName(), and prepareGlobalNetNames().

◆ m_hierBusNamesByScreen

std::map<std::string, std::map<std::string, std::string> > ORCAD_CONVERTER::m_hierBusNamesByScreen
private

◆ m_interfaceLabelSources

std::vector<INTERFACE_LABEL_SOURCE> ORCAD_CONVERTER::m_interfaceLabelSources
private

Definition at line 506 of file orcad_converter.h.

Referenced by finalizeNetNames(), and rememberInterfaceLabelSource().

◆ m_labelSourceNets

std::map<SCH_LABEL_BASE*, std::pair<SCH_SCREEN*, uint32_t> > ORCAD_CONVERTER::m_labelSourceNets
private

Definition at line 508 of file orcad_converter.h.

Referenced by appendNetIntent(), and finalizeNetNames().

◆ m_libSymbols

std::map<std::string, LIB_ENTRY> ORCAD_CONVERTER::m_libSymbols
private

◆ m_nativePowerFamilies

std::set<std::string> ORCAD_CONVERTER::m_nativePowerFamilies
private

Definition at line 459 of file orcad_converter.h.

Referenced by finalizeNativePowerPackages(), and placeInstance().

◆ m_netLabelIntents

std::vector<NET_LABEL_INTENT> ORCAD_CONVERTER::m_netLabelIntents
private

Definition at line 507 of file orcad_converter.h.

Referenced by appendNetIntent(), and minimizeNetLabels().

◆ m_occurrenceNetNameMinDepth

std::map<std::string, size_t> ORCAD_CONVERTER::m_occurrenceNetNameMinDepth
private

Definition at line 466 of file orcad_converter.h.

Referenced by Convert(), and placePorts().

◆ m_occurrenceNetNameScopeCounts

std::map<std::string, size_t> ORCAD_CONVERTER::m_occurrenceNetNameScopeCounts
private

Definition at line 465 of file orcad_converter.h.

Referenced by Convert().

◆ m_offpageNetNames

std::set<std::string> ORCAD_CONVERTER::m_offpageNetNames
private

Definition at line 463 of file orcad_converter.h.

Referenced by isOffpageNetName(), and prepareGlobalNetNames().

◆ m_pageItems

std::vector<SCH_ITEM*> ORCAD_CONVERTER::m_pageItems
private

Definition at line 472 of file orcad_converter.h.

Referenced by appendPageItem(), assignPageItemUuids(), and convertPage().

◆ m_pageItemScreen

SCH_SCREEN* ORCAD_CONVERTER::m_pageItemScreen = nullptr
private

Definition at line 471 of file orcad_converter.h.

Referenced by appendPageItem(), convertPage(), and placeSymbolFields().

◆ m_pageOrdinal

size_t ORCAD_CONVERTER::m_pageOrdinal = 0
private

Definition at line 469 of file orcad_converter.h.

◆ m_pkgToLib

std::map<PKG_KEY, std::pair<std::string, int> > ORCAD_CONVERTER::m_pkgToLib
private

Definition at line 455 of file orcad_converter.h.

Referenced by prepareSymbols().

◆ m_placedPackageUnits

std::vector<PLACED_PACKAGE_UNIT> ORCAD_CONVERTER::m_placedPackageUnits
private

Definition at line 458 of file orcad_converter.h.

Referenced by finalizeNativePowerPackages(), and placeInstance().

◆ m_powerCount

int ORCAD_CONVERTER::m_powerCount
private

"#PWR%04d" counter

Definition at line 467 of file orcad_converter.h.

Referenced by ORCAD_CONVERTER(), and placePowerSymbol().

◆ m_powerNetNames

std::set<std::string> ORCAD_CONVERTER::m_powerNetNames
private

Definition at line 462 of file orcad_converter.h.

Referenced by isPowerNetName(), and prepareGlobalNetNames().

◆ m_preparedLibUnits

std::map<std::string, std::vector<UNIT_INFO> > ORCAD_CONVERTER::m_preparedLibUnits
private

Definition at line 457 of file orcad_converter.h.

Referenced by finalizeNativePowerPackages(), placeInstance(), and prepareSymbols().

◆ m_preparedPkgToLib

std::map<PKG_KEY, std::pair<std::string, int> > ORCAD_CONVERTER::m_preparedPkgToLib
private

Definition at line 456 of file orcad_converter.h.

Referenced by finalizeNativePowerPackages(), placeInstance(), and prepareSymbols().

◆ m_progressReporter

PROGRESS_REPORTER* ORCAD_CONVERTER::m_progressReporter
private

Definition at line 451 of file orcad_converter.h.

Referenced by Convert(), convertUnreferencedPages(), and ORCAD_CONVERTER().

◆ m_reporter

REPORTER* ORCAD_CONVERTER::m_reporter
private

Definition at line 450 of file orcad_converter.h.

Referenced by note(), ORCAD_CONVERTER(), and warn().

◆ m_rootSheet

SCH_SHEET* ORCAD_CONVERTER::m_rootSheet
private

Definition at line 452 of file orcad_converter.h.

Referenced by Convert(), and ORCAD_CONVERTER().

◆ m_schematic

SCHEMATIC* ORCAD_CONVERTER::m_schematic
private

◆ m_scopeGeneratedFlatNets

bool ORCAD_CONVERTER::m_scopeGeneratedFlatNets = false
private

Definition at line 481 of file orcad_converter.h.

Referenced by Convert(), convertUnreferencedPages(), and placeWires().

◆ m_scopeNamedFlatNets

bool ORCAD_CONVERTER::m_scopeNamedFlatNets = false
private

Definition at line 480 of file orcad_converter.h.

Referenced by Convert(), convertUnreferencedPages(), and placeWires().

◆ m_screenOrdinal

size_t ORCAD_CONVERTER::m_screenOrdinal = 1
private

Definition at line 470 of file orcad_converter.h.

Referenced by Convert(), and convertUnreferencedPages().

◆ m_sourceGeneratedNetNames

std::map<std::pair<SCH_SCREEN*, uint32_t>, std::string> ORCAD_CONVERTER::m_sourceGeneratedNetNames
private

Definition at line 512 of file orcad_converter.h.

Referenced by recordNetNameMap().

◆ m_sourceInstances

std::map<SCH_SYMBOL*, const ORCAD_PLACED_INSTANCE*> ORCAD_CONVERTER::m_sourceInstances
private

Definition at line 522 of file orcad_converter.h.

Referenced by placeInstance(), and recordNetNameMap().

◆ m_sourceNetItems

std::map<std::pair<SCH_SCREEN*, uint32_t>, std::vector<SCH_ITEM*> > ORCAD_CONVERTER::m_sourceNetItems
private

Definition at line 510 of file orcad_converter.h.

Referenced by finalizeNetNames(), and recordNetNameMap().

◆ m_sourceNetNames

std::map<std::pair<SCH_SCREEN*, uint32_t>, std::set<std::string> > ORCAD_CONVERTER::m_sourceNetNames
private

Definition at line 511 of file orcad_converter.h.

Referenced by convertPage(), and recordNetNameMap().

◆ m_sourceOccurrences

std::map<SCH_SCREEN*, std::vector<wxString> > ORCAD_CONVERTER::m_sourceOccurrences
private

Definition at line 523 of file orcad_converter.h.

Referenced by convertPage(), and recordNetNameMap().

◆ m_sourcePages

std::map<SCH_SCREEN*, const ORCAD_RAW_PAGE*> ORCAD_CONVERTER::m_sourcePages
private

Definition at line 509 of file orcad_converter.h.

Referenced by convertPage(), and recordNetNameMap().

◆ m_sourcePinIdentities

std::map<SCH_SYMBOL*, std::vector<SOURCE_PIN_IDENTITY> > ORCAD_CONVERTER::m_sourcePinIdentities
private

Definition at line 521 of file orcad_converter.h.

Referenced by placeInstance(), and recordNetNameMap().

◆ m_usedSheetNames

std::set<wxString> ORCAD_CONVERTER::m_usedSheetNames
private

Lower-cased sheet names already emitted, to keep sibling sheet names unique.

Definition at line 527 of file orcad_converter.h.

Referenced by Convert(), and convertUnreferencedPages().

◆ m_wireEndpoints

std::map<std::pair<int, int>, std::vector<const ORCAD_WIRE*> > ORCAD_CONVERTER::m_wireEndpoints
private

Per-page wire lookup: endpoint -> wires ending there.

Rebuilt by buildNetLookup().

Definition at line 530 of file orcad_converter.h.

Referenced by buildNetLookup(), netAt(), placeOffpageConnectors(), and placePorts().

◆ m_wirelessNetNames

std::map<std::tuple<SCH_SCREEN*, const ORCAD_PLACED_INSTANCE*, size_t>, std::pair<uint32_t, std::string> > ORCAD_CONVERTER::m_wirelessNetNames
private

Definition at line 524 of file orcad_converter.h.

Referenced by recordNetNameMap().

◆ MARGIN_B_DBU

int ORCAD_CONVERTER::MARGIN_B_DBU = 100
staticconstexprprivate

Definition at line 227 of file orcad_converter.h.

Referenced by applyPageSettings().

◆ MARGIN_L_DBU

int ORCAD_CONVERTER::MARGIN_L_DBU = 60
staticconstexprprivate

Page margins in DBU leave room for the KiCad frame and title block.

Definition at line 224 of file orcad_converter.h.

Referenced by applyPageSettings().

◆ MARGIN_R_DBU

int ORCAD_CONVERTER::MARGIN_R_DBU = 60
staticconstexprprivate

Definition at line 226 of file orcad_converter.h.

Referenced by applyPageSettings().

◆ MARGIN_T_DBU

int ORCAD_CONVERTER::MARGIN_T_DBU = 60
staticconstexprprivate

Definition at line 225 of file orcad_converter.h.

Referenced by applyPageSettings().

◆ PIN_LEN_DBU

int ORCAD_CONVERTER::PIN_LEN_DBU = 10
staticconstexprprivate

– constants (calibrated; do not change) -------------------------------------—

Standard OrCAD pin length used for synthesized placeholder pins, DBU.

Definition at line 221 of file orcad_converter.h.

Referenced by synthesizeSymbol().


The documentation for this class was generated from the following files: