41 virtual bool Run()
override;
43 virtual const wxString
GetName()
const override {
return wxT(
"diameter" ); };
51 REPORT_AUX( wxT(
"Via diameter violations ignored. Tests not run." ) );
57 REPORT_AUX( wxT(
"No via diameter constraints found. Tests not run." ) );
64 auto checkViaDiameter =
75 via->Padstack().ForEachUniqueLayer(
78 if(
via->IsGhostLayer( aLayer ) )
83 bool fail_min =
false;
84 bool fail_max =
false;
85 int constraintDiameter = 0;
93 else if( aLayer ==
B_Cu )
96 return _(
"Inner Layers" );
98 return m_drcEngine->GetBoard()->GetLayerName( aLayer );
106 constraintDiameter = constraint.
Value().
Min();
112 constraintDiameter = constraint.
Value().
Max();
116 if( fail_min || fail_max )
119 wxString constraintName = constraint.
GetName();
125 constraintName =
_(
"board setup constraints" );
129 msg =
formatMsg(
_(
"(%s min diameter %s; actual %s)" ),
136 msg =
formatMsg(
_(
"(%s min diameter %s; actual %s on %s)" ),
147 msg =
formatMsg(
_(
"(%s max diameter %s; actual %s)" ),
154 msg =
formatMsg(
_(
"(%s max diameter %s; actual %s on %s)" ),
162 drcItem->SetErrorDetail( msg );
163 drcItem->SetItems( item );
173 const int progressDelta = 500;
181 if( !checkViaDiameter( item ) )
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
SEVERITY GetSeverity() const
MINOPTMAX< int > & Value()
DRC_RULE * GetParentRule() const
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
virtual ~DRC_TEST_PROVIDER_VIA_DIAMETER()=default
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
virtual const wxString GetName() const override
DRC_TEST_PROVIDER_VIA_DIAMETER()
virtual bool reportPhase(const wxString &aStageName)
void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, const std::function< void(PCB_MARKER *)> &aPathGenerator=[](PCB_MARKER *){})
wxString formatMsg(const wxString &aFormatString, const wxString &aSource, double aConstraint, double aActual, EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
virtual bool reportProgress(size_t aCount, size_t aSize, size_t aDelta=1)
@ NORMAL
Shape is the same on all layers.
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
@ VIA_DIAMETER_CONSTRAINT
PCB_LAYER_ID
A quick note on layer IDs:
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)