49 std::vector<wxString> tests = {
65 for(
const wxString&
test : tests )
69 SCH_SHEET_LIST sheets = m_schematic->BuildSheetListSortedByPageNumbers();
73 for(
size_t ii = 0; ii <
path.size(); ++ii )
77 std::vector<SCH_ITEM*> items;
81 if( !item->IsConnectable() )
90 items.push_back(
pin );
95 items.push_back( item );
103 auto& conn_items = check_item->ConnectedItems(
path );
104 auto conn = check_item->Connection();
105 std::string netname = conn ? conn->GetNetName().ToStdString() :
"NoNet";
106 int subgraph = conn ? conn->SubgraphCode() : -1;
108 << check_item->GetFriendlyName().ToStdString()
109 <<
" in net " << netname <<
" subgraph " << subgraph
110 <<
" has " << conn_items.size() <<
" connections" );
119 if( !item->IsConnectable() )
123 std::sort( prev_items.begin(), prev_items.end() );
127 std::set<std::pair<SCH_SHEET_PATH, SCH_ITEM*>> all_items =
128 m_schematic->ConnectionGraph()->ExtractAffectedItems( { item } );
129 all_items.insert( {
path, item } );
131 << item->GetFriendlyName().ToStdString()
132 <<
" in net " << netname.ToStdString()
133 <<
" has " << all_items.size() <<
" affected items" );
137 new_graph.
SetLastCodes( m_schematic->ConnectionGraph() );
139 for(
auto&[
path, item ] : all_items )
141 wxCHECK2( item,
continue );
142 item->SetConnectivityDirty();
146 m_schematic->ConnectionGraph()->Merge( new_graph );
149 std::sort( curr_items.begin(), curr_items.end() );
152 BOOST_CHECK_MESSAGE( prev_items == curr_items,
153 test.ToStdString() <<
": Item "
154 << item->GetFriendlyName().ToStdString()
155 <<
" in net " << netname.ToStdString()
156 <<
" changed from " << prev_items.size()
157 <<
" to " << curr_items.size() <<
" Location:" << item->GetPosition().x <<
"," << item->GetPosition().y );
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.