KiCad PCB EDA Suite
Loading...
Searching...
No Matches
board_design_settings.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 (C) 1992-2022 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, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include <pcb_dimension.h>
25#include <pcb_track.h>
26#include <layer_ids.h>
27#include <kiface_base.h>
28#include <pad.h>
30#include <drc/drc_item.h>
31#include <drc/drc_engine.h>
33#include <settings/parameters.h>
35#include <advanced_config.h>
36#include <pcbnew.h>
37
38const int bdsSchemaVersion = 2;
39
40
41BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) :
42 NESTED_SETTINGS( "board_design_settings", bdsSchemaVersion, aParent, aPath )
43{
44 // We want to leave alone parameters that aren't found in the project JSON as they may be
45 // initialized by the board file parser before NESTED_SETTINGS::LoadFromFile is called.
47
48 // Create a default NET_SETTINGS so that things don't break horribly if there's no project
49 // loaded. This also is used during file load for legacy boards that have netclasses stored
50 // in the file. After load, this information will be moved to the project and the pointer
51 // updated.
52 m_NetSettings = std::make_shared<NET_SETTINGS>( nullptr, "" );
53
54 m_HasStackup = false; // no stackup defined by default
55
56 m_Pad_Master = std::make_unique<PAD>( nullptr );
57
58 LSET all_set = LSET().set();
59 m_enabledLayers = all_set; // All layers enabled at first.
60 // SetCopperLayerCount() will adjust this.
61
62 SetCopperLayerCount( 2 ); // Default design is a double sided board
63 m_CurrentViaType = VIATYPE::THROUGH;
64
65 // if true, when creating a new track starting on an existing track, use this track width
68
69 // First is always the reference designator
70 m_DefaultFPTextItems.emplace_back( wxT( "REF**" ), true, F_SilkS );
71 // Second is always the value
72 m_DefaultFPTextItems.emplace_back( wxT( "" ), true, F_Fab );
73 // Any following ones are freebies
74 m_DefaultFPTextItems.emplace_back( wxT( "${REFERENCE}" ), true, F_Fab );
75
82
89
90 // Edges & Courtyards; text properties aren't used but better to have them holding
91 // reasonable values than not.
98
105
110 m_TextItalic[ LAYER_CLASS_FAB ] = false;
112
119
120 m_DimensionPrecision = DIM_PRECISION::X_XXXX;
121 m_DimensionUnitsMode = DIM_UNITS_MODE::AUTOMATIC;
122 m_DimensionUnitsFormat = DIM_UNITS_FORMAT::BARE_SUFFIX;
124 m_DimensionTextPosition = DIM_TEXT_POSITION::OUTSIDE;
128
129 m_useCustomTrackVia = false;
133
134 m_useCustomDiffPair = false;
138
154
155 for( int errorCode = DRCE_FIRST; errorCode <= DRCE_LAST; ++errorCode )
156 m_DRCSeverities[ errorCode ] = RPT_SEVERITY_ERROR;
157
159
163
166
169
171
176
182
184
187
189
193
194 // Global mask margins:
198
199 // Solder paste margin absolute value
201 // Solder paste margin as a ratio of pad size
202 // The final margin is the sum of these 2 values
203 // Usually < 0 because the mask is smaller than pad
205
207
208 // Layer thickness for 3D viewer
210
211 m_viaSizeIndex = 0;
213 m_diffPairIndex = 0;
214
215 // Parameters stored in JSON in the project file
216
217 // NOTE: Previously, BOARD_DESIGN_SETTINGS stored the basic board layer information (layer
218 // names and enable/disable state) in the project file even though this information is also
219 // stored in the board file. This was implemented for importing these settings from another
220 // project. Going forward, the import feature will just import from other board files (since
221 // we could have multi-board projects in the future anyway) so this functionality is dropped.
222
223
224 m_params.emplace_back( new PARAM<bool>( "rules.use_height_for_length_calcs",
225 &m_UseHeightForLengthCalcs, true ) );
226
227 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_clearance",
230
231 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_connection",
233 pcbIUScale.mmToIU( 0.00 ), pcbIUScale.mmToIU( 100.0 ), pcbIUScale.MM_PER_IU ) );
234
235 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_track_width",
238
239 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_via_annular_width",
242
243 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_via_diameter",
246
247 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_through_hole_diameter",
250
251 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_microvia_diameter",
254
255 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_microvia_drill",
258
259 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_hole_to_hole",
262
263 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_hole_clearance",
265 pcbIUScale.mmToIU( 0.00 ), pcbIUScale.mmToIU( 100.0 ), pcbIUScale.MM_PER_IU ) );
266
267 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_silk_clearance",
269 pcbIUScale.mmToIU( 0.00 ), pcbIUScale.mmToIU( 100.0 ), pcbIUScale.MM_PER_IU ) );
270
271 // While the maximum *effective* value is 4, we've had users interpret this as the count on
272 // all layers, and enter something like 10. They'll figure it out soon enough *unless* we
273 // enforce a max of 4 (and therefore reset it back to the default of 2), at which point it
274 // just looks buggy.
275 m_params.emplace_back( new PARAM<int>( "rules.min_resolved_spokes",
277
278 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_text_height",
280 pcbIUScale.mmToIU( 0.00 ), pcbIUScale.mmToIU( 100.0 ), pcbIUScale.MM_PER_IU ) );
281
282 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_text_thickness",
285
286 // Note: a clearance of -0.01 is a flag indicating we should use the legacy (pre-6.0) method
287 // based on the edge cut thicknesses.
288 m_params.emplace_back( new PARAM_SCALED<int>( "rules.min_copper_edge_clearance",
290 pcbIUScale.mmToIU( -0.01 ), pcbIUScale.mmToIU( 25.0 ), pcbIUScale.MM_PER_IU ) );
291
292 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "rule_severities",
293 [&]() -> nlohmann::json
294 {
295 nlohmann::json ret = {};
296
297 for( const RC_ITEM& item : DRC_ITEM::GetItemsWithSeverities() )
298 {
299 wxString name = item.GetSettingsKey();
300 int code = item.GetErrorCode();
301
302 if( name.IsEmpty() || m_DRCSeverities.count( code ) == 0 )
303 continue;
304
305 ret[std::string( name.ToUTF8() )] = SeverityToString( m_DRCSeverities[code] );
306 }
307
308 return ret;
309 },
310 [&]( const nlohmann::json& aJson )
311 {
312 if( !aJson.is_object() )
313 return;
314
315 for( const RC_ITEM& item : DRC_ITEM::GetItemsWithSeverities() )
316 {
317 wxString name = item.GetSettingsKey();
318 std::string key( name.ToUTF8() );
319
320 if( aJson.contains( key ) )
321 m_DRCSeverities[item.GetErrorCode()] = SeverityFromString( aJson[key] );
322 }
323 }, {} ) );
324
325 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "drc_exclusions",
326 [&]() -> nlohmann::json
327 {
328 nlohmann::json js = nlohmann::json::array();
329
330 for( const auto& entry : m_DrcExclusions )
331 js.push_back( entry );
332
333 return js;
334 },
335 [&]( const nlohmann::json& aObj )
336 {
337 m_DrcExclusions.clear();
338
339 if( !aObj.is_array() )
340 return;
341
342 for( const nlohmann::json& entry : aObj )
343 {
344 if( entry.empty() )
345 continue;
346
347 m_DrcExclusions.insert( entry.get<wxString>() );
348 }
349 },
350 {} ) );
351
352 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "track_widths",
353 [&]() -> nlohmann::json
354 {
355 nlohmann::json js = nlohmann::json::array();
356
357 for( const int& width : m_TrackWidthList )
358 js.push_back( pcbIUScale.IUTomm( width ) );
359
360 return js;
361 },
362 [&]( const nlohmann::json& aJson )
363 {
364 if( !aJson.is_array() )
365 return;
366
367 m_TrackWidthList.clear();
368
369 for( const nlohmann::json& entry : aJson )
370 {
371 if( entry.empty() )
372 continue;
373
374 m_TrackWidthList.emplace_back( pcbIUScale.mmToIU( entry.get<double>() ) );
375 }
376 },
377 {} ) );
378
379 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "via_dimensions",
380 [&]() -> nlohmann::json
381 {
382 nlohmann::json js = nlohmann::json::array();
383
384 for( const auto& via : m_ViasDimensionsList )
385 {
386 nlohmann::json entry = {};
387
388 entry["diameter"] = pcbIUScale.IUTomm( via.m_Diameter );
389 entry["drill"] = pcbIUScale.IUTomm( via.m_Drill );
390
391 js.push_back( entry );
392 }
393
394 return js;
395 },
396 [&]( const nlohmann::json& aObj )
397 {
398 if( !aObj.is_array() )
399 return;
400
401 m_ViasDimensionsList.clear();
402
403 for( const nlohmann::json& entry : aObj )
404 {
405 if( entry.empty() || !entry.is_object() )
406 continue;
407
408 if( !entry.contains( "diameter" ) || !entry.contains( "drill" ) )
409 continue;
410
411 int diameter = pcbIUScale.mmToIU( entry["diameter"].get<double>() );
412 int drill = pcbIUScale.mmToIU( entry["drill"].get<double>() );
413
414 m_ViasDimensionsList.emplace_back( VIA_DIMENSION( diameter, drill ) );
415 }
416 },
417 {} ) );
418
419 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "diff_pair_dimensions",
420 [&]() -> nlohmann::json
421 {
422 nlohmann::json js = nlohmann::json::array();
423
424 for( const auto& pair : m_DiffPairDimensionsList )
425 {
426 nlohmann::json entry = {};
427
428 entry["width"] = pcbIUScale.IUTomm( pair.m_Width );
429 entry["gap"] = pcbIUScale.IUTomm( pair.m_Gap );
430 entry["via_gap"] = pcbIUScale.IUTomm( pair.m_ViaGap );
431
432 js.push_back( entry );
433 }
434
435 return js;
436 },
437 [&]( const nlohmann::json& aObj )
438 {
439 if( !aObj.is_array() )
440 return;
441
443
444 for( const nlohmann::json& entry : aObj )
445 {
446 if( entry.empty() || !entry.is_object() )
447 continue;
448
449 if( !entry.contains( "width" ) || !entry.contains( "gap" )
450 || !entry.contains( "via_gap" ) )
451 continue;
452
453 int width = pcbIUScale.mmToIU( entry["width"].get<double>() );
454 int gap = pcbIUScale.mmToIU( entry["gap"].get<double>() );
455 int via_gap = pcbIUScale.mmToIU( entry["via_gap"].get<double>() );
456
457 m_DiffPairDimensionsList.emplace_back(
458 DIFF_PAIR_DIMENSION( width, gap, via_gap ) );
459 }
460 },
461 {} ) );
462
463 // Handle options for teardrops (targets and some others):
464 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "teardrop_options",
465 [&]() -> nlohmann::json
466 {
467 nlohmann::json js = nlohmann::json::array();
468 nlohmann::json entry = {};
469
470 entry["td_onviapad"] = m_TeardropParamsList.m_TargetViasPads;
471 entry["td_onpadsmd"] = m_TeardropParamsList.m_TargetPadsWithNoHole;
472 entry["td_ontrackend"] = m_TeardropParamsList.m_TargetTrack2Track;
473 entry["td_onroundshapesonly"] = m_TeardropParamsList.m_UseRoundShapesOnly;
474
475 js.push_back( entry );
476
477 return js;
478 },
479 [&]( const nlohmann::json& aObj )
480 {
481 if( !aObj.is_array() )
482 return;
483
484 for( const nlohmann::json& entry : aObj )
485 {
486 if( entry.empty() || !entry.is_object() )
487 continue;
488
489 if( entry.contains( "td_onviapad" ) )
490 m_TeardropParamsList.m_TargetViasPads = entry["td_onviapad"].get<bool>();
491
492 if( entry.contains( "td_onpadsmd" ) )
493 m_TeardropParamsList.m_TargetPadsWithNoHole = entry["td_onpadsmd"].get<bool>();
494
495 if( entry.contains( "td_ontrackend" ) )
496 m_TeardropParamsList.m_TargetTrack2Track = entry["td_ontrackend"].get<bool>();
497
498 if( entry.contains( "td_onroundshapesonly" ) )
499 m_TeardropParamsList.m_UseRoundShapesOnly = entry["td_onroundshapesonly"].get<bool>();
500
501 // Legacy settings
502 for( int ii = 0; ii < 3; ++ii )
503 {
505
506 if( entry.contains( "td_allow_use_two_tracks" ) )
507 td_prm->m_AllowUseTwoTracks = entry["td_allow_use_two_tracks"].get<bool>();
508
509 if( entry.contains( "td_curve_segcount" ) )
510 td_prm->m_CurveSegCount = entry["td_curve_segcount"].get<int>();
511
512 if( entry.contains( "td_on_pad_in_zone" ) )
513 td_prm->m_TdOnPadsInZones = entry["td_on_pad_in_zone"].get<bool>();
514 }
515 }
516 },
517 {} ) );
518
519 // Handle parameters (sizes, shape) for each type of teardrop:
520 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "teardrop_parameters",
521 [&]() -> nlohmann::json
522 {
523 nlohmann::json js = nlohmann::json::array();
524
525 for( size_t ii = 0; ii < m_TeardropParamsList.GetParametersCount(); ii++ )
526 {
527 nlohmann::json entry = {};
529
530 entry["td_target_name"] = GetTeardropTargetCanonicalName( (TARGET_TD)ii );
531 entry["td_maxlen"] = pcbIUScale.IUTomm( td_prm->m_TdMaxLen );
532 entry["td_maxheight"] = pcbIUScale.IUTomm( td_prm->m_TdMaxWidth );
533 entry["td_length_ratio"] = td_prm->m_BestLengthRatio;
534 entry["td_height_ratio"] = td_prm->m_BestWidthRatio;
535 entry["td_curve_segcount"] = td_prm->m_CurveSegCount;
536 entry["td_width_to_size_filter_ratio"] = td_prm->m_WidthtoSizeFilterRatio;
537 entry["td_allow_use_two_tracks"] = td_prm->m_AllowUseTwoTracks;
538 entry["td_curve_segcount"] = td_prm->m_CurveSegCount;
539 entry["td_on_pad_in_zone"] = td_prm->m_TdOnPadsInZones;
540
541 js.push_back( entry );
542 }
543
544 return js;
545 },
546 [&]( const nlohmann::json& aObj )
547 {
548 if( !aObj.is_array() )
549 return;
550
551 for( const nlohmann::json& entry : aObj )
552 {
553 if( entry.empty() || !entry.is_object() )
554 continue;
555
556 if( !entry.contains( "td_target_name" ) )
557 continue;
558
559 int idx = GetTeardropTargetTypeFromCanonicalName( entry["td_target_name"].get<std::string>() );
560
561 if( idx >= 0 && idx < 3 )
562 {
564
565 if( entry.contains( "td_maxlen" ) )
566 td_prm->m_TdMaxLen = pcbIUScale.mmToIU( entry["td_maxlen"].get<double>() );
567
568 if( entry.contains( "td_maxheight" ) )
569 td_prm->m_TdMaxWidth = pcbIUScale.mmToIU( entry["td_maxheight"].get<double>() );
570
571 if( entry.contains( "td_length_ratio" ) )
572 td_prm->m_BestLengthRatio = entry["td_length_ratio"].get<double>();
573
574 if( entry.contains( "td_height_ratio" ) )
575 td_prm->m_BestWidthRatio = entry["td_height_ratio"].get<double>();
576
577 if( entry.contains( "td_curve_segcount" ) )
578 td_prm->m_CurveSegCount = entry["td_curve_segcount"].get<int>();
579
580 if( entry.contains( "td_width_to_size_filter_ratio" ) )
581 td_prm->m_WidthtoSizeFilterRatio = entry["td_width_to_size_filter_ratio"].get<double>();
582
583 if( entry.contains( "td_allow_use_two_tracks" ) )
584 td_prm->m_AllowUseTwoTracks = entry["td_allow_use_two_tracks"].get<bool>();
585
586 if( entry.contains( "td_curve_segcount" ) )
587 td_prm->m_CurveSegCount = entry["td_curve_segcount"].get<int>();
588
589 if( entry.contains( "td_on_pad_in_zone" ) )
590 td_prm->m_TdOnPadsInZones = entry["td_on_pad_in_zone"].get<bool>();
591 }
592 }
593 },
594 {} ) );
595
596 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_line_width",
599
600 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_text_size_v",
603
604 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_text_size_h",
607
608 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_text_thickness",
611
612 m_params.emplace_back( new PARAM<bool>( "defaults.silk_text_italic",
613 &m_TextItalic[LAYER_CLASS_SILK], false ) );
614
615 m_params.emplace_back( new PARAM<bool>( "defaults.silk_text_upright",
616 &m_TextUpright[ LAYER_CLASS_SILK ], true ) );
617
618 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_line_width",
621
622 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_text_size_v",
625
626 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_text_size_h",
629
630 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_text_thickness",
633
634 m_params.emplace_back( new PARAM<bool>( "defaults.copper_text_italic",
635 &m_TextItalic[LAYER_CLASS_COPPER], false ) );
636
637 m_params.emplace_back( new PARAM<bool>( "defaults.copper_text_upright",
639
640 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.board_outline_line_width",
643
644 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.courtyard_line_width",
647
648 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_line_width",
651
652 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_text_size_v",
655
656 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_text_size_h",
659
660 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_text_thickness",
663
664 m_params.emplace_back( new PARAM<bool>( "defaults.fab_text_italic",
665 &m_TextItalic[LAYER_CLASS_FAB], false ) );
666
667 m_params.emplace_back( new PARAM<bool>( "defaults.fab_text_upright",
668 &m_TextUpright[LAYER_CLASS_FAB], true ) );
669
670 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_line_width",
673
674 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_text_size_v",
677
678 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_text_size_h",
681
682 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_text_thickness",
685
686 m_params.emplace_back( new PARAM<bool>( "defaults.other_text_italic",
687 &m_TextItalic[LAYER_CLASS_OTHERS], false ) );
688
689 m_params.emplace_back( new PARAM<bool>( "defaults.other_text_upright",
691
692 m_params.emplace_back( new PARAM_ENUM<DIM_UNITS_MODE>( "defaults.dimension_units",
693 &m_DimensionUnitsMode, DIM_UNITS_MODE::AUTOMATIC, DIM_UNITS_MODE::INCHES,
694 DIM_UNITS_MODE::AUTOMATIC ) );
695
696 m_params.emplace_back( new PARAM_ENUM<DIM_PRECISION>( "defaults.dimension_precision",
697 &m_DimensionPrecision, DIM_PRECISION::X_XXXX, DIM_PRECISION::X, DIM_PRECISION::V_VVVVV ) );
698
699 m_params.emplace_back( new PARAM_ENUM<DIM_UNITS_FORMAT>( "defaults.dimensions.units_format",
700 &m_DimensionUnitsFormat, DIM_UNITS_FORMAT::BARE_SUFFIX, DIM_UNITS_FORMAT::NO_SUFFIX,
701 DIM_UNITS_FORMAT::PAREN_SUFFIX ) );
702
703 m_params.emplace_back( new PARAM<bool>( "defaults.dimensions.suppress_zeroes",
704 &m_DimensionSuppressZeroes, false ) );
705
706 // NOTE: excluding DIM_TEXT_POSITION::MANUAL from the valid range here
707 m_params.emplace_back( new PARAM_ENUM<DIM_TEXT_POSITION>( "defaults.dimensions.text_position",
708 &m_DimensionTextPosition, DIM_TEXT_POSITION::OUTSIDE, DIM_TEXT_POSITION::OUTSIDE,
709 DIM_TEXT_POSITION::INLINE ) );
710
711 m_params.emplace_back( new PARAM<bool>( "defaults.dimensions.keep_text_aligned",
713
714 m_params.emplace_back( new PARAM<int>( "defaults.dimensions.arrow_length",
717
718 m_params.emplace_back( new PARAM<int>( "defaults.dimensions.extension_offset",
721
722 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.zones.min_clearance",
725
726 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "defaults.pads",
727 [&]() -> nlohmann::json
728 {
729 nlohmann::json ret =
730 {
731 { "width", pcbIUScale.IUTomm( m_Pad_Master->GetSize().x ) },
732 { "height", pcbIUScale.IUTomm( m_Pad_Master->GetSize().y ) },
733 { "drill", pcbIUScale.IUTomm( m_Pad_Master->GetDrillSize().x ) }
734 };
735
736 return ret;
737 },
738 [&]( const nlohmann::json& aJson )
739 {
740 if( aJson.contains( "width" ) && aJson.contains( "height" )
741 && aJson.contains( "drill" ) )
742 {
743 VECTOR2I sz;
744 sz.x = pcbIUScale.mmToIU( aJson["width"].get<double>() );
745 sz.y = pcbIUScale.mmToIU( aJson["height"].get<double>() );
746
747 m_Pad_Master->SetSize( sz );
748
749 int drill = pcbIUScale.mmToIU( aJson["drill"].get<double>() );
750
751 m_Pad_Master->SetDrillSize( VECTOR2I( drill, drill ) );
752 }
753 }, {} ) );
754
755 m_params.emplace_back( new PARAM_SCALED<int>( "rules.max_error",
757
758 m_params.emplace_back( new PARAM_SCALED<int>( "rules.solder_mask_to_copper_clearance",
761
762 m_params.emplace_back( new PARAM<bool>( "zones_allow_external_fillets",
763 &m_ZoneKeepExternalFillets, false ) );
764
766
767 registerMigration( 1, 2,
768 [&]() -> bool
769 {
770 // Schema 1 to 2: move mask and paste margin settings back to board.
771 // The parameters are removed, so we just have to manually load them here and
772 // they will get saved with the board
773 if( std::optional<double> optval = Get<double>( "rules.solder_mask_clearance" ) )
774 m_SolderMaskExpansion = static_cast<int>( *optval * pcbIUScale.IU_PER_MM );
775
776 if( std::optional<double> optval = Get<double>( "rules.solder_mask_min_width" ) )
777 m_SolderMaskMinWidth = static_cast<int>( *optval * pcbIUScale.IU_PER_MM );
778
779 if( std::optional<double> optval = Get<double>( "rules.solder_paste_clearance" ) )
780 m_SolderPasteMargin = static_cast<int>( *optval * pcbIUScale.IU_PER_MM );
781
782 if( std::optional<double> optval = Get<double>( "rules.solder_paste_margin_ratio" ) )
783 m_SolderPasteMarginRatio = *optval;
784
785 try
786 {
787 At( "rules" ).erase( "solder_mask_clearance" );
788 At( "rules" ).erase( "solder_mask_min_width" );
789 At( "rules" ).erase( "solder_paste_clearance" );
790 At( "rules" ).erase( "solder_paste_margin_ratio" );
791 }
792 catch( ... )
793 {}
794
795 return true;
796 } );
797}
798
799
801{
802 if( m_parent )
803 {
805 m_parent = nullptr;
806 }
807}
808
809
811 NESTED_SETTINGS( "board_design_settings", bdsSchemaVersion, aOther.m_parent,
812 aOther.m_path ),
813 m_Pad_Master( nullptr )
814{
815 initFromOther( aOther );
816}
817
818
820{
821 initFromOther( aOther );
822 return *this;
823}
824
825
827{
828 // Copy of NESTED_SETTINGS around is not allowed, so let's just update the params.
835 m_MinConn = aOther.m_MinConn;
851 m_MaxError = aOther.m_MaxError;
858
859 std::copy( std::begin( aOther.m_LineThickness ), std::end( aOther.m_LineThickness ),
860 std::begin( m_LineThickness ) );
861
862 std::copy( std::begin( aOther.m_TextSize ), std::end( aOther.m_TextSize ),
863 std::begin( m_TextSize ) );
864
865 std::copy( std::begin( aOther.m_TextThickness ), std::end( aOther.m_TextThickness ),
866 std::begin( m_TextThickness ) );
867
868 std::copy( std::begin( aOther.m_TextItalic ), std::end( aOther.m_TextItalic ),
869 std::begin( m_TextItalic ) );
870
871 std::copy( std::begin( aOther.m_TextUpright ), std::end( aOther.m_TextUpright ),
872 std::begin( m_TextUpright ) );
873
882
883 m_auxOrigin = aOther.m_auxOrigin;
884 m_gridOrigin = aOther.m_gridOrigin;
885 m_HasStackup = aOther.m_HasStackup;
887
900 m_stackup = aOther.m_stackup;
902 m_Pad_Master = std::make_unique<PAD>( *aOther.m_Pad_Master );
904}
905
906
908{
926 std::string units_ptr( "defaults.dimension_units" );
927 std::string precision_ptr( "defaults.dimension_precision" );
928
929 if( !( Contains( units_ptr ) && Contains( precision_ptr ) &&
930 At( units_ptr ).is_number_integer() &&
931 At( precision_ptr ).is_number_integer() ) )
932 {
933 // if either is missing or invalid, migration doesn't make sense
934 return true;
935 }
936
937 int units = *Get<int>( units_ptr );
938 int precision = *Get<int>( precision_ptr );
939
940 // The enum maps directly to precision if the units is mils
941 int extraDigits = 0;
942
943 switch( units )
944 {
945 case 0: extraDigits = 3; break;
946 case 2: extraDigits = 2; break;
947 default: break;
948 }
949
950 precision += extraDigits;
951
952 Set( precision_ptr, precision );
953
954 return true;
955}
956
957
958bool BOARD_DESIGN_SETTINGS::LoadFromFile( const wxString& aDirectory )
959{
960 bool ret = NESTED_SETTINGS::LoadFromFile( aDirectory );
961
962 // A number of things won't have been translated by the PROJECT_FILE migration because of
963 // descoped objects required to decode this data. So, it will be in the legacy.pcbnew
964 // section and needs to be pulled out here
965
966 PROJECT_FILE* project = dynamic_cast<PROJECT_FILE*>( GetParent() );
967
968 if( !project )
969 return ret;
970
971 bool migrated = false;
972
973 auto drcName =
974 []( int aCode ) -> std::string
975 {
976 std::shared_ptr<DRC_ITEM> item = DRC_ITEM::Create( aCode );
977 wxString name = item->GetSettingsKey();
978 return std::string( name.ToUTF8() );
979 };
980
981 const std::string rs = "rule_severities.";
982 const std::string no_courtyard_key = "legacy_no_courtyard_defined";
983 const std::string courtyard_overlap_key = "legacy_courtyards_overlap";
984
985 try
986 {
987 nlohmann::json& severities =
988 project->Internals()->at( "/board/design_settings/rule_severities"_json_pointer );
989
990 if( severities.contains( no_courtyard_key ) )
991 {
992 if( severities[no_courtyard_key].get<bool>() )
993 Set( rs + drcName( DRCE_MISSING_COURTYARD ), "error" );
994 else
995 Set( rs + drcName( DRCE_MISSING_COURTYARD ), "ignore" );
996
997 severities.erase( no_courtyard_key );
998 migrated = true;
999 }
1000
1001 if( severities.contains( courtyard_overlap_key ) )
1002 {
1003 if( severities[courtyard_overlap_key].get<bool>() )
1004 Set( rs + drcName( DRCE_OVERLAPPING_FOOTPRINTS ), "error" );
1005 else
1006 Set( rs + drcName( DRCE_OVERLAPPING_FOOTPRINTS ), "ignore" );
1007
1008 severities.erase( courtyard_overlap_key );
1009 migrated = true;
1010 }
1011 }
1012 catch( ... )
1013 {
1014 }
1015 if( Contains( "legacy" ) )
1016 {
1017 // This defaults to false for new boards, but version 5.1.x and prior kept the fillets
1018 // so we do the same for legacy boards.
1020
1021 project->At( "legacy" ).erase( "pcbnew" );
1022 }
1023
1024 // Now that we have everything, we need to load again
1025 if( migrated )
1026 Load();
1027
1028 return ret;
1029}
1030
1031
1033{
1034 return m_DRCSeverities[ aDRCErrorCode ];
1035}
1036
1037
1038bool BOARD_DESIGN_SETTINGS::Ignore( int aDRCErrorCode )
1039{
1040 return m_DRCSeverities[ aDRCErrorCode ] == RPT_SEVERITY_IGNORE;
1041}
1042
1043
1045{
1046 int biggest = 0;
1047 DRC_CONSTRAINT constraint;
1048
1049 if( m_DRCEngine )
1050 {
1051 m_DRCEngine->QueryWorstConstraint( CLEARANCE_CONSTRAINT, constraint );
1052 biggest = std::max( biggest, constraint.Value().Min() );
1053
1054 m_DRCEngine->QueryWorstConstraint( HOLE_CLEARANCE_CONSTRAINT, constraint );
1055 biggest = std::max( biggest, constraint.Value().Min() );
1056
1057 m_DRCEngine->QueryWorstConstraint( EDGE_CLEARANCE_CONSTRAINT, constraint );
1058 biggest = std::max( biggest, constraint.Value().Min() );
1059
1060 m_DRCEngine->QueryWorstConstraint( HOLE_TO_HOLE_CONSTRAINT, constraint );
1061 biggest = std::max( biggest, constraint.Value().Min() );
1062 }
1063
1064 return biggest;
1065}
1066
1067
1069{
1070 int clearance = m_NetSettings->m_DefaultNetClass->GetClearance();
1071
1072 for( const auto& [ name, netclass ] : m_NetSettings->m_NetClasses )
1073 clearance = std::min( clearance, netclass->GetClearance() );
1074
1075 return clearance;
1076}
1077
1078
1080{
1081 m_viaSizeIndex = std::min( aIndex, (unsigned) m_ViasDimensionsList.size() );
1082 m_useCustomTrackVia = false;
1083}
1084
1085
1087{
1090 else if( m_viaSizeIndex == 0 )
1091 return m_NetSettings->m_DefaultNetClass->GetViaDiameter();
1092 else
1093 return m_ViasDimensionsList[ m_viaSizeIndex ].m_Diameter;
1094}
1095
1096
1098{
1099 int drill;
1100
1102 drill = m_customViaSize.m_Drill;
1103 else if( m_viaSizeIndex == 0 )
1104 drill = m_NetSettings->m_DefaultNetClass->GetViaDrill();
1105 else
1106 drill = m_ViasDimensionsList[ m_viaSizeIndex ].m_Drill;
1107
1108 return drill > 0 ? drill : -1;
1109}
1110
1111
1113{
1114 m_trackWidthIndex = std::min( aIndex, (unsigned) m_TrackWidthList.size() );
1115 m_useCustomTrackVia = false;
1116}
1117
1118
1120{
1122 return m_customTrackWidth;
1123 else if( m_trackWidthIndex == 0 )
1124 return m_NetSettings->m_DefaultNetClass->GetTrackWidth();
1125 else
1127}
1128
1129
1131{
1132 if( !m_DiffPairDimensionsList.empty() )
1133 {
1134 m_diffPairIndex = std::min( aIndex,
1135 static_cast<unsigned>( m_DiffPairDimensionsList.size() ) - 1 );
1136 }
1137
1138 m_useCustomDiffPair = false;
1139}
1140
1141
1143{
1145 {
1147 }
1148 else if( m_diffPairIndex == 0 )
1149 {
1150 if( m_NetSettings->m_DefaultNetClass->HasDiffPairWidth() )
1151 return m_NetSettings->m_DefaultNetClass->GetDiffPairWidth();
1152 else
1153 return m_NetSettings->m_DefaultNetClass->GetTrackWidth();
1154 }
1155 else
1156 {
1158 }
1159}
1160
1161
1163{
1165 {
1166 return m_customDiffPair.m_Gap;
1167 }
1168 else if( m_diffPairIndex == 0 )
1169 {
1170 if( m_NetSettings->m_DefaultNetClass->HasDiffPairGap() )
1171 return m_NetSettings->m_DefaultNetClass->GetDiffPairGap();
1172 else
1173 return m_NetSettings->m_DefaultNetClass->GetClearance();
1174 }
1175 else
1176 {
1178 }
1179}
1180
1181
1183{
1185 {
1187 }
1188 else if( m_diffPairIndex == 0 )
1189 {
1190 if( m_NetSettings->m_DefaultNetClass->HasDiffPairViaGap() )
1191 return m_NetSettings->m_DefaultNetClass->GetDiffPairViaGap();
1192 else
1193 return GetCurrentDiffPairGap();
1194 }
1195 else
1196 {
1198 }
1199}
1200
1201
1203{
1204 m_copperLayerCount = aNewLayerCount;
1205
1206 // Update only enabled copper layers mask
1207 m_enabledLayers &= ~LSET::AllCuMask();
1208
1209 if( aNewLayerCount > 0 )
1210 m_enabledLayers |= LSET::AllCuMask( aNewLayerCount );
1211}
1212
1213
1215{
1216 // Back and front layers are always enabled.
1217 aMask.set( B_Cu ).set( F_Cu );
1218
1219 m_enabledLayers = aMask;
1220
1221 // update m_CopperLayerCount to ensure its consistency with m_EnabledLayers
1222 m_copperLayerCount = ( aMask & LSET::AllCuMask() ).count();
1223}
1224
1225
1226// Return the layer class index { silk, copper, edges & courtyards, fab, others } of the
1227// given layer.
1229{
1230 if( aLayer == F_SilkS || aLayer == B_SilkS )
1231 return LAYER_CLASS_SILK;
1232 else if( IsCopperLayer( aLayer ) )
1233 return LAYER_CLASS_COPPER;
1234 else if( aLayer == Edge_Cuts )
1235 return LAYER_CLASS_EDGES;
1236 else if( aLayer == F_CrtYd || aLayer == B_CrtYd )
1237 return LAYER_CLASS_COURTYARD;
1238 else if( aLayer == F_Fab || aLayer == B_Fab )
1239 return LAYER_CLASS_FAB;
1240 else
1241 return LAYER_CLASS_OTHERS;
1242}
1243
1244
1246{
1247 return pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_DRCEpsilon );
1248}
1249
1250
1252{
1253 return pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_HoleWallThickness );
1254}
1255
1256
1258{
1259 return m_LineThickness[ GetLayerClass( aLayer ) ];
1260}
1261
1262
1264{
1265 return m_TextSize[ GetLayerClass( aLayer ) ];
1266}
1267
1268
1270{
1271 return m_TextThickness[ GetLayerClass( aLayer ) ];
1272}
1273
1274
1276{
1277 return m_TextItalic[ GetLayerClass( aLayer ) ];
1278}
1279
1280
1282{
1283 return m_TextUpright[ GetLayerClass( aLayer ) ];
1284}
1285
1286
const char * name
Definition: DXF_plotter.cpp:56
constexpr int ARC_HIGH_DEF
Definition: base_units.h:121
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
const int bdsSchemaVersion
#define DEFAULT_MICROVIASMINDRILL
#define DEFAULT_SOLDERPASTE_CLEARANCE
#define DEFAULT_SOLDERPASTE_RATIO
#define DEFAULT_CUSTOMDPAIRWIDTH
#define DEFAULT_VIASMINSIZE
#define DEFAULT_TEXT_WIDTH
#define DEFAULT_COPPER_TEXT_WIDTH
#define DEFAULT_CUSTOMDPAIRGAP
#define DEFAULT_MINCLEARANCE
#define DEFAULT_HOLECLEARANCE
#define DEFAULT_SOLDERMASK_EXPANSION
@ LAYER_CLASS_OTHERS
@ LAYER_CLASS_FAB
@ LAYER_CLASS_COURTYARD
@ LAYER_CLASS_SILK
@ LAYER_CLASS_COPPER
@ LAYER_CLASS_EDGES
#define LEGACY_COPPEREDGECLEARANCE
#define DEFAULT_SOLDERMASK_MIN_WIDTH
#define DEFAULT_DIMENSION_EXTENSION_OFFSET
#define DEFAULT_COPPEREDGECLEARANCE
#define DEFAULT_DIMENSION_ARROW_LENGTH
#define DEFAULT_TRACKMINWIDTH
#define DEFAULT_MINTHROUGHDRILL
#define DEFAULT_SILK_TEXT_SIZE
#define DEFAULT_HOLETOHOLEMIN
#define DEFAULT_MINCONNECTION
#define DEFAULT_COPPER_LINE_WIDTH
#define DEFAULT_SILK_LINE_WIDTH
#define DEFAULT_SILKCLEARANCE
#define DEFAULT_MICROVIASMINSIZE
#define DEFAULT_SILK_TEXT_WIDTH
#define DEFAULT_TEXT_SIZE
#define DEFAULT_EDGE_WIDTH
#define DEFAULT_CUSTOMTRACKWIDTH
#define DEFAULT_CUSTOMDPAIRVIAGAP
#define DEFAULT_COPPER_TEXT_SIZE
#define DEFAULT_SOLDERMASK_TO_COPPER_CLEARANCE
#define DEFAULT_LINE_WIDTH
#define DEFAULT_COURTYARD_WIDTH
#define DEFAULT_BOARD_THICKNESS_MM
#define DEFAULT_MINRESOLVEDSPOKES
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Container for design settings for a BOARD object.
DIM_PRECISION m_DimensionPrecision
Number of digits after the decimal.
std::vector< TEXT_ITEM_INFO > m_DefaultFPTextItems
int GetHolePlatingThickness() const
Pad & via drills are finish size.
VIATYPE m_CurrentViaType
(VIA_BLIND_BURIED, VIA_THROUGH, VIA_MICROVIA)
void SetDiffPairIndex(unsigned aIndex)
std::shared_ptr< NET_SETTINGS > m_NetSettings
DIM_UNITS_FORMAT m_DimensionUnitsFormat
void initFromOther(const BOARD_DESIGN_SETTINGS &aOther)
bool GetTextUpright(PCB_LAYER_ID aLayer) const
std::map< int, SEVERITY > m_DRCSeverities
VECTOR2I m_gridOrigin
origin for grid offsets
int GetTextThickness(PCB_LAYER_ID aLayer) const
Return the default text thickness from the layer class for the given layer.
VECTOR2I m_auxOrigin
origin for plot exports
bool m_TextUpright[LAYER_CLASS_COUNT]
BOARD_DESIGN_SETTINGS(JSON_SETTINGS *aParent, const std::string &aPath)
bool GetTextItalic(PCB_LAYER_ID aLayer) const
wxString m_currentNetClassName
Current net class name used to display netclass info.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
void SetEnabledLayers(LSET aMask)
Change the bit-mask of enabled layers to aMask.
std::vector< DIFF_PAIR_DIMENSION > m_DiffPairDimensionsList
std::set< wxString > m_DrcExclusions
bool Ignore(int aDRCErrorCode)
Return true if the DRC error code's severity is SEVERITY_IGNORE.
std::unique_ptr< PAD > m_Pad_Master
void SetTrackWidthIndex(unsigned aIndex)
Set the current track width list index to aIndex.
TEARDROP_PARAMETERS_LIST m_TeardropParamsList
The parameters of teardrops for the different teardrop targets (via/pad, track end) 3 set of paramete...
void SetViaSizeIndex(unsigned aIndex)
Set the current via size list index to aIndex.
int GetLayerClass(PCB_LAYER_ID aLayer) const
int m_boardThickness
Board thickness for 3D viewer.
int m_copperLayerCount
Number of copper layers for this design.
bool LoadFromFile(const wxString &aDirectory="") override
Loads the backing file from disk and then calls Load()
int m_TextThickness[LAYER_CLASS_COUNT]
ZONE_SETTINGS m_defaultZoneSettings
The default settings that will be used for new zones.
SEVERITY GetSeverity(int aDRCErrorCode)
std::vector< int > m_TrackWidthList
DIFF_PAIR_DIMENSION m_customDiffPair
int m_LineThickness[LAYER_CLASS_COUNT]
VECTOR2I GetTextSize(PCB_LAYER_ID aLayer) const
Return the default text size from the layer class for the given layer.
int GetLineThickness(PCB_LAYER_ID aLayer) const
Return the default graphic segment thickness from the layer class for the given layer.
bool m_UseHeightForLengthCalcs
Enable inclusion of stackup height in track length measurements and length tuning.
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
LSET m_enabledLayers
Bit-mask for layer enabling.
bool m_TextItalic[LAYER_CLASS_COUNT]
void SetCopperLayerCount(int aNewLayerCount)
Set the copper layer count to aNewLayerCount.
DIM_TEXT_POSITION m_DimensionTextPosition
BOARD_STACKUP m_stackup
the description of layers stackup, for board fabrication only physical layers are in layers stackup.
DIM_UNITS_MODE m_DimensionUnitsMode
std::vector< VIA_DIMENSION > m_ViasDimensionsList
BOARD_DESIGN_SETTINGS & operator=(const BOARD_DESIGN_SETTINGS &aOther)
MINOPTMAX< int > & Value()
Definition: drc_rule.h:142
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
Definition: drc_item.h:122
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
Definition: drc_item.cpp:325
bool Contains(const std::string &aPath) const
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
void registerMigration(int aOldSchemaVersion, int aNewSchemaVersion, std::function< bool(void)> aMigrator)
Registers a migration from one schema version to another.
nlohmann::json & At(const std::string &aPath)
Wrappers for the underlying JSON API so that most consumers don't need json.hpp All of these function...
void ReleaseNestedSettings(NESTED_SETTINGS *aSettings)
Saves and frees a nested settings object, if it exists within this one.
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
bool m_resetParamsIfMissing
Whether or not to set parameters to their default value if missing from JSON on Load()
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:536
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:773
T Min() const
Definition: minoptmax.h:33
NESTED_SETTINGS is a JSON_SETTINGS that lives inside a JSON_SETTINGS.
JSON_SETTINGS * GetParent()
JSON_SETTINGS * m_parent
A pointer to the parent object to load and store from.
bool LoadFromFile(const wxString &aDirectory="") override
Loads the JSON document from the parent and then calls Load()
Stores an enum as an integer.
Definition: parameters.h:217
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:282
Represents a parameter that has a scaling factor between the value in the file and the value used int...
Definition: parameters.h:335
The backing store for a PROJECT, in JSON format.
Definition: project_file.h:65
A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
Definition: rc_item.h:75
bool m_TargetPadsWithNoHole
True to create teardrops for pads without holes (SMD and others.
bool m_TargetViasPads
True to create teardrops for vias and pads with holes.
bool m_UseRoundShapesOnly
True to create teardrops for round shapes only.
bool m_TargetTrack2Track
True to create teardrops at the end of a track connected to the end of another track having a differe...
TEARDROP_PARAMETERS * GetParameters(TARGET_TD aTdType)
TEARDROP_PARAMETARS is a helper class to handle parameters needed to build teardrops for a board thes...
int m_CurveSegCount
number of segments to build the curved sides of a teardrop area must be > 2.
double m_BestWidthRatio
The height of a teardrop as ratio between height and size of pad/via.
int m_TdMaxLen
max allowed length for teardrops in IU. <= 0 to disable
bool m_AllowUseTwoTracks
True to create teardrops using 2 track segments if the first in too small.
int m_TdMaxWidth
max allowed height for teardrops in IU. <= 0 to disable
double m_BestLengthRatio
The length of a teardrop as ratio between length and size of pad/via.
double m_WidthtoSizeFilterRatio
The ratio (H/D) between the via/pad size and the track width max value to create a teardrop 1....
bool m_TdOnPadsInZones
A filter to exclude pads inside zone fills.
@ DRCE_SILK_EDGE_CLEARANCE
Definition: drc_item.h:90
@ DRCE_PADSTACK
Definition: drc_item.h:59
@ DRCE_LIB_FOOTPRINT_ISSUES
Definition: drc_item.h:76
@ DRCE_OVERLAPPING_FOOTPRINTS
Definition: drc_item.h:61
@ DRCE_OVERLAPPING_SILK
Definition: drc_item.h:93
@ DRCE_MISSING_COURTYARD
Definition: drc_item.h:62
@ DRCE_ISOLATED_COPPER
Definition: drc_item.h:47
@ DRCE_COPPER_SLIVER
Definition: drc_item.h:84
@ DRCE_PTH_IN_COURTYARD
Definition: drc_item.h:65
@ DRCE_FIRST
Definition: drc_item.h:38
@ DRCE_DANGLING_VIA
Definition: drc_item.h:49
@ DRCE_FOOTPRINT_TYPE_MISMATCH
Definition: drc_item.h:75
@ DRCE_DUPLICATE_FOOTPRINT
Definition: drc_item.h:71
@ DRCE_DANGLING_TRACK
Definition: drc_item.h:50
@ DRCE_TEXT_HEIGHT
Definition: drc_item.h:91
@ DRCE_DRILLED_HOLES_COLOCATED
Definition: drc_item.h:52
@ DRCE_EXTRA_FOOTPRINT
Definition: drc_item.h:72
@ DRCE_SILK_CLEARANCE
Definition: drc_item.h:88
@ DRCE_LAST
Definition: drc_item.h:101
@ DRCE_LIB_FOOTPRINT_MISMATCH
Definition: drc_item.h:77
@ DRCE_NET_CONFLICT
Definition: drc_item.h:73
@ DRCE_MISSING_FOOTPRINT
Definition: drc_item.h:70
@ DRCE_TEXT_THICKNESS
Definition: drc_item.h:92
@ DRCE_NPTH_IN_COURTYARD
Definition: drc_item.h:66
@ DRCE_CONNECTION_WIDTH
Definition: drc_item.h:56
@ EDGE_CLEARANCE_CONSTRAINT
Definition: drc_rule.h:50
@ CLEARANCE_CONSTRAINT
Definition: drc_rule.h:47
@ HOLE_CLEARANCE_CONSTRAINT
Definition: drc_rule.h:48
@ HOLE_TO_HOLE_CONSTRAINT
Definition: drc_rule.h:49
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:831
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ F_CrtYd
Definition: layer_ids.h:117
@ Edge_Cuts
Definition: layer_ids.h:113
@ B_Cu
Definition: layer_ids.h:95
@ F_Fab
Definition: layer_ids.h:120
@ F_SilkS
Definition: layer_ids.h:104
@ B_CrtYd
Definition: layer_ids.h:116
@ B_SilkS
Definition: layer_ids.h:103
@ F_Cu
Definition: layer_ids.h:64
@ B_Fab
Definition: layer_ids.h:119
#define TEXTS_MAX_SIZE
Maximum text size in internal units (10 inches)
Definition: pcbnew.h:32
#define TEXTS_MIN_SIZE
Minimum text size in internal units (1 mil)
Definition: pcbnew.h:31
#define TEXTS_MAX_WIDTH
Maximum text width in internal units (10 inches)
Definition: pcbnew.h:33
SEVERITY
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_IGNORE
Container to handle a stock of specific differential pairs each with unique track width,...
constexpr double IUTomm(int iu) const
Definition: base_units.h:87
const double IU_PER_MM
Definition: base_units.h:77
const double MM_PER_IU
Definition: base_units.h:79
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
constexpr int mmToIU(double mm) const
Definition: base_units.h:89
Container to handle a stock of specific vias each with unique diameter and drill sizes in the BOARD c...
std::string GetTeardropTargetCanonicalName(TARGET_TD aTdType)
TARGET_TD GetTeardropTargetTypeFromCanonicalName(const std::string &aTargetName)
wxString SeverityToString(const SEVERITY &aSeverity)
Definition: ui_common.cpp:59
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588
#define ZONE_CLEARANCE_MM
Definition: zones.h:37