Rename mechanical_clearance -> physical_clearance.
Fixes https://gitlab.com/kicad/code/kicad/issues/11554
This commit is contained in:
parent
a19490b097
commit
30ecca464d
|
@ -34,6 +34,8 @@ opt
|
|||
outer
|
||||
pad
|
||||
pth
|
||||
physical_clearance
|
||||
physical_hole_clearance
|
||||
rule
|
||||
severity
|
||||
silk_clearance
|
||||
|
|
|
@ -240,7 +240,7 @@ set( PCBNEW_DRC_SRCS
|
|||
drc/drc_test_provider_disallow.cpp
|
||||
drc/drc_test_provider_connectivity.cpp
|
||||
drc/drc_test_provider_copper_clearance.cpp
|
||||
drc/drc_test_provider_mechanical_clearance.cpp
|
||||
drc/drc_test_provider_physical_clearance.cpp
|
||||
drc/drc_test_provider_courtyard_clearance.cpp
|
||||
drc/drc_test_provider_edge_clearance.cpp
|
||||
drc/drc_test_provider_footprint_checks.cpp
|
||||
|
|
|
@ -378,9 +378,9 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent )
|
|||
"hole_clearance|"
|
||||
"hole_size|"
|
||||
"hole_to_hole|"
|
||||
"mechanical_clearance|"
|
||||
"mechanical_hole_clearance|"
|
||||
"min_resolved_spokes|"
|
||||
"physical_clearance|"
|
||||
"physical_hole_clearance|"
|
||||
"silk_clearance|"
|
||||
"skew|"
|
||||
"text_height|"
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
* length
|
||||
* hole\_clearance
|
||||
* hole\_size
|
||||
* mechanical\_clearance
|
||||
* mechanical\_hole\_clearance
|
||||
* min\_resolved\_spokes
|
||||
* physical\_clearance
|
||||
* physical\_hole\_clearance
|
||||
* silk\_clearance
|
||||
* skew
|
||||
* text\_height
|
||||
|
@ -46,7 +46,7 @@
|
|||
* via\_diameter
|
||||
* zone\_connection
|
||||
|
||||
Note: `clearance` and `hole_clearance` rules are not run against items of the same net; `mechanical_clearance` and `mechanical_hole_clearance` rules are.
|
||||
Note: `clearance` and `hole_clearance` rules are not run against items of the same net; `physical_clearance` and `physical_hole_clearance` rules are.
|
||||
<br>
|
||||
|
||||
### Item Types
|
||||
|
@ -258,7 +258,7 @@ For the latter use a `(layer "layer_name")` clause in the rule.
|
|||
|
||||
# Prevent solder wicking from SMD pads
|
||||
(rule holes_in_pads
|
||||
(constraint mechanical_hole_clearance (min 0.2mm))
|
||||
(constraint physical_hole_clearance (min 0.2mm))
|
||||
(condition "B.Pad_Type == 'SMD'"))
|
||||
|
||||
# Disallow solder mask margin overrides
|
||||
|
|
|
@ -40,9 +40,6 @@
|
|||
#include <pad.h>
|
||||
#include <pcb_track.h>
|
||||
#include <zone.h>
|
||||
#include <geometry/shape.h>
|
||||
#include <geometry/shape_segment.h>
|
||||
#include <geometry/shape_null.h>
|
||||
|
||||
|
||||
// wxListBox's performance degrades horrifically with very large datasets. It's not clear
|
||||
|
@ -911,8 +908,8 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
|
|||
case SILK_CLEARANCE_CONSTRAINT:
|
||||
case HOLE_CLEARANCE_CONSTRAINT:
|
||||
case EDGE_CLEARANCE_CONSTRAINT:
|
||||
case MECHANICAL_CLEARANCE_CONSTRAINT:
|
||||
case MECHANICAL_HOLE_CLEARANCE_CONSTRAINT:
|
||||
case PHYSICAL_CLEARANCE_CONSTRAINT:
|
||||
case PHYSICAL_HOLE_CLEARANCE_CONSTRAINT:
|
||||
REPORT( wxString::Format( _( "Checking %s clearance: %s." ),
|
||||
EscapeHTML( c->constraint.GetName() ),
|
||||
REPORT_VALUE( c->constraint.m_Value.Min() ) ) )
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2020-2022 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -66,8 +66,8 @@ enum DRC_CONSTRAINT_T
|
|||
DIFF_PAIR_MAX_UNCOUPLED_CONSTRAINT,
|
||||
DIFF_PAIR_INTRA_SKEW_CONSTRAINT,
|
||||
VIA_COUNT_CONSTRAINT,
|
||||
MECHANICAL_CLEARANCE_CONSTRAINT,
|
||||
MECHANICAL_HOLE_CLEARANCE_CONSTRAINT,
|
||||
PHYSICAL_CLEARANCE_CONSTRAINT,
|
||||
PHYSICAL_HOLE_CLEARANCE_CONSTRAINT,
|
||||
ASSERTION_CONSTRAINT
|
||||
};
|
||||
|
||||
|
|
|
@ -72,6 +72,20 @@ void DRC_RULES_PARSER::reportError( const wxString& aMessage )
|
|||
}
|
||||
|
||||
|
||||
void DRC_RULES_PARSER::reportDeprecation( const wxString& oldToken, const wxString newToken )
|
||||
{
|
||||
if( m_reporter )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "The '%s' keyword has been deprecated. "
|
||||
"Please use '%s' instead." ),
|
||||
oldToken,
|
||||
newToken);
|
||||
|
||||
m_reporter->Report( msg, RPT_SEVERITY_WARNING );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DRC_RULES_PARSER::parseUnknown()
|
||||
{
|
||||
int depth = 1;
|
||||
|
@ -258,11 +272,26 @@ void DRC_RULES_PARSER::parseConstraint( DRC_RULE* aRule )
|
|||
|
||||
T token = NextTok();
|
||||
|
||||
if( (int) token == DSN_RIGHT || token == T_EOF )
|
||||
if( token == T_mechanical_clearance )
|
||||
{
|
||||
reportDeprecation( wxT( "mechanical_clearance" ), wxT( "physical_clearance" ) );
|
||||
token = T_physical_clearance;
|
||||
}
|
||||
else if( token == T_mechanical_hole_clearance )
|
||||
{
|
||||
reportDeprecation( wxT( "mechanical_hole_clearance" ), wxT( "physical_hole_clearance" ) );
|
||||
token = T_physical_hole_clearance;
|
||||
}
|
||||
else if( token == T_hole )
|
||||
{
|
||||
reportDeprecation( wxT( "hole" ), wxT( "hole_size" ) );
|
||||
token = T_hole_size;
|
||||
}
|
||||
else if( (int) token == DSN_RIGHT || token == T_EOF )
|
||||
{
|
||||
msg.Printf( _( "Missing constraint type.| Expected %s." ),
|
||||
wxT( "assertion, clearance, hole_clearance, edge_clearance, "
|
||||
"mechanical_clearance, mechanical_hole_clearance, courtyard_clearance, "
|
||||
"physical_clearance, physical_hole_clearance, courtyard_clearance, "
|
||||
"silk_clearance, hole_size, hole_to_hole, track_width, annular_width, "
|
||||
"via_diameter, disallow, zone_connection, thermal_relief_gap, "
|
||||
"thermal_spoke_width, min_resolved_spokes, length, skew, via_count, "
|
||||
|
@ -277,7 +306,6 @@ void DRC_RULES_PARSER::parseConstraint( DRC_RULE* aRule )
|
|||
case T_clearance: c.m_Type = CLEARANCE_CONSTRAINT; break;
|
||||
case T_hole_clearance: c.m_Type = HOLE_CLEARANCE_CONSTRAINT; break;
|
||||
case T_edge_clearance: c.m_Type = EDGE_CLEARANCE_CONSTRAINT; break;
|
||||
case T_hole: // legacy token
|
||||
case T_hole_size: c.m_Type = HOLE_SIZE_CONSTRAINT; break;
|
||||
case T_hole_to_hole: c.m_Type = HOLE_TO_HOLE_CONSTRAINT; break;
|
||||
case T_courtyard_clearance: c.m_Type = COURTYARD_CLEARANCE_CONSTRAINT; break;
|
||||
|
@ -297,12 +325,16 @@ void DRC_RULES_PARSER::parseConstraint( DRC_RULE* aRule )
|
|||
case T_via_count: c.m_Type = VIA_COUNT_CONSTRAINT; break;
|
||||
case T_diff_pair_gap: c.m_Type = DIFF_PAIR_GAP_CONSTRAINT; break;
|
||||
case T_diff_pair_uncoupled: c.m_Type = DIFF_PAIR_MAX_UNCOUPLED_CONSTRAINT; break;
|
||||
case T_mechanical_clearance: c.m_Type = MECHANICAL_CLEARANCE_CONSTRAINT; break;
|
||||
case T_mechanical_hole_clearance: c.m_Type = MECHANICAL_HOLE_CLEARANCE_CONSTRAINT; break;
|
||||
case T_physical_clearance: c.m_Type = PHYSICAL_CLEARANCE_CONSTRAINT; break;
|
||||
case T_physical_hole_clearance: c.m_Type = PHYSICAL_HOLE_CLEARANCE_CONSTRAINT; break;
|
||||
// legacy tokens:
|
||||
case T_hole: c.m_Type = HOLE_SIZE_CONSTRAINT; break;
|
||||
case T_mechanical_clearance: c.m_Type = PHYSICAL_CLEARANCE_CONSTRAINT; break;
|
||||
case T_mechanical_hole_clearance: c.m_Type = PHYSICAL_HOLE_CLEARANCE_CONSTRAINT; break;
|
||||
default:
|
||||
msg.Printf( _( "Unrecognized item '%s'.| Expected %s." ), FromUTF8(),
|
||||
wxT( "assertion, clearance, hole_clearance, edge_clearance, "
|
||||
"mechanical_clearance, mechanical_hole_clearance, courtyard_clearance, "
|
||||
"physical_clearance, physical_hole_clearance, courtyard_clearance, "
|
||||
"silk_clearance, hole_size, hole_to_hole, track_width, annular_width, "
|
||||
"disallow, zone_connection, thermal_relief_gap, thermal_spoke_width, "
|
||||
"min_resolved_spokes, length, skew, via_count, via_diameter, "
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2020-2022 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -55,6 +55,7 @@ private:
|
|||
void parseUnknown();
|
||||
|
||||
void reportError( const wxString& aMessage );
|
||||
void reportDeprecation( const wxString& oldToken, const wxString newToken );
|
||||
|
||||
private:
|
||||
int m_requiredVersion;
|
||||
|
|
|
@ -39,22 +39,22 @@
|
|||
#include <drc/drc_test_provider_clearance_base.h>
|
||||
|
||||
/*
|
||||
Mechanical clearance test.
|
||||
Physical clearance tests.
|
||||
|
||||
Errors generated:
|
||||
- DRCE_MECHANICAL_CLEARANCE
|
||||
- DRCE_MECHANICAL_HOLE_CLEARANCE
|
||||
- DRCE_PHYSICAL_CLEARANCE
|
||||
- DRCE_PHYSICAL_HOLE_CLEARANCE
|
||||
*/
|
||||
|
||||
class DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE : public DRC_TEST_PROVIDER_CLEARANCE_BASE
|
||||
class DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE : public DRC_TEST_PROVIDER_CLEARANCE_BASE
|
||||
{
|
||||
public:
|
||||
DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE () :
|
||||
DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE () :
|
||||
DRC_TEST_PROVIDER_CLEARANCE_BASE()
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE()
|
||||
virtual ~DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public:
|
|||
|
||||
virtual const wxString GetName() const override
|
||||
{
|
||||
return wxT( "mechanical_clearance" );
|
||||
return wxT( "physical_clearance" );
|
||||
};
|
||||
|
||||
virtual const wxString GetDescription() const override
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
};
|
||||
|
||||
|
||||
bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run()
|
||||
bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run()
|
||||
{
|
||||
m_board = m_drcEngine->GetBoard();
|
||||
m_itemTree.clear();
|
||||
|
@ -97,10 +97,10 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run()
|
|||
int errorMax = m_board->GetDesignSettings().m_MaxError;
|
||||
DRC_CONSTRAINT worstConstraint;
|
||||
|
||||
if( m_drcEngine->QueryWorstConstraint( MECHANICAL_CLEARANCE_CONSTRAINT, worstConstraint ) )
|
||||
if( m_drcEngine->QueryWorstConstraint( PHYSICAL_CLEARANCE_CONSTRAINT, worstConstraint ) )
|
||||
m_largestClearance = worstConstraint.GetValue().Min();
|
||||
|
||||
if( m_drcEngine->QueryWorstConstraint( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, worstConstraint ) )
|
||||
if( m_drcEngine->QueryWorstConstraint( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, worstConstraint ) )
|
||||
m_largestClearance = std::max( m_largestClearance, worstConstraint.GetValue().Min() );
|
||||
|
||||
if( m_largestClearance <= 0 )
|
||||
|
@ -282,7 +282,7 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run()
|
|||
if( !reportProgress( ii++, count, delta ) )
|
||||
return false;
|
||||
|
||||
DRC_CONSTRAINT c = m_drcEngine->EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT,
|
||||
DRC_CONSTRAINT c = m_drcEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT,
|
||||
item, nullptr, layer );
|
||||
|
||||
if( shape )
|
||||
|
@ -367,10 +367,10 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::Run()
|
|||
}
|
||||
|
||||
|
||||
void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testShapeLineChain( const SHAPE_LINE_CHAIN& aOutline,
|
||||
int aLineWidth, PCB_LAYER_ID aLayer,
|
||||
BOARD_ITEM* aParentItem,
|
||||
DRC_CONSTRAINT& aConstraint )
|
||||
void DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain( const SHAPE_LINE_CHAIN& aOutline,
|
||||
int aLineWidth, PCB_LAYER_ID aLayer,
|
||||
BOARD_ITEM* aParentItem,
|
||||
DRC_CONSTRAINT& aConstraint )
|
||||
{
|
||||
// We don't want to collide with neighboring segments forming a curve until the concavity
|
||||
// approaches 180 degrees.
|
||||
|
@ -510,8 +510,8 @@ void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testShapeLineChain( const SHAPE_LIN
|
|||
}
|
||||
|
||||
|
||||
void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testZoneLayer( ZONE* aZone, PCB_LAYER_ID aLayer,
|
||||
DRC_CONSTRAINT& aConstraint )
|
||||
void DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer( ZONE* aZone, PCB_LAYER_ID aLayer,
|
||||
DRC_CONSTRAINT& aConstraint )
|
||||
{
|
||||
int epsilon = m_board->GetDesignSettings().GetDRCEpsilon();
|
||||
int clearance = aConstraint.GetValue().Min();
|
||||
|
@ -573,10 +573,10 @@ void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testZoneLayer( ZONE* aZone, PCB_LAY
|
|||
}
|
||||
|
||||
|
||||
bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* item,
|
||||
SHAPE* itemShape,
|
||||
PCB_LAYER_ID layer,
|
||||
BOARD_ITEM* other )
|
||||
bool DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* item,
|
||||
SHAPE* itemShape,
|
||||
PCB_LAYER_ID layer,
|
||||
BOARD_ITEM* other )
|
||||
{
|
||||
bool testClearance = !m_drcEngine->IsErrorLimitExceeded( DRCE_CLEARANCE );
|
||||
bool testHoles = !m_drcEngine->IsErrorLimitExceeded( DRCE_HOLE_CLEARANCE );
|
||||
|
@ -589,7 +589,7 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* it
|
|||
|
||||
if( testClearance )
|
||||
{
|
||||
constraint = m_drcEngine->EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, item, other, layer );
|
||||
constraint = m_drcEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, item, other, layer );
|
||||
clearance = constraint.GetValue().Min();
|
||||
}
|
||||
|
||||
|
@ -652,7 +652,7 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* it
|
|||
|
||||
if( itemHoleShape || otherHoleShape )
|
||||
{
|
||||
constraint = m_drcEngine->EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, other, item,
|
||||
constraint = m_drcEngine->EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, other, item,
|
||||
layer );
|
||||
clearance = constraint.GetValue().Min();
|
||||
}
|
||||
|
@ -697,8 +697,8 @@ bool DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstItem( BOARD_ITEM* it
|
|||
}
|
||||
|
||||
|
||||
void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aItem,
|
||||
PCB_LAYER_ID aLayer )
|
||||
void DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aItem,
|
||||
PCB_LAYER_ID aLayer )
|
||||
{
|
||||
for( ZONE* zone : m_zones )
|
||||
{
|
||||
|
@ -723,7 +723,7 @@ void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstZones( BOARD_ITEM* a
|
|||
|
||||
if( testClearance )
|
||||
{
|
||||
constraint = m_drcEngine->EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, aItem, zone,
|
||||
constraint = m_drcEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, aItem, zone,
|
||||
aLayer );
|
||||
clearance = constraint.GetValue().Min();
|
||||
}
|
||||
|
@ -803,8 +803,8 @@ void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstZones( BOARD_ITEM* a
|
|||
|
||||
if( holeShape )
|
||||
{
|
||||
constraint = m_drcEngine->EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT,
|
||||
aItem, zone, aLayer );
|
||||
constraint = m_drcEngine->EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, aItem,
|
||||
zone, aLayer );
|
||||
clearance = constraint.GetValue().Min();
|
||||
|
||||
if( constraint.GetSeverity() != RPT_SEVERITY_IGNORE
|
||||
|
@ -837,5 +837,5 @@ void DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE::testItemAgainstZones( BOARD_ITEM* a
|
|||
|
||||
namespace detail
|
||||
{
|
||||
static DRC_REGISTER_TEST_PROVIDER<DRC_TEST_PROVIDER_MECHANICAL_CLEARANCE> dummy;
|
||||
static DRC_REGISTER_TEST_PROVIDER<DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE> dummy;
|
||||
}
|
|
@ -388,16 +388,16 @@ void BOARD_INSPECTION_TOOL::InspectDRCError( const std::shared_ptr<RC_ITEM>& aDR
|
|||
r->Report( "" );
|
||||
r->Report( "" );
|
||||
r->Report( "" );
|
||||
reportHeader( _( "Mechanical hole clearance resolution for:" ), a, b, layer, r );
|
||||
reportHeader( _( "Physical hole clearance resolution for:" ), a, b, layer, r );
|
||||
|
||||
constraint = drcEngine.EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
constraint = drcEngine.EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
clearance = constraint.m_Value.Min();
|
||||
clearanceStr = StringFromValue( r->GetUnits(), clearance, true );
|
||||
|
||||
if( !drcEngine.HasRulesForConstraintType( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT ) )
|
||||
if( !drcEngine.HasRulesForConstraintType( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT ) )
|
||||
{
|
||||
r->Report( "" );
|
||||
r->Report( _( "No 'mechanical_hole_clearance' constraints defined." ) );
|
||||
r->Report( _( "No 'physical_hole_clearance' constraints defined." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -474,16 +474,16 @@ void BOARD_INSPECTION_TOOL::InspectDRCError( const std::shared_ptr<RC_ITEM>& aDR
|
|||
r->Report( "" );
|
||||
r->Report( "" );
|
||||
r->Report( "" );
|
||||
reportHeader( _( "Mechanical clearance resolution for:" ), a, b, layer, r );
|
||||
reportHeader( _( "Physical clearance resolution for:" ), a, b, layer, r );
|
||||
|
||||
constraint = drcEngine.EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
constraint = drcEngine.EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
clearance = constraint.m_Value.Min();
|
||||
clearanceStr = StringFromValue( r->GetUnits(), clearance, true );
|
||||
|
||||
if( !drcEngine.HasRulesForConstraintType( MECHANICAL_CLEARANCE_CONSTRAINT ) )
|
||||
if( !drcEngine.HasRulesForConstraintType( PHYSICAL_CLEARANCE_CONSTRAINT ) )
|
||||
{
|
||||
r->Report( "" );
|
||||
r->Report( _( "No 'mechanical_clearance' constraints defined." ) );
|
||||
r->Report( _( "No 'physical_clearance' constraints defined." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -671,14 +671,14 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
|||
r->Report( wxString::Format( _( "Zone clearance: %s." ),
|
||||
StringFromValue( units, clearance, true ) ) );
|
||||
|
||||
constraint = drcEngine.EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, pad, zone, layer, r );
|
||||
constraint = drcEngine.EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, pad, zone, layer, r );
|
||||
|
||||
if( constraint.m_Value.Min() > clearance )
|
||||
{
|
||||
clearance = constraint.m_Value.Min();
|
||||
|
||||
r->Report( "" );
|
||||
r->Report( wxString::Format( _( "Overridden by larger mechanical clearance from %s;"
|
||||
r->Report( wxString::Format( _( "Overridden by larger physical clearance from %s;"
|
||||
"clearance: %s." ),
|
||||
EscapeHTML( constraint.GetName() ),
|
||||
StringFromValue( units, clearance, true ) ) );
|
||||
|
@ -686,7 +686,7 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
|||
|
||||
if( !pad->FlashLayer( layer ) )
|
||||
{
|
||||
constraint = drcEngine.EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, pad, zone,
|
||||
constraint = drcEngine.EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, pad, zone,
|
||||
layer, r );
|
||||
|
||||
if( constraint.m_Value.Min() > clearance )
|
||||
|
@ -694,7 +694,7 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
|||
clearance = constraint.m_Value.Min();
|
||||
|
||||
r->Report( "" );
|
||||
r->Report( wxString::Format( _( "Overridden by larger mechanical hole clearance from %s;"
|
||||
r->Report( wxString::Format( _( "Overridden by larger physical hole clearance from %s;"
|
||||
"clearance: %s." ),
|
||||
EscapeHTML( constraint.GetName() ),
|
||||
StringFromValue( units, clearance, true ) ) );
|
||||
|
@ -914,7 +914,7 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
}
|
||||
|
||||
r = m_inspectClearanceDialog->AddPage( _( "Mechanical" ) );
|
||||
r = m_inspectClearanceDialog->AddPage( _( "Physical Clearances" ) );
|
||||
|
||||
if( layerIntersection.any() )
|
||||
{
|
||||
|
@ -923,19 +923,19 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
|||
if( !layerIntersection.test( layer ) )
|
||||
layer = layerIntersection.Seq().front();
|
||||
|
||||
reportHeader( _( "Mechanical clearance resolution for:" ), a, b, layer, r );
|
||||
reportHeader( _( "Physical clearance resolution for:" ), a, b, layer, r );
|
||||
|
||||
constraint = drcEngine.EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
constraint = drcEngine.EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
clearance = constraint.m_Value.Min();
|
||||
|
||||
if( compileError )
|
||||
{
|
||||
reportCompileError( r );
|
||||
}
|
||||
else if( !drcEngine.HasRulesForConstraintType( MECHANICAL_CLEARANCE_CONSTRAINT ) )
|
||||
else if( !drcEngine.HasRulesForConstraintType( PHYSICAL_CLEARANCE_CONSTRAINT ) )
|
||||
{
|
||||
r->Report( "" );
|
||||
r->Report( _( "No 'mechanical_clearance' constraints defined." ) );
|
||||
r->Report( _( "No 'physical_clearance' constraints defined." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -962,19 +962,19 @@ int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent )
|
|||
else
|
||||
layer = a->GetLayer();
|
||||
|
||||
reportHeader( _( "Mechanical hole clearance resolution for:" ), a, b, layer, r );
|
||||
reportHeader( _( "Physical hole clearance resolution for:" ), a, b, layer, r );
|
||||
|
||||
constraint = drcEngine.EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
constraint = drcEngine.EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, a, b, layer, r );
|
||||
clearance = constraint.m_Value.Min();
|
||||
|
||||
if( compileError )
|
||||
{
|
||||
reportCompileError( r );
|
||||
}
|
||||
else if( !drcEngine.HasRulesForConstraintType( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT ) )
|
||||
else if( !drcEngine.HasRulesForConstraintType( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT ) )
|
||||
{
|
||||
r->Report( "" );
|
||||
r->Report( _( "No 'mechanical_hole_clearance' constraints defined." ) );
|
||||
r->Report( _( "No 'physical_hole_clearance' constraints defined." ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -605,7 +605,7 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer
|
|||
break;
|
||||
|
||||
case ZONE_CONNECTION::NONE:
|
||||
constraint = bds.m_DRCEngine->EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT, pad,
|
||||
constraint = bds.m_DRCEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT, pad,
|
||||
aZone, aLayer );
|
||||
|
||||
if( constraint.GetValue().Min() > aZone->GetLocalClearance() )
|
||||
|
@ -613,7 +613,7 @@ void ZONE_FILLER::knockoutThermalReliefs( const ZONE* aZone, PCB_LAYER_ID aLayer
|
|||
else
|
||||
padClearance = aZone->GetLocalClearance();
|
||||
|
||||
constraint = bds.m_DRCEngine->EvalRules( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT, pad,
|
||||
constraint = bds.m_DRCEngine->EvalRules( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, pad,
|
||||
aZone, aLayer );
|
||||
|
||||
if( constraint.GetValue().Min() > padClearance )
|
||||
|
@ -688,8 +688,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
|
|||
auto knockoutPadClearance =
|
||||
[&]( PAD* aPad )
|
||||
{
|
||||
int gap = evalRulesForItems( MECHANICAL_CLEARANCE_CONSTRAINT,
|
||||
aZone, aPad, aLayer );
|
||||
int gap = evalRulesForItems( PHYSICAL_CLEARANCE_CONSTRAINT, aZone, aPad, aLayer );
|
||||
bool hasHole = aPad->GetDrillSize().x > 0;
|
||||
bool flashLayer = aPad->FlashLayer( aLayer );
|
||||
bool platedHole = hasHole && aPad->GetAttribute() == PAD_ATTRIB::PTH;
|
||||
|
@ -705,7 +704,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
|
|||
|
||||
if( hasHole )
|
||||
{
|
||||
gap = std::max( gap, evalRulesForItems( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT,
|
||||
gap = std::max( gap, evalRulesForItems( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT,
|
||||
aZone, aPad, aLayer ) );
|
||||
|
||||
gap = std::max( gap, evalRulesForItems( HOLE_CLEARANCE_CONSTRAINT,
|
||||
|
@ -734,7 +733,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
|
|||
bool sameNet = aTrack->GetNetCode() == aZone->GetNetCode()
|
||||
&& aZone->GetNetCode() != 0;
|
||||
|
||||
int gap = evalRulesForItems( MECHANICAL_CLEARANCE_CONSTRAINT,
|
||||
int gap = evalRulesForItems( PHYSICAL_CLEARANCE_CONSTRAINT,
|
||||
aZone, aTrack, aLayer );
|
||||
|
||||
if( !sameNet )
|
||||
|
@ -754,7 +753,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
|
|||
m_maxError, ERROR_OUTSIDE );
|
||||
}
|
||||
|
||||
gap = std::max( gap, evalRulesForItems( MECHANICAL_HOLE_CLEARANCE_CONSTRAINT,
|
||||
gap = std::max( gap, evalRulesForItems( PHYSICAL_HOLE_CLEARANCE_CONSTRAINT,
|
||||
aZone, via, aLayer ) );
|
||||
|
||||
if( !sameNet )
|
||||
|
@ -810,7 +809,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
|
|||
if( aItem->GetBoundingBox().Intersects( zone_boundingbox ) )
|
||||
{
|
||||
bool ignoreLineWidths = false;
|
||||
int gap = evalRulesForItems( MECHANICAL_CLEARANCE_CONSTRAINT,
|
||||
int gap = evalRulesForItems( PHYSICAL_CLEARANCE_CONSTRAINT,
|
||||
aZone, aItem, aLayer );
|
||||
|
||||
if( aItem->IsOnLayer( aLayer ) )
|
||||
|
@ -894,7 +893,7 @@ void ZONE_FILLER::buildCopperItemClearances( const ZONE* aZone, PCB_LAYER_ID aLa
|
|||
}
|
||||
else
|
||||
{
|
||||
int gap = evalRulesForItems( MECHANICAL_CLEARANCE_CONSTRAINT, aZone,
|
||||
int gap = evalRulesForItems( PHYSICAL_CLEARANCE_CONSTRAINT, aZone,
|
||||
aKnockout, aLayer );
|
||||
|
||||
gap = std::max( gap, evalRulesForItems( CLEARANCE_CONSTRAINT, aZone,
|
||||
|
@ -1252,7 +1251,7 @@ bool ZONE_FILLER::fillNonCopperZone( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
|||
if( aItem->IsKnockout() && aItem->IsOnLayer( aLayer )
|
||||
&& aItem->GetBoundingBox().Intersects( zone_boundingbox ) )
|
||||
{
|
||||
DRC_CONSTRAINT cc = bds.m_DRCEngine->EvalRules( MECHANICAL_CLEARANCE_CONSTRAINT,
|
||||
DRC_CONSTRAINT cc = bds.m_DRCEngine->EvalRules( PHYSICAL_CLEARANCE_CONSTRAINT,
|
||||
aZone, aItem, aLayer );
|
||||
|
||||
addKnockout( aItem, aLayer, cc.GetValue().Min(), false, clearanceHoles );
|
||||
|
|
Loading…
Reference in New Issue