KiCad PCB EDA Suite
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
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
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 entry["td_allow_use_two_tracks"] = m_TeardropParamsList.m_AllowUseTwoTracks;
475 entry["td_curve_segcount"] = m_TeardropParamsList.m_CurveSegCount;
476 entry["td_on_pad_in_zone"] = m_TeardropParamsList.m_TdOnPadsInZones;
477
478 js.push_back( entry );
479
480 return js;
481 },
482 [&]( const nlohmann::json& aObj )
483 {
484 if( !aObj.is_array() )
485 return;
486
487 for( const nlohmann::json& entry : aObj )
488 {
489 if( entry.empty() || !entry.is_object() )
490 continue;
491
492 if( entry.contains( "td_onviapad" ) )
493 m_TeardropParamsList.m_TargetViasPads = entry["td_onviapad"].get<bool>();
494
495 if( entry.contains( "td_onpadsmd" ) )
496 m_TeardropParamsList.m_TargetPadsWithNoHole = entry["td_onpadsmd"].get<bool>();
497
498 if( entry.contains( "td_ontrackend" ) )
499 m_TeardropParamsList.m_TargetTrack2Track = entry["td_ontrackend"].get<bool>();
500
501 if( entry.contains( "td_onroundshapesonly" ) )
502 m_TeardropParamsList.m_UseRoundShapesOnly = entry["td_onroundshapesonly"].get<bool>();
503
504 if( entry.contains( "td_allow_use_two_tracks" ) )
505 m_TeardropParamsList.m_AllowUseTwoTracks = entry["td_allow_use_two_tracks"].get<bool>();
506
507 if( entry.contains( "td_curve_segcount" ) )
508 m_TeardropParamsList.m_CurveSegCount = entry["td_curve_segcount"].get<int>();
509
510 if( entry.contains( "td_on_pad_in_zone" ) )
511 m_TeardropParamsList.m_TdOnPadsInZones = entry["td_on_pad_in_zone"].get<bool>();
512 }
513 },
514 {} ) );
515
516 // Handle parameters (sizes, shape) for each type of teardrop:
517 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "teardrop_parameters",
518 [&]() -> nlohmann::json
519 {
520 nlohmann::json js = nlohmann::json::array();
521
522 for( size_t ii = 0; ii < m_TeardropParamsList.GetParametersCount(); ii++ )
523 {
524 nlohmann::json entry = {};
526
527 entry["td_target_name"] = GetTeardropTargetCanonicalName( (TARGET_TD)ii );
528 entry["td_maxlen"] = pcbIUScale.IUTomm( td_prm->m_TdMaxLen );
529 entry["td_maxheight"] = pcbIUScale.IUTomm( td_prm->m_TdMaxHeight );
530 entry["td_length_ratio"] = td_prm->m_LengthRatio;
531 entry["td_height_ratio"] = td_prm->m_HeightRatio;
532 entry["td_curve_segcount"] = td_prm->m_CurveSegCount;
533 entry["td_width_to_size_filter_ratio"] = td_prm->m_WidthtoSizeFilterRatio;
534
535 js.push_back( entry );
536 }
537
538 return js;
539 },
540 [&]( const nlohmann::json& aObj )
541 {
542 if( !aObj.is_array() )
543 return;
544
545 for( const nlohmann::json& entry : aObj )
546 {
547 if( entry.empty() || !entry.is_object() )
548 continue;
549
550 if( !entry.contains( "td_target_name" ) )
551 continue;
552
553 int idx = GetTeardropTargetTypeFromCanonicalName( entry["td_target_name"].get<std::string>() );
554
555 if( idx >= 0 && idx < 3 )
556 {
558
559 if( entry.contains( "td_maxlen" ) )
560 td_prm->m_TdMaxLen = pcbIUScale.mmToIU( entry["td_maxlen"].get<double>() );
561
562 if( entry.contains( "td_maxheight" ) )
563 td_prm->m_TdMaxHeight = pcbIUScale.mmToIU( entry["td_maxheight"].get<double>() );
564
565 if( entry.contains( "td_length_ratio" ) )
566 td_prm->m_LengthRatio = entry["td_length_ratio"].get<double>();
567
568 if( entry.contains( "td_height_ratio" ) )
569 td_prm->m_HeightRatio = entry["td_height_ratio"].get<double>();
570
571 if( entry.contains( "td_curve_segcount" ) )
572 td_prm->m_CurveSegCount = entry["td_curve_segcount"].get<int>();
573
574 if( entry.contains( "td_width_to_size_filter_ratio" ) )
575 td_prm->m_WidthtoSizeFilterRatio = entry["td_width_to_size_filter_ratio"].get<double>();
576 }
577 }
578 },
579 {} ) );
580
581 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_line_width",
584
585 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_text_size_v",
588
589 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_text_size_h",
592
593 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.silk_text_thickness",
596
597 m_params.emplace_back( new PARAM<bool>( "defaults.silk_text_italic",
598 &m_TextItalic[LAYER_CLASS_SILK], false ) );
599
600 m_params.emplace_back( new PARAM<bool>( "defaults.silk_text_upright",
601 &m_TextUpright[ LAYER_CLASS_SILK ], true ) );
602
603 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_line_width",
606
607 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_text_size_v",
610
611 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_text_size_h",
614
615 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.copper_text_thickness",
618
619 m_params.emplace_back( new PARAM<bool>( "defaults.copper_text_italic",
620 &m_TextItalic[LAYER_CLASS_COPPER], false ) );
621
622 m_params.emplace_back( new PARAM<bool>( "defaults.copper_text_upright",
624
625 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.board_outline_line_width",
628
629 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.courtyard_line_width",
632
633 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_line_width",
636
637 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_text_size_v",
640
641 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_text_size_h",
644
645 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.fab_text_thickness",
648
649 m_params.emplace_back( new PARAM<bool>( "defaults.fab_text_italic",
650 &m_TextItalic[LAYER_CLASS_FAB], false ) );
651
652 m_params.emplace_back( new PARAM<bool>( "defaults.fab_text_upright",
653 &m_TextUpright[LAYER_CLASS_FAB], true ) );
654
655 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_line_width",
658
659 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_text_size_v",
662
663 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_text_size_h",
666
667 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.other_text_thickness",
670
671 m_params.emplace_back( new PARAM<bool>( "defaults.other_text_italic",
672 &m_TextItalic[LAYER_CLASS_OTHERS], false ) );
673
674 m_params.emplace_back( new PARAM<bool>( "defaults.other_text_upright",
676
677 m_params.emplace_back( new PARAM_ENUM<DIM_UNITS_MODE>( "defaults.dimension_units",
680
681 m_params.emplace_back( new PARAM<int>( "defaults.dimension_precision",
682 &m_DimensionPrecision, 4, 0, 5 ) );
683
684 m_params.emplace_back( new PARAM_ENUM<DIM_UNITS_FORMAT>( "defaults.dimensions.units_format",
687
688 m_params.emplace_back( new PARAM<bool>( "defaults.dimensions.suppress_zeroes",
689 &m_DimensionSuppressZeroes, false ) );
690
691 // NOTE: excluding DIM_TEXT_POSITION::MANUAL from the valid range here
692 m_params.emplace_back( new PARAM_ENUM<DIM_TEXT_POSITION>( "defaults.dimensions.text_position",
695
696 m_params.emplace_back( new PARAM<bool>( "defaults.dimensions.keep_text_aligned",
698
699 m_params.emplace_back( new PARAM<int>( "defaults.dimensions.arrow_length",
702
703 m_params.emplace_back( new PARAM<int>( "defaults.dimensions.extension_offset",
706
707 m_params.emplace_back( new PARAM_SCALED<int>( "defaults.zones.min_clearance",
710
711 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "defaults.pads",
712 [&]() -> nlohmann::json
713 {
714 nlohmann::json ret =
715 {
716 { "width", pcbIUScale.IUTomm( m_Pad_Master->GetSize().x ) },
717 { "height", pcbIUScale.IUTomm( m_Pad_Master->GetSize().y ) },
718 { "drill", pcbIUScale.IUTomm( m_Pad_Master->GetDrillSize().x ) }
719 };
720
721 return ret;
722 },
723 [&]( const nlohmann::json& aJson )
724 {
725 if( aJson.contains( "width" ) && aJson.contains( "height" )
726 && aJson.contains( "drill" ) )
727 {
728 wxSize sz;
729 sz.SetWidth( pcbIUScale.mmToIU( aJson["width"].get<double>() ) );
730 sz.SetHeight( pcbIUScale.mmToIU( aJson["height"].get<double>() ) );
731
732 m_Pad_Master->SetSize( sz );
733
734 int drill = pcbIUScale.mmToIU( aJson["drill"].get<double>() );
735
736 m_Pad_Master->SetDrillSize( wxSize( drill, drill ) );
737 }
738 }, {} ) );
739
740 m_params.emplace_back( new PARAM_SCALED<int>( "rules.max_error",
742
743 m_params.emplace_back( new PARAM_SCALED<int>( "rules.solder_mask_to_copper_clearance",
746
747 m_params.emplace_back( new PARAM<bool>( "zones_allow_external_fillets",
748 &m_ZoneKeepExternalFillets, false ) );
749
751
752 registerMigration( 1, 2,
753 [&]() -> bool
754 {
755 // Schema 1 to 2: move mask and paste margin settings back to board.
756 // The parameters are removed, so we just have to manually load them here and
757 // they will get saved with the board
758 if( std::optional<double> optval = Get<double>( "rules.solder_mask_clearance" ) )
759 m_SolderMaskExpansion = static_cast<int>( *optval * pcbIUScale.IU_PER_MM );
760
761 if( std::optional<double> optval = Get<double>( "rules.solder_mask_min_width" ) )
762 m_SolderMaskMinWidth = static_cast<int>( *optval * pcbIUScale.IU_PER_MM );
763
764 if( std::optional<double> optval = Get<double>( "rules.solder_paste_clearance" ) )
765 m_SolderPasteMargin = static_cast<int>( *optval * pcbIUScale.IU_PER_MM );
766
767 if( std::optional<double> optval = Get<double>( "rules.solder_paste_margin_ratio" ) )
768 m_SolderPasteMarginRatio = *optval;
769
770 try
771 {
772 At( "rules" ).erase( "solder_mask_clearance" );
773 At( "rules" ).erase( "solder_mask_min_width" );
774 At( "rules" ).erase( "solder_paste_clearance" );
775 At( "rules" ).erase( "solder_paste_margin_ratio" );
776 }
777 catch( ... )
778 {}
779
780 return true;
781 } );
782}
783
784
786{
787 if( m_parent )
788 {
790 m_parent = nullptr;
791 }
792}
793
794
796 NESTED_SETTINGS( "board_design_settings", bdsSchemaVersion, aOther.m_parent,
797 aOther.m_path ),
798 m_Pad_Master( nullptr )
799{
800 initFromOther( aOther );
801}
802
803
805{
806 initFromOther( aOther );
807 return *this;
808}
809
810
812{
813 // Copy of NESTED_SETTINGS around is not allowed, so let's just update the params.
820 m_MinConn = aOther.m_MinConn;
836 m_MaxError = aOther.m_MaxError;
843
844 std::copy( std::begin( aOther.m_LineThickness ), std::end( aOther.m_LineThickness ),
845 std::begin( m_LineThickness ) );
846
847 std::copy( std::begin( aOther.m_TextSize ), std::end( aOther.m_TextSize ),
848 std::begin( m_TextSize ) );
849
850 std::copy( std::begin( aOther.m_TextThickness ), std::end( aOther.m_TextThickness ),
851 std::begin( m_TextThickness ) );
852
853 std::copy( std::begin( aOther.m_TextItalic ), std::end( aOther.m_TextItalic ),
854 std::begin( m_TextItalic ) );
855
856 std::copy( std::begin( aOther.m_TextUpright ), std::end( aOther.m_TextUpright ),
857 std::begin( m_TextUpright ) );
858
867
868 m_auxOrigin = aOther.m_auxOrigin;
869 m_gridOrigin = aOther.m_gridOrigin;
870 m_HasStackup = aOther.m_HasStackup;
872
885 m_stackup = aOther.m_stackup;
887 m_Pad_Master = std::make_unique<PAD>( *aOther.m_Pad_Master );
889}
890
891
893{
911 std::string units_ptr( "defaults.dimension_units" );
912 std::string precision_ptr( "defaults.dimension_precision" );
913
914 if( !( Contains( units_ptr ) && Contains( precision_ptr ) &&
915 At( units_ptr ).is_number_integer() &&
916 At( precision_ptr ).is_number_integer() ) )
917 {
918 // if either is missing or invalid, migration doesn't make sense
919 return true;
920 }
921
922 int units = *Get<int>( units_ptr );
923 int precision = *Get<int>( precision_ptr );
924
925 // The enum maps directly to precision if the units is mils
926 int extraDigits = 0;
927
928 switch( units )
929 {
930 case 0: extraDigits = 3; break;
931 case 2: extraDigits = 2; break;
932 default: break;
933 }
934
935 precision += extraDigits;
936
937 Set( precision_ptr, precision );
938
939 return true;
940}
941
942
943bool BOARD_DESIGN_SETTINGS::LoadFromFile( const wxString& aDirectory )
944{
945 bool ret = NESTED_SETTINGS::LoadFromFile( aDirectory );
946
947 // A number of things won't have been translated by the PROJECT_FILE migration because of
948 // descoped objects required to decode this data. So, it will be in the legacy.pcbnew
949 // section and needs to be pulled out here
950
951 PROJECT_FILE* project = dynamic_cast<PROJECT_FILE*>( GetParent() );
952
953 if( !project )
954 return ret;
955
956 bool migrated = false;
957
958 auto drcName =
959 []( int aCode ) -> std::string
960 {
961 std::shared_ptr<DRC_ITEM> item = DRC_ITEM::Create( aCode );
962 wxString name = item->GetSettingsKey();
963 return std::string( name.ToUTF8() );
964 };
965
966 std::string bp = "board.design_settings.rule_severities.";
967 std::string rs = "rule_severities.";
968
969 if( std::optional<bool> v = project->Get<bool>( bp + "legacy_no_courtyard_defined" ) )
970 {
971 if( *v )
972 Set( rs + drcName( DRCE_MISSING_COURTYARD ), "error" );
973 else
974 Set( rs + drcName( DRCE_MISSING_COURTYARD ), "ignore" );
975
976 project->Internals()->erase( m_internals->PointerFromString( bp + "legacy_no_courtyard_defined" ) );
977 migrated = true;
978 }
979
980 if( std::optional<bool> v = project->Get<bool>( bp + "legacy_courtyards_overlap" ) )
981 {
982 if( *v )
983 Set( rs + drcName( DRCE_OVERLAPPING_FOOTPRINTS ), "error" );
984 else
985 Set( rs + drcName( DRCE_OVERLAPPING_FOOTPRINTS ), "ignore" );
986
987 project->Internals()->erase( JSON_SETTINGS_INTERNALS::PointerFromString( bp + "legacy_courtyards_overlap" ) );
988 migrated = true;
989 }
990
991 if( Contains( "legacy" ) )
992 {
993 // This defaults to false for new boards, but version 5.1.x and prior kept the fillets
994 // so we do the same for legacy boards.
996
997 project->At( "legacy" ).erase( "pcbnew" );
998 }
999
1000 // Now that we have everything, we need to load again
1001 if( migrated )
1002 Load();
1003
1004 return ret;
1005}
1006
1007
1009{
1010 return m_DRCSeverities[ aDRCErrorCode ];
1011}
1012
1013
1014bool BOARD_DESIGN_SETTINGS::Ignore( int aDRCErrorCode )
1015{
1016 return m_DRCSeverities[ aDRCErrorCode ] == RPT_SEVERITY_IGNORE;
1017}
1018
1019
1021{
1022 int biggest = 0;
1023 DRC_CONSTRAINT constraint;
1024
1025 if( m_DRCEngine )
1026 {
1027 m_DRCEngine->QueryWorstConstraint( CLEARANCE_CONSTRAINT, constraint );
1028 biggest = std::max( biggest, constraint.Value().Min() );
1029
1030 m_DRCEngine->QueryWorstConstraint( HOLE_CLEARANCE_CONSTRAINT, constraint );
1031 biggest = std::max( biggest, constraint.Value().Min() );
1032
1033 m_DRCEngine->QueryWorstConstraint( EDGE_CLEARANCE_CONSTRAINT, constraint );
1034 biggest = std::max( biggest, constraint.Value().Min() );
1035
1036 m_DRCEngine->QueryWorstConstraint( HOLE_TO_HOLE_CONSTRAINT, constraint );
1037 biggest = std::max( biggest, constraint.Value().Min() );
1038 }
1039
1040 return biggest;
1041}
1042
1043
1045{
1046 int clearance = m_NetSettings->m_DefaultNetClass->GetClearance();
1047
1048 for( const auto& [ name, netclass ] : m_NetSettings->m_NetClasses )
1049 clearance = std::min( clearance, netclass->GetClearance() );
1050
1051 return clearance;
1052}
1053
1054
1056{
1057 m_viaSizeIndex = std::min( aIndex, (unsigned) m_ViasDimensionsList.size() );
1058 m_useCustomTrackVia = false;
1059}
1060
1061
1063{
1066 else if( m_viaSizeIndex == 0 )
1067 return m_NetSettings->m_DefaultNetClass->GetViaDiameter();
1068 else
1069 return m_ViasDimensionsList[ m_viaSizeIndex ].m_Diameter;
1070}
1071
1072
1074{
1075 int drill;
1076
1078 drill = m_customViaSize.m_Drill;
1079 else if( m_viaSizeIndex == 0 )
1080 drill = m_NetSettings->m_DefaultNetClass->GetViaDrill();
1081 else
1082 drill = m_ViasDimensionsList[ m_viaSizeIndex ].m_Drill;
1083
1084 return drill > 0 ? drill : -1;
1085}
1086
1087
1089{
1090 m_trackWidthIndex = std::min( aIndex, (unsigned) m_TrackWidthList.size() );
1091 m_useCustomTrackVia = false;
1092}
1093
1094
1096{
1098 return m_customTrackWidth;
1099 else if( m_trackWidthIndex == 0 )
1100 return m_NetSettings->m_DefaultNetClass->GetTrackWidth();
1101 else
1103}
1104
1105
1107{
1108 if( !m_DiffPairDimensionsList.empty() )
1109 {
1110 m_diffPairIndex = std::min( aIndex,
1111 static_cast<unsigned>( m_DiffPairDimensionsList.size() ) - 1 );
1112 }
1113
1114 m_useCustomDiffPair = false;
1115}
1116
1117
1119{
1121 {
1123 }
1124 else if( m_diffPairIndex == 0 )
1125 {
1126 if( m_NetSettings->m_DefaultNetClass->HasDiffPairWidth() )
1127 return m_NetSettings->m_DefaultNetClass->GetDiffPairWidth();
1128 else
1129 return m_NetSettings->m_DefaultNetClass->GetTrackWidth();
1130 }
1131 else
1132 {
1134 }
1135}
1136
1137
1139{
1141 {
1142 return m_customDiffPair.m_Gap;
1143 }
1144 else if( m_diffPairIndex == 0 )
1145 {
1146 if( m_NetSettings->m_DefaultNetClass->HasDiffPairGap() )
1147 return m_NetSettings->m_DefaultNetClass->GetDiffPairGap();
1148 else
1149 return m_NetSettings->m_DefaultNetClass->GetClearance();
1150 }
1151 else
1152 {
1154 }
1155}
1156
1157
1159{
1161 {
1163 }
1164 else if( m_diffPairIndex == 0 )
1165 {
1166 if( m_NetSettings->m_DefaultNetClass->HasDiffPairViaGap() )
1167 return m_NetSettings->m_DefaultNetClass->GetDiffPairViaGap();
1168 else
1169 return GetCurrentDiffPairGap();
1170 }
1171 else
1172 {
1174 }
1175}
1176
1177
1179{
1180 m_copperLayerCount = aNewLayerCount;
1181
1182 // Update only enabled copper layers mask
1183 m_enabledLayers &= ~LSET::AllCuMask();
1184
1185 if( aNewLayerCount > 0 )
1186 m_enabledLayers |= LSET::AllCuMask( aNewLayerCount );
1187}
1188
1189
1191{
1192 // Back and front layers are always enabled.
1193 aMask.set( B_Cu ).set( F_Cu );
1194
1195 m_enabledLayers = aMask;
1196
1197 // update m_CopperLayerCount to ensure its consistency with m_EnabledLayers
1198 m_copperLayerCount = ( aMask & LSET::AllCuMask() ).count();
1199}
1200
1201
1202// Return the layer class index { silk, copper, edges & courtyards, fab, others } of the
1203// given layer.
1205{
1206 if( aLayer == F_SilkS || aLayer == B_SilkS )
1207 return LAYER_CLASS_SILK;
1208 else if( IsCopperLayer( aLayer ) )
1209 return LAYER_CLASS_COPPER;
1210 else if( aLayer == Edge_Cuts )
1211 return LAYER_CLASS_EDGES;
1212 else if( aLayer == F_CrtYd || aLayer == B_CrtYd )
1213 return LAYER_CLASS_COURTYARD;
1214 else if( aLayer == F_Fab || aLayer == B_Fab )
1215 return LAYER_CLASS_FAB;
1216 else
1217 return LAYER_CLASS_OTHERS;
1218}
1219
1220
1222{
1223 return pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_DRCEpsilon );
1224}
1225
1226
1228{
1229 return pcbIUScale.mmToIU( ADVANCED_CFG::GetCfg().m_HoleWallThickness );
1230}
1231
1232
1234{
1235 return m_LineThickness[ GetLayerClass( aLayer ) ];
1236}
1237
1238
1240{
1241 return m_TextSize[ GetLayerClass( aLayer ) ];
1242}
1243
1244
1246{
1247 return m_TextThickness[ GetLayerClass( aLayer ) ];
1248}
1249
1250
1252{
1253 return m_TextItalic[ GetLayerClass( aLayer ) ];
1254}
1255
1256
1258{
1259 return m_TextUpright[ GetLayerClass( aLayer ) ];
1260}
1261
1262
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
#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
@ LAYER_CLASS_OTHERS
@ LAYER_CLASS_FAB
@ LAYER_CLASS_COURTYARD
@ LAYER_CLASS_SILK
@ LAYER_CLASS_COPPER
@ LAYER_CLASS_EDGES
#define DEFAULT_SILK_TEXT_WIDTH
#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.
wxSize GetTextSize(PCB_LAYER_ID aLayer) const
Return the default text size from the layer class for the given layer.
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 m_DimensionPrecision
Number of digits after the decimal.
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]
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.
wxSize 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:140
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
static nlohmann::json::json_pointer PointerFromString(std::string aPath)
Builds a JSON pointer based on a given string.
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.
std::unique_ptr< JSON_SETTINGS_INTERNALS > m_internals
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:530
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
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.
int m_CurveSegCount
the number of segments to apprximate a curve (Bezier curve) in a teardrop Must be > 2,...
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...
bool m_TdOnPadsInZones
Pads inside a zone of the same net do not have teardrop added.
bool m_AllowUseTwoTracks
True to create teardrops using 2 track segments if the first in too small.
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_HeightRatio
The height of a teardrop as ratio between height and size of pad/via.
int m_TdMaxHeight
max allowed height for teardrops in IU. <= 0 to disable
int m_TdMaxLen
the type of target for these parameters
double m_WidthtoSizeFilterRatio
The ratio (H/D) between the via/pad size and the track width max value to create a teardrop 1....
double m_LengthRatio
The length of a teardrop as ratio between length and size of pad/via.
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
@ 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:49
@ CLEARANCE_CONSTRAINT
Definition: drc_rule.h:46
@ HOLE_CLEARANCE_CONSTRAINT
Definition: drc_rule.h:47
@ HOLE_TO_HOLE_CONSTRAINT
Definition: drc_rule.h:48
nlohmann::json json
Definition: gerbview.cpp:44
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:823
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
@ OUTSIDE
Text appears outside the dimension line (default)
@ INLINE
Text appears in line with the dimension line.
#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
#define ZONE_CLEARANCE_MIL
Definition: zones.h:37