Fix diff pair coupling test when gap constraint is in a different rule
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8519
This commit is contained in:
parent
c4cabb38d5
commit
6381ffd10a
|
@ -410,8 +410,10 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
|
||||||
{
|
{
|
||||||
auto val = gapConstraint->GetValue();
|
auto val = gapConstraint->GetValue();
|
||||||
bool insideRange = true;
|
bool insideRange = true;
|
||||||
|
|
||||||
if( val.HasMin() && gap < val.Min() )
|
if( val.HasMin() && gap < val.Min() )
|
||||||
insideRange = false;
|
insideRange = false;
|
||||||
|
|
||||||
if( val.HasMax() && gap > val.Max() )
|
if( val.HasMax() && gap > val.Max() )
|
||||||
insideRange = false;
|
insideRange = false;
|
||||||
|
|
||||||
|
@ -419,10 +421,14 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
|
||||||
// drc_dbg(10, "Vmin %d vmax %d\n", val.Min(), val.Max() );
|
// drc_dbg(10, "Vmin %d vmax %d\n", val.Min(), val.Max() );
|
||||||
|
|
||||||
cpair.couplingOK = insideRange;
|
cpair.couplingOK = insideRange;
|
||||||
|
|
||||||
if( insideRange )
|
|
||||||
it.second.totalCoupled += length;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cpair.couplingOK = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( cpair.couplingOK )
|
||||||
|
it.second.totalCoupled += length;
|
||||||
}
|
}
|
||||||
|
|
||||||
int totalLen = std::max( it.second.totalLengthN, it.second.totalLengthP );
|
int totalLen = std::max( it.second.totalLengthN, it.second.totalLengthP );
|
||||||
|
|
Loading…
Reference in New Issue