KiCad PCB EDA Suite
class_board_stackup.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) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 #include "class_board_stackup.h"
23 #include <convert_to_biu.h>
24 #include <base_units.h>
26 #include <board_design_settings.h>
27 #include <class_board.h>
28 #include <i18n_utility.h> // For _HKI definition
30 
31 
33 {
34  DIELECTRIC_PRMS item_prms;
35  m_DielectricPrmsList.emplace_back( item_prms );
37  m_Type = aType;
39  SetEnabled( true );
40 
41  // Initialize parameters to a usual value for allowed types:
42  switch( m_Type )
43  {
47  break;
48 
50  m_TypeName = KEY_CORE; // or prepreg
51  SetMaterial( "FR4" ); // or other dielectric name
52  SetLossTangent( 0.02 ); // for FR4
53  SetEpsilonR( 4.5 ); // for FR4
54  break;
55 
57  m_TypeName = "solderpaste";
58  break;
59 
61  m_TypeName = "soldermask";
62  m_Color = "Green";
63  SetMaterial( NotSpecifiedPrm() ); // or other solder mask material name
66  break;
67 
69  m_TypeName = "silkscreen";
71  SetMaterial( NotSpecifiedPrm() ); // or other silkscreen material name
73  break;
74 
76  break;
77  }
78 }
79 
80 
82 {
83  m_LayerId = aOther.m_LayerId;
85  m_Type = aOther.m_Type;
86  m_enabled = aOther.m_enabled;
88  m_TypeName = aOther.m_TypeName;
89  m_LayerName = aOther.m_LayerName;
90  m_Color = aOther.GetColor();
91 }
92 
93 
94 void BOARD_STACKUP_ITEM::AddDielectricPrms( int aDielectricPrmsIdx )
95 {
96  // add a DIELECTRIC_PRMS item to m_DielectricPrmsList
97  DIELECTRIC_PRMS new_prms;
98 
99  m_DielectricPrmsList.emplace( m_DielectricPrmsList.begin() + aDielectricPrmsIdx,
100  new_prms );
101 }
102 
103 
104 void BOARD_STACKUP_ITEM::RemoveDielectricPrms( int aDielectricPrmsIdx )
105 {
106  // Remove a DIELECTRIC_PRMS item from m_DielectricPrmsList if possible
107 
108  if( GetSublayersCount() < 2 || aDielectricPrmsIdx < 0 || aDielectricPrmsIdx >= GetSublayersCount() )
109  return;
110 
111  m_DielectricPrmsList.erase( m_DielectricPrmsList.begin() + aDielectricPrmsIdx );
112 }
113 
114 
115 
117 {
118  // A reasonable thickness for copper layers:
119  return Millimeter2iu( 0.035 );
120 }
121 
122 
124 {
125  // A reasonable thickness for solder mask:
126  return Millimeter2iu( 0.01 );
127 }
128 
129 // Getters:
130 int BOARD_STACKUP_ITEM::GetThickness( int aDielectricSubLayer ) const
131 {
132  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
133 
134  return m_DielectricPrmsList[aDielectricSubLayer].m_Thickness;
135 }
136 
137 
138 double BOARD_STACKUP_ITEM::GetLossTangent( int aDielectricSubLayer ) const
139 {
140  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
141 
142  return m_DielectricPrmsList[aDielectricSubLayer].m_LossTangent;
143 }
144 
145 
146 double BOARD_STACKUP_ITEM::GetEpsilonR( int aDielectricSubLayer ) const
147 {
148  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
149 
150  return m_DielectricPrmsList[aDielectricSubLayer].m_EpsilonR;
151 }
152 
153 
154 bool BOARD_STACKUP_ITEM::IsThicknessLocked( int aDielectricSubLayer ) const
155 {
156  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
157 
158  return m_DielectricPrmsList[aDielectricSubLayer].m_ThicknessLocked;
159 }
160 
161 
162 wxString BOARD_STACKUP_ITEM::GetMaterial( int aDielectricSubLayer ) const
163 {
164  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
165 
166  return m_DielectricPrmsList[aDielectricSubLayer].m_Material;
167 }
168 
169 
170 // Setters:
171 void BOARD_STACKUP_ITEM::SetThickness( int aThickness, int aDielectricSubLayer )
172 {
173  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
174 
175  if( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() )
176  m_DielectricPrmsList[aDielectricSubLayer].m_Thickness = aThickness;
177 }
178 
179 
180 void BOARD_STACKUP_ITEM::SetLossTangent( double aTg, int aDielectricSubLayer )
181 {
182  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
183 
184  if( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() )
185  m_DielectricPrmsList[aDielectricSubLayer].m_LossTangent = aTg;
186 }
187 
188 
189 void BOARD_STACKUP_ITEM::SetEpsilonR( double aEpsilon, int aDielectricSubLayer )
190 {
191  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
192 
193  if( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() )
194  m_DielectricPrmsList[aDielectricSubLayer].m_EpsilonR = aEpsilon;
195 }
196 
197 
198 void BOARD_STACKUP_ITEM::SetThicknessLocked( bool aLocked, int aDielectricSubLayer )
199 {
200  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
201 
202  if( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() )
203  m_DielectricPrmsList[aDielectricSubLayer].m_ThicknessLocked = aLocked;
204 }
205 
206 
207 void BOARD_STACKUP_ITEM::SetMaterial( const wxString& aName, int aDielectricSubLayer )
208 {
209  wxASSERT( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() );
210 
211  if( aDielectricSubLayer >= 0 && aDielectricSubLayer < GetSublayersCount() )
212  m_DielectricPrmsList[aDielectricSubLayer].m_Material = aName;
213 }
214 
215 
217 {
220  //|| m_Type == BS_ITEM_TYPE_SILKSCREEN
221  ;
222 };
223 
224 
226 {
229 };
230 
231 
232 bool BOARD_STACKUP_ITEM::HasMaterialValue( int aDielectricSubLayer ) const
233 {
234  // return true if the material is specified
235  return IsMaterialEditable() && IsPrmSpecified( GetMaterial( aDielectricSubLayer ) );
236 }
237 
238 
240 {
241  // The material is editable only for dielectric
242  return m_Type == BS_ITEM_TYPE_DIELECTRIC ||
245 }
246 
247 
249 {
251 }
252 
253 
255 {
256  switch( m_Type )
257  {
258  case BS_ITEM_TYPE_COPPER:
259  return true;
260 
262  return true;
263 
265  return true;
266 
268  return false;
269 
271  return false;
272 
273  default:
274  break;
275  }
276 
277  return false;
278 }
279 
280 
281 wxString BOARD_STACKUP_ITEM::FormatEpsilonR( int aDielectricSubLayer ) const
282 {
283  // return a wxString to print/display Epsilon R
284  wxString txt;
285  txt.Printf( "%.2f", GetEpsilonR( aDielectricSubLayer ) );
286  return txt;
287 }
288 
289 
290 wxString BOARD_STACKUP_ITEM::FormatLossTangent( int aDielectricSubLayer ) const
291 {
292  // return a wxString to print/display Loss Tangent
293  wxString txt;
294  txt.Printf( "%g", GetLossTangent( aDielectricSubLayer ) );
295  return txt;
296 }
297 
298 
300 {
301  // return a wxString to print/display a dielectriv name
302  wxString lname;
303  lname.Printf( _( "Dielectric %d" ), GetDielectricLayerId() );
304 
305  return lname;
306 }
307 
308 
310 {
311  m_HasDielectricConstrains = false; // True if some dielectric layers have constrains
312  // (Loss tg and Epison R)
313  m_HasThicknessConstrains = false; // True if some dielectric or copper layers have constrains
315  m_CastellatedPads = false; // True if some castellated pads exist
316  m_EdgePlating = false; // True if edge board is plated
317  m_FinishType = "None"; // undefined finish type
318 }
319 
320 
322 {
327  m_EdgePlating = aOther.m_EdgePlating;
328  m_FinishType = aOther.m_FinishType;
329 
330  // All items in aOther.m_list have to be duplicated, because aOther.m_list
331  // manage pointers to these items
332  for( auto item : aOther.m_list )
333  {
334  BOARD_STACKUP_ITEM* dup_item = new BOARD_STACKUP_ITEM( *item );
335  Add( dup_item );
336  }
337 }
338 
339 
341 {
346  m_EdgePlating = aOther.m_EdgePlating;
347  m_FinishType = aOther.m_FinishType;
348 
349  RemoveAll();
350 
351  // All items in aOther.m_list have to be duplicated, because aOther.m_list
352  // manage pointers to these items
353  for( auto item : aOther.m_list )
354  {
355  BOARD_STACKUP_ITEM* dup_item = new BOARD_STACKUP_ITEM( *item );
356  Add( dup_item );
357  }
358 
359  return *this;
360 }
361 
362 
364 {
365  for( auto item : m_list )
366  delete item;
367 
368  m_list.clear();
369 }
370 
371 
373 {
374  if( aIndex < 0 || aIndex >= GetCount() )
375  return nullptr;
376 
377  return GetList()[aIndex];
378 }
379 
380 
382 {
383  // return the board thickness from the thickness of BOARD_STACKUP_ITEM list
384  int thickness = 0;
385 
386  for( auto item : m_list )
387  {
388  if( item->IsThicknessEditable() && item->IsEnabled() )
389  thickness += item->GetThickness();
390  }
391 
392  return thickness;
393 }
394 
395 
397 {
398  bool change = false;
399  // Build the suitable stackup:
400  BOARD_STACKUP stackup;
401  stackup.BuildDefaultStackupList( aSettings );
402 
403  // First, find removed layers:
404  for( BOARD_STACKUP_ITEM* curr_item: m_list )
405  {
406  bool found = false;
407 
408  for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
409  {
410  if( curr_item->GetBrdLayerId() != UNDEFINED_LAYER )
411  {
412  if( item->GetBrdLayerId() == curr_item->GetBrdLayerId() )
413  {
414  found = true;
415  break;
416  }
417  }
418  else // curr_item = dielectric layer
419  {
420  if( item->GetBrdLayerId() != UNDEFINED_LAYER )
421  continue;
422 
423  if( item->GetDielectricLayerId() == curr_item->GetDielectricLayerId() )
424  {
425  found = true;
426  break;
427  }
428  }
429  }
430 
431  if( !found ) // a layer was removed: a change is found
432  {
433  change = true;
434  break;
435  }
436  }
437 
438  // Now initialize all stackup items to the initial values, when exist
439  for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
440  {
441  bool found = false;
442  // Search for initial settings:
443  for( BOARD_STACKUP_ITEM* initial_item: m_list )
444  {
445  if( item->GetBrdLayerId() != UNDEFINED_LAYER )
446  {
447  if( item->GetBrdLayerId() == initial_item->GetBrdLayerId() )
448  {
449  *item = *initial_item;
450  found = true;
451  break;
452  }
453  }
454  else // dielectric layer: see m_DielectricLayerId for identification
455  {
456  // Compare dielectric layer with dielectric layer
457  if( initial_item->GetBrdLayerId() != UNDEFINED_LAYER )
458  continue;
459 
460  if( item->GetDielectricLayerId() == initial_item->GetDielectricLayerId() )
461  {
462  *item = *initial_item;
463  found = true;
464  break;
465  }
466  }
467  }
468 
469  if( !found )
470  {
471  change = true;
472  }
473  }
474 
475  // Transfer other stackup settings from aSettings
476  BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
479  m_CastellatedPads = source_stackup.m_CastellatedPads;
480  m_EdgePlating = source_stackup.m_EdgePlating;
481  m_FinishType = source_stackup.m_FinishType;
482 
483  *this = stackup;
484 
485  return change;
486 }
487 
488 
490  int aActiveCopperLayersCount )
491 {
492  // Creates a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
493  // Note: the m_TypeName string is made translatable using _HKI marker, but is not
494  // translated when building the stackup.
495  // It will be used as this in files, and can be translated only in dialog
496  // if aSettings == NULL, build a full stackup (with 32 copper layers)
497  LSET enabledLayer = aSettings ? aSettings->GetEnabledLayers() : StackupAllowedBrdLayers();
498  int copperLayerCount = aSettings ? aSettings->GetCopperLayerCount() : B_Cu+1;
499 
500  // We need to calculate a suitable dielectric layer thickness.
501  // If no settings, and if aActiveCopperLayersCount is given, use it
502  // (If no settings, and no aActiveCopperLayersCount, the full 32 layers are used)
503  int activeCuLayerCount = copperLayerCount;
504 
505  if( aSettings == nullptr && aActiveCopperLayersCount > 0 )
506  activeCuLayerCount = aActiveCopperLayersCount;
507 
508  int brd__thickness = aSettings ? aSettings->GetBoardThickness() : Millimeter2iu( 1.6 );
509  int diel_thickness = brd__thickness -
510  ( BOARD_STACKUP_ITEM::GetCopperDefaultThickness() * activeCuLayerCount );
511 
512  // Take in account the solder mask thickness:
513  int sm_count = ( enabledLayer & LSET( 2, F_Mask, B_Mask) ).count();
514  diel_thickness -= BOARD_STACKUP_ITEM::GetMaskDefaultThickness() * sm_count;
515 
516  int dielectric_idx = 0;
517 
518  // Add silk screen, solder mask and solder paste layers on top
519  if( enabledLayer[F_SilkS] )
520  {
522  item->SetBrdLayerId( F_SilkS );
523  item->SetTypeName( _HKI( "Top Silk Screen" ) );
524  Add( item );
525  }
526 
527  if( enabledLayer[F_Paste] )
528  {
530  item->SetBrdLayerId( F_Paste );
531  item->SetTypeName( _HKI( "Top Solder Paste" ) );
532  Add( item );
533  }
534 
535  if( enabledLayer[F_Mask] )
536  {
538  item->SetBrdLayerId( F_Mask );
539  item->SetTypeName( _HKI( "Top Solder Mask" ) );
540  Add( item );
541  }
542 
543  // Add copper and dielectric layers
544  for( int ii = 0; ii < copperLayerCount; ii++ )
545  {
547  item->SetBrdLayerId( ( PCB_LAYER_ID )ii );
548  item->SetTypeName( KEY_COPPER );
549  Add( item );
550 
551  if( ii == copperLayerCount-1 )
552  {
553  item->SetBrdLayerId( B_Cu );
554  break;
555  }
556 
557  // Add the dielectric layer:
559  item->SetThickness( diel_thickness );
560  item->SetDielectricLayerId( dielectric_idx + 1 );
561 
562  // Display a dielectric default layer name:
563  if( (dielectric_idx & 1) == 0 )
564  {
565  item->SetTypeName( KEY_CORE );
566  item->SetMaterial( "FR4" );
567  }
568  else
569  {
570  item->SetTypeName( KEY_PREPREG );
571  item->SetMaterial( "FR4" );
572  }
573 
574  Add( item );
575  dielectric_idx++;
576  }
577 
578  // Add silk screen, solder mask and solder paste layers on bottom
579  if( enabledLayer[B_Mask] )
580  {
582  item->SetBrdLayerId( B_Mask );
583  item->SetTypeName( _HKI( "Bottom Solder Mask" ) );
584  Add( item );
585  }
586 
587  if( enabledLayer[B_Paste] )
588  {
590  item->SetBrdLayerId( B_Paste );
591  item->SetTypeName( _HKI( "Bottom Solder Paste" ) );
592  Add( item );
593  }
594 
595  if( enabledLayer[B_SilkS] )
596  {
598  item->SetBrdLayerId( B_SilkS );
599  item->SetTypeName( _HKI( "Bottom Silk Screen" ) );
600  Add( item );
601  }
602 
603  // Transfer other stackup settings from aSettings
604  if( aSettings )
605  {
606  BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
609  m_CastellatedPads = source_stackup.m_CastellatedPads;
610  m_EdgePlating = source_stackup.m_EdgePlating;
611  m_FinishType = source_stackup.m_FinishType;
612  }
613 }
614 
615 
616 
618  BOARD* aBoard, int aNestLevel ) const
619 {
620  // Board stackup is the ordered list from top to bottom of
621  // physical layers and substrate used to build the board.
622  if( m_list.empty() )
623  return;
624 
625  aFormatter->Print( aNestLevel, "(stackup\n" );
626  int nest_level = aNestLevel+1;
627 
628  // Note:
629  // Unspecified parameters are not stored in file.
630  for( BOARD_STACKUP_ITEM* item: m_list )
631  {
632  wxString layer_name;
633 
634  if( item->GetBrdLayerId() == UNDEFINED_LAYER )
635  {
636  layer_name.Printf( "dielectric %d", item->GetDielectricLayerId() );
637  }
638  else
639  layer_name = aBoard->GetLayerName( item->GetBrdLayerId() );
640 
641  aFormatter->Print( nest_level, "(layer %s (type %s)",
642  aFormatter->Quotew( layer_name ).c_str(),
643  aFormatter->Quotew( item->GetTypeName() ).c_str() );
644 
645  if( item->IsColorEditable() && IsPrmSpecified( item->GetColor() ) )
646  aFormatter->Print( 0, " (color %s)",
647  aFormatter->Quotew( item->GetColor() ).c_str() );
648 
649  for( int idx = 0; idx < item->GetSublayersCount(); idx++ )
650  {
651  if( idx ) // not for the main (first) layer.
652  {
653  aFormatter->Print( 0, "\n" );
654  aFormatter->Print( nest_level+1, "addsublayer" );
655  }
656 
657  if( item->IsThicknessEditable() )
658  {
659  if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC && item->IsThicknessLocked( idx ) )
660  aFormatter->Print( 0, " (thickness %s locked)",
661  FormatInternalUnits( item->GetThickness( idx ) ).c_str() );
662  else
663  aFormatter->Print( 0, " (thickness %s)",
664  FormatInternalUnits( item->GetThickness( idx ) ).c_str() );
665  }
666 
667  if( item->HasMaterialValue( idx ) )
668  aFormatter->Print( 0, " (material %s)",
669  aFormatter->Quotew( item->GetMaterial( idx ) ).c_str() );
670 
671  if( item->HasEpsilonRValue() && item->HasMaterialValue( idx ) )
672  aFormatter->Print( 0, " (epsilon_r %g)", item->GetEpsilonR( idx ) );
673 
674  if( item->HasLossTangentValue() && item->HasMaterialValue( idx ) )
675  aFormatter->Print( 0, " (loss_tangent %s)",
676  Double2Str(item->GetLossTangent( idx ) ).c_str() );
677  }
678 
679  aFormatter->Print( 0, ")\n" );
680  }
681 
682  // Other infos about board, related to layers and other fabrication specifications
684  aFormatter->Print( nest_level, "(copper_finish %s)\n",
685  aFormatter->Quotew( m_FinishType ).c_str() );
686 
687  aFormatter->Print( nest_level, "(dielectric_constraints %s)\n",
688  m_HasDielectricConstrains ? "yes" : "no" );
689 
691  aFormatter->Print( nest_level, "(edge_connector %s)\n",
692  m_EdgeConnectorConstraints > 1 ? "bevelled": "yes" );
693 
694  if( m_CastellatedPads )
695  aFormatter->Print( nest_level, "(castellated_pads yes)\n" );
696 
697  if( m_EdgePlating )
698  aFormatter->Print( nest_level, "(edge_plating yes)\n" );
699 
700  aFormatter->Print( aNestLevel, ")\n" );
701 }
702 
703 
704 bool IsPrmSpecified( const wxString& aPrmValue )
705 {
706  // return true if the param value is specified:
707 
708  if( !aPrmValue.IsEmpty()
709  && ( aPrmValue.CmpNoCase( NotSpecifiedPrm() ) != 0 )
710  && aPrmValue != wxGetTranslation( NotSpecifiedPrm() ) )
711  return true;
712 
713  return false;
714 }
void FormatBoardStackup(OUTPUTFORMATTER *aFormatter, BOARD *aBoard, int aNestLevel) const
Writes the stackup info on board file.
int BuildBoardTicknessFromStackup() const
#define DEFAULT_EPSILON_R_SOLDERMASK
void SetBrdLayerId(PCB_LAYER_ID aBrdLayerId)
void SetTypeName(const wxString &aName)
BOARD_STACKUP_ITEM * GetStackupLayer(int aIndex)
std::vector< BOARD_STACKUP_ITEM * > & GetList()
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
bool HasMaterialValue(int aDielectricSubLayer=0) const
this class manage the layers needed to make a physical board they are solder mask,...
Implementation of conversion functions that require both schematic and board internal units.
wxString m_FinishType
The name of external copper finish.
bool m_EdgePlating
True if the edge board is plated.
bool IsPrmSpecified(const wxString &aPrmValue)
bool IsThicknessLocked(int aDielectricSubLayer=0) const
BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints
If the board has edge connector cards, some constrains can be specifed in job file: BS_EDGE_CONNECTOR...
bool m_CastellatedPads
True if castellated pads exist.
#define KEY_COPPER
wxString GetColor() const
OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a convenient ...
Definition: richio.h:327
wxString m_TypeName
name of layer as shown in layer manager. Usefull to create reports
std::string Double2Str(double aValue)
Helper function Double2Str to print a float number without using scientific notation and no trailing ...
Definition: base_units.cpp:62
BOARD_STACKUP & operator=(const BOARD_STACKUP &aOther)
double GetLossTangent(int aDielectricSubLayer=0) const
static int GetCopperDefaultThickness()
bool SynchronizeWithBoard(BOARD_DESIGN_SETTINGS *aSettings)
Synchronize the BOARD_STACKUP_ITEM* list with the board.
std::vector< DIELECTRIC_PRMS > m_DielectricPrmsList
the "layer" id for dielectric layers, from 1 (top) to 31 (bottom) (only 31 dielectric layers for 32 c...
bool m_HasDielectricConstrains
True if some layers have impedance controlled tracks or have specific constrains for micro-wave appli...
BOARD_STACKUP & GetStackupDescriptor()
PCB_LAYER_ID
A quick note on layer IDs:
bool IsThicknessEditable() const
LSET is a set of PCB_LAYER_IDs.
static LSET StackupAllowedBrdLayers()
wxString NotSpecifiedPrm()
int GetThickness(int aDielectricSubLayer=0) const
void SetDielectricLayerId(int aLayerId)
bool HasLossTangentValue() const
A helper class to manage a dielectric layer set of parameters.
double GetEpsilonR(int aDielectricSubLayer=0) const
PCB_LAYER_ID m_LayerId
mainly for silkscreen and solder mask
wxString FormatEpsilonR(int aDielectricSubLayer=0) const
wxString FormatLossTangent(int aDielectricSubLayer=0) const
void SetMaterial(const wxString &aName, int aDielectricSubLayer=0)
std::string Quotew(const wxString &aWrapee)
Definition: richio.cpp:472
std::vector< BOARD_STACKUP_ITEM * > m_list
#define KEY_PREPREG
bool m_HasThicknessConstrains
True if some layers (copper and/or dielectric) have specific thickness.
this class manage one layer needed to make a physical board it can be a solder mask,...
void SetEpsilonR(double aEpsilon, int aDielectricSubLayer=0)
void AddDielectricPrms(int aDielectricPrmsIdx)
true if this stackup item must be taken in account, false to ignore it.
void SetThickness(int aThickness, int aDielectricSubLayer=0)
Some functions to handle hotkeys in KiCad.
static int GetMaskDefaultThickness()
#define DEFAULT_EPSILON_R_SILKSCREEN
void SetThicknessLocked(bool aLocked, int aDielectricSubLayer=0)
wxString m_Color
type name of layer (copper, silk screen, core, prepreg ...)
void RemoveAll()
Delete all items in list and clear the list.
BOARD_STACKUP_ITEM(BOARD_STACKUP_ITEM_TYPE aType)
Board layer functions and definitions.
int GetDielectricLayerId() const
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:178
LSET GetEnabledLayers() const
Function GetEnabledLayers returns a bit-mask of all the layers that are enabled.
#define _(s)
Definition: 3d_actions.cpp:33
BOARD_STACKUP_ITEM_TYPE
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
#define KEY_CORE
void Add(BOARD_STACKUP_ITEM *aItem)
Add a new item in stackup layer.
BOARD_STACKUP_ITEM_TYPE m_Type
static constexpr int Millimeter2iu(double mm)
#define _HKI(x)
int GetCopperLayerCount() const
Function GetCopperLayerCount.
void SetLossTangent(double aTg, int aDielectricSubLayer=0)
wxString GetMaterial(int aDielectricSubLayer=0) const
int m_DielectricLayerId
the layer id (F.Cu to B.Cu, F.Silk, B.silk, F.Mask, B.Mask) and UNDEFINED_LAYER (-1) for dielectic la...
std::string FormatInternalUnits(int aValue)
Function FormatInternalUnits converts aValue from internal units to a string appropriate for writing ...
Definition: base_units.cpp:560
wxString FormatDielectricLayerName() const
void BuildDefaultStackupList(BOARD_DESIGN_SETTINGS *aSettings, int aActiveCopperLayersCount=0)
Creates a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
void SetEnabled(bool aEnable)
void RemoveDielectricPrms(int aDielectricPrmsIdx)
Remove a DIELECTRIC_PRMS item from m_DielectricPrmsList.