|
KiCad PCB EDA Suite
|
#include <sch_io/orcad/orcad_converter.h>#include <sch_io/ole_image.h>#include <algorithm>#include <array>#include <charconv>#include <cctype>#include <chrono>#include <cmath>#include <functional>#include <numeric>#include <limits>#include <map>#include <memory>#include <optional>#include <set>#include <string>#include <string_view>#include <utility>#include <vector>#include <wx/buffer.h>#include <wx/filename.h>#include <wx/image.h>#include <wx/log.h>#include <wx/tokenzr.h>#include <wx/translation.h>#include <base_units.h>#include <bitmap_base.h>#include <connection_graph.h>#include <core/kicad_algo.h>#include <font/font.h>#include <ki_exception.h>#include <kiid.h>#include <layer_ids.h>#include <lib_symbol.h>#include <math/util.h>#include <page_info.h>#include <progress_reporter.h>#include <project.h>#include <reference_image.h>#include <reporter.h>#include <schematic.h>#include <sch_bitmap.h>#include <sch_bus_entry.h>#include <sch_junction.h>#include <sch_label.h>#include <sch_line.h>#include <sch_no_connect.h>#include <sch_screen.h>#include <sch_shape.h>#include <sch_sheet.h>#include <sch_sheet_path.h>#include <sch_sheet_pin.h>#include <sch_symbol.h>#include <sch_pin.h>#include <import_net_map.h>#include <sch_text.h>#include <string_utils.h>#include <stroke_params.h>#include <template_fieldnames.h>#include <title_block.h>#include <sch_io/orcad/orcad_stream.h>Go to the source code of this file.
Classes | |
| struct | BUS_RANGE |
| A vector bus name "PREFIX[first..last]" (or ':' as separator); last may be below first. More... | |
Functions | |
| 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. | |
| void | OrcadOffsetPrimitive (ORCAD_PRIMITIVE &aPrim, int aDx, int aDy) |
| Translate a primitive, box included. | |
| 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. | |
| VECTOR2I | OrcadStretchedImageSize (int aWidth, int aHeight, int aBoxWidth, int aBoxHeight) |
| KIGFX::COLOR4D | OrcadColor (int aColorIndex) |
| int | OrcadPageOrder (wxString &aName) |
| Return a numeric page prefix (or -1); strip only the "N - title" convention. | |
| static std::string | scopedHierBusName (const std::string &aName, uint32_t aOccurrenceId) |
| static std::vector< std::pair< BUS_RANGE, BUS_RANGE > > | scopedBusRanges (const std::map< std::string, std::string > &aBusNames) |
| Only renames whose source and scoped ranges have the same length map member by member. | |
| static std::string | scopedHierBusMember (const std::string &aName, const std::map< std::string, std::string > &aBusNames) |
| static std::string | scopedHierBusRange (const std::string &aName, const std::map< std::string, std::string > &aBusNames) |
| static bool | rawPointOnSegment (int aX, int aY, const ORCAD_WIRE &aWire) |
| static std::optional< VECTOR2I > | rawWireIntersection (const ORCAD_WIRE &aFirst, const ORCAD_WIRE &aSecond) |
| static bool | rawBusSegmentsTouch (const ORCAD_WIRE &aFirst, const ORCAD_WIRE &aSecond) |
| static std::vector< std::string > | busPrefixRuns (const std::string &aPrefix) |
| static std::set< std::string > | busPrefixTokens (const std::string &aPrefix) |
| static std::string | firstBusPrefixToken (const std::string &aPrefix) |
| static std::set< std::string > | pageNetNames (const ORCAD_RAW_PAGE &aPage, uint32_t aNetId) |
| static std::set< uint32_t > | pageNetIdsNamed (const ORCAD_RAW_PAGE &aPage, std::string_view aName) |
| static std::string | connectedBusName (const ORCAD_RAW_PAGE &aPage, const ORCAD_BLOCK_PIN &aPin, const std::string &aFallback) |
| static LABEL_FLAG_SHAPE | hierarchicalPinShape (ORCAD_PORT_TYPE aType) |
| static uint32_t | busNetAt (const ORCAD_RAW_PAGE &aPage, const ORCAD_BLOCK_PIN &aPin) |
| static std::string | flatNetSuffix (const ORCAD_DRAWN_INSTANCE &aBlock) |
| static std::string | appendOccurrenceSuffix (const std::string &aParentSuffix, const ORCAD_DRAWN_INSTANCE &aBlock) |
| static const ORCAD_DRAWN_INSTANCE * | findDrawnBlock (const ORCAD_RAW_PAGE &aPage, uint32_t aDbId) |
| static std::pair< const ORCAD_DRAWN_INSTANCE *, const ORCAD_RAW_PAGE * > | findDrawnBlock (const std::vector< ORCAD_RAW_PAGE > &aPages, uint32_t aDbId) |
| static std::vector< const ORCAD_OCC_BLOCK * > | sortedOccurrences (const ORCAD_OCC_SCOPE &aScope) |
| Capture orders child pages by numeric folder prefix, then by folder name without case. | |
| static SHEET_SIDE | nearestSheetSide (const ORCAD_BLOCK_PIN &aPin, const ORCAD_DRAWN_INSTANCE &aBlock) |
| static std::optional< VECTOR2I > | safeConnectivityLabelPosition (SCH_SCREEN *aScreen, const VECTOR2I &aPosition, const std::optional< std::vector< SEG > > &aSourceWires) |
| static std::optional< std::vector< SEG > > | eligibleSourceConnectivityWires (const ORCAD_RAW_PAGE &aPage, const VECTOR2I &aPosition, const std::set< std::string > &aNames, bool aBus=false, uint32_t *aNetId=nullptr) |
| static std::optional< std::vector< SEG > > | interfaceSourceWires (const ORCAD_RAW_PAGE &aPage, const VECTOR2I &aPosition, const std::set< std::string > &aNames, const std::string &aNet) |
| Bus labels fall back to bus wires; a net label with no eligible net wire may still sit on a bus. | |
|
static |
Definition at line 1296 of file orcad_converter_sheet.cpp.
References flatNetSuffix().
Referenced by ORCAD_CONVERTER::convertFlatPages(), and ORCAD_CONVERTER::placeFolder().
|
static |
Definition at line 1264 of file orcad_converter_sheet.cpp.
References ORCAD_WIRE::id, ORCAD_WIRE::isBus, rawPointOnSegment(), ORCAD_RAW_PAGE::wires, ORCAD_BLOCK_PIN::x, ORCAD_WIRE::x1, ORCAD_WIRE::x2, ORCAD_BLOCK_PIN::y, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.
Referenced by ORCAD_CONVERTER::createBlockSheet().
|
static |
Definition at line 969 of file orcad_converter_sheet.cpp.
References end.
Referenced by busPrefixTokens(), and firstBusPrefixToken().
|
static |
Definition at line 994 of file orcad_converter_sheet.cpp.
References busPrefixRuns(), and result.
Referenced by connectedBusName().
|
static |
Definition at line 1093 of file orcad_converter_sheet.cpp.
References ORCAD_WIRE::aliases, busPrefixTokens(), candidates(), cursor, firstBusPrefixToken(), group, ORCAD_WIRE::id, ORCAD_GRAPHIC_INST::logicalName, name, ORCAD_ALIAS::name, ORCAD_GRAPHIC_INST::name, ORCAD_RAW_PAGE::netGroups, ORCAD_RAW_PAGE::offpage, pageNetNames(), BUS_RANGE::Parse(), ORCAD_RAW_PAGE::ports, rawBusSegmentsTouch(), rawPointOnSegment(), source, ORCAD_RAW_PAGE::wires, ORCAD_BLOCK_PIN::x, and ORCAD_BLOCK_PIN::y.
Referenced by ORCAD_CONVERTER::createBlockSheet().
|
static |
Definition at line 5439 of file orcad_converter_sheet.cpp.
References ORCAD_WIRE::id, ORCAD_WIRE::isBus, OrcadDbuToIu(), pageNetNames(), rawPointOnSegment(), ORCAD_RAW_PAGE::wires, VECTOR2< T >::x, ORCAD_WIRE::x1, ORCAD_WIRE::x2, VECTOR2< T >::y, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.
Referenced by interfaceSourceWires().
|
static |
Definition at line 1313 of file orcad_converter_sheet.cpp.
References ORCAD_RAW_PAGE::blocks.
Referenced by ORCAD_CONVERTER::canBuildNativeHierarchy(), ORCAD_CONVERTER::collectFolderPowerAliases(), ORCAD_CONVERTER::convertFlatPages(), findDrawnBlock(), and ORCAD_CONVERTER::placeFolder().
|
static |
Definition at line 1326 of file orcad_converter_sheet.cpp.
References findDrawnBlock().
|
static |
Definition at line 1008 of file orcad_converter_sheet.cpp.
References busPrefixRuns().
Referenced by connectedBusName().
|
static |
Definition at line 1285 of file orcad_converter_sheet.cpp.
References name, ORCAD_DRAWN_INSTANCE::name, and ORCAD_DRAWN_INSTANCE::props.
Referenced by appendOccurrenceSuffix().
|
static |
Definition at line 1249 of file orcad_converter_sheet.cpp.
References BIDIRECTIONAL, INPUT_TYPE, L_BIDI, L_INPUT, L_OUTPUT, L_TRISTATE, L_UNSPECIFIED, OUTPUT, and TRI_STATE.
Referenced by ORCAD_CONVERTER::createBlockSheet().
|
static |
Bus labels fall back to bus wires; a net label with no eligible net wire may still sit on a bus.
Definition at line 7017 of file orcad_converter_sheet.cpp.
References eligibleSourceConnectivityWires(), FromOrcadString(), and SCH_CONNECTION::IsBusLabel().
Referenced by ORCAD_CONVERTER::placeOffpageConnectors(), and ORCAD_CONVERTER::placePorts().
|
static |
Definition at line 1421 of file orcad_converter_sheet.cpp.
References std::abs(), BOTTOM, ORCAD_DRAWN_INSTANCE::h, LEFT, RIGHT, TOP, ORCAD_DRAWN_INSTANCE::w, ORCAD_BLOCK_PIN::x, ORCAD_DRAWN_INSTANCE::x1, ORCAD_BLOCK_PIN::y, and ORCAD_DRAWN_INSTANCE::y1.
Referenced by ORCAD_CONVERTER::createBlockSheet().
| KIGFX::COLOR4D OrcadColor | ( | int | aColorIndex | ) |
Definition at line 400 of file orcad_converter_sheet.cpp.
References KIGFX::COLOR4D::UNSPECIFIED.
Referenced by addOrcadSymbolHatch(), ORCAD_CONVERTER::addSymbolPrimitive(), ORCAD_CONVERTER::applyDisplayProp(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ORCAD_CONVERTER::finishInterfaceLabel(), ORCAD_CONVERTER::placeBusEntries(), ORCAD_CONVERTER::placeGraphicDisplayText(), ORCAD_CONVERTER::placeGraphics(), ORCAD_CONVERTER::placeHierarchicalBlockPinFill(), and ORCAD_CONVERTER::placeSymbolFields().
| 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.
Definition at line 357 of file orcad_converter_sheet.cpp.
References GROUP_PRIM.
Referenced by ORCAD_CONVERTER::placeDefinitionImages(), ORCAD_CONVERTER::placeDefinitionVectors(), and ORCAD_CONVERTER::placeGraphics().
| void OrcadOffsetPrimitive | ( | ORCAD_PRIMITIVE & | aPrim, |
| int | aDx, | ||
| int | aDy ) |
Translate a primitive, box included.
Group children are relative to the group and need no shift.
Definition at line 343 of file orcad_converter_sheet.cpp.
References OrcadTransformPrimitivePoints(), ORCAD_POINT::x, ORCAD_PRIMITIVE::x1, ORCAD_PRIMITIVE::x2, ORCAD_POINT::y, ORCAD_PRIMITIVE::y1, and ORCAD_PRIMITIVE::y2.
Referenced by ORCAD_CONVERTER::offsetPage(), and ORCAD_CONVERTER::placeGraphics().
| int OrcadPageOrder | ( | wxString & | aName | ) |
Return a numeric page prefix (or -1); strip only the "N - title" convention.
Definition at line 717 of file orcad_converter_sheet.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
| VECTOR2I OrcadStretchedImageSize | ( | int | aWidth, |
| int | aHeight, | ||
| int | aBoxWidth, | ||
| int | aBoxHeight ) |
Definition at line 376 of file orcad_converter_sheet.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and ORCAD_CONVERTER::placeBitmap().
| 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.
The box corners are left alone.
Definition at line 329 of file orcad_converter_sheet.cpp.
References ORCAD_PRIMITIVE::end, ORCAD_PRIMITIVE::points, and ORCAD_PRIMITIVE::start.
Referenced by OrcadOffsetPrimitive(), and ORCAD_CONVERTER::placeDefinitionVectors().
|
static |
Definition at line 1032 of file orcad_converter_sheet.cpp.
References ORCAD_RAW_PAGE::netmap, and pageNetNames().
Referenced by ORCAD_CONVERTER::offpageNets(), and ORCAD_CONVERTER::resolvePowerNet().
|
static |
Definition at line 1015 of file orcad_converter_sheet.cpp.
References ORCAD_RAW_PAGE::netAliases, and ORCAD_RAW_PAGE::netmap.
Referenced by ORCAD_CONVERTER::buildNetLookup(), connectedBusName(), eligibleSourceConnectivityWires(), pageNetIdsNamed(), ORCAD_CONVERTER::pinOccurrenceTargets(), ORCAD_CONVERTER::placePorts(), ORCAD_CONVERTER::placeWires(), ORCAD_CONVERTER::powerPinPos(), and ORCAD_CONVERTER::resolvePowerNet().
|
static |
Definition at line 961 of file orcad_converter_sheet.cpp.
References rawPointOnSegment(), ORCAD_WIRE::x1, ORCAD_WIRE::x2, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.
Referenced by connectedBusName().
|
static |
Definition at line 913 of file orcad_converter_sheet.cpp.
References ORCAD_WIRE::x1, ORCAD_WIRE::x2, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.
Referenced by ORCAD_CONVERTER::buildNetLookup(), busNetAt(), connectedBusName(), ORCAD_CONVERTER::convertFlatPages(), eligibleSourceConnectivityWires(), ORCAD_CONVERTER::offpageNets(), ORCAD_CONVERTER::pinOccurrenceTargets(), ORCAD_CONVERTER::placePorts(), ORCAD_CONVERTER::prepareOccurrenceNets(), and rawBusSegmentsTouch().
|
static |
Definition at line 922 of file orcad_converter_sheet.cpp.
References ORCAD_WIRE::x1, ORCAD_WIRE::x2, ORCAD_WIRE::y1, and ORCAD_WIRE::y2.
Referenced by ORCAD_CONVERTER::computeJunctions().
|
static |
Definition at line 7031 of file orcad_converter_sheet.cpp.
References std::abs(), ALL_BODY_STYLES, ALL_UNITS, candidates(), SEG::Contains(), delta, SCH_ITEM::GetLayer(), SCH_LINE::GetSeg(), SCH_SCREEN::Items(), LAYER_BUS, LAYER_WIRE, pin, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_JUNCTION_T, SCH_LINE_T, SCH_SHEET_T, SCH_SYMBOL_T, schIUScale, source, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ORCAD_CONVERTER::finalizeNetNames(), ORCAD_CONVERTER::minimizeNetLabels(), ORCAD_CONVERTER::placeOffpageConnectors(), and ORCAD_CONVERTER::placePorts().
|
static |
Only renames whose source and scoped ranges have the same length map member by member.
Definition at line 848 of file orcad_converter_sheet.cpp.
References BUS_RANGE::Parse(), and source.
Referenced by scopedHierBusMember(), and scopedHierBusRange().
|
static |
Definition at line 865 of file orcad_converter_sheet.cpp.
References next(), scopedBusRanges(), and source.
Referenced by ORCAD_CONVERTER::recordNetNameMap().
|
static |
Definition at line 773 of file orcad_converter_sheet.cpp.
Referenced by ORCAD_CONVERTER::createBlockSheet().
|
static |
Definition at line 887 of file orcad_converter_sheet.cpp.
References BUS_RANGE::Parse(), scopedBusRanges(), and source.
Referenced by ORCAD_CONVERTER::createBlockSheet().
|
static |
Capture orders child pages by numeric folder prefix, then by folder name without case.
Definition at line 1339 of file orcad_converter_sheet.cpp.
References ORCAD_OCC_SCOPE::blocks.
Referenced by ORCAD_CONVERTER::placeFolder().