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
This commit is contained in:
parent
e8e7282fe1
commit
7176dbe6dc
@ -285,6 +285,8 @@ public:
|
||||
|
||||
EDA_UNITS GetUnits() const { return m_units; }
|
||||
|
||||
bool StringIsWildcard() const { return m_stringIsWildcard; }
|
||||
|
||||
private:
|
||||
VAR_TYPE_T m_type;
|
||||
mutable double m_valueDbl; // mutable to support deferred evaluation
|
||||
|
@ -170,8 +170,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();
|
||||
}
|
||||
@ -189,8 +202,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