20#include <boost/test/unit_test.hpp>
54 graph->
Recalculate( m_schematic->BuildSheetListSortedByPageNumbers(),
true );
61 std::map<wxString, wxString> classes;
62 std::map<wxString, KIGFX::COLOR4D> colors;
63 classes[wxT(
"FIRST" )] = wxT(
"DDR_DATA" );
89 std::map<wxString, CONNECTION_GRAPH::CHAIN_TERMINAL_REFS> termRefs;
90 termRefs[wxT(
"FIRST" )] = { { liveRefA, livePinA }, { liveRefB, livePinB } };
96 if( potentials.size() > 1 )
120 BOOST_CHECK( nccOverrides.find( wxT(
"FIRST" ) ) == nccOverrides.end() );
121 BOOST_CHECK( nccOverrides.find( wxT(
"RENAMED" ) ) != nccOverrides.end() );
125 BOOST_CHECK( colOverrides.find( wxT(
"FIRST" ) ) == colOverrides.end() );
126 BOOST_CHECK( colOverrides.find( wxT(
"RENAMED" ) ) != colOverrides.end() );
131 BOOST_CHECK( refOverrides.find( wxT(
"FIRST" ) ) == refOverrides.end() );
132 BOOST_REQUIRE( refOverrides.find( wxT(
"RENAMED" ) ) != refOverrides.end() );
144 graph->
Recalculate( m_schematic->BuildSheetListSortedByPageNumbers(),
true );
148 bool sawFirst =
false;
149 bool sawRenamed =
false;
151 for(
const std::unique_ptr<SCH_NETCHAIN>& s : chains )
156 if( s->GetName() == wxT(
"FIRST" ) )
159 if( s->GetName() == wxT(
"RENAMED" ) )
163 BOOST_CHECK( !sawFirst );
164 BOOST_CHECK( sawRenamed );
178 for(
const std::unique_ptr<SCH_NETCHAIN>& s : netChains )
180 if( s && s->GetName() == wxT(
"RENAMED" ) )
184 BOOST_CHECK( !found );
Calculate the connectivity of a schematic and generate netlists.
void SetNetChainColorOverrides(const std::map< wxString, COLOR4D > &aOverrides)
const std::map< wxString, COLOR4D > & GetNetChainColorOverrides() const
void SetNetChainNetClassOverrides(const std::map< wxString, wxString > &aOverrides)
Stash per-net-chain netclass overrides read from the schematic file.
void SetNetChainTerminalRefOverrides(const std::map< wxString, CHAIN_TERMINAL_REFS > &aRefs)
SCH_NETCHAIN * CreateNetChainFromPotential(SCH_NETCHAIN *aPotential, const wxString &aName)
Promote a potential net chain to an actual user net chain with the provided name.
bool RenameCommittedNetChain(const wxString &aOld, const wxString &aNew)
Rename a committed net chain.
void Recalculate(const SCH_SHEET_LIST &aSheetList, bool aUnconditional=false, std::function< void(SCH_ITEM *)> *aChangedItemHandler=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Update the connection graph for the given list of sheets.
const std::vector< std::unique_ptr< SCH_NETCHAIN > > & GetPotentialNetChains() const
Potential net chains are inferred groupings produced by RebuildNetChains() but not yet user-committed...
const std::map< wxString, wxString > & GetNetChainNetClassOverrides() const
const std::vector< std::unique_ptr< SCH_NETCHAIN > > & GetCommittedNetChains() const
Return user-created (committed) net chains (legacy accessor retained under net-chain API).
bool DeleteCommittedNetChain(const wxString &aName)
Delete a committed net chain by name.
const std::map< wxString, CHAIN_TERMINAL_REFS > & GetNetChainTerminalRefOverrides() const
A color representation with 4 components: red, green, blue, alpha.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
A net chain is a collection of nets that are connected together through passive components.
const KIID & GetTerminalPinB() const
const wxString & GetTerminalRef(int aIdx) const
const wxString & GetNetClass() const
const wxString & GetName() const
const wxString & GetTerminalPinNum(int aIdx) const
const KIID & GetTerminalPinA() const
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::vector< FAB_LAYER_COLOR > dummy
NETCHAIN_RENAME_FIXTURE()
std::unique_ptr< SCHEMATIC > m_schematic
SETTINGS_MANAGER m_settingsManager
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_FIXTURE_TEST_CASE(NetChain_RemoveRenameRoundTrip, NETCHAIN_RENAME_FIXTURE)
BOOST_CHECK_EQUAL(result, "25.4")