Global Label Dialog: add power nets to dropdrown

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9118
This commit is contained in:
Mike Williams 2023-01-19 12:47:32 -05:00
parent 7ab651f078
commit 5a2f4c445b
1 changed files with 10 additions and 0 deletions

View File

@ -275,6 +275,16 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataToWindow()
existingLabels.insert( UnescapeString( label->GetText() ) );
}
// Add global power labels from power symbols
if( m_currentLabel->Type() == SCH_GLOBAL_LABEL_T )
{
for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_LOCATE_POWER_T ) )
{
const SCH_SYMBOL* power = static_cast<const SCH_SYMBOL*>( item );
existingLabels.insert( UnescapeString( power->GetValueFieldText( false ) ) );
}
}
std::set<std::shared_ptr<BUS_ALIAS>> sheetAliases = screen->GetBusAliases();
busAliases.insert( busAliases.end(), sheetAliases.begin(), sheetAliases.end() );
}