Use more precise formatting in DRC messages when less precise values are identical.
Fixes https://gitlab.com/kicad/code/kicad/issues/12587
This commit is contained in:
parent
9119b5072a
commit
098e96f1c7
|
@ -360,3 +360,20 @@ bool DRC_TEST_PROVIDER::isInvisibleText( const BOARD_ITEM* aItem ) const
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
wxString DRC_TEST_PROVIDER::formatMsg( const wxString& aFormatString, const wxString& aSource,
|
||||
int aConstraint, int aActual )
|
||||
{
|
||||
wxString constraint_str = MessageTextFromValue( aConstraint );
|
||||
wxString actual_str = MessageTextFromValue( aActual );
|
||||
|
||||
if( constraint_str == actual_str )
|
||||
{
|
||||
// Use more precise formatting if the message-text strings were equal.
|
||||
constraint_str = StringFromValue( aConstraint );
|
||||
actual_str = StringFromValue( aActual );
|
||||
}
|
||||
|
||||
return wxString::Format( aFormatString, aSource, constraint_str, actual_str );
|
||||
}
|
|
@ -113,6 +113,9 @@ protected:
|
|||
|
||||
bool isInvisibleText( const BOARD_ITEM* aItem ) const;
|
||||
|
||||
wxString formatMsg( const wxString& aFormatString, const wxString& aSource, int aConstraint,
|
||||
int aActual );
|
||||
|
||||
// List of basic (ie: non-compound) geometry items
|
||||
static std::vector<KICAD_T> s_allBasicItems;
|
||||
static std::vector<KICAD_T> s_allBasicItemsButZones;
|
||||
|
|
|
@ -245,18 +245,18 @@ bool DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run()
|
|||
|
||||
if( fail_min )
|
||||
{
|
||||
msg.Printf( _( "(%s min annular width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( v_min ),
|
||||
MessageTextFromValue( annularWidth ) );
|
||||
msg = formatMsg( _( "(%s min annular width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
v_min,
|
||||
annularWidth );
|
||||
}
|
||||
|
||||
if( fail_max )
|
||||
{
|
||||
msg.Printf( _( "(%s max annular width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( v_max ),
|
||||
MessageTextFromValue( annularWidth ) );
|
||||
msg = formatMsg( _( "(%s max annular width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
v_max,
|
||||
annularWidth );
|
||||
}
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
|
|
@ -756,11 +756,14 @@ bool DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run()
|
|||
auto drce = DRC_ITEM::Create( DRCE_CONNECTION_WIDTH );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "Minimum connection width %s; actual %s" ),
|
||||
MessageTextFromValue( aMinWidth ),
|
||||
MessageTextFromValue( dist ) );
|
||||
msg = formatMsg( _( "(%s minimum connection width %s; actual %s)" ),
|
||||
c.GetName(),
|
||||
aMinWidth,
|
||||
dist );
|
||||
|
||||
drce->SetErrorMessage( msg + wxS( " " ) + layerDesc( aLayer ) );
|
||||
msg += wxS( " " ) + layerDesc( aLayer );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetViolatingRule( c.GetParentRule() );
|
||||
|
||||
for( BOARD_ITEM* item : contributingItems )
|
||||
|
|
|
@ -218,12 +218,10 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem( PCB_TRACK* track,
|
|||
else
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( track, other );
|
||||
|
@ -271,13 +269,13 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem( PCB_TRACK* track,
|
|||
if( constraint.GetSeverity() != RPT_SEVERITY_IGNORE && clearance > 0 )
|
||||
{
|
||||
if( a_shape[ii]->Collide( holeShape.get(), std::max( 0, clearance - m_drcEpsilon ),
|
||||
&actual, &pos ) )
|
||||
&actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ), constraint.GetName(),
|
||||
MessageTextFromValue( clearance ), MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( a[ii], b[ii] );
|
||||
|
@ -357,12 +355,10 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone( BOARD_ITEM* aItem,
|
|||
std::max( 0, clearance - m_drcEpsilon ), &actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, aZone );
|
||||
|
@ -397,13 +393,11 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone( BOARD_ITEM* aItem,
|
|||
std::max( 0, clearance - m_drcEpsilon ),
|
||||
&actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, aZone );
|
||||
|
@ -619,12 +613,10 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
|
|||
&actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( pad, other );
|
||||
|
@ -652,12 +644,10 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
|
|||
&actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( pad, other );
|
||||
|
@ -675,12 +665,10 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
|
|||
&actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( pad, other );
|
||||
|
@ -698,12 +686,10 @@ bool DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem( PAD* pad, SHAPE* pa
|
|||
&actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( pad, otherVia );
|
||||
|
@ -951,12 +937,10 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones()
|
|||
else if( testClearance )
|
||||
{
|
||||
drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( zone2zoneClearance ),
|
||||
MessageTextFromValue( std::max( actual, 0 ) ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
zone2zoneClearance,
|
||||
std::max( actual, 0 ) );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
}
|
||||
|
|
|
@ -229,11 +229,10 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances()
|
|||
|
||||
if( clearance > 0 )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetViolatingRule( constraint.GetParentRule() );
|
||||
|
@ -263,11 +262,10 @@ bool DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances()
|
|||
|
||||
if( clearance > 0 )
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetViolatingRule( constraint.GetParentRule() );
|
||||
|
|
|
@ -157,14 +157,16 @@ struct DIFF_PAIR_COUPLED_SEGMENTS
|
|||
PCB_TRACK* parentP;
|
||||
int computedGap;
|
||||
PCB_LAYER_ID layer;
|
||||
bool couplingOK;
|
||||
bool couplingFailMin;
|
||||
bool couplingFailMax;
|
||||
|
||||
DIFF_PAIR_COUPLED_SEGMENTS() :
|
||||
parentN( nullptr ),
|
||||
parentP( nullptr ),
|
||||
computedGap( 0 ),
|
||||
layer( UNDEFINED_LAYER ),
|
||||
couplingOK( false )
|
||||
couplingFailMin( false ),
|
||||
couplingFailMax( false )
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -398,22 +400,15 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
|
|||
if( gapConstraint )
|
||||
{
|
||||
const MINOPTMAX<int>& val = gapConstraint->GetValue();
|
||||
bool insideRange = true;
|
||||
|
||||
if( val.HasMin() && gap < val.Min() - epsilon )
|
||||
insideRange = false;
|
||||
dp.couplingFailMin = true;
|
||||
|
||||
if( val.HasMax() && gap > val.Max() + epsilon )
|
||||
insideRange = false;
|
||||
|
||||
dp.couplingOK = insideRange;
|
||||
}
|
||||
else
|
||||
{
|
||||
dp.couplingOK = true;
|
||||
dp.couplingFailMax = true;
|
||||
}
|
||||
|
||||
if( dp.couplingOK )
|
||||
if( !dp.couplingFailMin && !dp.couplingFailMax )
|
||||
itemSet.totalCoupled += length;
|
||||
}
|
||||
|
||||
|
@ -433,12 +428,10 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
|
|||
if ( val.HasMax() && totalUncoupled > val.Max() )
|
||||
{
|
||||
auto drce = DRC_ITEM::Create( DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG );
|
||||
wxString msg;
|
||||
|
||||
msg = wxString::Format( _( "(%s maximum uncoupled length: %s; actual: %s)" ),
|
||||
wxString msg = formatMsg( _( "(%s maximum uncoupled length %s; actual %s)" ),
|
||||
maxUncoupledConstraint->GetParentRule()->m_Name,
|
||||
MessageTextFromValue( val.Max() ),
|
||||
MessageTextFromValue( totalUncoupled ) );
|
||||
val.Max(),
|
||||
totalUncoupled );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
|
||||
|
@ -478,31 +471,28 @@ bool test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run()
|
|||
{
|
||||
for( DIFF_PAIR_COUPLED_SEGMENTS& dp : itemSet.coupled )
|
||||
{
|
||||
if( !dp.couplingOK && ( dp.parentP || dp.parentN ) )
|
||||
if( ( dp.couplingFailMin || dp.couplingFailMax ) && ( dp.parentP || dp.parentN ) )
|
||||
{
|
||||
MINOPTMAX<int> val = gapConstraint->GetValue();
|
||||
auto drcItem = DRC_ITEM::Create( DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE );
|
||||
wxString msg;
|
||||
|
||||
msg = drcItem->GetErrorText() + wxT( " (" ) +
|
||||
gapConstraint->GetParentRule()->m_Name + wxS( " " );
|
||||
|
||||
if( val.HasMin() )
|
||||
if( dp.couplingFailMin )
|
||||
{
|
||||
msg += wxString::Format( _( "minimum gap: %s; " ),
|
||||
MessageTextFromValue( val.Min() ) );
|
||||
msg = formatMsg( _( "(%s minimum gap %s; actual %s)" ),
|
||||
gapConstraint->GetParentRule()->m_Name,
|
||||
val.Min(),
|
||||
dp.computedGap );
|
||||
}
|
||||
else if( dp.couplingFailMax )
|
||||
{
|
||||
msg = formatMsg( _( "(%s maximum gap %s; actual %s)" ),
|
||||
gapConstraint->GetParentRule()->m_Name,
|
||||
val.Max(),
|
||||
dp.computedGap );
|
||||
}
|
||||
|
||||
if( val.HasMax() )
|
||||
{
|
||||
msg += wxString::Format( _( "maximum gap: %s; " ),
|
||||
MessageTextFromValue( val.Max() ) );
|
||||
}
|
||||
|
||||
msg += wxString::Format( _( "actual: %s)" ),
|
||||
MessageTextFromValue( dp.computedGap ) );
|
||||
|
||||
drcItem->SetErrorMessage( msg );
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
||||
BOARD_CONNECTED_ITEM* item = nullptr;
|
||||
|
||||
|
|
|
@ -117,12 +117,10 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge( BOARD_ITEM* item, SHAPE*
|
|||
// Only report clearance info if there is any; otherwise it's just a straight collision
|
||||
if( minClearance > 0 )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( minClearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
minClearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
}
|
||||
|
|
|
@ -155,17 +155,17 @@ void DRC_TEST_PROVIDER_HOLE_SIZE::checkPadHole( PAD* aPad )
|
|||
|
||||
if( fail_min )
|
||||
{
|
||||
msg.Printf( _( "(%s min width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintValue ),
|
||||
MessageTextFromValue( holeMinor ) );
|
||||
msg = formatMsg( _( "(%s min width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintValue,
|
||||
holeMinor );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _( "(%s max width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintValue ),
|
||||
MessageTextFromValue( holeMajor ) );
|
||||
msg = formatMsg( _( "(%s max width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintValue,
|
||||
holeMajor );
|
||||
}
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
@ -224,17 +224,17 @@ void DRC_TEST_PROVIDER_HOLE_SIZE::checkViaHole( PCB_VIA* via, bool aExceedMicro,
|
|||
|
||||
if( fail_min )
|
||||
{
|
||||
msg.Printf( _( "(%s min width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintValue ),
|
||||
MessageTextFromValue( via->GetDrillValue() ) );
|
||||
msg = formatMsg( _( "(%s min width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintValue,
|
||||
via->GetDrillValue() );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _( "(%s max width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintValue ),
|
||||
MessageTextFromValue( via->GetDrillValue() ) );
|
||||
msg = formatMsg( _( "(%s max width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintValue,
|
||||
via->GetDrillValue() );
|
||||
}
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
|
|
@ -301,12 +301,10 @@ bool DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole( BOARD_ITEM* aItem, SHA
|
|||
&& actual < minClearance )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_DRILLED_HOLES_TOO_CLOSE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s min %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( minClearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s min %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
minClearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, aOther );
|
||||
|
|
|
@ -113,17 +113,17 @@ void DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths( const DRC_CONSTRAINT& aCons
|
|||
|
||||
if( minViolation )
|
||||
{
|
||||
msg.Printf( _( "(%s min length: %s; actual: %s)" ),
|
||||
aConstraint.GetName(),
|
||||
MessageTextFromValue( minLen ),
|
||||
MessageTextFromValue( ent.total ) );
|
||||
msg = formatMsg( _( "(%s min length %s; actual %s)" ),
|
||||
aConstraint.GetName(),
|
||||
minLen,
|
||||
ent.total );
|
||||
}
|
||||
else if( maxViolation )
|
||||
{
|
||||
msg.Printf( _( "(%s max length: %s; actual: %s)" ),
|
||||
aConstraint.GetName(),
|
||||
MessageTextFromValue( maxLen ),
|
||||
MessageTextFromValue( ent.total ) );
|
||||
msg = formatMsg( _( "(%s max length %s; actual %s)" ),
|
||||
aConstraint.GetName(),
|
||||
maxLen,
|
||||
ent.total );
|
||||
}
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
@ -157,7 +157,7 @@ void DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews( const DRC_CONSTRAINT& aConstr
|
|||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_SKEW_OUT_OF_RANGE );
|
||||
wxString msg;
|
||||
|
||||
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(),
|
||||
MessageTextFromValue( aConstraint.GetValue().Max() ),
|
||||
MessageTextFromValue( skew ),
|
||||
|
@ -186,12 +186,10 @@ void DRC_TEST_PROVIDER_MATCHED_LENGTH::checkViaCounts( const DRC_CONSTRAINT& aCo
|
|||
if( aConstraint.GetValue().HasMax() && ent.viaCount > aConstraint.GetValue().Max() )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_TOO_MANY_VIAS );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s max count: %d; actual: %d)" ),
|
||||
aConstraint.GetName(),
|
||||
aConstraint.GetValue().Max(),
|
||||
ent.viaCount );
|
||||
wxString msg = wxString::Format( _( "(%s max count %d; actual %d)" ),
|
||||
aConstraint.GetName(),
|
||||
aConstraint.GetValue().Max(),
|
||||
ent.viaCount );
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
||||
|
|
|
@ -489,16 +489,15 @@ void DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain( const SHAPE_LINE_
|
|||
for( std::pair<VECTOR2I, int> collision : collisions )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
VECTOR2I pt = collision.first;
|
||||
|
||||
if( aParentItem->GetParentFootprint() )
|
||||
pt += aParentItem->GetParentFootprint()->GetPosition();
|
||||
|
||||
msg.Printf( _( "Internal clearance violation (%s clearance %s; actual %s)" ),
|
||||
aConstraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( collision.second ) );
|
||||
wxString msg = formatMsg( _( "Internal clearance violation (%s clearance %s; actual %s)" ),
|
||||
aConstraint.GetName(),
|
||||
clearance,
|
||||
collision.second );
|
||||
|
||||
drce->SetErrorMessage( msg );
|
||||
drce->SetItems( aParentItem );
|
||||
|
@ -544,12 +543,10 @@ void DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer( ZONE* aZone, PCB_LAYER
|
|||
if( firstOutline->Collide( secondSeg, clearance - epsilon, &actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
aConstraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
aConstraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aZone );
|
||||
|
@ -603,12 +600,10 @@ bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aIte
|
|||
if( aItemShape->Collide( otherShape.get(), clearance, &actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, other );
|
||||
|
@ -656,12 +651,10 @@ bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aIte
|
|||
if( itemHoleShape && itemHoleShape->Collide( otherShape.get(), clearance, &actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance ,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, other );
|
||||
|
@ -673,12 +666,10 @@ bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* aIte
|
|||
if( otherHoleShape && otherHoleShape->Collide( aItemShape, clearance, &actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, other );
|
||||
|
@ -762,12 +753,10 @@ void DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aIt
|
|||
if( colliding )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, zone );
|
||||
|
@ -803,12 +792,10 @@ void DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aIt
|
|||
&actual, &pos ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_HOLE_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aItem, zone );
|
||||
|
|
|
@ -237,12 +237,10 @@ bool DRC_TEST_PROVIDER_SILK_CLEARANCE::Run()
|
|||
|
||||
if( minClearance > 0 )
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetParentRule()->m_Name,
|
||||
MessageTextFromValue( minClearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetParentRule()->m_Name,
|
||||
minClearance,
|
||||
actual );
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
}
|
||||
|
|
|
@ -276,12 +276,10 @@ void DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance()
|
|||
clearance, &actual, &pos ) )
|
||||
{
|
||||
auto drce = DRC_ITEM::Create( DRCE_SILK_CLEARANCE );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( clearance ),
|
||||
MessageTextFromValue( actual ) );
|
||||
wxString msg = formatMsg( _( "(%s clearance %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
clearance,
|
||||
actual );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( item );
|
||||
|
|
|
@ -105,12 +105,10 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
|
|||
if( constraint.Value().HasMin() && actualHeight < constraint.Value().Min() )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_TEXT_HEIGHT );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s min height %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraint.Value().Min() ),
|
||||
MessageTextFromValue( actualHeight ) );
|
||||
wxString msg = formatMsg( _( "(%s min height %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraint.Value().Min(),
|
||||
actualHeight );
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
drcItem->SetItems( item );
|
||||
|
@ -122,12 +120,10 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
|
|||
if( constraint.Value().HasMax() && actualHeight > constraint.Value().Max() )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_TEXT_HEIGHT );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s max height %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraint.Value().Max() ),
|
||||
MessageTextFromValue( actualHeight ) );
|
||||
wxString msg = formatMsg( _( "(%s max height %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraint.Value().Max(),
|
||||
actualHeight );
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
drcItem->SetItems( item );
|
||||
|
@ -225,12 +221,10 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
|
|||
if( constraint.Value().HasMin() && actualThickness < constraint.Value().Min() )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_TEXT_THICKNESS );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s min thickness %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraint.Value().Min() ),
|
||||
MessageTextFromValue( actualThickness ) );
|
||||
wxString msg = formatMsg( _( "(%s min thickness %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraint.Value().Min(),
|
||||
actualThickness );
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
drcItem->SetItems( item );
|
||||
|
@ -242,12 +236,10 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
|
|||
if( constraint.Value().HasMax() && actualThickness > constraint.Value().Max() )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_TEXT_THICKNESS );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s max thickness %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraint.Value().Max() ),
|
||||
MessageTextFromValue( actualThickness ) );
|
||||
wxString msg = formatMsg( _( "(%s max thickness %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraint.Value().Max(),
|
||||
actualThickness );
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
drcItem->SetItems( item );
|
||||
|
|
|
@ -128,17 +128,17 @@ bool DRC_TEST_PROVIDER_TRACK_WIDTH::Run()
|
|||
|
||||
if( fail_min )
|
||||
{
|
||||
msg.Printf( _( "(%s min width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintWidth ),
|
||||
MessageTextFromValue( actual ) );
|
||||
msg = formatMsg( _( "(%s min width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintWidth,
|
||||
actual );
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.Printf( _( "(%s max width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintWidth ),
|
||||
MessageTextFromValue( actual ) );
|
||||
msg = formatMsg( _( "(%s max width %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintWidth,
|
||||
actual );
|
||||
}
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
|
|
@ -118,17 +118,17 @@ bool DRC_TEST_PROVIDER_VIA_DIAMETER::Run()
|
|||
|
||||
if( fail_min )
|
||||
{
|
||||
msg.Printf( _( "(%s min diameter %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintDiameter ),
|
||||
MessageTextFromValue( actual ) );
|
||||
msg = formatMsg( _( "(%s min diameter %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintDiameter,
|
||||
actual );
|
||||
}
|
||||
else if( fail_max )
|
||||
{
|
||||
msg.Printf( _( "(%s max diameter %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
MessageTextFromValue( constraintDiameter ),
|
||||
MessageTextFromValue( actual ) );
|
||||
msg = formatMsg( _( "(%s max diameter %s; actual %s)" ),
|
||||
constraint.GetName(),
|
||||
constraintDiameter,
|
||||
actual );
|
||||
}
|
||||
|
||||
drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS( " " ) + msg );
|
||||
|
|
|
@ -168,12 +168,10 @@ void DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer( ZONE* aZone, PCB_LAYER_I
|
|||
if( spokes < minCount )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drce = DRC_ITEM::Create( DRCE_STARVED_THERMAL );
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( _( "(%s min spoke count %d; actual %d)" ),
|
||||
constraint.GetName(),
|
||||
minCount,
|
||||
spokes );
|
||||
wxString msg = wxString::Format( _( "(%s min spoke count %d; actual %d)" ),
|
||||
constraint.GetName(),
|
||||
minCount,
|
||||
spokes );
|
||||
|
||||
drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
|
||||
drce->SetItems( aZone, pad );
|
||||
|
|
Loading…
Reference in New Issue