Don't re-add deleted netclass assignments in incremental connectivity
Ensures that if moving or deleting a netclass directive label, the
netclass on the previously-assigned net doesn't have the stale
netclass re-applied.
Cherry-picked from 0826c10a20
(Along with prior connectivity cherry-pick...)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18173
This commit is contained in:
parent
8dbdc3717c
commit
bdd5a752dc
|
@ -2334,6 +2334,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||||
|
|
||||||
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Prj().GetProjectFile().m_NetSettings;
|
std::shared_ptr<NET_SETTINGS>& netSettings = m_schematic->Prj().GetProjectFile().m_NetSettings;
|
||||||
std::map<wxString, wxString> oldAssignments = netSettings->m_NetClassLabelAssignments;
|
std::map<wxString, wxString> oldAssignments = netSettings->m_NetClassLabelAssignments;
|
||||||
|
std::set<wxString> affectedNetclassNetAssignments;
|
||||||
|
|
||||||
netSettings->m_NetClassLabelAssignments.clear();
|
netSettings->m_NetClassLabelAssignments.clear();
|
||||||
|
|
||||||
|
@ -2404,10 +2405,16 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||||
if( oldAssignments.count( netname ) )
|
if( oldAssignments.count( netname ) )
|
||||||
{
|
{
|
||||||
if( oldAssignments[netname] != netclass )
|
if( oldAssignments[netname] != netclass )
|
||||||
|
{
|
||||||
|
affectedNetclassNetAssignments.insert( netname );
|
||||||
dirtySubgraphs( subgraphs );
|
dirtySubgraphs( subgraphs );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if( !netclass.IsEmpty() )
|
else if( !netclass.IsEmpty() )
|
||||||
|
{
|
||||||
|
affectedNetclassNetAssignments.insert( netname );
|
||||||
dirtySubgraphs( subgraphs );
|
dirtySubgraphs( subgraphs );
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
for( const auto& [ netname, subgraphs ] : m_net_name_to_subgraphs_map )
|
for( const auto& [ netname, subgraphs ] : m_net_name_to_subgraphs_map )
|
||||||
|
@ -2417,8 +2424,11 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
|
||||||
{
|
{
|
||||||
for( auto& [ netname, netclass ] : oldAssignments )
|
for( auto& [ netname, netclass ] : oldAssignments )
|
||||||
{
|
{
|
||||||
if( netSettings->m_NetClassLabelAssignments.count( netname ) )
|
if( netSettings->m_NetClassLabelAssignments.count( netname )
|
||||||
|
|| affectedNetclassNetAssignments.count( netname ) )
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
netSettings->m_NetClassLabelAssignments[ netname ] = netclass;
|
netSettings->m_NetClassLabelAssignments[ netname ] = netclass;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue