53 virtual bool Run()
override;
55 virtual const wxString
GetName()
const override
57 return wxT(
"hole_size" );
62 return wxT(
"Tests sizes of drilled holes (via/pad drills)" );
80 for(
PAD*
pad : footprint->Pads() )
109 if( exceedMicro && exceedStd )
132 bool fail_min =
false;
133 bool fail_max =
false;
134 int constraintValue = 0;
139 if( constraint.Value().HasMin() && holeMinor < constraint.Value().Min() )
142 constraintValue = constraint.
Value().
Min();
145 if( constraint.Value().HasMax() && holeMajor > constraint.Value().Max() )
148 constraintValue = constraint.Value().Max();
151 if( fail_min || fail_max )
154 wxString constraintName = constraint.GetName();
159 if( constraint.GetParentRule() && constraint.GetParentRule()->m_Implicit )
160 constraintName =
_(
"board setup constraints" );
162 msg =
formatMsg(
_(
"(%s min hole %s; actual %s)" ),
169 msg =
formatMsg(
_(
"(%s max hole %s; actual %s)" ),
175 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) + msg );
176 drcItem->SetItems( aPad );
177 drcItem->SetViolatingRule( constraint.GetParentRule() );
188 if(
via->GetViaType() == VIATYPE::MICROVIA )
205 bool fail_min =
false;
206 bool fail_max =
false;
207 int constraintValue = 0;
212 if( constraint.Value().HasMin() &&
via->GetDrillValue() < constraint.Value().Min() )
215 constraintValue = constraint.
Value().
Min();
218 if( constraint.Value().HasMax() &&
via->GetDrillValue() > constraint.Value().Max() )
221 constraintValue = constraint.Value().Max();
224 if( fail_min || fail_max )
227 wxString constraintName = constraint.GetName();
232 if( constraint.m_ImplicitMin )
233 constraintName =
_(
"board setup constraints" );
235 msg =
formatMsg(
_(
"(%s min hole %s; actual %s)" ),
238 via->GetDrillValue() );
242 msg =
formatMsg(
_(
"(%s max hole %s; actual %s)" ),
245 via->GetDrillValue() );
248 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) + msg );
249 drcItem->SetItems(
via );
250 drcItem->SetViolatingRule( constraint.GetParentRule() );
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
MINOPTMAX< int > & Value()
bool IsErrorLimitExceeded(int error_code)
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
void checkPadHole(PAD *aPad)
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
DRC_TEST_PROVIDER_HOLE_SIZE()
void checkViaHole(PCB_VIA *via, bool aExceedMicro, bool aExceedStd)
virtual const wxString GetName() const override
virtual const wxString GetDescription() const override
virtual ~DRC_TEST_PROVIDER_HOLE_SIZE()
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out DRC_ITEM and posi...
wxString formatMsg(const wxString &aFormatString, const wxString &aSource, double aConstraint, double aActual)
virtual bool reportPhase(const wxString &aStageName)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer)
virtual void reportRuleStatistics()
const VECTOR2I & GetDrillSize() const
VECTOR2I GetPosition() const override
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_MICROVIA_DRILL_OUT_OF_RANGE
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)