24#ifndef DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA_H_
25#define DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA_H_
42 double aMaxUncoupledLength,
double aMinWidth,
43 double aPreferredWidth,
double aMaxWidth,
44 double aMinGap,
double aPreferredGap,
78 result.AddError(
_(
"Minimum Width must be greater than 0" ) );
81 result.AddError(
_(
"Preferred Width must be greater than 0" ) );
84 result.AddError(
_(
"Maximum Width must be greater than 0" ) );
87 result.AddError(
_(
"Minimum Gap must be greater than 0" ) );
90 result.AddError(
_(
"Preferred Gap must be greater than 0" ) );
93 result.AddError(
_(
"Maximum Gap must be greater than 0" ) );
96 result.AddError(
_(
"Maximum Uncoupled Length must be greater than 0" ) );
99 result.AddError(
_(
"Maximum Skew must be greater than or equal to 0" ) );
104 result.AddError(
_(
"Minimum Width cannot be greater than Preferred Width" ) );
107 result.AddError(
_(
"Preferred Width cannot be greater than Maximum Width" ) );
110 result.AddError(
_(
"Minimum Width cannot be greater than Maximum Width" ) );
113 result.AddError(
_(
"Minimum Gap cannot be greater than Preferred Gap" ) );
116 result.AddError(
_(
"Preferred Gap cannot be greater than Maximum Gap" ) );
119 result.AddError(
_(
"Minimum Gap cannot be greater than Maximum Gap" ) );
127 auto formatDistance = [](
double aValue )
132 wxString widthClause = wxString::Format(
133 wxS(
"(constraint track_width (min %s) (opt %s) (max %s))" ),
138 wxString gapClause = wxString::Format(
139 wxS(
"(constraint diff_pair_gap (min %s) (opt %s) (max %s))" ),
144 wxString uncoupledClause = wxString::Format(
145 wxS(
"(constraint diff_pair_uncoupled (max %s))" ),
148 std::vector<wxString> clauses = { widthClause, gapClause, uncoupledClause };
152 wxString skewClause = wxString::Format( wxS(
"(constraint skew (max %s))" ), formatDistance(
m_maxSkew ) );
153 clauses.push_back( skewClause );
BITMAPS
A list of all bitmap identifiers.
@ constraint_routing_diff_pair
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
void SetMaxGap(double aMaxGap)
void CopyFrom(const ICopyable &aSource) override
void SetMaxUncoupledLength(double aMaxUncoupledLength)
void SetPreferredGap(double aPreferredGap)
void SetMaxWidth(double aMaxWidth)
VALIDATION_RESULT Validate() const override
Validates the constraint data.
DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA()=default
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
double m_maxUncoupledLength
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.
DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA(int aId, int aParentId, wxString aRuleName, double aMaxUncoupledLength, double aMinWidth, double aPreferredWidth, double aMaxWidth, double aMinGap, double aPreferredGap, double aMaxGap)
void SetMaxSkew(double aMaxSkew)
void SetMinGap(double aMinGap)
DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA(const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
void SetPreferredWidth(double aPreferredWidth)
double GetMaxUncoupledLength()
std::vector< DRC_RE_FIELD_POSITION > GetFieldPositions() const override
Returns the field positions for controls overlaid on the constraint bitmap.
double GetPreferredWidth()
void SetMinWidth(double aMinWidth)
virtual ~DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA()=default
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.