45 virtual bool Run()
override;
47 virtual const wxString
GetName()
const override {
return wxT(
"width" ); };
55 REPORT_AUX( wxT(
"Track width violations ignored. Tests not run." ) );
61 REPORT_AUX( wxT(
"No track width constraints found. Tests not run." ) );
68 auto checkTrackWidth =
98 bool fail_min =
false;
99 bool fail_max =
false;
100 int constraintWidth = 0;
104 if( constraint.Value().HasMin() &&
actual < constraint.Value().Min() )
107 constraintWidth = constraint.
Value().
Min();
110 if( constraint.Value().HasMax() &&
actual > constraint.Value().Max() )
113 constraintWidth = constraint.Value().Max();
117 if( fail_min || fail_max )
120 wxString constraintName = constraint.GetName();
125 if( constraint.m_ImplicitMin )
126 constraintName =
_(
"board setup constraints" );
128 msg =
formatMsg(
_(
"(%s min width %s; actual %s)" ),
135 msg =
formatMsg(
_(
"(%s max width %s; actual %s)" ),
141 drcItem->SetErrorMessage( drcItem->GetErrorText() + wxS(
" " ) + msg );
142 drcItem->SetItems( item );
143 drcItem->SetViolatingRule( constraint.GetParentRule() );
151 const int progressDelta = 250;
159 if( !checkTrackWidth( item ) )
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
const TRACKS & Tracks() const
MINOPTMAX< int > & Value()
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.
DRC_TEST_PROVIDER_TRACK_WIDTH()
virtual const wxString GetName() const override
virtual ~DRC_TEST_PROVIDER_TRACK_WIDTH()=default
virtual bool Run() override
Run this provider against the given PCB with configured options (if any).
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out DRC_ITEM and posi...
virtual bool reportPhase(const wxString &aStageName)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer, DRC_CUSTOM_MARKER_HANDLER *aCustomHandler=nullptr)
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)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
virtual int GetWidth() const
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_ANNULAR_WIDTH > dummy
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)