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( "%.1f", 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 {
326  m_EdgePlating = aOther.m_EdgePlating;
327  m_FinishType = aOther.m_FinishType;
328 
329  // All items in aOther.m_list have to be duplicated, because aOther.m_list
330  // manage pointers to these items
331  for( auto item : aOther.m_list )
332  {
333  BOARD_STACKUP_ITEM* dup_item = new BOARD_STACKUP_ITEM( *item );
334  Add( dup_item );
335  }
336 }
337 
338 
340 {
344  m_EdgePlating = aOther.m_EdgePlating;
345  m_FinishType = aOther.m_FinishType;
346 
347  RemoveAll();
348 
349  // All items in aOther.m_list have to be duplicated, because aOther.m_list
350  // manage pointers to these items
351  for( auto item : aOther.m_list )
352  {
353  BOARD_STACKUP_ITEM* dup_item = new BOARD_STACKUP_ITEM( *item );
354  Add( dup_item );
355  }
356 
357  return *this;
358 }
359 
360 
362 {
363  for( auto item : m_list )
364  delete item;
365 
366  m_list.clear();
367 }
368 
369 
371 {
372  if( aIndex < 0 || aIndex >= GetCount() )
373  return nullptr;
374 
375  return GetList()[aIndex];
376 }
377 
378 
380 {
381  // return the board thickness from the thickness of BOARD_STACKUP_ITEM list
382  int thickness = 0;
383 
384  for( auto item : m_list )
385  {
386  if( item->IsThicknessEditable() && item->IsEnabled() )
387  thickness += item->GetThickness();
388  }
389 
390  return thickness;
391 }
392 
393 
395 {
396  bool change = false;
397  // Build the suitable stackup:
398  BOARD_STACKUP stackup;
399  stackup.BuildDefaultStackupList( aSettings );
400 
401  // First, find removed layers:
402  for( BOARD_STACKUP_ITEM* curr_item: m_list )
403  {
404  bool found = false;
405 
406  for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
407  {
408  if( curr_item->GetBrdLayerId() != UNDEFINED_LAYER )
409  {
410  if( item->GetBrdLayerId() == curr_item->GetBrdLayerId() )
411  {
412  found = true;
413  break;
414  }
415  }
416  else // curr_item = dielectric layer
417  {
418  if( item->GetBrdLayerId() != UNDEFINED_LAYER )
419  continue;
420 
421  if( item->GetDielectricLayerId() == curr_item->GetDielectricLayerId() )
422  {
423  found = true;
424  break;
425  }
426  }
427  }
428 
429  if( !found ) // a layer was removed: a change is found
430  {
431  change = true;
432  break;
433  }
434  }
435 
436  // Now initialize all stackup items to the initial values, when exist
437  for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
438  {
439  bool found = false;
440  // Search for initial settings:
441  for( BOARD_STACKUP_ITEM* initial_item: m_list )
442  {
443  if( item->GetBrdLayerId() != UNDEFINED_LAYER )
444  {
445  if( item->GetBrdLayerId() == initial_item->GetBrdLayerId() )
446  {
447  *item = *initial_item;
448  found = true;
449  break;
450  }
451  }
452  else // dielectric layer: see m_DielectricLayerId for identification
453  {
454  // Compare dielectric layer with dielectric layer
455  if( initial_item->GetBrdLayerId() != UNDEFINED_LAYER )
456  continue;
457 
458  if( item->GetDielectricLayerId() == initial_item->GetDielectricLayerId() )
459  {
460  *item = *initial_item;
461  found = true;
462  break;
463  }
464  }
465  }
466 
467  if( !found )
468  {
469  change = true;
470  }
471  }
472 
473  // Transfer other stackup settings from aSettings
474  BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
477  m_CastellatedPads = source_stackup.m_CastellatedPads;
478  m_EdgePlating = source_stackup.m_EdgePlating;
479  m_FinishType = source_stackup.m_FinishType;
480 
481  *this = stackup;
482 
483  return change;
484 }
485 
486 
488  int aActiveCopperLayersCount )
489 {
490  // Creates a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
491  // Note: the m_TypeName string is made translatable using _HKI marker, but is not
492  // translated when building the stackup.
493  // It will be used as this in files, and can be translated only in dialog
494  // if aSettings == NULL, build a full stackup (with 32 copper layers)
495  LSET enabledLayer = aSettings ? aSettings->GetEnabledLayers() : StackupAllowedBrdLayers();
496  int copperLayerCount = aSettings ? aSettings->GetCopperLayerCount() : B_Cu+1;
497 
498  // We need to calculate a suitable dielectric layer thickness.
499  // If no settings, and if aActiveCopperLayersCount is given, use it
500  // (If no settings, and no aActiveCopperLayersCount, the full 32 layers are used)
501  int activeCuLayerCount = copperLayerCount;
502 
503  if( aSettings == nullptr && aActiveCopperLayersCount > 0 )
504  activeCuLayerCount = aActiveCopperLayersCount;
505 
506  int brd__thickness = aSettings ? aSettings->GetBoardThickness() : Millimeter2iu( 1.6 );
507  int diel_thickness = brd__thickness -
508  ( BOARD_STACKUP_ITEM::GetCopperDefaultThickness() * activeCuLayerCount );
509 
510  // Take in account the solder mask thickness:
511  int sm_count = ( enabledLayer & LSET( 2, F_Mask, B_Mask) ).count();
512  diel_thickness -= BOARD_STACKUP_ITEM::GetMaskDefaultThickness() * sm_count;
513 
514  int dielectric_idx = 0;
515 
516  // Add silk screen, solder mask and solder paste layers on top
517  if( enabledLayer[F_SilkS] )
518  {
520  item->SetBrdLayerId( F_SilkS );
521  item->SetTypeName( _HKI( "Top Silk Screen" ) );
522  Add( item );
523  }
524 
525  if( enabledLayer[F_Paste] )
526  {
528  item->SetBrdLayerId( F_Paste );
529  item->SetTypeName( _HKI( "Top Solder Paste" ) );
530  Add( item );
531  }
532 
533  if( enabledLayer[F_Mask] )
534  {
536  item->SetBrdLayerId( F_Mask );
537  item->SetTypeName( _HKI( "Top Solder Mask" ) );
538  Add( item );
539  }
540 
541  // Add copper and dielectric layers
542  for( int ii = 0; ii < copperLayerCount; ii++ )
543  {
545  item->SetBrdLayerId( ( PCB_LAYER_ID )ii );
546  item->SetTypeName( KEY_COPPER );
547  Add( item );
548 
549  if( ii == copperLayerCount-1 )
550  {
551  item->SetBrdLayerId( B_Cu );
552  break;
553  }
554 
555  // Add the dielectric layer:
557  item->SetThickness( diel_thickness );
558  item->SetDielectricLayerId( dielectric_idx + 1 );
559 
560  // Display a dielectric default layer name:
561  if( (dielectric_idx & 1) == 0 )
562  {
563  item->SetTypeName( KEY_CORE );
564  item->SetMaterial( "FR4" );
565  }
566  else
567  {
568  item->SetTypeName( KEY_PREPREG );
569  item->SetMaterial( "FR4" );
570  }
571 
572  Add( item );
573  dielectric_idx++;
574  }
575 
576  // Add silk screen, solder mask and solder paste layers on bottom
577  if( enabledLayer[B_Mask] )
578  {
580  item->SetBrdLayerId( B_Mask );
581  item->SetTypeName( _HKI( "Bottom Solder Mask" ) );
582  Add( item );
583  }
584 
585  if( enabledLayer[B_Paste] )
586  {
588  item->SetBrdLayerId( B_Paste );
589  item->SetTypeName( _HKI( "Bottom Solder Paste" ) );
590  Add( item );
591  }
592 
593  if( enabledLayer[B_SilkS] )
594  {
596  item->SetBrdLayerId( B_SilkS );
597  item->SetTypeName( _HKI( "Bottom Silk Screen" ) );
598  Add( item );
599  }
600 
601  // Transfer other stackup settings from aSettings
602  if( aSettings )
603  {
604  BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
607  m_CastellatedPads = source_stackup.m_CastellatedPads;
608  m_EdgePlating = source_stackup.m_EdgePlating;
609  m_FinishType = source_stackup.m_FinishType;
610  }
611 }
612 
613 
614 
616  BOARD* aBoard, int aNestLevel ) const
617 {
618  // Board stackup is the ordered list from top to bottom of
619  // physical layers and substrate used to build the board.
620  if( m_list.empty() )
621  return;
622 
623  aFormatter->Print( aNestLevel, "(stackup\n" );
624  int nest_level = aNestLevel+1;
625 
626  // Note:
627  // Unspecified parameters are not stored in file.
628  for( BOARD_STACKUP_ITEM* item: m_list )
629  {
630  wxString layer_name;
631 
632  if( item->GetBrdLayerId() == UNDEFINED_LAYER )
633  {
634  layer_name.Printf( "dielectric %d", item->GetDielectricLayerId() );
635  }
636  else
637  layer_name = aBoard->GetLayerName( item->GetBrdLayerId() );
638 
639  aFormatter->Print( nest_level, "(layer %s (type %s)",
640  aFormatter->Quotew( layer_name ).c_str(),
641  aFormatter->Quotew( item->GetTypeName() ).c_str() );
642 
643  if( item->IsColorEditable() && IsPrmSpecified( item->GetColor() ) )
644  aFormatter->Print( 0, " (color %s)",
645  aFormatter->Quotew( item->GetColor() ).c_str() );
646 
647  for( int idx = 0; idx < item->GetSublayersCount(); idx++ )
648  {
649  if( idx ) // not for the main (first) layer.
650  {
651  aFormatter->Print( 0, "\n" );
652  aFormatter->Print( nest_level+1, "addsublayer" );
653  }
654 
655  if( item->IsThicknessEditable() )
656  {
657  if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC && item->IsThicknessLocked( idx ) )
658  aFormatter->Print( 0, " (thickness %s locked)",
659  FormatInternalUnits( item->GetThickness( idx ) ).c_str() );
660  else
661  aFormatter->Print( 0, " (thickness %s)",
662  FormatInternalUnits( item->GetThickness( idx ) ).c_str() );
663  }
664 
665  if( item->HasMaterialValue( idx ) )
666  aFormatter->Print( 0, " (material %s)",
667  aFormatter->Quotew( item->GetMaterial( idx ) ).c_str() );
668 
669  if( item->HasEpsilonRValue() && item->HasMaterialValue( idx ) )
670  aFormatter->Print( 0, " (epsilon_r %g)", item->GetEpsilonR( idx ) );
671 
672  if( item->HasLossTangentValue() && item->HasMaterialValue( idx ) )
673  aFormatter->Print( 0, " (loss_tangent %s)",
674  Double2Str(item->GetLossTangent( idx ) ).c_str() );
675  }
676 
677  aFormatter->Print( 0, ")\n" );
678  }
679 
680  // Other infos about board, related to layers and other fabrication specifications
682  aFormatter->Print( nest_level, "(copper_finish %s)\n",
683  aFormatter->Quotew( m_FinishType ).c_str() );
684 
685  aFormatter->Print( nest_level, "(dielectric_constraints %s)\n",
686  m_HasDielectricConstrains ? "yes" : "no" );
687 
689  aFormatter->Print( nest_level, "(edge_connector %s)\n",
690  m_EdgeConnectorConstraints > 1 ? "bevelled": "yes" );
691 
692  if( m_CastellatedPads )
693  aFormatter->Print( nest_level, "(castellated_pads yes)\n" );
694 
695  if( m_EdgePlating )
696  aFormatter->Print( nest_level, "(edge_plating yes)\n" );
697 
698  aFormatter->Print( aNestLevel, ")\n" );
699 }
700 
701 
702 bool IsPrmSpecified( const wxString& aPrmValue )
703 {
704  // return true if the param value is specified:
705 
706  if( !aPrmValue.IsEmpty()
707  && ( aPrmValue.CmpNoCase( NotSpecifiedPrm() ) != 0 )
708  && aPrmValue != wxGetTranslation( NotSpecifiedPrm() ) )
709  return true;
710 
711  return false;
712 }
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 given by aLayer.
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
Class OUTPUTFORMATTER is an important interface (abstract class) used to output 8 bit text in a conve...
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:63
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
Class 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,...
#define _(s)
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
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
LSET GetEnabledLayers() const
Function GetEnabledLayers returns a bit-mask of all the layers that are enabled.
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
#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:478
wxString FormatDielectricLayerName() const
void BuildDefaultStackupList(BOARD_DESIGN_SETTINGS *aSettings, int aActiveCopperLayersCount=0)
Creates a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
Class 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.