Resolve text variables when resolving netclasses.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22413
(cherry picked from commit 36c603b6f0)
This commit is contained in:
@@ -441,13 +441,13 @@ CONNECTION_SUBGRAPH::GetNetclassesForDriver( SCH_ITEM* aItem ) const
|
||||
// Get netclasses on attached rule areas
|
||||
for( SCH_RULE_AREA* ruleArea : ruleAreaCache )
|
||||
{
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>> ruleNetclasses =
|
||||
ruleArea->GetResolvedNetclasses();
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>> ruleAreaNetclasses =
|
||||
ruleArea->GetResolvedNetclasses( &m_sheet );
|
||||
|
||||
if( ruleNetclasses.size() > 0 )
|
||||
if( ruleAreaNetclasses.size() > 0 )
|
||||
{
|
||||
foundNetclasses.insert( foundNetclasses.end(), ruleNetclasses.begin(),
|
||||
ruleNetclasses.end() );
|
||||
foundNetclasses.insert( foundNetclasses.end(), ruleAreaNetclasses.begin(),
|
||||
ruleAreaNetclasses.end() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -342,7 +342,8 @@ const std::unordered_set<SCH_DIRECTIVE_LABEL*>& SCH_RULE_AREA::GetDirectives() c
|
||||
}
|
||||
|
||||
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>> SCH_RULE_AREA::GetResolvedNetclasses() const
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>>
|
||||
SCH_RULE_AREA::GetResolvedNetclasses( const SCH_SHEET_PATH* aSheetPath ) const
|
||||
{
|
||||
std::vector<std::pair<wxString, SCH_ITEM*>> resolvedNetclasses;
|
||||
|
||||
@@ -357,7 +358,7 @@ const std::vector<std::pair<wxString, SCH_ITEM*>> SCH_RULE_AREA::GetResolvedNetc
|
||||
|
||||
if( field->GetCanonicalName() == wxT( "Netclass" ) )
|
||||
{
|
||||
wxString netclass = field->GetText();
|
||||
wxString netclass = field->GetShownText( aSheetPath, false );
|
||||
|
||||
if( netclass != wxEmptyString )
|
||||
resolvedNetclasses.push_back( { netclass, directive } );
|
||||
@@ -395,8 +396,7 @@ void SCH_RULE_AREA::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PAN
|
||||
|
||||
m_stroke.GetMsgPanelInfo( aFrame, aList );
|
||||
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>> netclasses =
|
||||
SCH_RULE_AREA::GetResolvedNetclasses();
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>> netclasses = SCH_RULE_AREA::GetResolvedNetclasses( nullptr );
|
||||
wxString resolvedNetclass = _( "<None>" );
|
||||
|
||||
if( netclasses.size() > 0 )
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
/// Resolve the netclass of this rule area from connected directive labels.
|
||||
///
|
||||
/// @return The resolved netclass (if any), and the SCH_ITEM providing the declaration.
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>> GetResolvedNetclasses() const;
|
||||
const std::vector<std::pair<wxString, SCH_ITEM*>> GetResolvedNetclasses( const SCH_SHEET_PATH* aSheetPath ) const;
|
||||
|
||||
/// Clear and resets items and directives attached to this rule area.
|
||||
void ResetDirectivesAndItems( KIGFX::SCH_VIEW* view );
|
||||
|
||||
Reference in New Issue
Block a user