52 virtual bool Run()
override;
54 virtual const wxString
GetName()
const override 61 return "Tests pad/via annular rings";
74 reportAux(
"Annular width violations ignored. Skipping check." );
78 const int delta = 250;
82 reportAux(
"No annulus constraints found. Tests not run." );
86 if( !
reportPhase(
_(
"Checking via annular rings..." ) ) )
97 VIA*
via = dyn_cast<VIA*>( item );
106 int annulus = (
via->GetWidth() -
via->GetDrillValue() ) / 2;
107 bool fail_min =
false;
108 bool fail_max =
false;
110 if( constraint.Value().HasMin() )
113 fail_min = annulus < v_min;
116 if( constraint.Value().HasMax() )
118 v_max = constraint.Value().Max();
119 fail_max = annulus > v_max;
122 if( fail_min || fail_max )
127 m_msg.Printf(
_(
"(%s min annular width %s; actual %s)" ),
128 constraint.GetName(),
133 m_msg.Printf(
_(
"(%s max annular width %s; actual %s)" ),
134 constraint.GetName(),
138 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) +
m_msg );
139 drcItem->SetItems( item );
140 drcItem->SetViolatingRule( constraint.GetParentRule() );
156 if( !checkAnnulus( 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()
DRC_TEST_PROVIDER_ANNULUS()
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULUS > dummy
bool IsErrorLimitExceeded(int error_code)
virtual bool reportProgress(int aCount, int aSize, int aDelta)
virtual ~DRC_TEST_PROVIDER_ANNULUS()
virtual const wxString GetName() const override
virtual void reportRuleStatistics()
bool HasRulesForConstraintType(DRC_CONSTRAINT_T constraintID)
virtual bool reportPhase(const wxString &aStageName)
virtual const wxString GetDescription() const override
EDA_UNITS userUnits() const
int GetNumPhases() const override
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintId, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, wxPoint aMarkerPos)
DRC_TEST_PROVIDER is a base class that represents a DRC "provider" which runs some DRC functions over...
Information pertinent to a Pcbnew printed circuit board.
virtual bool Run() override
Runs this provider against the given PCB with configured options (if any).
virtual std::set< DRC_CONSTRAINT_T > GetConstraintTypes() const override
virtual void reportAux(wxString fmt,...)