50 std::vector<wxString> tests = {
66 for(
const wxString&
test : tests )
70 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
74 for(
size_t ii = 0; ii <
path.size(); ++ii )
78 std::vector<SCH_ITEM*> items;
82 if( !item->IsConnectable() )
91 items.push_back(
pin );
96 items.push_back( item );
104 auto& conn_items = check_item->ConnectedItems(
path );
105 auto conn = check_item->Connection();
106 std::string netname = conn ? conn->GetNetName().ToStdString() :
"NoNet";
107 int subgraph = conn ? conn->SubgraphCode() : -1;
108 BOOST_TEST_MESSAGE(
test.ToStdString() <<
": Item "
109 << check_item->GetFriendlyName().ToStdString()
110 <<
" in net " << netname <<
" subgraph " << subgraph
111 <<
" has " << conn_items.size() <<
" connections" );
120 if( !item->IsConnectable() )
124 std::sort( prev_items.begin(), prev_items.end() );
128 std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> all_items =
129 m_schematic->ConnectionGraph()->ExtractAffectedItems( { item } );
130 all_items.insert( {
path, item } );
131 BOOST_TEST_MESSAGE(
test.ToStdString() <<
": Item "
132 << item->GetFriendlyName().ToStdString()
133 <<
" in net " << netname.ToStdString()
134 <<
" has " << all_items.size() <<
" affected items" );
138 new_graph.
SetLastCodes( m_schematic->ConnectionGraph() );
140 for(
auto&[
path, item ] : all_items )
142 wxCHECK2( item,
continue );
143 item->SetConnectivityDirty();
147 m_schematic->ConnectionGraph()->Merge( new_graph );
150 std::sort( curr_items.begin(), curr_items.end() );
153 BOOST_CHECK_MESSAGE( prev_items == curr_items,
154 test.ToStdString() <<
": Item "
155 << item->GetFriendlyName().ToStdString()
156 <<
" in net " << netname.ToStdString()
157 <<
" changed from " << prev_items.size()
158 <<
" to " << curr_items.size() <<
" Location:" << item->GetPosition().x <<
"," << item->GetPosition().y );
Calculate the connectivity of a schematic and generates netlists.
void SetLastCodes(const CONNECTION_GRAPH *aOther)
void Recalculate(const SCH_SHEET_LIST &aSheetList, bool aUnconditional=false, std::function< void(SCH_ITEM *)> *aChangedItemHandler=nullptr)
Update the connection graph for the given list of sheets.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
wxString GetNetName() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_SCREEN * GetScreen() const
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
void remove_duplicates(_Container &__c)
Deletes all duplicate values from __c.
std::vector< SCH_ITEM * > SCH_ITEM_VEC
std::vector< FAB_LAYER_COLOR > dummy
SETTINGS_MANAGER m_settingsManager
CONNECTIVITY_TEST_FIXTURE()
std::unique_ptr< SCHEMATIC > m_schematic
BOOST_FIXTURE_TEST_CASE(RemoveAddItems, CONNECTIVITY_TEST_FIXTURE)