52 config.m_ConnectivityEngine =
true;
53 config.m_IncrementalConnectivity =
true;
56 SCH_SCREEN* screen = schematic->GetTopLevelSheets().front()->GetScreen();
72 manager.
SetEnvironment( schematic.get(),
nullptr,
nullptr,
nullptr,
nullptr );
73 schematic->RebuildConnectivity();
80 rebuilt.
Update( *schematic,
true );
88 const wxString number =
pin->GetNumber();
96 for(
SCH_PIN* libPin : updated->GetPinsByNumber( number ) )
97 updated->RemoveDrawItem( libPin );
100 replacement.
Modify( symbol, screen );
103 replacement.
Push(
"Replace native symbol pin set",
SKIP_UNDO );
104 BOOST_CHECK( !schematic->Connectivity().Connection(
id,
path ) );
108 restoration.
Modify( symbol, screen );
112 BOOST_CHECK( restored->
GetParent() == symbol );
113 BOOST_CHECK( restored == symbol->
GetPin( number ) );
114 restoration.
Push(
"Restore native symbol pin set",
SKIP_UNDO );
123 SCH_SCREEN* screen = schematic->GetTopLevelSheets().front()->GetScreen();
129 auto* candidate =
static_cast<SCH_SYMBOL*
>( item );
133 if( !candidatePin->GetAlt().IsEmpty() )
147 const wxString alternate =
pin->GetAlt();
148 const auto type =
pin->GetType();
150 auto copy = std::make_unique<SCH_SYMBOL>( *symbol );
156 BOOST_CHECK( updated->GetType() == type );
157 BOOST_CHECK( updated->GetLibPin()->GetParent() == symbol->
GetLibSymbolRef().get() );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
EDA_ITEM * GetParent() const
EE_TYPE OfType(KICAD_T aType) const
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Commit for the schematic and symbol editors.
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
Model-owned source resolver.
void Update(SCHEMATIC &aSchematic, bool aRebuild=false)
Base class for any item which can be embedded within the SCHEMATIC container class,...
void SwapItemData(SCH_ITEM *aImage)
Swap data between aItem and aImage.
EE_RTREE & Items()
Get the full RTree, usually for iterating.
SCH_ITEM * GetConnectivityItem(const KIID &aId) const
Resolve a drawing item or a connectable child on this screen; ambiguous IDs return null.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
std::vector< SCH_PIN * > GetGraphicalPins(int aUnit, int aBodyStyle) const override
SCH_PIN * GetPin(const wxString &number) const
Find a symbol pin by number.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
void SetLibSymbol(LIB_SYMBOL *aLibSymbol)
Set this schematic symbol library symbol reference to aLibSymbol.
RAII class that sets an value at construction and resets it to the original value at destruction.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::string Dump(SCHEMATIC &aSchematic)
Canonical, pointer-free connectivity rows for migration and rebuild comparisons.
std::unique_ptr< SCHEMATIC > schematic
SETTINGS_MANAGER settings
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(ScreenIndexTracksSymbolPinReplacementAndUndo)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")