46 virtual bool Run()
override;
48 virtual const wxString
GetName()
const override
50 return wxT(
"diameter" );
55 return wxT(
"Tests via diameters" );
64 reportAux( wxT(
"Via diameter violations ignored. Tests not run." ) );
70 reportAux( wxT(
"No via diameter constraints found. Tests not run." ) );
77 auto checkViaDiameter =
91 bool fail_min =
false;
92 bool fail_max =
false;
93 int constraintDiameter = 0;
99 if( constraint.Value().HasMin() && actual < constraint.Value().Min() )
102 constraintDiameter = constraint.Value().Min();
105 if( constraint.Value().HasMax() && actual > constraint.Value().Max() )
108 constraintDiameter = constraint.Value().Max();
112 if( fail_min || fail_max )
115 wxString constraintName = constraint.GetName();
120 if( constraint.m_ImplicitMin )
121 constraintName =
_(
"board setup constraints" );
123 msg =
formatMsg(
_(
"(%s min diameter %s; actual %s)" ),
130 msg =
formatMsg(
_(
"(%s max diameter %s; actual %s)" ),
136 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) + msg );
137 drcItem->SetItems( item );
138 drcItem->SetViolatingRule( constraint.GetParentRule() );
146 const int progressDelta = 500;
154 if( !checkViaDiameter( item ) )
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
const TRACKS & Tracks() const
bool HasRulesForConstraintType(DRC_CONSTRAINT_T constraintID)
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.
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
virtual const wxString GetName() const override
virtual const wxString GetDescription() const override
DRC_TEST_PROVIDER_VIA_DIAMETER()
virtual ~DRC_TEST_PROVIDER_VIA_DIAMETER()
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)
void reportAux(const wxString &aMsg)
virtual void reportRuleStatistics()
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
@ VIA_DIAMETER_CONSTRAINT
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)