20#include <boost/test/unit_test.hpp>
62 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
71 const std::set<wxString> originalNets = potential->
GetNets();
72 const std::size_t originalNetCnt = originalNets.size();
73 const std::size_t originalSymCnt = potential->
GetSymbols().size();
75 BOOST_REQUIRE_GT( originalNetCnt, 0u );
76 BOOST_REQUIRE_GT( originalSymCnt, 0u );
80 BOOST_REQUIRE_EQUAL( committed->
GetNets().size(), originalNetCnt );
81 BOOST_REQUIRE_EQUAL( committed->
GetSymbols().size(), originalSymCnt );
89 BOOST_REQUIRE_MESSAGE( refreshed,
90 "Committed chain disappeared across unconditional Recalculate" );
93 "Committed chain has empty m_symbols after unconditional Recalculate; "
94 "Reset() cleared the cache and RebuildNetChains() failed to refresh it" );
97 "Committed chain has empty m_nets after unconditional Recalculate" );
113 BOOST_CHECK( !twice->
GetNets().empty() );
131 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
138 wxT(
"OVERRIDE_TEST" ) );
151 BOOST_CHECK_CLOSE( refreshed->
GetColor().
r, 1.0, 1e-6 );
152 BOOST_CHECK_CLOSE( refreshed->
GetColor().
g, 0.5, 1e-6 );
153 BOOST_CHECK_CLOSE( refreshed->
GetColor().
b, 0.25, 1e-6 );
171 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
205 "Refresh helper overwrote the user's terminal-pin override on pin A" );
207 "Refresh helper changed the unaffected terminal pin B" );
Calculate the connectivity of a schematic and generates netlists.
SCH_NETCHAIN * GetNetChainByName(const wxString &aName)
SCH_NETCHAIN * CreateNetChainFromPotential(SCH_NETCHAIN *aPotential, const wxString &aName)
Promote a potential net chain to an actual user net chain with the provided name.
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...
void ReplaceNetChainTerminalPin(const wxString &aNetChain, const KIID &aPrev, const KIID &aNew)
A color representation with 4 components: red, green, blue, alpha.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
wxString AsString() const
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 std::set< wxString > & GetNets() const
const wxString & GetTerminalRef(int aIdx) const
const wxString & GetNetClass() const
const KIGFX::COLOR4D & GetColor() const
const std::set< class SCH_SYMBOL * > & GetSymbols() const
void SetNetClass(const wxString &aNetClass)
Net chains may override the netclass applied to every member net.
void SetColor(const KIGFX::COLOR4D &aColor)
Optional display color for the chain.
const KIID & GetTerminalPinA() const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
std::vector< FAB_LAYER_COLOR > dummy
SETTINGS_MANAGER m_settingsManager
NETCHAIN_RECALC_REFRESH_FIXTURE()
std::unique_ptr< SCHEMATIC > m_schematic
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_FIXTURE_TEST_CASE(NetChain_RefreshCommittedChainAcrossUnconditionalRecalc, NETCHAIN_RECALC_REFRESH_FIXTURE)
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_CHECK_EQUAL(result, "25.4")