24#ifndef DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA_H_
25#define DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA_H_
41 double aNumericInputValue, wxString aRuleName ) :
51 std::vector<DRC_RE_FIELD_POSITION>
GetFieldPositions()
const override {
return { { 20, 40, 20, 1 } }; }
58 if( code ==
"via_count" )
60 return { wxString::Format(
"(constraint %s (max %s))", code, valueStr ) };
62 else if( code ==
"min_resolved_spokes" )
64 return { wxString::Format(
"(constraint %s %s)", code, valueStr ) };
66 else if( code ==
"track_angle" )
68 return { wxString::Format(
"(constraint %s (min %sdeg))", code, valueStr ) };
70 else if( code ==
"maximum_allowed_deviation" )
72 return { wxString::Format(
"(constraint %s (max %smm))", code, valueStr ) };
76 return { wxString::Format(
"(constraint %s (min %smm))", code, valueStr ) };
94 result.AddError(
_(
"Numeric input value must be greater than 0" ));
BITMAPS
A list of all bitmap identifiers.
@ constraint_minimum_track_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
Abstract interface class to enable polymorphic copying between objects.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.