KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_rule.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20
21#include <board.h>
22#include <board_item.h>
23#include <api/api_enums.h>
24#include <api/board/board.pb.h>
25#include <api/board/board_rules.pb.h>
26#include <base_units.h>
27#include <string_utils.h>
28#include <drc/drc_rule.h>
30
31
32bool IsComponentClassSelector( const wxString& aToken )
33{
34 return aToken.Upper().StartsWith( wxT( "CLASS:" ) );
35}
36
37
39 m_Unary( false ),
41 m_ImplicitItem( nullptr ),
42 m_LayerCondition( LSET::AllLayersMask() ),
43 m_Condition( nullptr ),
46{
47}
48
49
50DRC_RULE::DRC_RULE( const wxString& aName ) :
51 m_Unary( false ),
53 m_ImplicitItem( nullptr ),
54 m_Name( aName ),
55 m_LayerCondition( LSET::AllLayersMask() ),
56 m_Condition( nullptr ),
59{
60}
61
62
64{
65 delete m_Condition;
66}
67
68
70{
71 aConstraint.SetParentRule( this );
72 m_Constraints.push_back( aConstraint );
73}
74
75
76std::optional<DRC_CONSTRAINT> DRC_RULE::FindConstraint( DRC_CONSTRAINT_T aType )
77{
79 {
80 if( c.m_Type == aType )
81 return c;
82 }
83
84 return std::optional<DRC_CONSTRAINT>();
85}
86
87
89{
90 // Classify by the items supplied to rule evaluation, not the geometry measured by the test.
91 switch( m_Type )
92 {
107 case SKEW_CONSTRAINT:
113 case HOLE_ASPECT_RATIO_CONSTRAINT: return true;
114
115 default:
116 return false;
117 }
118}
119
120
122{
123 if( aOther.GetValue().HasMin()
124 && ( !GetValue().HasMin() || (aOther.GetValue().Min() > GetValue().Min() ) ) )
125 {
126 Value().SetMin( aOther.GetValue().Min() );
127 m_minRule = aOther.GetMinRule() ? aOther.GetMinRule() : aOther.GetParentRule();
128 }
129
130 if( aOther.GetValue().HasMax()
131 && ( !GetValue().HasMax() || aOther.GetValue().Max() < GetValue().Max() ) )
132 {
133 Value().SetMax( aOther.GetValue().Max() );
134 m_maxRule = aOther.GetMaxRule() ? aOther.GetMaxRule() : aOther.GetParentRule();
135 }
136
137 if( aOther.GetValue().HasOpt() && !GetValue().HasOpt() )
138 {
139 Value().SetOpt( aOther.GetValue().Opt() );
140 m_parentRule = aOther.GetParentRule();
141 }
142}
143
144
145wxString DRC_RULE::FormatRuleFromProto( const kiapi::board::CustomRule& aRule, wxString* aErrorText )
146{
147 if( aErrorText )
148 *aErrorText = wxEmptyString;
149
150 auto fail =
151 [&]( const wxString& aMessage ) -> wxString
152 {
153 if( aErrorText )
154 *aErrorText = aMessage;
155
156 return wxEmptyString;
157 };
158
159 auto escapeQuotedRuleText =
160 []( const wxString& aText ) -> wxString
161 {
162 wxString escaped = aText;
163 escaped.Replace( "\\", "\\\\" );
164 escaped.Replace( "\"", "\\\"" );
165 return escaped;
166 };
167
168 auto hasConstraintOption =
169 []( const kiapi::board::CustomRuleConstraint& aConstraint,
170 const kiapi::board::CustomRuleConstraintOption aOption ) -> bool
171 {
172 for( int optionValue : aConstraint.options() )
173 {
174 if( static_cast<kiapi::board::CustomRuleConstraintOption>( optionValue ) == aOption )
175 return true;
176 }
177
178 return false;
179 };
180
181 auto getConstraintToken =
182 []( const kiapi::board::CustomRuleConstraintType aType,
183 bool* aAddWithinDiffPairs ) -> std::optional<wxString>
184 {
185 if( aAddWithinDiffPairs )
186 *aAddWithinDiffPairs = false;
187
188 switch( aType )
189 {
190 case kiapi::board::CRCT_CLEARANCE: return wxS( "clearance" );
191 case kiapi::board::CRCT_CREEPAGE: return wxS( "creepage" );
192 case kiapi::board::CRCT_HOLE_CLEARANCE: return wxS( "hole_clearance" );
193 case kiapi::board::CRCT_HOLE_TO_HOLE: return wxS( "hole_to_hole" );
194 case kiapi::board::CRCT_EDGE_CLEARANCE: return wxS( "edge_clearance" );
195 case kiapi::board::CRCT_HOLE_SIZE: return wxS( "hole_size" );
196 case kiapi::board::CRCT_COURTYARD_CLEARANCE: return wxS( "courtyard_clearance" );
197 case kiapi::board::CRCT_SILK_CLEARANCE: return wxS( "silk_clearance" );
198 case kiapi::board::CRCT_TEXT_HEIGHT: return wxS( "text_height" );
199 case kiapi::board::CRCT_LINE_WIDTH: return wxS( "line_width" );
200 case kiapi::board::CRCT_TRACK_WIDTH: return wxS( "track_width" );
201 case kiapi::board::CRCT_TRACK_SEGMENT_LENGTH: return wxS( "track_segment_length" );
202 case kiapi::board::CRCT_ANNULAR_WIDTH: return wxS( "annular_width" );
203 case kiapi::board::CRCT_ZONE_CONNECTION: return wxS( "zone_connection" );
204 case kiapi::board::CRCT_THERMAL_RELIEF_GAP: return wxS( "thermal_relief_gap" );
205 case kiapi::board::CRCT_THERMAL_SPOKE_WIDTH: return wxS( "thermal_spoke_width" );
206 case kiapi::board::CRCT_MIN_RESOLVED_SPOKES: return wxS( "min_resolved_spokes" );
207 case kiapi::board::CRCT_SOLDER_MASK_EXPANSION: return wxS( "solder_mask_expansion" );
208 case kiapi::board::CRCT_SOLDER_PASTE_ABS_MARGIN: return wxS( "solder_paste_abs_margin" );
209 case kiapi::board::CRCT_SOLDER_PASTE_REL_MARGIN: return wxS( "solder_paste_rel_margin" );
210 case kiapi::board::CRCT_DISALLOW: return wxS( "disallow" );
211 case kiapi::board::CRCT_VIA_DIAMETER: return wxS( "via_diameter" );
212 case kiapi::board::CRCT_LENGTH: return wxS( "length" );
213 case kiapi::board::CRCT_SKEW: return wxS( "skew" );
214 case kiapi::board::CRCT_DIFF_PAIR_GAP: return wxS( "diff_pair_gap" );
215 case kiapi::board::CRCT_MAX_UNCOUPLED: return wxS( "diff_pair_uncoupled" );
216 case kiapi::board::CRCT_DIFF_PAIR_INTRA_SKEW:
217 {
218 if( aAddWithinDiffPairs )
219 *aAddWithinDiffPairs = true;
220
221 return wxS( "skew" );
222 }
223 case kiapi::board::CRCT_VIA_COUNT: return wxS( "via_count" );
224 case kiapi::board::CRCT_PHYSICAL_CLEARANCE: return wxS( "physical_clearance" );
225 case kiapi::board::CRCT_PHYSICAL_HOLE_CLEARANCE: return wxS( "physical_hole_clearance" );
226 case kiapi::board::CRCT_ASSERTION: return wxS( "assertion" );
227 case kiapi::board::CRCT_CONNECTION_WIDTH: return wxS( "connection_width" );
228 case kiapi::board::CRCT_TRACK_ANGLE: return wxS( "track_angle" );
229 case kiapi::board::CRCT_VIA_DANGLING: return wxS( "via_dangling" );
230 case kiapi::board::CRCT_BRIDGED_MASK: return wxS( "bridged_mask" );
231 case kiapi::board::CRCT_SOLDER_MASK_SLIVER: return wxS( "solder_mask_sliver" );
232 case kiapi::board::CRCT_NET_CHAIN_LENGTH: return wxS( "net_chain_length" );
233 case kiapi::board::CRCT_NET_CHAIN_STUB_LENGTH: return wxS( "stub_length" );
234 case kiapi::board::CRCT_NET_CHAIN_RETURN_PATH: return wxS( "return_path" );
235 case kiapi::board::CRCT_MICROVIA_STACK_DEPTH: return wxS( "microvia_stack_depth" );
236 case kiapi::board::CRCT_HOLE_ASPECT_RATIO: return wxS( "hole_aspect_ratio" );
237
238 case kiapi::board::CRCT_UNKNOWN:
239 default:
240 return std::nullopt;
241 }
242 };
243
244 auto formatNumericValueForConstraint =
245 [&]( const kiapi::board::CustomRuleConstraint& aConstraint,
246 const int aValue ) -> wxString
247 {
248 if( aConstraint.type() == kiapi::board::CRCT_TRACK_ANGLE )
249 return wxString::Format( "%ddeg", aValue );
250
251 if( aConstraint.type() == kiapi::board::CRCT_HOLE_ASPECT_RATIO )
252 return wxString::FromUTF8( FormatDouble2Str( aValue / 1000.0 ) );
253
254 switch( aConstraint.type() )
255 {
256 case kiapi::board::CRCT_VIA_COUNT:
257 case kiapi::board::CRCT_MIN_RESOLVED_SPOKES:
258 case kiapi::board::CRCT_VIA_DANGLING:
259 case kiapi::board::CRCT_BRIDGED_MASK:
260 case kiapi::board::CRCT_MICROVIA_STACK_DEPTH:
261 return wxString::Format( "%d", aValue );
262
263 default:
264 break;
265 }
266
267 if( hasConstraintOption( aConstraint, kiapi::board::CRCO_TIME_DOMAIN ) )
268 {
269 double picoseconds = aValue / pcbIUScale.IU_PER_PS;
270 return wxString::FromUTF8( FormatDouble2Str( picoseconds ) ) + "ps";
271 }
272
273 wxString formatted = wxString::FromUTF8( EDA_UNIT_UTILS::FormatInternalUnits( pcbIUScale, aValue ) );
274 return formatted + "mm";
275 };
276
277 auto severityToken =
278 []( const kiapi::common::types::RuleSeverity aSeverity ) -> wxString
279 {
280 switch( aSeverity )
281 {
282 case kiapi::common::types::RuleSeverity::RS_WARNING: return wxS( "warning" );
283 case kiapi::common::types::RuleSeverity::RS_ERROR: return wxS( "error" );
284 case kiapi::common::types::RuleSeverity::RS_EXCLUSION: return wxS( "exclusion" );
285 case kiapi::common::types::RuleSeverity::RS_IGNORE: return wxS( "ignore" );
286
287 default:
288 return wxEmptyString;
289 }
290 };
291
292 if( aRule.name().empty() )
293 return fail( wxS( "Rules must have a name" ) );
294
295 wxString ruleText;
296 ruleText << "(rule \"" << escapeQuotedRuleText( wxString::FromUTF8( aRule.name() ) ) << "\"\n";
297
298 if( aRule.has_comments() && !aRule.comments().empty() )
299 {
300 wxArrayString commentLines = wxSplit( wxString::FromUTF8( aRule.comments() ), '\n', '\0' );
301
302 for( const wxString& line : commentLines )
303 ruleText << "\t# " << line << "\n";
304 }
305
306 if( !aRule.condition().empty() )
307 {
308 ruleText << "\t(condition \""
309 << escapeQuotedRuleText( wxString::FromUTF8( aRule.condition() ) )
310 << "\")\n";
311 }
312
313 if( aRule.layer_condition_case() == kiapi::board::CustomRule::LayerConditionCase::kLayerMode )
314 {
315 switch( aRule.layer_mode() )
316 {
317 case kiapi::board::CRLM_OUTER:
318 ruleText << "\t(layer outer)\n";
319 break;
320
321 case kiapi::board::CRLM_INNER:
322 ruleText << "\t(layer inner)\n";
323 break;
324
325 case kiapi::board::CRLM_UNKNOWN:
326 default:
327 break;
328 }
329 }
330 else if( aRule.layer_condition_case() == kiapi::board::CustomRule::LayerConditionCase::kSingleLayer )
331 {
332 PCB_LAYER_ID layer =
334
335 if( layer == UNDEFINED_LAYER || layer == UNSELECTED_LAYER )
336 return fail( wxS( "Invalid single_layer value in custom rule" ) );
337
338 ruleText << "\t(layer \"" << BOARD::GetStandardLayerName( layer ) << "\")\n";
339 }
340
341 for( const kiapi::board::CustomRuleConstraint& constraint : aRule.constraints() )
342 {
343 bool addWithinDiffPairs = false;
344 std::optional<wxString> token = getConstraintToken( constraint.type(), &addWithinDiffPairs );
345
346 if( !token )
347 return fail( wxS( "Unsupported custom rule constraint type" ) );
348
349 wxString text = wxS( "\t(constraint " ) + *token;
350
351 if( constraint.has_name() && !constraint.name().empty() )
352 {
353 text += wxS( " (name \"" )
354 + escapeQuotedRuleText( wxString::FromUTF8( constraint.name() ) )
355 + wxS( "\")" );
356 }
357
358 // Special case for CRCT_MIN_RESOLVED_SPOKES, which is a kNumeric value, but doesn't use
359 // min/opt/max for serialization in order to avoid the implication that we support opt.
360 if( constraint.type() == kiapi::board::CRCT_MIN_RESOLVED_SPOKES )
361 {
362 text += wxString::Format( "%d", constraint.numeric().min() );
363 }
364 else if( constraint.value_case() == kiapi::board::CustomRuleConstraint::ValueCase::kDisallow )
365 {
366 for( int disallowTypeValue : constraint.disallow().types() )
367 {
368 kiapi::board::CustomRuleDisallowType disallowType =
369 static_cast<kiapi::board::CustomRuleDisallowType>( disallowTypeValue );
370
371 switch( disallowType )
372 {
373 case kiapi::board::CRDT_THROUGH_VIAS: text += wxS( " through_via" ); break;
374 case kiapi::board::CRDT_MICRO_VIAS: text += wxS( " micro_via" ); break;
375 case kiapi::board::CRDT_BLIND_VIAS: text += wxS( " blind_via" ); break;
376 case kiapi::board::CRDT_BURIED_VIAS: text += wxS( " buried_via" ); break;
377 case kiapi::board::CRDT_TRACKS: text += wxS( " track" ); break;
378 case kiapi::board::CRDT_PADS: text += wxS( " pad" ); break;
379 case kiapi::board::CRDT_ZONES: text += wxS( " zone" ); break;
380 case kiapi::board::CRDT_TEXTS: text += wxS( " text" ); break;
381 case kiapi::board::CRDT_GRAPHICS: text += wxS( " graphic" ); break;
382 case kiapi::board::CRDT_HOLES: text += wxS( " hole" ); break;
383 case kiapi::board::CRDT_FOOTPRINTS: text += wxS( " footprint" ); break;
384
385 case kiapi::board::CRDT_UNKNOWN:
386 default:
387 break;
388 }
389 }
390 }
391 else if( constraint.value_case() == kiapi::board::CustomRuleConstraint::ValueCase::kZoneConnection )
392 {
393 switch( constraint.zone_connection() )
394 {
395 case kiapi::board::types::ZCS_FULL:
396 text += wxS( " solid" );
397 break;
398
399 case kiapi::board::types::ZCS_THERMAL:
400 text += wxS( " thermal_reliefs" );
401 break;
402
403 case kiapi::board::types::ZCS_NONE:
404 text += wxS( " none" );
405 break;
406
407 default:
408 return fail( wxS( "Unsupported zone connection style" ) );
409 }
410 }
411 else if( constraint.value_case() == kiapi::board::CustomRuleConstraint::ValueCase::kAssertionExpression )
412 {
413 text += wxS( " \"" )
414 + escapeQuotedRuleText( wxString::FromUTF8( constraint.assertion_expression() ) )
415 + wxS( "\"" );
416 }
417 else if( constraint.value_case() == kiapi::board::CustomRuleConstraint::ValueCase::kReturnPath )
418 {
419 const kiapi::board::CustomRuleReturnPathSettings& returnPath = constraint.return_path();
420
421 if( !returnPath.reference_layer().empty() )
422 {
423 text += wxS( " (layer \"" )
424 + escapeQuotedRuleText( wxString::FromUTF8( returnPath.reference_layer() ) )
425 + wxS( "\")" );
426 }
427
428 if( !returnPath.reference_net().empty() )
429 {
430 text += wxS( " (net \"" )
431 + escapeQuotedRuleText( wxString::FromUTF8( returnPath.reference_net() ) )
432 + wxS( "\")" );
433 }
434 }
435 else if( constraint.value_case() == kiapi::board::CustomRuleConstraint::ValueCase::kNumeric )
436 {
437 const kiapi::common::types::MinOptMax& numeric = constraint.numeric();
438
439 if( numeric.has_min() )
440 text += wxS( " (min " )
441 + formatNumericValueForConstraint( constraint, numeric.min() )
442 + wxS( ")" );
443
444 if( numeric.has_opt() )
445 text += wxS( " (opt " )
446 + formatNumericValueForConstraint( constraint, numeric.opt() )
447 + wxS( ")" );
448
449 if( numeric.has_max() )
450 text += wxS( " (max " )
451 + formatNumericValueForConstraint( constraint, numeric.max() )
452 + wxS( ")" );
453 }
454
455 if( addWithinDiffPairs
456 || hasConstraintOption( constraint, kiapi::board::CRCO_SKEW_WITHIN_DIFF_PAIRS ) )
457 {
458 text += wxS( " (within_diff_pairs)" );
459 }
460
461 text += wxS( ")" );
462 ruleText << text << "\n";
463 }
464
465 wxString severity = severityToken( aRule.severity() );
466
467 if( !severity.IsEmpty() )
468 ruleText << "\t(severity " << severity << ")\n";
469
470 ruleText << ")\n";
471 return ruleText;
472}
473
474
475void DRC_CONSTRAINT::ToProto( kiapi::board::CustomRuleConstraint& aProto ) const
476{
478
479 if( !m_name.IsEmpty() )
480 aProto.set_name( m_name.ToUTF8() );
481
482 for( size_t ii = 0; ii < static_cast<size_t>( OPTIONS::NUM_OPTIONS ); ++ii )
483 {
484 OPTIONS option = static_cast<OPTIONS>( ii );
485
486 if( GetOption( option ) )
488 }
489
491 {
492 kiapi::board::CustomRuleDisallowSettings* disallow = aProto.mutable_disallow();
493
495 {
496 if( m_DisallowFlags & flag )
497 {
499 static_cast<DRC_DISALLOW_T>( flag ) ) );
500 }
501 }
502 }
504 {
505 aProto.set_zone_connection(
507 }
508 else if( m_Type == ASSERTION_CONSTRAINT )
509 {
510 if( m_Test )
511 aProto.set_assertion_expression( m_Test->GetExpression().ToUTF8() );
512 }
514 {
515 kiapi::board::CustomRuleReturnPathSettings* returnPath = aProto.mutable_return_path();
516 returnPath->set_reference_layer( m_ReferenceLayer.ToUTF8() );
517 returnPath->set_reference_net( m_ReferenceNet.ToUTF8() );
518 }
519 else
520 {
521 kiapi::common::types::MinOptMax* numeric = aProto.mutable_numeric();
522
523 if( m_Value.HasMin() )
524 numeric->set_min( m_Value.Min() );
525
526 if( m_Value.HasOpt() )
527 numeric->set_opt( m_Value.Opt() );
528
529 if( m_Value.HasMax() )
530 numeric->set_max( m_Value.Max() );
531 }
532}
KICOMMON_API types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
KICOMMON_API KICAD_T FromProtoEnum(types::KiCadObjectType aValue)
Definition api_enums.cpp:56
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:128
static wxString GetStandardLayerName(PCB_LAYER_ID aLayerId)
Return an "English Standard" name of a PCB layer when given aLayerNumber.
Definition board.h:1131
DRC_RULE_CONDITION * m_Test
Definition drc_rule.h:209
void ToProto(kiapi::board::CustomRuleConstraint &aProto) const
Definition drc_rule.cpp:475
int m_DisallowFlags
Definition drc_rule.h:207
DRC_RULE * GetMinRule() const
Definition drc_rule.h:156
DRC_RULE * m_parentRule
Definition drc_rule.h:224
void SetParentRule(DRC_RULE *aParentRule)
Attribute the constraint, including each min, opt and max value it has, to aParentRule.
Definition drc_rule.h:135
MINOPTMAX< int > & Value()
Definition drc_rule.h:130
const MINOPTMAX< int > & GetValue() const
Definition drc_rule.h:129
DRC_RULE * m_maxRule
Definition drc_rule.h:227
ZONE_CONNECTION m_ZoneConnection
Definition drc_rule.h:208
MINOPTMAX< int > m_Value
Definition drc_rule.h:206
wxString m_ReferenceLayer
Definition drc_rule.h:215
DRC_CONSTRAINT_T m_Type
Definition drc_rule.h:205
bool IsUnary() const
Definition drc_rule.cpp:88
DRC_RULE * m_minRule
Definition drc_rule.h:225
wxString m_name
Definition drc_rule.h:223
DRC_RULE * GetMaxRule() const
Definition drc_rule.h:158
bool GetOption(OPTIONS option) const
Definition drc_rule.h:193
DRC_RULE * GetParentRule() const
Definition drc_rule.h:147
void Merge(const DRC_CONSTRAINT &aOther)
Definition drc_rule.cpp:121
DRC_CONSTRAINT(DRC_CONSTRAINT_T aType=NULL_CONSTRAINT, const wxString &aName=wxEmptyString)
Definition drc_rule.h:96
wxString m_ReferenceNet
Definition drc_rule.h:220
SEVERITY m_Severity
Definition drc_rule.h:86
bool m_Unary
Definition drc_rule.h:77
DRC_RULE_CONDITION * m_Condition
Definition drc_rule.h:84
LSET m_LayerCondition
Definition drc_rule.h:83
static wxString FormatRuleFromProto(const kiapi::board::CustomRule &aRule, wxString *aErrorText=nullptr)
Definition drc_rule.cpp:145
KIID m_ImplicitItemId
Definition drc_rule.h:78
std::vector< DRC_CONSTRAINT > m_Constraints
Definition drc_rule.h:85
BOARD_ITEM * m_ImplicitItem
Definition drc_rule.h:79
wxString m_Name
Definition drc_rule.h:80
void AddConstraint(DRC_CONSTRAINT &aConstraint)
Definition drc_rule.cpp:69
virtual ~DRC_RULE()
Definition drc_rule.cpp:63
std::optional< DRC_CONSTRAINT > FindConstraint(DRC_CONSTRAINT_T aType)
Definition drc_rule.cpp:76
DRC_IMPLICIT_SOURCE m_implicitSource
Definition drc_rule.h:89
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
T Min() const
Definition minoptmax.h:29
void SetMin(T v)
Definition minoptmax.h:41
bool HasMax() const
Definition minoptmax.h:38
void SetOpt(T v)
Definition minoptmax.h:43
bool HasMin() const
Definition minoptmax.h:37
void SetMax(T v)
Definition minoptmax.h:42
T Max() const
Definition minoptmax.h:30
T Opt() const
Definition minoptmax.h:31
bool HasOpt() const
Definition minoptmax.h:39
DRC_IMPLICIT_SOURCE
@ DRC_DISALLOW_THROUGH_VIAS
@ DRC_DISALLOW_FOOTPRINTS
@ ANNULAR_WIDTH_CONSTRAINT
@ BRIDGED_MASK_CONSTRAINT
@ VIA_DIAMETER_CONSTRAINT
@ ZONE_CONNECTION_CONSTRAINT
@ NET_CHAIN_LENGTH_CONSTRAINT
@ VIA_DANGLING_CONSTRAINT
@ NET_CHAIN_STUB_LENGTH_CONSTRAINT
@ DISALLOW_CONSTRAINT
@ TRACK_SEGMENT_LENGTH_CONSTRAINT
@ HOLE_ASPECT_RATIO_CONSTRAINT
@ LENGTH_CONSTRAINT
@ VIA_COUNT_CONSTRAINT
@ NET_CHAIN_RETURN_PATH_CONSTRAINT
@ ASSERTION_CONSTRAINT
@ SKEW_CONSTRAINT
@ LINE_WIDTH_CONSTRAINT
@ MICROVIA_STACK_DEPTH_CONSTRAINT
@ SOLDER_PASTE_ABS_MARGIN_CONSTRAINT
@ SOLDER_MASK_EXPANSION_CONSTRAINT
@ HOLE_SIZE_CONSTRAINT
@ TEXT_HEIGHT_CONSTRAINT
@ SOLDER_PASTE_REL_MARGIN_CONSTRAINT
bool IsComponentClassSelector(const wxString &aToken)
${Class:X} inside a DRC rule is a component-class selector consumed by testFootprintSelector(),...
Definition drc_rule.cpp:32
@ NONE
Definition eda_fill.h:42
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
@ UNSELECTED_LAYER
Definition layer_ids.h:58
@ UNDEFINED_LAYER
Definition layer_ids.h:57
KICOMMON_API std::string FormatInternalUnits(const EDA_IU_SCALE &aIuScale, int aValue, EDA_DATA_TYPE aDataType=EDA_DATA_TYPE::DISTANCE)
Converts aValue from internal units to a string appropriate for writing to file.
@ RPT_SEVERITY_UNDEFINED
std::string FormatDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 This function is intended in...
static wxString formatted(LIB_SYMBOL &aSymbol)
Serialize one symbol the way the library writer would.