26#include <drc_rules_lexer.h>
42#include <unordered_map>
44using CODE_MAP = std::unordered_map<DRC_RULE_EDITOR_CONSTRAINT_NAME, const char*>;
45using REVERSE_CODE_MAP = std::unordered_map<wxString, DRC_RULE_EDITOR_CONSTRAINT_NAME, wxStringHash, wxStringEqual>;
60 {
HOLE_SIZE, DRC_RULES_LEXER::TokenName( DRCRULE_T::T_hole_size ) },
72 {
ROUTING_WIDTH, DRC_RULES_LEXER::TokenName( DRCRULE_T::T_track_width ) },
83 for(
const auto& [type, code] :
sCodeMap )
84 map.emplace( wxString::FromUTF8( code ), type );
90 static std::vector<DRC_RULE_EDITOR_UTILS::RuleConverter> converters;
129 case LENGTH_CONSTRAINT:
return DRC_RULES_LEXER::TokenName( DRCRULE_T::T_length );
130 case SKEW_CONSTRAINT:
return DRC_RULES_LEXER::TokenName( DRCRULE_T::T_skew );
145 static bool initialized =
false;
152 [](
const std::shared_ptr<DRC_RULE>& aRule ) -> std::shared_ptr<DRC_RE_BASE_CONSTRAINT_DATA>
154 if( aRule->m_Constraints.empty() )
return nullptr;
156 const auto& constraint = aRule->m_Constraints[0];
159 if( code.IsEmpty() )
return nullptr;
167 double val = constraint.GetValue().Min() / 1000000.0;
169 data->SetRuleName( aRule->m_Name );
170 data->SetNumericInputValue( val );
171 data->SetConstraintCode( code );
176 auto data = std::make_shared<DRC_RE_BOOL_INPUT_CONSTRAINT_DATA>( 0, 0,
true, aRule->m_Name );
177 data->SetConstraintCode( code );
180 else if( code ==
"track_width" )
182 double minW = constraint.GetValue().Min() / 1000000.0;
183 double optW = constraint.GetValue().Opt() / 1000000.0;
184 double maxW = constraint.GetValue().Max() / 1000000.0;
188 tol = std::max( optW - minW, maxW - optW );
191 std::make_shared<DRC_RE_ROUTING_WIDTH_CONSTRAINT_DATA>( 0, 0, aRule->m_Name, optW, tol );
192 data->SetConstraintCode( code );
201 [](
const std::shared_ptr<DRC_RULE>& aRule ) -> std::shared_ptr<DRC_RE_BASE_CONSTRAINT_DATA>
206 if( diaConstraint && holeConstraint )
208 double minDia = diaConstraint->GetValue().Min() / 1000000.0;
209 double maxDia = diaConstraint->GetValue().Max() / 1000000.0;
211 double minDrill = holeConstraint->GetValue().Min() / 1000000.0;
212 double maxDrill = holeConstraint->GetValue().Max() / 1000000.0;
216 if( aRule->m_Condition )
218 wxString expr = aRule->m_Condition->GetExpression();
220 if( expr.Contains( wxS(
"'Micro'" ) ) )
222 else if( expr.Contains( wxS(
"'Through'" ) ) )
224 else if( expr.Contains( wxS(
"'Blind'" ) ) )
226 else if( expr.Contains( wxS(
"'Buried'" ) ) )
230 auto data = std::make_shared<DRC_RE_VIA_STYLE_CONSTRAINT_DATA>( 0, 0, aRule->m_Name, minDia, maxDia,
231 minDrill, maxDrill, viaType );
232 data->SetConstraintCode(
"via_style" );
242 auto it =
sCodeMap.find( aConstraintType );
244 return wxString::FromUTF8( it->second );
285 switch( aConstraintType )
287 default:
return false;
294 switch( aConstraintType )
326 int* aErrorCount, wxString* aValidationMessage )
331 if( !aTextCtrl->Validate() )
340 *aValidationMessage +=
342 wxString::Format(
_(
"%s should not be empty." ), aLabel ) );
349 *aErrorCount, wxString::Format(
_(
"The value of %s must be a valid number." ), aLabel ) );
356 *aErrorCount, wxString::Format(
_(
"The value of %s must be greater than 0." ), aLabel ) );
368 int* aErrorCount, wxString* aValidationMessage )
373 if( !aTextCtrl->Validate() )
382 *aValidationMessage +=
384 wxString::Format(
_(
"%s should not be empty." ), aLabel ) );
391 *aErrorCount, wxString::Format(
_(
"The value of %s must be a valid integer." ), aLabel ) );
398 *aErrorCount, wxString::Format(
_(
"The value of %s must be greater than 0." ), aLabel ) );
410 wxString* aValidationMessage )
413 aComboBox->SetValidator( cmbCtrlValidator );
415 if( !aComboBox->Validate() )
425 wxString::Format(
_(
"Please choose %s." ), aLabel ) );
437 const wxString& aMinLabel,
const wxString& aMaxLabel,
438 int* aErrorCount, wxString* aValidationMessage )
440 aMinTextCtrl->SetName(
"min" );
441 aMaxTextCtrl->SetName(
"max" );
445 if( !aMinTextCtrl->Validate() )
455 *aErrorCount, wxString::Format(
_(
"%s value cannot be greater than %s value." ),
456 aMinLabel, aMaxLabel ) );
463 aMinTextCtrl->SetName(
"text" );
464 aMaxTextCtrl->SetName(
"text" );
471 wxTextCtrl* aMaxTextCtrl,
const wxString& aMinLabel,
472 const wxString& aPreferredLabel,
const wxString& aMaxLabel,
473 int* aErrorCount, wxString* aValidationMessage )
475 aMinTextCtrl->SetName(
"min" );
476 aPreferredTextCtrl->SetName(
"preferred" );
477 aMaxTextCtrl->SetName(
"max" );
481 if( !aMinTextCtrl->Validate() )
492 *aErrorCount, wxString::Format(
_(
"%s value cannot be greater than %s value." ),
493 aMinLabel, aPreferredLabel ) );
500 *aErrorCount, wxString::Format(
_(
"%s value cannot be greater than %s value." ),
501 aPreferredLabel, aMaxLabel ) );
508 *aErrorCount, wxString::Format(
_(
"%s value cannot be greater than %s value." ),
509 aMinLabel, aMaxLabel ) );
516 aMinTextCtrl->SetName(
"text" );
517 aPreferredTextCtrl->SetName(
"text" );
518 aMaxTextCtrl->SetName(
"text" );
525 int* aErrorCount, wxString* aValidationMessage )
529 aCheckboxes[0]->SetValidator(
validator );
531 if( !aCheckboxes[0]->Validate() )
541 *aErrorCount, wxString::Format(
_(
"Please select at least one option from %s list." ), aLabel ));
554 return wxString::Format( wxS(
"%d. %s\n" ), aErrorCount, aErrorMessage );
563 if( !aCanBeZero && aValue <= 0.0 )
565 aResult->
AddError( wxString::Format(
_(
"The value of %s must be greater than 0." ), aLabel ) );
574 bool aIntegerOnly,
const wxString& aLabel,
577 if( aValueStr.IsEmpty() )
579 aResult->
AddError( wxString::Format(
_(
"%s should not be empty." ), aLabel ) );
587 std::string stdStr = aValueStr.ToStdString();
589 long intVal = std::stol( stdStr, &pos );
591 if( pos != stdStr.length() )
593 aResult->
AddError( wxString::Format(
_(
"The value of %s must be a valid integer." ), aLabel ) );
597 if( !aCanBeZero && intVal <= 0 )
599 aResult->
AddError( wxString::Format(
_(
"The value of %s must be greater than 0." ), aLabel ) );
605 std::string stdStr = aValueStr.ToStdString();
607 double floatVal = std::stod( stdStr, &pos );
609 if( pos != stdStr.length() )
611 aResult->
AddError( wxString::Format(
_(
"The value of %s must be a valid number." ), aLabel ) );
615 if( !aCanBeZero && floatVal <= 0.0 )
617 aResult->
AddError( wxString::Format(
_(
"The value of %s must be greater than 0." ), aLabel ) );
622 catch(
const std::exception& )
625 aResult->
AddError( wxString::Format(
_(
"The value of %s must be a valid integer." ), aLabel ) );
627 aResult->
AddError( wxString::Format(
_(
"The value of %s must be a valid number." ), aLabel ) );
641 aResult->
AddError( wxString::Format(
_(
"%s value cannot be greater than %s value." ), aMinLabel, aMaxLabel ));
650 const wxString& aMinLabel,
651 const wxString& aPrefLabel,
652 const wxString& aMaxLabel,
657 if( aMin > aPreferred )
659 aResult->
AddError( wxString::Format(
_(
"%s value cannot be greater than %s value." ), aMinLabel, aPrefLabel ));
663 if( aPreferred > aMax )
665 aResult->
AddError( wxString::Format(
_(
"%s value cannot be greater than %s value." ), aPrefLabel, aMaxLabel ));
671 aResult->
AddError( wxString::Format(
_(
"%s value cannot be greater than %s value." ), aMinLabel, aMaxLabel ));
680 const wxString& aLabel,
683 for(
bool selected : aSelected )
689 aResult->
AddError( wxString::Format(
_(
"Please select at least one option from %s list." ), aLabel ) );
697 if( aSelectionIndex < 0 )
699 aResult->
AddError( wxString::Format(
_(
"Please choose %s." ), aLabel ) );
711 std::vector<std::shared_ptr<DRC_RE_BASE_CONSTRAINT_DATA>> rules;
712 std::vector<std::shared_ptr<DRC_RULE>> parsedRules;
714 wxString rulesText = aRules;
715 if( !rulesText.Contains(
"(version" ) )
716 rulesText.Prepend(
"(version 2)\n" );
721 parser.
Parse( parsedRules,
nullptr );
727 for(
const auto& rule : parsedRules )
729 std::shared_ptr<DRC_RE_BASE_CONSTRAINT_DATA> data;
733 data = converter( rule );
740 auto customData = std::make_shared<DRC_RE_CUSTOM_RULE_CONSTRAINT_DATA>( 0, 0, rule->m_Name );
741 customData->SetRuleText( wxString::Format(
"(rule \"%s\" ...)", rule->m_Name ) );
745 if( rule->m_Condition )
746 data->SetRuleCondition( rule->m_Condition->GetExpression() );
748 rules.push_back( data );
755 const std::vector<std::shared_ptr<DRC_RE_BASE_CONSTRAINT_DATA>>& aRules,
756 const BOARD* aBoard )
758 wxString content = wxT(
"(version 2)\n" );
760 for(
const auto& data : aRules )
767 ctx.
comment = data->GetComment();
771 std::vector<PCB_LAYER_ID> layers = data->GetLayers();
773 if( !layers.empty() && aBoard )
775 wxString layerStr =
"(layer";
778 layerStr +=
" \"" + aBoard->
GetLayerName( layer ) +
"\"";
784 content += data->GenerateRule( ctx ) + wxT(
"\n" );
787 std::string utf8 = std::string( content.mb_str( wxConvUTF8 ) );
797 switch( aConstraintType )
860 switch( aConstraintType )
863 return wxString::Format( wxS(
"(layer \"%s\")" ),
864 aIsTop ? wxS(
"F.CrtYd" ) : wxS(
"B.CrtYd" ) );
868 return wxString::Format( wxS(
"(condition \"A.Layer == '%s' && B.Layer == '%s'\")" ),
869 aIsTop ? wxS(
"F.SilkS" ) : wxS(
"B.SilkS" ),
870 aIsTop ? wxS(
"F.Mask" ) : wxS(
"B.Mask" ) );
874 return wxString::Format( wxS(
"(layer \"%s\")" ), aIsTop ? wxS(
"F.Cu" ) : wxS(
"B.Cu" ) );
877 return wxEmptyString;
882std::shared_ptr<DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA>
889 case COURTYARD_CLEARANCE:
return std::make_shared<DRC_RE_COURTYARD_CLEARANCE_CONSTRAINT_DATA>();
890 case PHYSICAL_CLEARANCE:
return std::make_shared<DRC_RE_PHYSICAL_CLEARANCE_CONSTRAINT_DATA>();
891 case CREEPAGE_DISTANCE:
return std::make_shared<DRC_RE_CREEPAGE_DISTANCE_CONSTRAINT_DATA>();
892 case HOLE_SIZE:
return std::make_shared<DRC_RE_HOLE_SIZE_CONSTRAINT_DATA>();
894 case MAXIMUM_VIA_COUNT:
return std::make_shared<DRC_RE_MAXIMUM_VIA_COUNT_CONSTRAINT_DATA>();
896 case MINIMUM_CLEARANCE:
return std::make_shared<DRC_RE_MINIMUM_CLEARANCE_CONSTRAINT_DATA>();
900 case MICROVIA_STACK_DEPTH:
return std::make_shared<DRC_RE_MICROVIA_STACK_DEPTH_CONSTRAINT_DATA>();
902 case MINIMUM_DRILL_SIZE:
return std::make_shared<DRC_RE_MINIMUM_DRILL_SIZE_CONSTRAINT_DATA>();
903 case MINIMUM_VIA_DIAMETER:
return std::make_shared<DRC_RE_MINIMUM_VIA_DIAMETER_CONSTRAINT_DATA>();
906 case SOLDERMASK_EXPANSION:
return std::make_shared<DRC_RE_SOLDERMASK_EXPANSION_CONSTRAINT_DATA>();
908 default:
return std::make_shared<DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA>();
913std::shared_ptr<DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA>
921 case COURTYARD_CLEARANCE:
return std::make_shared<DRC_RE_COURTYARD_CLEARANCE_CONSTRAINT_DATA>( aBase );
922 case PHYSICAL_CLEARANCE:
return std::make_shared<DRC_RE_PHYSICAL_CLEARANCE_CONSTRAINT_DATA>( aBase );
923 case CREEPAGE_DISTANCE:
return std::make_shared<DRC_RE_CREEPAGE_DISTANCE_CONSTRAINT_DATA>( aBase );
924 case HOLE_SIZE:
return std::make_shared<DRC_RE_HOLE_SIZE_CONSTRAINT_DATA>( aBase );
925 case HOLE_TO_HOLE_DISTANCE:
return std::make_shared<DRC_RE_HOLE_TO_HOLE_DISTANCE_CONSTRAINT_DATA>( aBase );
926 case MAXIMUM_VIA_COUNT:
return std::make_shared<DRC_RE_MAXIMUM_VIA_COUNT_CONSTRAINT_DATA>( aBase );
927 case MINIMUM_ANNULAR_WIDTH:
return std::make_shared<DRC_RE_MINIMUM_ANNULAR_WIDTH_CONSTRAINT_DATA>( aBase );
928 case MINIMUM_CLEARANCE:
return std::make_shared<DRC_RE_MINIMUM_CLEARANCE_CONSTRAINT_DATA>( aBase );
932 case MICROVIA_STACK_DEPTH:
return std::make_shared<DRC_RE_MICROVIA_STACK_DEPTH_CONSTRAINT_DATA>( aBase );
933 case MICROVIA_ASPECT_RATIO:
return std::make_shared<DRC_RE_MICROVIA_ASPECT_RATIO_CONSTRAINT_DATA>( aBase );
934 case MINIMUM_DRILL_SIZE:
return std::make_shared<DRC_RE_MINIMUM_DRILL_SIZE_CONSTRAINT_DATA>( aBase );
935 case MINIMUM_VIA_DIAMETER:
return std::make_shared<DRC_RE_MINIMUM_VIA_DIAMETER_CONSTRAINT_DATA>( aBase );
936 case SILK_TO_SILK_CLEARANCE:
return std::make_shared<DRC_RE_SILK_TO_SILK_CLEARANCE_CONSTRAINT_DATA>( aBase );
938 case SOLDERMASK_EXPANSION:
return std::make_shared<DRC_RE_SOLDERMASK_EXPANSION_CONSTRAINT_DATA>( aBase );
939 case SOLDERPASTE_EXPANSION:
return std::make_shared<DRC_RE_SOLDERPASTE_EXPANSION_CONSTRAINT_DATA>( aBase );
940 default:
return std::make_shared<DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA>( aBase );
Information pertinent to a Pcbnew printed circuit board.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
void SetConstraintCode(const wxString &aCode)
void Parse(std::vector< std::shared_ptr< DRC_RULE > > &aRules, REPORTER *aReporter)
static bool IsNumericInputType(const DRC_RULE_EDITOR_CONSTRAINT_NAME &aConstraintType)
static wxString ConstraintToKicadDrc(DRC_RULE_EDITOR_CONSTRAINT_NAME aType)
Convert a constraint type into the keyword used in a .kicad_drc file.
static bool ValidateNumericValue(double aValue, bool aCanBeZero, const wxString &aLabel, VALIDATION_RESULT *aResult)
Validates a numeric value.
static bool ValidateAtLeastOneSelected(const std::vector< bool > &aSelected, const wxString &aLabel, VALIDATION_RESULT *aResult)
Validates that at least one option is selected.
static bool ValidateSelection(int aSelectionIndex, const wxString &aLabel, VALIDATION_RESULT *aResult)
Validates that a selection has been made (index >= 0).
static wxString GetConstraintCode(DRC_RULE_EDITOR_CONSTRAINT_NAME aConstraintType)
Translate a rule tree node type into the keyword used by the rules file for that constraint.
static bool ValidateNumericCtrl(wxTextCtrl *aTextCtrl, const wxString &aLabel, bool aCanBeZero, int *aErrorCount, wxString *aValidationMessage)
Validates a numeric input control, checking if the value is valid, non-empty, and greater than zero.
static bool ValidateMinMax(double aMin, double aMax, const wxString &aMinLabel, const wxString &aMaxLabel, VALIDATION_RESULT *aResult)
Validates that min <= max.
static bool ConstraintFromKicadDrc(const wxString &aCode, DRC_RE_BASE_CONSTRAINT_DATA *aData)
Populate a constraint data object using a keyword from a .kicad_drc file.
static bool ValidateMinPreferredMaxCtrl(wxTextCtrl *aMinTextCtrl, wxTextCtrl *aPreferredTextCtrl, wxTextCtrl *aMaxTextCtrl, const wxString &aMinLabel, const wxString &aPreferredLabel, const wxString &aMaxLabel, int *aErrorCount, wxString *aValidationMessage)
Validates the minimum, preferred, and maximum value controls, ensuring that:
static wxString FormatErrorMessage(int aErrorCount, const wxString &aErrorMessage)
static std::optional< DRC_RULE_EDITOR_CONSTRAINT_NAME > GetConstraintTypeFromCode(const wxString &aCode)
Resolve a constraint keyword from a rules file into the corresponding rule tree enumeration value.
static bool ValidateComboCtrl(wxComboBox *aComboBox, const wxString &aLabel, int *aErrorCount, wxString *aValidationMessage)
Validates a combo box control, ensuring that a selection has been made.
static bool SaveRules(const wxString &aFilename, const std::vector< std::shared_ptr< DRC_RE_BASE_CONSTRAINT_DATA > > &aRules, const BOARD *aBoard)
static void RegisterRuleConverter(RuleConverter aConverter)
static wxString TranslateTopBottomLayer(DRC_RULE_EDITOR_CONSTRAINT_NAME aConstraintType, bool aIsTop)
Translate a top/bottom selection to the appropriate layer clause or condition.
static bool ValidateCheckBoxCtrls(const std::vector< wxCheckBox * > &aCheckboxes, const wxString &aLabel, int *aErrorCount, wxString *aValidationMessage)
Validates a list of checkboxes, ensuring that at least one option is selected.
static bool ValidateNumericString(const wxString &aValueStr, bool aCanBeZero, bool aIntegerOnly, const wxString &aLabel, VALIDATION_RESULT *aResult)
Validates that a string represents a valid numeric value.
static bool ValidateMinMaxCtrl(wxTextCtrl *aMinTextCtrl, wxTextCtrl *aMaxTextCtrl, const wxString &aMinLabel, const wxString &aMaxLabel, int *aErrorCount, wxString *aValidationMessage)
Validates the minimum and maximum value controls, ensuring that the minimum value is not greater than...
std::function< std::shared_ptr< DRC_RE_BASE_CONSTRAINT_DATA >(const std::shared_ptr< DRC_RULE > &)> RuleConverter
static std::shared_ptr< DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA > CreateNumericConstraintData(DRC_RULE_EDITOR_CONSTRAINT_NAME aType)
static DRC_LAYER_CATEGORY GetLayerCategoryForConstraint(DRC_RULE_EDITOR_CONSTRAINT_NAME aConstraintType)
Get the layer category for a constraint type.
static bool ValidateMinPreferredMax(double aMin, double aPreferred, double aMax, const wxString &aMinLabel, const wxString &aPrefLabel, const wxString &aMaxLabel, VALIDATION_RESULT *aResult)
Validates that min <= preferred <= max.
static bool ValidateIntegerCtrl(wxTextCtrl *aTextCtrl, const wxString &aLabel, bool aCanBeZero, int *aErrorCount, wxString *aValidationMessage)
Validates an integer input control, ensuring the value is a valid integer, non-empty,...
static bool IsBoolInputType(const DRC_RULE_EDITOR_CONSTRAINT_NAME &aConstraintType)
static std::vector< std::shared_ptr< DRC_RE_BASE_CONSTRAINT_DATA > > ParseRules(const wxString &aRules)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
VALIDATION_STATE GetValidationState() const
VALIDATION_STATE GetValidationState() const
VALIDATION_STATE GetValidationState() const
@ PreferredGreaterThanMax
@ MinGreaterThanPreferred
VALIDATION_STATE GetValidationState() const
VALIDATION_STATE GetValidationState() const
@ ANNULAR_WIDTH_CONSTRAINT
@ BRIDGED_MASK_CONSTRAINT
@ COURTYARD_CLEARANCE_CONSTRAINT
@ VIA_DIAMETER_CONSTRAINT
@ ZONE_CONNECTION_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
@ VIA_DANGLING_CONSTRAINT
@ SOLDER_MASK_SLIVER_CONSTRAINT
@ SILK_CLEARANCE_CONSTRAINT
@ EDGE_CLEARANCE_CONSTRAINT
@ MIN_RESOLVED_SPOKES_CONSTRAINT
@ TRACK_SEGMENT_LENGTH_CONSTRAINT
@ TEXT_THICKNESS_CONSTRAINT
@ PHYSICAL_HOLE_CLEARANCE_CONSTRAINT
@ MICROVIA_ASPECT_RATIO_CONSTRAINT
@ THERMAL_SPOKE_WIDTH_CONSTRAINT
@ CONNECTION_WIDTH_CONSTRAINT
@ THERMAL_RELIEF_GAP_CONSTRAINT
@ MAX_UNCOUPLED_CONSTRAINT
@ MICROVIA_STACK_DEPTH_CONSTRAINT
@ HOLE_CLEARANCE_CONSTRAINT
@ SOLDER_PASTE_ABS_MARGIN_CONSTRAINT
@ SOLDER_MASK_EXPANSION_CONSTRAINT
@ PHYSICAL_CLEARANCE_CONSTRAINT
@ SOLDER_PASTE_REL_MARGIN_CONSTRAINT
@ HOLE_TO_HOLE_CONSTRAINT
DRC_RULE_EDITOR_CONSTRAINT_NAME
@ SILK_TO_SOLDERMASK_CLEARANCE
@ MINIMUM_CONNECTION_WIDTH
@ MINIMUM_THERMAL_RELIEF_SPOKE_COUNT
@ MINIMUM_TEXT_HEIGHT_AND_THICKNESS
@ COPPER_TO_HOLE_CLEARANCE
@ MATCHED_LENGTH_DIFF_PAIR
@ COPPER_TO_EDGE_CLEARANCE
@ MINIMUM_SOLDERMASK_SLIVER
DRC_LAYER_CATEGORY
Layer categories for filtering the layer selector dropdown.
@ NO_LAYER_SELECTOR
Hide layer selector entirely.
@ TOP_BOTTOM_ANY
Simplified top/bottom/any selector with custom translation.
@ SOLDERMASK_ONLY
F_Mask, B_Mask.
@ GENERAL_ANY_LAYER
All layers + inner/outer synthetic.
@ SOLDERPASTE_ONLY
F_Paste, B_Paste.
@ COPPER_ONLY
Copper layers + inner/outer synthetic.
@ SILKSCREEN_ONLY
F_SilkS, B_SilkS.
static wxString GetConstraintCodeFromType(DRC_CONSTRAINT_T aType)
std::unordered_map< DRC_RULE_EDITOR_CONSTRAINT_NAME, const char * > CODE_MAP
static void RegisterDefaultConverters()
static const CODE_MAP sCodeMap
static const REVERSE_CODE_MAP sCodeReverse
std::unordered_map< wxString, DRC_RULE_EDITOR_CONSTRAINT_NAME, wxStringHash, wxStringEqual > REVERSE_CODE_MAP
static std::vector< DRC_RULE_EDITOR_UTILS::RuleConverter > & GetRuleConverters()
PCB_LAYER_ID
A quick note on layer IDs:
wxString conditionExpression
Result of a validation operation.
void AddError(const wxString &aError)
JSON_SCHEMA_VALIDATOR validator(schema)