mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Check parent footprint as well for component class.
Also output more descriptive text when checking inherited rules on parent footprint. Fixes https://gitlab.com/kicad/code/kicad/-/issues/20281
This commit is contained in:
parent
a4893523e4
commit
d92f42cdcb
@ -1349,8 +1349,8 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||
{
|
||||
std::vector<DRC_ENGINE_CONSTRAINT*>* ruleset = m_constraintMap[ aConstraintType ];
|
||||
|
||||
for( int ii = 0; ii < (int) ruleset->size(); ++ii )
|
||||
processConstraint( ruleset->at( ii ) );
|
||||
for( DRC_ENGINE_CONSTRAINT* rule : *ruleset )
|
||||
processConstraint( rule );
|
||||
}
|
||||
|
||||
if( constraint.GetParentRule() && !constraint.GetParentRule()->m_Implicit )
|
||||
@ -1364,6 +1364,10 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||
|| aConstraintType == THERMAL_RELIEF_GAP_CONSTRAINT
|
||||
|| aConstraintType == THERMAL_SPOKE_WIDTH_CONSTRAINT ) )
|
||||
{
|
||||
REPORT( "" )
|
||||
REPORT( wxString::Format( _( "Inheriting from parent: %s." ),
|
||||
EscapeHTML( parentFootprint->GetItemDescription( this, true ) ) ) )
|
||||
|
||||
if( a == pad )
|
||||
a = parentFootprint;
|
||||
else
|
||||
@ -1373,8 +1377,8 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
||||
{
|
||||
std::vector<DRC_ENGINE_CONSTRAINT*>* ruleset = m_constraintMap[ aConstraintType ];
|
||||
|
||||
for( int ii = 0; ii < (int) ruleset->size(); ++ii )
|
||||
processConstraint( ruleset->at( ii ) );
|
||||
for( DRC_ENGINE_CONSTRAINT* rule : *ruleset )
|
||||
processConstraint( rule );
|
||||
|
||||
if( constraint.GetParentRule() && !constraint.GetParentRule()->m_Implicit )
|
||||
return constraint;
|
||||
|
@ -1263,7 +1263,12 @@ static void hasComponentClassFunc( LIBEVAL::CONTEXT* aCtx, void* self )
|
||||
result->SetDeferredEval(
|
||||
[item, arg]() -> double
|
||||
{
|
||||
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( item );
|
||||
FOOTPRINT* footprint = nullptr;
|
||||
|
||||
if( item->Type() == PCB_FOOTPRINT_T )
|
||||
footprint = static_cast<FOOTPRINT*>( item );
|
||||
else
|
||||
footprint = item->GetParentFootprint();
|
||||
|
||||
if( !footprint )
|
||||
return 0.0;
|
||||
|
@ -302,7 +302,8 @@ wxString BOARD_INSPECTION_TOOL::InspectDRCErrorMenuText( const std::shared_ptr<R
|
||||
if( aDRCItem->GetErrorCode() == DRCE_CLEARANCE
|
||||
|| aDRCItem->GetErrorCode() == DRCE_EDGE_CLEARANCE
|
||||
|| aDRCItem->GetErrorCode() == DRCE_HOLE_CLEARANCE
|
||||
|| aDRCItem->GetErrorCode() == DRCE_DRILLED_HOLES_TOO_CLOSE )
|
||||
|| aDRCItem->GetErrorCode() == DRCE_DRILLED_HOLES_TOO_CLOSE
|
||||
|| aDRCItem->GetErrorCode() == DRCE_STARVED_THERMAL )
|
||||
{
|
||||
return menuDescription( PCB_ACTIONS::inspectClearance );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user