24#ifndef DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA_H_
25#define DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA_H_
42 double aOptWidth,
double aWidthTolerance,
double aOptGap,
43 double aGapTolerance,
double aMaxUncoupledLength ) :
85 result.AddError(
_(
"Width Tolerance must be greater than or equal to 0" ) );
88 result.AddError(
_(
"Width Tolerance must be less than Optimum Width" ) );
96 result.AddError(
_(
"Gap Tolerance must be greater than or equal to 0" ) );
99 result.AddError(
_(
"Gap Tolerance must be less than Optimum Gap" ) );
103 result.AddError(
_(
"Maximum Uncoupled Length must be greater than or equal to 0" ) );
106 result.AddError(
_(
"At least one constraint must be specified" ) );
113 auto formatDistance = [](
double aValue )
118 std::vector<wxString> clauses;
125 clauses.push_back( wxString::Format( wxS(
"(constraint track_width (min %s) (opt %s) (max %s))" ),
126 formatDistance( minWidth ), formatDistance(
m_optWidth ),
127 formatDistance( maxWidth ) ) );
135 clauses.push_back( wxString::Format( wxS(
"(constraint diff_pair_gap (min %s) (opt %s) (max %s))" ),
136 formatDistance( minGap ), formatDistance(
m_optGap ),
137 formatDistance( maxGap ) ) );
142 clauses.push_back( wxString::Format( wxS(
"(constraint diff_pair_uncoupled (max %s))" ),
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 CopyFrom(const ICopyable &aSource) override
void SetMaxUncoupledLength(double aMaxUncoupledLength)
VALIDATION_RESULT Validate() const override
Validates the constraint data.
DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA(int aId, int aParentId, const wxString &aRuleName, double aOptWidth, double aWidthTolerance, double aOptGap, double aGapTolerance, double aMaxUncoupledLength)
DRC_RE_ROUTING_DIFF_PAIR_CONSTRAINT_DATA()=default
double GetWidthTolerance()
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
void SetOptWidth(double aOptWidth)
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(const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
double GetMaxUncoupledLength()
std::vector< DRC_RE_FIELD_POSITION > GetFieldPositions() const override
Returns the field positions for controls overlaid on the constraint bitmap.
void SetOptGap(double aOptGap)
void SetWidthTolerance(double aTolerance)
void SetGapTolerance(double aTolerance)
virtual ~DRC_RE_ROUTING_DIFF_PAIR_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.