24#ifndef DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA_H_
25#define DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA_H_
42 double aWidthTolerance ) :
69 result.AddError(
_(
"Optimum Width must be greater than 0" ) );
72 result.AddError(
_(
"Width Tolerance must be greater than or equal to 0" ) );
75 result.AddError(
_(
"Width Tolerance must be less than Optimum Width" ) );
83 auto formatDistance = [](
double aValue )
91 code = wxS(
"track_width" );
97 wxString::Format( wxS(
"(constraint %s (min %s) (opt %s) (max %s))" ), code, formatDistance( minWidth ),
98 formatDistance(
m_optWidth ), formatDistance( maxWidth ) );
BITMAPS
A list of all bitmap identifiers.
@ constraint_routing_width
wxString GetConstraintCode() const
static wxString formatDouble(double aValue, int aPrecision=6)
wxString buildRule(const RULE_GENERATION_CONTEXT &aContext, const std::vector< wxString > &aConstraintClauses) const
void CopyFrom(const ICopyable &aSource) override
DRC_RE_BASE_CONSTRAINT_DATA()=default
std::vector< DRC_RE_FIELD_POSITION > GetFieldPositions() const override
Returns the field positions for controls overlaid on the constraint bitmap.
DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA(int aId, int aParentId, const wxString &aRuleName, double aOptWidth, double aWidthTolerance)
BITMAPS GetOverlayBitmap() const override
Returns the bitmap to use for the overlay panel background.
std::vector< wxString > GetConstraintClauses(const RULE_GENERATION_CONTEXT &aContext) const override
Returns just the constraint clauses without the rule wrapper.
double GetWidthTolerance()
void SetOptWidth(double aOptWidth)
DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA(const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
VALIDATION_RESULT Validate() const override
Validates the constraint data.
void SetWidthTolerance(double aTolerance)
void CopyFrom(const ICopyable &aSource) override
virtual ~DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA()=default
DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA()=default
Abstract interface class to enable polymorphic copying between objects.
constexpr int DRC_RE_OVERLAY_XO
constexpr int DRC_RE_OVERLAY_YO
@ RIGHT
Label to the right of the field.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.