Add SHORT_NET_NAME processing to footprint variable resolution.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15095
(cherry picked from commit def1a9f39c
)
This commit is contained in:
parent
e53269c37f
commit
6316b78a5e
|
@ -485,6 +485,7 @@ void FOOTPRINT::GetContextualTextVars( wxArrayString* aVars ) const
|
||||||
aVars->push_back( wxT( "LAYER" ) );
|
aVars->push_back( wxT( "LAYER" ) );
|
||||||
aVars->push_back( wxT( "FOOTPRINT_LIBRARY" ) );
|
aVars->push_back( wxT( "FOOTPRINT_LIBRARY" ) );
|
||||||
aVars->push_back( wxT( "FOOTPRINT_NAME" ) );
|
aVars->push_back( wxT( "FOOTPRINT_NAME" ) );
|
||||||
|
aVars->push_back( wxT( "SHORT_NET_NAME(<pad_number>)" ) );
|
||||||
aVars->push_back( wxT( "NET_NAME(<pad_number>)" ) );
|
aVars->push_back( wxT( "NET_NAME(<pad_number>)" ) );
|
||||||
aVars->push_back( wxT( "NET_CLASS(<pad_number>)" ) );
|
aVars->push_back( wxT( "NET_CLASS(<pad_number>)" ) );
|
||||||
aVars->push_back( wxT( "PIN_NAME(<pad_number>)" ) );
|
aVars->push_back( wxT( "PIN_NAME(<pad_number>)" ) );
|
||||||
|
@ -521,8 +522,9 @@ bool FOOTPRINT::ResolveTextVar( wxString* token, int aDepth ) const
|
||||||
*token = m_fpid.GetLibItemName();
|
*token = m_fpid.GetLibItemName();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if( token->StartsWith( wxT( "NET_NAME(" ) )
|
else if( token->StartsWith( wxT( "SHORT_NET_NAME(" ) )
|
||||||
|| token->StartsWith( wxT( "NET_CLASS(" ) )
|
|| token->StartsWith( wxT( "NET_NAME(" ) )
|
||||||
|
|| token->StartsWith( wxT( "NET_CLASS(" ) )
|
||||||
|| token->StartsWith( wxT( "PIN_NAME(" ) ) )
|
|| token->StartsWith( wxT( "PIN_NAME(" ) ) )
|
||||||
{
|
{
|
||||||
wxString padNumber = token->AfterFirst( '(' );
|
wxString padNumber = token->AfterFirst( '(' );
|
||||||
|
@ -532,7 +534,9 @@ bool FOOTPRINT::ResolveTextVar( wxString* token, int aDepth ) const
|
||||||
{
|
{
|
||||||
if( pad->GetNumber() == padNumber )
|
if( pad->GetNumber() == padNumber )
|
||||||
{
|
{
|
||||||
if( token->StartsWith( wxT( "NET_NAME" ) ) )
|
if( token->StartsWith( wxT( "SHORT_NET_NAME" ) ) )
|
||||||
|
*token = pad->GetShortNetname();
|
||||||
|
else if( token->StartsWith( wxT( "NET_NAME" ) ) )
|
||||||
*token = pad->GetNetname();
|
*token = pad->GetNetname();
|
||||||
else if( token->StartsWith( wxT( "NET_CLASS" ) ) )
|
else if( token->StartsWith( wxT( "NET_CLASS" ) ) )
|
||||||
*token = pad->GetNetClassName();
|
*token = pad->GetNetClassName();
|
||||||
|
|
Loading…
Reference in New Issue