24#ifndef DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA_H_
25#define DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA_H_
42 double aMinRoutingWidth,
43 double aPreferredRoutingWidth,
44 double aMaxRoutingWidth ) :
72 result.AddError(
_(
"Minimum Routing Width must be greater than 0" ) );
75 result.AddError(
_(
"Preferred Routing Width must be greater than 0" ) );
78 result.AddError(
_(
"Maximum Routing Width must be greater than 0" ) );
83 result.AddError(
_(
"Minimum Routing Width cannot be greater than Preferred Routing Width" ) );
86 result.AddError(
_(
"Preferred Routing Width cannot be greater than Maximum Routing Width" ) );
89 result.AddError(
_(
"Minimum Routing Width cannot be greater than Maximum Routing Width" ) );
98 auto formatDistance = [](
double aValue )
106 code = wxS(
"track_width" );
108 wxString clause = wxString::Format(
109 wxS(
"(constraint %s (min %s) (opt %s) (max %s))" ),
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.
BITMAPS GetOverlayBitmap() const override
Returns the bitmap to use for the overlay panel background.
void SetMinRoutingWidth(double aMinRoutingWidth)
std::vector< wxString > GetConstraintClauses(const RULE_GENERATION_CONTEXT &aContext) const override
Returns just the constraint clauses without the rule wrapper.
double GetMinRoutingWidth()
DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA(const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA(int aId, int aParentId, wxString aRuleName, double aMinRoutingWidth, double aPreferredRoutingWidth, double aMaxRoutingWidth)
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
double GetMaxRoutingWidth()
double m_preferredRoutingWidth
VALIDATION_RESULT Validate() const override
Validates the constraint data.
void CopyFrom(const ICopyable &aSource) override
virtual ~DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA()=default
void SetMaxRoutingWidth(double aMaxRoutingWidth)
DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA()=default
void SetPreferredRoutingWidth(double aPreferredRoutingWidth)
double GetPreferredRoutingWidth()
Abstract interface class to enable polymorphic copying between objects.
@ RIGHT
Label to the right of the field.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.