53 virtual bool Run()
override;
55 virtual const wxString
GetName()
const override 57 return wxT(
"annular_width" );
62 return wxT(
"Tests pad/via annular rings" );
75 reportAux( wxT(
"Annular width violations ignored. Skipping check." ) );
79 const int delta = 250;
83 reportAux( wxT(
"No annular width constraints found. Tests not run." ) );
87 if( !
reportPhase(
_(
"Checking via annular rings..." ) ) )
90 auto checkAnnularWidth =
107 int annularWidth = (
via->GetWidth() -
via->GetDrillValue() ) / 2;
108 bool fail_min =
false;
109 bool fail_max =
false;
111 if( constraint.Value().HasMin() )
114 fail_min = annularWidth < v_min;
117 if( constraint.Value().HasMax() )
119 v_max = constraint.Value().Max();
120 fail_max = annularWidth > v_max;
123 if( fail_min || fail_max )
128 m_msg.Printf(
_(
"(%s min annular width %s; actual %s)" ),
129 constraint.GetName(),
134 m_msg.Printf(
_(
"(%s max annular width %s; actual %s)" ),
135 constraint.GetName(),
139 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) +
m_msg );
140 drcItem->SetItems( item );
141 drcItem->SetViolatingRule( constraint.GetParentRule() );
157 if( !checkAnnularWidth( item ) )
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
MINOPTMAX< int > & Value()
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const wxPoint &aMarkerPos)
DRC_TEST_PROVIDER_ANNULAR_WIDTH()
bool IsErrorLimitExceeded(int error_code)
virtual bool reportProgress(int aCount, int aSize, int aDelta)
virtual void reportRuleStatistics()
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
bool HasRulesForConstraintType(DRC_CONSTRAINT_T constraintID)
virtual const wxString GetName() const override
virtual bool reportPhase(const wxString &aStageName)
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
virtual std::set< DRC_CONSTRAINT_T > GetConstraintTypes() const override
EDA_UNITS userUnits() const
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out #DRC_ITEMs and po...
Information pertinent to a Pcbnew printed circuit board.
virtual const wxString GetDescription() const override
int GetNumPhases() const override
virtual ~DRC_TEST_PROVIDER_ANNULAR_WIDTH()
virtual void reportAux(wxString fmt,...)