mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Re-implement wildcard matches for netclass constituents in DRC evaluation
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20955 (cherry picked from commit 7176dbe6dcb4aad5a8fc559962781509c2836924)
This commit is contained in:
parent
44543cf30c
commit
d928a2a0e3
@ -286,6 +286,8 @@ public:
|
||||
m_valueStr = val.m_valueStr;
|
||||
}
|
||||
|
||||
bool StringIsWildcard() const { return m_stringIsWildcard; }
|
||||
|
||||
private:
|
||||
VAR_TYPE_T m_type;
|
||||
mutable double m_valueDbl; // mutable to support deferred evaluation
|
||||
|
@ -169,8 +169,21 @@ public:
|
||||
|
||||
if( b->GetType() == LIBEVAL::VT_STRING )
|
||||
{
|
||||
if( m_item->GetEffectiveNetClass()->ContainsNetclassWithName( b->AsString() ) )
|
||||
return true;
|
||||
for( const auto nc : m_item->GetEffectiveNetClass()->GetConstituentNetclasses() )
|
||||
{
|
||||
const wxString& ncName = nc->GetName();
|
||||
|
||||
if( b->StringIsWildcard() )
|
||||
{
|
||||
if( WildCompareString( b->AsString(), ncName, false ) )
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ncName.IsSameAs( b->AsString(), false ) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return m_item->GetEffectiveNetClass()->GetName() == b->AsString();
|
||||
}
|
||||
@ -188,8 +201,30 @@ public:
|
||||
|
||||
if( b->GetType() == LIBEVAL::VT_STRING )
|
||||
{
|
||||
const bool isInConstituents =
|
||||
m_item->GetEffectiveNetClass()->ContainsNetclassWithName( b->AsString() );
|
||||
bool isInConstituents = false;
|
||||
|
||||
for( const auto nc : m_item->GetEffectiveNetClass()->GetConstituentNetclasses() )
|
||||
{
|
||||
const wxString& ncName = nc->GetName();
|
||||
|
||||
if( b->StringIsWildcard() )
|
||||
{
|
||||
if( WildCompareString( b->AsString(), ncName, false ) )
|
||||
{
|
||||
isInConstituents = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ncName.IsSameAs( b->AsString(), false ) )
|
||||
{
|
||||
isInConstituents = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const bool isFullName = m_item->GetEffectiveNetClass()->GetName() == b->AsString();
|
||||
|
||||
return !isInConstituents && !isFullName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user