25#ifndef ORCAD_CONVERTER_H_
26#define ORCAD_CONVERTER_H_
107 const std::function<
void(
const ORCAD_PRIMITIVE&,
int,
int )>& aVisit );
114 int det = e.
a * e.
d - e.
b * e.
c;
116 return { ( e.
d * aX - e.
b * aY ) / det, ( -e.
c * aX + e.
a * aY ) / det };
146 static constexpr const char*
LIB_NICK =
"orcad_import";
189 using PKG_KEY = std::tuple<std::string, std::string, int, std::string>;
209 std::map<std::pair<int, int>, std::vector<const ORCAD_WIRE*>>
wireEndpoints;
210 std::map<const ORCAD_PIN_INST*, std::set<uint32_t>>
pinNets;
217 mutable std::map<const ORCAD_GRAPHIC_INST*, std::string>
powerNets;
224 std::map<std::string, std::pair<std::string, size_t>>
targets;
265 void warn(
const wxString& aMsg );
268 void note(
const wxString& aMsg );
295 const std::vector<const ORCAD_PLACED_INSTANCE*>& aInstances )
const;
305 const PKG_KEY** aSourceUnit =
nullptr );
315 std::string
powerLibFor(
const std::string& aSymbolName,
const std::string& aNetName );
322 int aOffsetX = 0,
int aOffsetY = 0 );
347 const std::function<
bool(
const LIB_ENTRY& )>& aReusable )
const;
371 int aOrient,
const std::string& aValue,
const std::string& aFootprint );
393 bool aSymbolFlips,
bool aApplyVisibility =
true )
const;
395 int textBaselineOffset(
int aTextSize,
int aFontIdx,
bool aTemplateFont =
true )
const;
401 int fontHeightDbu(
int aFontIdx,
bool aTemplateFont =
true )
const;
404 int textSizeIU(
int aFontIdx,
bool aTemplateFont =
true )
const;
409 void applyFont(
EDA_TEXT* aText,
int aFontIdx,
bool aTemplateFont =
true )
const;
413 static std::string
SymbolId(
const std::string& aName );
417 bool aContainerPage =
false,
bool aSharedFolderPage =
false );
419 const std::string& aChildFolder );
437 const std::string& aFlatNetSuffix )
const;
442 const wxString& aName,
const std::string& aFilePageName,
int aPageIndex );
446 std::vector<SCH_SHEET*>
createTopLevelSheets(
const std::vector<std::pair<wxString, wxString>>& aNamesAndFiles,
447 bool aReuseRoot,
bool aOrdinalSheetUuids );
449 void recordPowerAlias( std::map<std::string, POWER_ALIAS_EVIDENCE>& aCandidates,
const std::string& aSourceName,
450 const std::string& aElectricalName )
const;
453 void acceptPowerAliases(
const std::map<std::string, POWER_ALIAS_EVIDENCE>& aCandidates );
467 const std::string& aOccurrenceSuffix,
bool aRepeatedFolder,
468 const std::map<std::string, std::string>& aUnconnectedInterfaceNetNames,
469 std::map<std::string, std::string> aInterfaceNetAliases );
476 bool aUnreferenced =
false )
const;
484 const std::map<uint32_t, std::string>& aScopeNets,
486 std::set<std::string>* aSourceKeys =
nullptr )
const;
506 static wxString
MakePageFileName(
int aPageIndex,
const std::string& aPageName );
550 const std::string& aNetName )
const;
563 bool aNestedHierarchy,
bool aSharedFolderPage );
570 const std::string& aText,
SCH_SCREEN* aScreen );
585 const std::vector<SEG>& aSourceWires,
SCH_SCREEN* aScreen );
592 bool* aUsedEmbeddedEmf =
nullptr );
598 SCH_SCREEN* aScreen,
double aTextScaleX = 1.0,
double aTextScaleY = 1.0,
599 bool aUseGenericTextBaseline =
false );
664 const std::vector<SEG>& aSourceWires );
684 std::map<std::tuple<SCH_SCREEN*, const ORCAD_PLACED_INSTANCE*, size_t>, std::pair<uint32_t, std::string>>
m_wirelessNetNames;
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
A color representation with 4 components: red, green, blue, alpha.
Define a library symbol object.
void placePowerSymbol(ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst, const std::string &aNet, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath)
void placePageFrame(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
void placeJunctions(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
Append computed junctions as SCH_JUNCTION items.
std::string uniqueLibName(const std::string &aBase, const std::function< bool(const LIB_ENTRY &)> &aReusable) const
aBase, or aBase_pinsN for the first N >= 2 whose existing entry is absent or passes aReusable.
bool displayUsesTemplateFont(const ORCAD_DISPLAY_PROP &aProp) const
std::map< std::string, size_t > m_occurrenceFolderCounts
std::vector< VECTOR2I > computeJunctions(const ORCAD_RAW_PAGE &aPage) const
Use both geometry and net IDs; a crossing alone does not create a junction.
void computeFontBaseline()
int displayFontId(const ORCAD_DISPLAY_PROP &aProp) const
std::vector< OFFPAGE_NET > offpageNets(const ORCAD_RAW_PAGE &aPage) const
Resolve every off-page connector on the page to (index, net, pin position).
void addChildOccurrenceAliases(const ORCAD_RAW_PAGE &aParentPage, const ORCAD_OCC_SCOPE &aParentScope, const ORCAD_DRAWN_INSTANCE &aDrawn, const ORCAD_OCC_SCOPE &aChildScope)
std::string netAt(const ORCAD_RAW_PAGE &aPage, int aX, int aY) const
Prefer endpoint nets, then intersecting wires, then endpoint aliases.
static constexpr int MARGIN_B_DBU
LIB_ENTRY buildPackageEntry(const ORCAD_PACKAGE &aPackage) const
One unit per package device; a Convert view becomes the unit's DeMorgan body.
PROGRESS_REPORTER * m_progressReporter
SCH_SHEET * Convert(SCH_SHEET *aRootSheet)
aRootSheet must have a screen and be registered on the schematic.
void assignPageItemUuids(size_t aPageOrdinal)
void buildNetLookup(const ORCAD_RAW_PAGE &aPage)
Rebuild m_netIndex for a page in the current scope.
std::map< SCH_SYMBOL *, std::vector< SOURCE_PIN_IDENTITY > > m_sourcePinIdentities
void assignPinUuids(SCH_SYMBOL *aSymbol, const std::string &aRole) const
Name-based UUIDs for a symbol's raw pins, derived from aRole and each pin's number,...
std::set< const ORCAD_PIN_INST * > m_currentImplicitPowerPins
std::vector< int > placedStackedPinOffsets(const ORCAD_PLACED_INSTANCE &aInstance) const
void rememberInterfaceLabelSource(SCH_SCREEN *aScreen, SCH_LABEL_BASE *aLabel, const std::vector< SEG > &aSourceWires)
void forEachDesignPage(const std::function< void(const ORCAD_RAW_PAGE &)> &aVisit, bool aUnreferenced=false) const
Visit root pages, then child-folder pages, then unreferenced folder pages if asked.
static constexpr int PIN_LEN_DBU
– constants (calibrated; do not change) -------------------------------------—
static constexpr int MARGIN_R_DBU
std::map< SCH_SCREEN *, std::vector< wxString > > m_sourceOccurrences
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::map< SCH_SCREEN *, const ORCAD_RAW_PAGE * > m_sourcePages
std::map< SCH_SYMBOL *, const ORCAD_PLACED_INSTANCE * > m_sourceInstances
void acceptPowerAliases(const std::map< std::string, POWER_ALIAS_EVIDENCE > &aCandidates)
Rename a power symbol to the net most of its placements resolve to.
bool canBuildFolderHierarchy(const std::vector< ORCAD_RAW_PAGE > &aPages, const ORCAD_OCC_SCOPE &aScope) const
Every occurrence block is drawn exactly once on its parent folder's pages.
SCH_SCREEN * newScreen()
A new screen with the next deterministic screen UUID, recorded as created by this import.
PAGE_SCOPE occurrenceScope(const ORCAD_OCC_SCOPE &aOcc) const
A scope for aOcc carrying the occurrence aliases known so far.
std::string occurrenceBaseNetName(const std::string &aName) const
std::set< SCH_SCREEN * > m_importedScreens
std::vector< SCH_SHEET * > createTopLevelSheets(const std::vector< std::pair< wxString, wxString > > &aNamesAndFiles, bool aReuseRoot, bool aOrdinalSheetUuids)
Top-level sheets named by aNamesAndFiles.
bool isOffpageNetName(const std::string &aName) const
void placeBitmap(const ORCAD_PRIMITIVE &aPrim, SCH_SCREEN *aScreen, int aOrient=0, bool *aUsedEmbeddedEmf=nullptr)
Skip undecodable images with a warning.
VECTOR2I graphicPinPos(const ORCAD_GRAPHIC_INST &aInst) const
Use the transformed cache pin position, or the instance anchor if no pin is available.
SCH_SHEET_PATH topLevelPath(SCH_SHEET *aSheet, size_t aPageNumber) const
The hierarchy path ending at a top-level sheet, numbered aPageNumber.
const ORCAD_PACKAGE * packageFor(const ORCAD_PLACED_INSTANCE &aInst) const
The cache package backing a placement, or nullptr when the design has none.
std::map< std::string, std::vector< UNIT_INFO > > m_preparedLibUnits
void applyPageSettings(ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
Shift content on the 10-DBU grid to preserve connectivity.
VECTOR2I displayPropPosition(const ORCAD_DISPLAY_PROP &aDisplay, const VECTOR2I &aAnchorIu) const
Capture's display-property origin sits on the font baseline; return the KiCad text origin.
SPIN_STYLE spinAwayFromWire(const VECTOR2I &aPosDbu) const
Point an interface label at aPosDbu away from the wire that ends there.
std::set< const SCH_ITEM * > m_preExistingItems
already on the root screen
ORCAD_CONVERTER(ORCAD_DESIGN &aDesign, SCHEMATIC *aSchematic, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter=nullptr)
bool m_simpleRepeatedLeafDesign
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.
wxString uniqueSheetName(const wxString &aBase)
aBase, or "aBase (N)" for the first N >= 2 not already used by a sibling sheet.
std::map< std::tuple< SCH_SCREEN *, const ORCAD_PLACED_INSTANCE *, size_t >, std::pair< uint32_t, std::string > > m_wirelessNetNames
~ORCAD_CONVERTER()
Out-of-line: LIB_ENTRY holds LIB_SYMBOL by unique_ptr.
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.
int resolveFontIndex(int aFontIdx) const
Resolve a Design Template font ID to its 1-based LOGFONT index.
void applyCisVariants(SCH_SYMBOL *aSymbol, const ORCAD_PLACED_INSTANCE &aInst, const SCH_SHEET_PATH &aSheetPath, const std::string &aValue)
Record each CIS variant's installed state and property overrides as KiCad symbol variants.
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.
static wxString MakePageFileName(int aPageIndex, const std::string &aPageName)
LIB_SYMBOL * kicadSymbolFor(const std::string &aLibName)
static BOX2I pageExtentDbu(const ORCAD_RAW_PAGE &aPage)
Free graphics use nested primitive bounds; their outer boxes do not describe page coordinates.
std::map< PKG_KEY, std::pair< std::string, int > > m_pkgToLib
void appendPageItem(SCH_SCREEN *aScreen, SCH_ITEM *aItem)
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)
std::vector< NET_LABEL_INTENT > m_netLabelIntents
int textBaselineOffset(int aTextSize, int aFontIdx, bool aTemplateFont=true) const
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)
std::set< wxString > m_usedSheetNames
Lower-cased sheet names already emitted, to keep sibling sheet names unique.
void convertFlatPages(const SCH_SHEET_PATH &aRootPath)
Every page, each child occurrence expanded, becomes a top-level sheet.
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.
std::map< std::string, std::string > m_baseOccurrenceNetAliases
Occurrence net aliases shared by every scope, then those a parent block adds per child scope.
std::vector< INTERFACE_LABEL_SOURCE > m_interfaceLabelSources
PAGE_NET_INDEX m_netIndex
SCH_SCREEN * m_pageItemScreen
void placeFolder(FOLDER_WALK &aWalk, std::vector< ORCAD_RAW_PAGE > &aPages, const ORCAD_OCC_SCOPE &aScope, SCH_SHEET *aFolderSheet, const SCH_SHEET_PATH &aFolderPath, const std::string &aOccurrenceSuffix, bool aRepeatedFolder, const std::map< std::string, std::string > &aUnconnectedInterfaceNetNames, std::map< std::string, std::string > aInterfaceNetAliases)
void prepareGlobalNetNames()
Capture net names ignore case; KiCad net names do not.
std::map< std::string, LIB_ENTRY > m_libSymbols
keyed by emitted lib name
std::map< std::string, size_t > m_occurrenceNetNameScopeCounts
std::string resolvePowerNet(const ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst) const
static int toKicadOrientation(int aOrient)
int m_powerCount
"#PWR%04d" counter
void convertUnreferencedPages()
void convertPage(ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, const SCH_SHEET_PATH &aSheetPath, bool aContainerPage=false, bool aSharedFolderPage=false)
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.
KIID deterministicUuid(const std::string &aRole, size_t aOrdinal) const
std::set< std::string > m_offpageNetNames
SCH_SYMBOL * instantiateSymbol(const LIB_SYMBOL &aLibSymbol, const std::string &aLibName, int aUnit, int aOrient, const VECTOR2I &aPos, const SCH_SHEET_PATH &aSheetPath) const
New placement of a library symbol, oriented by an OrCAD orientation code.
void applyTitleBlock(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
void finalizeNativePowerPackages()
void finishConversion()
Run the shared finalization sequence that ends every conversion entry point.
std::map< std::pair< SCH_SCREEN *, uint32_t >, std::vector< SCH_ITEM * > > m_sourceNetItems
void placeDefinitionImages(const ORCAD_SYMBOL_DEF &aDefinition, int aBaseX, int aBaseY, int aOrient, SCH_SCREEN *aScreen)
wxString resolveReference(const ORCAD_PLACED_INSTANCE &aInst) const
Use the occurrence reference when the instance has an unannotated template.
std::string occurrenceElectricalNetName(uint32_t aOccurrenceId, const std::string &aName) const
std::map< std::pair< SCH_SCREEN *, uint32_t >, std::string > m_sourceGeneratedNetNames
void applyFont(EDA_TEXT *aText, int aFontIdx, bool aTemplateFont=true) const
std::map< std::pair< SCH_SCREEN *, uint32_t >, std::set< std::string > > m_sourceNetNames
SCH_SHEET * createBlockSheet(SCH_SHEET *aParentSheet, const ORCAD_RAW_PAGE &aParentPage, const ORCAD_DRAWN_INSTANCE &aBlock, const ORCAD_OCC_BLOCK &aOccurrence, const wxString &aName, const std::string &aFilePageName, int aPageIndex)
The child sheet for a hierarchical block, with its pins, appended to aParentSheet's screen.
std::pair< std::string, int > libForInstance(const ORCAD_PLACED_INSTANCE &aInst, const PKG_KEY **aSourceUnit=nullptr)
Returns the registered library name and unit number.
static void offsetPage(ORCAD_RAW_PAGE &aPage, int aDx, int aDy)
aDx and aDy must be multiples of the 10-DBU grid.
void recordPowerAlias(std::map< std::string, POWER_ALIAS_EVIDENCE > &aCandidates, const std::string &aSourceName, const std::string &aElectricalName) const
void convertFolderHierarchy(const SCH_SHEET_PATH &aRootPath, bool aNative)
VECTOR2I textSize(int aFontIdx, bool aTemplateFont=true) const
Preserve an explicit LOGFONT width while retaining natural font aspect when it is zero.
std::string unitLetter(const ORCAD_PLACED_INSTANCE &aInst) const
The unit key includes a non-Normal view so DeMorgan graphics remain distinct.
static std::string SymbolId(const std::string &aName)
LIB_ID-safe symbol name: ':', '"', '/' and whitespace runs -> '_'; "SYM" if empty.
bool isPowerNetName(const std::string &aName) const
bool hasImplicitPowerPinName(const ORCAD_PLACED_INSTANCE &aInstance, size_t aPinIndex, const std::string &aNetName) const
std::map< PKG_KEY, std::pair< std::string, int > > m_preparedPkgToLib
std::vector< std::pair< SCH_LABEL_BASE *, std::pair< SCH_SCREEN *, uint32_t > > > m_labelSourceNets
void addSymbolPrimitive(LIB_SYMBOL *aSymbol, const ORCAD_PRIMITIVE &aPrim, int aUnit, int aColor, int aOffsetX=0, int aOffsetY=0)
std::vector< PLACED_PACKAGE_UNIT > m_placedPackageUnits
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 canonicalGlobalNetKey(const std::string &aName) const
Case-folded canonicalGlobalNetName() for use as a map key.
std::tuple< std::string, std::string, int, std::string > PKG_KEY
(sourcePackage-or-pkgName, pkgName, variant index, unit discriminator) -> (lib name,...
static constexpr int MARGIN_T_DBU
void placeHierarchicalBlockFields(SCH_SHEET *aSheet, const ORCAD_DRAWN_INSTANCE &aBlock, const std::string &aChildFolder)
void placeGraphics(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen)
std::map< std::string, std::string > unconnectedInterfaceNetNames(const ORCAD_DRAWN_INSTANCE &aBlock, const std::string &aFlatNetSuffix) const
No-connect block pins whose names are wired elsewhere become per-occurrence nets.
std::string powerLibFor(const std::string &aSymbolName, const std::string &aNetName)
Key power symbols by net name because users can rename their ports.
void placeHierarchicalBlockPinFill(SCH_SCREEN *aScreen, SCH_SHEET_PIN *aPin)
void collectFolderPowerAliases(std::map< std::string, POWER_ALIAS_EVIDENCE > &aCandidates, std::vector< ORCAD_RAW_PAGE > &aPages, const ORCAD_OCC_SCOPE &aScope)
std::vector< SCH_ITEM * > m_pageItems
void placeWires(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, bool aHierarchical, bool aNestedHierarchy, bool aSharedFolderPage)
int textSizeIU(int aFontIdx, bool aTemplateFont=true) const
std::map< std::string, std::map< std::string, std::string > > m_hierBusNamesByScreen
void assignRemainingUuids()
Give items created after page conversion, such as moved labels and cleanup junctions,...
void warn(const wxString &aMsg)
– reporting [orcad_converter_sheet.cpp] ---------------------------------------—
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)
std::map< std::string, std::string > m_globalNetAliases
std::string canonicalGlobalNetName(const std::string &aName) const
Return the design-wide spelling selected by prepareGlobalNetNames().
void applyMultilineSpacing(SCH_TEXT *aText, int aFontIdx, bool aTemplateFont=true) const
std::map< std::string, size_t > m_occurrenceNetNameMinDepth
std::map< const std::map< uint32_t, std::string > *, std::map< std::string, std::string > > m_occurrenceAliasesByScope
std::vector< LIB_SYMBOL * > BuildSymbolLibrary()
The caller owns the returned library symbols.
void placePorts(const ORCAD_RAW_PAGE &aPage, SCH_SCREEN *aScreen, bool aHierarchical)
static constexpr const char * LIB_NICK
Symbol library nickname used in every emitted LIB_ID.
void prepareOccurrenceNets()
– hierarchy [orcad_converter_sheet.cpp] --------------------------------------—
int wireAliasFontId(const ORCAD_ALIAS &aAlias) const
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 margins in DBU leave room for the KiCad frame and title block.
std::set< std::string > m_connectedBlockInterfaceNames
void addSymbolPin(LIB_SYMBOL *aSymbol, const ORCAD_SYMBOL_PIN &aPin, const BOX2I &aBodyBox, PIN_EMIT aEmit)
VECTOR2I placedPinElectricalPosition(const ORCAD_PLACED_INSTANCE &aInstance, size_t aPinIndex) const
void enterScope(PAGE_SCOPE aScope)
std::string powerNet(const ORCAD_RAW_PAGE &aPage, const ORCAD_GRAPHIC_INST &aInst) const
Memoized resolvePowerNet() for the indexed page.
std::set< const std::string * > pinOccurrenceTargets(const ORCAD_RAW_PAGE &aPage, const ORCAD_BLOCK_PIN &aPin, const std::map< uint32_t, std::string > &aScopeNets, bool aSkipGenerated, std::set< std::string > *aSourceKeys=nullptr) const
Occurrence nets in aScopeNets that a block pin on aPage reaches by name or by wire object id.
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).
const std::set< uint32_t > & pinNetIds(const ORCAD_PIN_INST &aPin) const
Page nets a placed pin joins through its net id, its wire object id or a wire under it.
std::set< std::string > m_nativePowerFamilies
const ORCAD_SYMBOL_DEF * graphicDefinition(const ORCAD_GRAPHIC_INST &aInst) const
The cached variant a page graphic uses: its Source Library first, then its placed bounds,...
std::optional< uint32_t > occurrenceNetIdFor(const std::string *aName) const
Return the occurrence net id owning aName, which the table identifies by address.
static wxString SanitizeFileName(const std::string &aName)
std::map< std::string, std::string > m_globalNetNames
void applyDisplayProp(SCH_FIELD &aField, const ORCAD_DISPLAY_PROP &aDisplay, const VECTOR2I &aAnchorIu, bool aSymbolFlips, bool aApplyVisibility=true) const
Style a field from a display property.
int fontHeightDbu(int aFontIdx, bool aTemplateFont=true) const
|lfHeight| of a Design Template font ID; ID 0 selects the template default.
void appendNetIntent(SCH_SCREEN *aScreen, SCH_LABEL *aLabel, bool aExplicitName, uint32_t aNetId=0)
bool canBuildNativeHierarchy(const ORCAD_RAW_PAGE &aPage, const ORCAD_OCC_SCOPE &aScope) const
One root page whose every block opens a single-page child.
std::set< std::string > m_powerNetNames
std::string effectiveInterfaceNetName(const std::string &aName) const
const ORCAD_DISPLAY_PROP * finishInterfaceLabel(const ORCAD_GRAPHIC_INST &aGraphic, SCH_LABEL_BASE *aLabel, const std::vector< SEG > &aSourceWires, SCH_SCREEN *aScreen)
Style a port or off-page label from its source graphic, draw its stored IREF text and add it.
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 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.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Holds all the data relating to one schematic.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Segment description base class to describe items which have 2 end points (track, wire,...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Spin style for labels of all kinds on schematics.
int OrcadDisplayType(const ORCAD_DISPLAY_PROP &aProp)
VECTOR2I OrcadDbuToIu(int aX, int aY)
bool OrcadDisplayPropShowsName(const ORCAD_DISPLAY_PROP &aProp)
FILL_T OrcadFillType(int aFillStyle, int aHatchStyle)
ORCAD_POINT OrcadInverseOrient(int aOrient, int aX, int aY)
Undo the orientation matrix of OrcadTransformPoint.
int OrcadLineWidthIu(int aWidth)
std::pair< double, double > OrcadDashRatios(int aFormatVersionMajor)
int OrcadTextBaselineOffset(int aTextSize)
std::vector< SEG > OrcadHatchLines(const EDA_SHAPE &aShape, int aHatchStyle, int aPitch)
int OrcadPageOrder(wxString &aName)
Return a numeric page prefix (or -1); strip only the "N - title" convention.
int OrcadHatchPitchIu(uint32_t aModifyTimestamp)
bool OrcadDisplayPropShowsValue(const ORCAD_DISPLAY_PROP &aProp)
int OrcadHatchLineWidthIu(uint32_t aModifyTimestamp)
void OrcadTransformPrimitivePoints(ORCAD_PRIMITIVE &aPrim, const std::function< ORCAD_POINT(const ORCAD_POINT &)> &aMap)
Map the point members of a primitive: points, arc start and arc end.
KIGFX::COLOR4D OrcadColor(int aColorIndex)
void OrcadOffsetPrimitive(ORCAD_PRIMITIVE &aPrim, int aDx, int aDy)
Translate a primitive, box included.
int OrcadDisplayFontId(const ORCAD_DISPLAY_PROP &aProp)
wxString OrcadPinNameMarkup(const wxString &aName)
void OrcadForEachLeafPrimitive(const std::vector< ORCAD_PRIMITIVE > &aPrimitives, const std::function< void(const ORCAD_PRIMITIVE &, int, int)> &aVisit)
Visit every non-group primitive in drawing order with the accumulated offset of its enclosing groups.
constexpr int ORCAD_IU_PER_DBU
Schematic internal units per OrCAD DBU: 10 mil * 254 IU/mil.
bool OrcadDisplayPropVisible(const ORCAD_DISPLAY_PROP &aProp)
LINE_STYLE OrcadLineStyle(int aStyle)
int OrcadPageGraphicLineWidthIu(int aWidth)
VECTOR2I OrcadStretchedImageSize(int aWidth, int aHeight, int aBoxWidth, int aBoxHeight)
constexpr ORCAD_ORIENT_ENTRY ORCAD_ORIENT_TABLE[8]
Indexed by orientation bits: angle, mirror, offset selectors, then matrix coefficients.
LINE_STYLE
Dashed line types.
The owning wire defines the connection.
One interface pin of a hierarchical block, at its absolute page position.
Page counters and rules threaded through a folder hierarchy walk.
bool folderSheetNames
name an unreferenced block after its folder, else its page
bool occurrenceAliases
learn power and child occurrence aliases before placing pages
bool rootSharedFolderPage
convert the root page as a shared folder page
bool numberSourcePages
fill title-block page numbers from the walk order
bool nestedFlatSuffix
suffix by block path; else only in simple repeated leaf designs
bool interfaceAliases
alias a child's interface nets to the parent occurrence net
std::vector< SCH_LINE * > wires
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::vector< UNIT_INFO > units
sorted by letter; unit numbers are 1-based indices
std::string powerNet
power symbols are keyed by NET name
One resolved off-page connector: index into page.offpage, net, pin position.
Lookups for the page and scope being converted, rebuilt by buildNetLookup().
std::vector< VECTOR2I > junctions
std::map< const ORCAD_PIN_INST *, std::set< uint32_t > > pinNets
std::map< std::pair< int, int >, std::vector< const ORCAD_WIRE * > > wireEndpoints
const ORCAD_RAW_PAGE * page
std::map< uint32_t, std::set< const std::string * > > occurrenceNamesByNetId
Scope occurrence nets owned by a page net through a wire or part object id.
std::map< const ORCAD_GRAPHIC_INST *, std::string > powerNets
powerNet() depends on the scope, so the memo lives only as long as this index.
Occurrence context of the page being converted.
std::map< std::string, std::string > interfaceNetAliases
std::set< std::string > connectorInterfaceNetAliases
std::map< std::string, std::string > unconnectedInterfaceNetNames
std::map< std::string, size_t > electricalKeyCounts
std::map< std::string, std::string > occurrenceNetAliases
const ORCAD_OCC_SCOPE * occ
null when the page has no occurrence
std::string flatNetSuffix
Per-pin choices kicadSymbolFor() makes before emitting a pin.
const PKG_KEY * sourceUnit
Placements of a power symbol name and the power nets they resolved to.
std::map< std::string, std::pair< std::string, size_t > > targets
std::optional< KIID > libraryPin
– shared bookkeeping types ------------------------------------------------—
std::vector< int > pinOffsets
hidden duplicate-pin electrical offsets, DBU
std::vector< bool > pinIgnore
package pins suppressed for this unit
const ORCAD_SYMBOL_DEF * convert
DeMorgan view sharing this unit's pin map.
const ORCAD_SYMBOL_DEF * symbol
std::vector< bool > explicitPinNets
placed pins whose source net overrides implicit power naming
std::vector< std::string > pinNumbers
device pin-number map for this unit
std::string letter
unit discriminator, e.g. "A", "-16", "B:Convert"
bool operator==(const UNIT_INFO &) const =default
std::vector< bool > pinNumberVisible
nonblank source package pin numbers
Child-folder pages are instantiated for each occurrence, with that occurrence's references.
Display positions use symbol coordinates; rotFont combines the font index and quarter turns.
The inline LibraryPart defines the block interface; placed pin records supply absolute positions.
Free graphics use nested primitive coordinates.
Repeated child folders have separate scopes and reference designators.
Each scope holds the references and child blocks for one instantiation path.
OrCAD rotates about the bounding box; KiCad rotates about the anchor.
Pin positions are absolute page connection points.
The placed box includes displayed text.
Integer point in OrCAD DBU.
Primitive byte lengths can include or exclude the eight-byte size envelope.
One parsed 'Views/<folder>/Pages/<page>' stream, raw structure lists in stream order.
The bounding box occupies the final eight bytes before the next prefix stop.
Pin coordinates use symbol space with Y down.
The wire ID refers to the page net table.
VECTOR2< int32_t > VECTOR2I