Implement min skew checking.
This commit is contained in:
parent
782af3a918
commit
c3496e4af6
|
@ -150,17 +150,37 @@ void DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews( const DRC_CONSTRAINT& aConstr
|
||||||
for( const auto& ent : aMatchedConnections )
|
for( const auto& ent : aMatchedConnections )
|
||||||
{
|
{
|
||||||
int skew = KiROUND( ent.total - avgLength );
|
int skew = KiROUND( ent.total - avgLength );
|
||||||
|
bool fail_min = false;
|
||||||
|
bool fail_max = false;
|
||||||
|
|
||||||
if( aConstraint.GetValue().HasMax() && abs( skew ) > aConstraint.GetValue().Max() )
|
if( aConstraint.GetValue().HasMax() && abs( skew ) > aConstraint.GetValue().Max() )
|
||||||
|
fail_max = true;
|
||||||
|
else if( aConstraint.GetValue().HasMin() && abs( skew ) < aConstraint.GetValue().Min() )
|
||||||
|
fail_min = true;
|
||||||
|
|
||||||
|
if( fail_min || fail_max )
|
||||||
{
|
{
|
||||||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_SKEW_OUT_OF_RANGE );
|
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_SKEW_OUT_OF_RANGE );
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
|
if( fail_min )
|
||||||
|
{
|
||||||
|
msg.Printf( _( "(%s min skew %s; actual %s; average net length %s; actual %s)" ),
|
||||||
|
aConstraint.GetName(),
|
||||||
|
MessageTextFromValue( aConstraint.GetValue().Min() ),
|
||||||
|
MessageTextFromValue( skew ),
|
||||||
|
MessageTextFromValue( avgLength ),
|
||||||
|
MessageTextFromValue( ent.total ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
msg.Printf( _( "(%s max skew %s; actual %s; average net length %s; actual %s)" ),
|
msg.Printf( _( "(%s max skew %s; actual %s; average net length %s; actual %s)" ),
|
||||||
aConstraint.GetName(),
|
aConstraint.GetName(),
|
||||||
MessageTextFromValue( aConstraint.GetValue().Max() ),
|
MessageTextFromValue( aConstraint.GetValue().Max() ),
|
||||||
MessageTextFromValue( skew ),
|
MessageTextFromValue( skew ),
|
||||||
MessageTextFromValue( avgLength ),
|
MessageTextFromValue( avgLength ),
|
||||||
MessageTextFromValue( ent.total ) );
|
MessageTextFromValue( ent.total ) );
|
||||||
|
}
|
||||||
|
|
||||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + " " + msg );
|
drcItem->SetErrorMessage( drcItem->GetErrorText() + " " + msg );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue