KiCad PCB EDA Suite
BOARD_DESIGN_SETTINGS Class Reference

Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object. More...

#include <class_board_design_settings.h>

Public Member Functions

 BOARD_DESIGN_SETTINGS ()
 
NETCLASSPTR GetDefault () const
 Function GetDefault. More...
 
const wxString & GetCurrentNetClassName () const
 Function GetCurrentNetClassName. More...
 
bool UseNetClassTrack () const
 Function UseNetClassTrack returns true if netclass values should be used to obtain appropriate track width. More...
 
bool UseNetClassVia () const
 Function UseNetClassVia returns true if netclass values should be used to obtain appropriate via size. More...
 
bool SetCurrentNetClass (const wxString &aNetClassName)
 Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter change Initialize vias and tracks values displayed in comb boxes of the auxiliary toolbar and some others parameters (netclass name ....) More...
 
int GetBiggestClearanceValue ()
 Function GetBiggestClearanceValue. More...
 
int GetSmallestClearanceValue ()
 Function GetSmallestClearanceValue. More...
 
int GetCurrentMicroViaSize ()
 Function GetCurrentMicroViaSize. More...
 
int GetCurrentMicroViaDrill ()
 Function GetCurrentMicroViaDrill. More...
 
unsigned GetTrackWidthIndex () const
 Function GetTrackWidthIndex. More...
 
void SetTrackWidthIndex (unsigned aIndex)
 Function SetTrackWidthIndex sets the current track width list index to aIndex. More...
 
int GetCurrentTrackWidth () const
 Function GetCurrentTrackWidth. More...
 
void SetCustomTrackWidth (int aWidth)
 Function SetCustomTrackWidth Sets custom width for track (i.e. More...
 
int GetCustomTrackWidth () const
 Function GetCustomTrackWidth. More...
 
unsigned GetViaSizeIndex () const
 Function GetViaSizeIndex. More...
 
void SetViaSizeIndex (unsigned aIndex)
 Function SetViaSizeIndex sets the current via size list index to aIndex. More...
 
int GetCurrentViaSize () const
 Function GetCurrentViaSize. More...
 
void SetCustomViaSize (int aSize)
 Function SetCustomViaSize Sets custom size for via diameter (i.e. More...
 
int GetCustomViaSize () const
 Function GetCustomViaSize. More...
 
int GetCurrentViaDrill () const
 Function GetCurrentViaDrill. More...
 
void SetCustomViaDrill (int aDrill)
 Function SetCustomViaDrill Sets custom size for via drill (i.e. More...
 
int GetCustomViaDrill () const
 Function GetCustomViaDrill. More...
 
void UseCustomTrackViaSize (bool aEnabled)
 Function UseCustomTrackViaSize Enables/disables custom track/via size settings. More...
 
bool UseCustomTrackViaSize () const
 Function UseCustomTrackViaSize. More...
 
LSET GetVisibleLayers () const
 Function GetVisibleLayers returns a bit-mask of all the layers that are visible. More...
 
void SetVisibleAlls ()
 Function SetVisibleAlls Set the bit-mask of all visible elements categories, including enabled layers. More...
 
void SetVisibleLayers (LSET aMask)
 Function SetVisibleLayers changes the bit-mask of visible layers. More...
 
bool IsLayerVisible (PCB_LAYER_ID aLayerId) const
 Function IsLayerVisible tests whether a given layer is visible. More...
 
void SetLayerVisibility (PCB_LAYER_ID aLayerId, bool aNewState)
 Function SetLayerVisibility changes the visibility of a given layer. More...
 
int GetVisibleElements () const
 Function GetVisibleElements returns a bit-mask of all the element categories that are visible. More...
 
void SetVisibleElements (int aMask)
 Function SetVisibleElements changes the bit-mask of visible element categories. More...
 
bool IsElementVisible (GAL_LAYER_ID aElementCategory) const
 Function IsElementVisible tests whether a given element category is visible. More...
 
void SetElementVisibility (GAL_LAYER_ID aElementCategory, bool aNewState)
 Function SetElementVisibility changes the visibility of an element category. More...
 
LSET GetEnabledLayers () const
 Function GetEnabledLayers returns a bit-mask of all the layers that are enabled. More...
 
void SetEnabledLayers (LSET aMask)
 Function SetEnabledLayers changes the bit-mask of enabled layers. More...
 
bool IsLayerEnabled (PCB_LAYER_ID aLayerId) const
 Function IsLayerEnabled tests whether a given layer is enabled. More...
 
int GetCopperLayerCount () const
 Function GetCopperLayerCount. More...
 
void SetCopperLayerCount (int aNewLayerCount)
 Function SetCopperLayerCount do what its name says... More...
 
void AppendConfigs (PARAM_CFG_ARRAY *aResult)
 Function AppendConfigs appends to aResult the configuration setting accessors which will later allow reading or writing of configuration file information directly into this object. More...
 
int GetBoardThickness () const
 
void SetBoardThickness (int aThickness)
 

Public Attributes

std::vector< VIA_DIMENSIONm_ViasDimensionsList
 Vias size and drill list. More...
 
std::vector< int > m_TrackWidthList
 Track width list. More...
 
NETCLASSES m_NetClasses
 List of current netclasses. There is always the default netclass. More...
 
bool m_MicroViasAllowed
 true to allow micro vias More...
 
bool m_BlindBuriedViaAllowed
 true to allow blind/buried vias More...
 
VIATYPE_T m_CurrentViaType
 via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA) More...
 
bool m_UseConnectedTrackWidth
 if true, when creating a new track starting on an existing track, use this track width More...
 
int m_DrawSegmentWidth
 current graphic line width (not EDGE layer) More...
 
int m_EdgeSegmentWidth
 current graphic line width (EDGE layer only) More...
 
int m_PcbTextWidth
 current Pcb (not module) Text width More...
 
wxSize m_PcbTextSize
 current Pcb (not module) Text size More...
 
int m_TrackMinWidth
 track min value for width ((min copper size value More...
 
int m_ViasMinSize
 vias (not micro vias) min diameter More...
 
int m_ViasMinDrill
 vias (not micro vias) min drill diameter More...
 
int m_MicroViasMinSize
 micro vias (not vias) min diameter More...
 
int m_MicroViasMinDrill
 micro vias (not vias) min drill diameter More...
 
int m_SolderMaskMargin
 Solder mask margin. More...
 
int m_SolderMaskMinWidth
 Solder mask min width. More...
 
int m_SolderPasteMargin
 Solder paste margin absolute value. More...
 
double m_SolderPasteMarginRatio
 Solder pask margin ratio value of pad size The final margin is the sum of these 2 values. More...
 
int m_ModuleSegmentWidth
 Default width for all graphic lines. More...
 
wxSize m_ModuleTextSize
 Default footprint texts size. More...
 
int m_ModuleTextWidth
 Default footprint texts thickness. More...
 
wxString m_RefDefaultText
 Default ref text on fp creation. More...
 
bool m_RefDefaultVisibility
 Default ref text visibility on fp creation. More...
 
int m_RefDefaultlayer
 Default ref text layer on fp creation. More...
 
wxString m_ValueDefaultText
 Default value text on fp creation. More...
 
bool m_ValueDefaultVisibility
 Default value text visibility on fp creation. More...
 
int m_ValueDefaultlayer
 Default value text layer on fp creation. More...
 
wxPoint m_AuxOrigin
 origin for plot exports More...
 
wxPoint m_GridOrigin
 origin for grid offsets More...
 
D_PAD m_Pad_Master
 A dummy pad to store all default parameters. More...
 

Private Member Functions

void formatNetClass (NETCLASS *aNetClass, OUTPUTFORMATTER *aFormatter, int aNestLevel, int aControlBits) const
 

Private Attributes

unsigned m_viaSizeIndex
 Index for m_ViasDimensionsList to select the current via size. More...
 
unsigned m_trackWidthIndex
 0 is the index selection of the default value Netclass More...
 
bool m_useCustomTrackVia
 

Use custom values for track/via sizes (not specified in net class nor in the size lists).

More...
 
int m_customTrackWidth
 

Custom track width (used after UseCustomTrackViaSize( true ) was called).

More...
 
VIA_DIMENSION m_customViaSize
 

Custom via size (used after UseCustomTrackViaSize( true ) was called).

More...
 
int m_copperLayerCount
 Number of copper layers for this design. More...
 
LSET m_enabledLayers
 Bit-mask for layer enabling. More...
 
LSET m_visibleLayers
 Bit-mask for layer visibility. More...
 
int m_visibleElements
 Bit-mask for element category visibility. More...
 
int m_boardThickness
 Board thickness for 3D viewer. More...
 
wxString m_currentNetClassName
 Current net class name used to display netclass info. More...
 

Detailed Description

Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.

Definition at line 97 of file class_board_design_settings.h.

Constructor & Destructor Documentation

BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS ( )

Definition at line 40 of file class_board_design_settings.cpp.

References DEFAULT_BOARD_THICKNESS_MM, DEFAULT_CUSTOMTRACKWIDTH, DEFAULT_GR_MODULE_THICKNESS, DEFAULT_GRAPHIC_THICKNESS, DEFAULT_MICROVIASMINDRILL, DEFAULT_MICROVIASMINSIZE, DEFAULT_PCB_EDGE_THICKNESS, DEFAULT_SOLDERMASK_CLEARANCE, DEFAULT_SOLDERMASK_MIN_WIDTH, DEFAULT_TEXT_MODULE_SIZE, DEFAULT_TEXT_PCB_SIZE, DEFAULT_TEXT_PCB_THICKNESS, DEFAULT_TRACKMINWIDTH, DEFAULT_VIASMINDRILL, DEFAULT_VIASMINSIZE, F_Fab, F_SilkS, GAL_LAYER_INDEX, LAYER_MOD_TEXT_INVISIBLE, m_BlindBuriedViaAllowed, m_boardThickness, m_CurrentViaType, m_customTrackWidth, m_customViaSize, VIA_DIMENSION::m_Diameter, m_DrawSegmentWidth, VIA_DIMENSION::m_Drill, m_EdgeSegmentWidth, m_enabledLayers, m_MicroViasAllowed, m_MicroViasMinDrill, m_MicroViasMinSize, m_ModuleSegmentWidth, m_ModuleTextSize, m_ModuleTextWidth, m_PcbTextSize, m_PcbTextWidth, m_RefDefaultlayer, m_RefDefaultText, m_RefDefaultVisibility, m_SolderMaskMargin, m_SolderMaskMinWidth, m_SolderPasteMargin, m_SolderPasteMarginRatio, m_TrackMinWidth, m_trackWidthIndex, m_UseConnectedTrackWidth, m_useCustomTrackVia, m_ValueDefaultlayer, m_ValueDefaultText, m_ValueDefaultVisibility, m_viaSizeIndex, m_ViasMinDrill, m_ViasMinSize, m_visibleElements, SetCopperLayerCount(), SetVisibleLayers(), and VIA_THROUGH.

40  :
41  m_Pad_Master( NULL )
42 {
43  LSET all_set = LSET().set();
44 
45  m_enabledLayers = all_set; // All layers enabled at first.
46  // SetCopperLayerCount() will adjust this.
47  SetVisibleLayers( all_set );
48 
49  // set all but hidden text as visible.
51 
52  SetCopperLayerCount( 2 ); // Default design is a double sided board
53 
54  // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA).
56 
57  // if true, when creating a new track starting on an existing track, use this track width
59 
60  m_BlindBuriedViaAllowed = false; // true to allow blind/buried vias
61  m_MicroViasAllowed = false; // true to allow micro vias
62 
63  m_DrawSegmentWidth = Millimeter2iu( DEFAULT_GRAPHIC_THICKNESS ); // current graphic line width (not EDGE layer)
64 
65  m_EdgeSegmentWidth = Millimeter2iu( DEFAULT_PCB_EDGE_THICKNESS ); // current graphic line width (EDGE layer only)
66  m_PcbTextWidth = Millimeter2iu( DEFAULT_TEXT_PCB_THICKNESS ); // current Pcb (not module) Text width
67 
68  m_PcbTextSize = wxSize( Millimeter2iu( DEFAULT_TEXT_PCB_SIZE ),
69  Millimeter2iu( DEFAULT_TEXT_PCB_SIZE ) ); // current Pcb (not module) Text size
70 
71  m_useCustomTrackVia = false;
74  m_customViaSize.m_Drill = Millimeter2iu( DEFAULT_VIASMINDRILL );
75 
76  m_TrackMinWidth = Millimeter2iu( DEFAULT_TRACKMINWIDTH ); // track min width
77  m_ViasMinSize = Millimeter2iu( DEFAULT_VIASMINSIZE ); // via (not uvia) min diam
78  m_ViasMinDrill = Millimeter2iu( DEFAULT_VIASMINDRILL ); // via (not uvia) min drill diam
79  m_MicroViasMinSize = Millimeter2iu( DEFAULT_MICROVIASMINSIZE );// uvia (not via) min diam
80  m_MicroViasMinDrill = Millimeter2iu( DEFAULT_MICROVIASMINDRILL );// uvia (not via) min drill diam
81 
82  // Global mask margins:
83  m_SolderMaskMargin = Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ); // Solder mask margin
84  m_SolderMaskMinWidth = Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH ); // Solder mask min width
85  m_SolderPasteMargin = 0; // Solder paste margin absolute value
86  m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size
87  // The final margin is the sum of these 2 values
88  // Usually < 0 because the mask is smaller than pad
89 
90  // Layer thickness for 3D viewer
92 
93  m_viaSizeIndex = 0;
95 
96  // Default values for the footprint editor and fp creation
97  // (also covers footprints created on the fly by micor-waves tools)
98  m_ModuleTextSize = wxSize( Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ),
99  Millimeter2iu( DEFAULT_TEXT_MODULE_SIZE ) );
102 
103  // These values will be overriden by config values after reading the config
104  // Default ref text on fp creation. if empty, use footprint name as default
105  m_RefDefaultText = wxT( "REF**" );
106  m_RefDefaultVisibility = true; // Default ref text visibility on fp creation
107  m_RefDefaultlayer = int( F_SilkS ); // Default ref text layer on fp creation
108  // Default value text on fp creation. if empty, use footprint name as default
109  m_ValueDefaultText = wxEmptyString;
111  m_ValueDefaultlayer = int( F_Fab );
112 }
unsigned m_trackWidthIndex
0 is the index selection of the default value Netclass
wxString m_RefDefaultText
Default ref text on fp creation.
int m_SolderMaskMargin
Solder mask margin.
VIA_DIMENSION m_customViaSize
Custom via size (used after UseCustomTrackViaSize( true ) was called).
void SetCopperLayerCount(int aNewLayerCount)
Function SetCopperLayerCount do what its name says...
bool m_ValueDefaultVisibility
Default value text visibility on fp creation.
VIATYPE_T m_CurrentViaType
via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA)
int m_SolderPasteMargin
Solder paste margin absolute value.
int m_ModuleTextWidth
Default footprint texts thickness.
int m_ModuleSegmentWidth
Default width for all graphic lines.
int m_PcbTextWidth
current Pcb (not module) Text width
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
int m_ValueDefaultlayer
Default value text layer on fp creation.
#define DEFAULT_SOLDERMASK_CLEARANCE
#define DEFAULT_VIASMINDRILL
wxSize m_ModuleTextSize
Default footprint texts size.
bool m_UseConnectedTrackWidth
if true, when creating a new track starting on an existing track, use this track width ...
#define DEFAULT_PCB_EDGE_THICKNESS
#define DEFAULT_TEXT_MODULE_SIZE
void SetVisibleLayers(LSET aMask)
Function SetVisibleLayers changes the bit-mask of visible layers.
#define DEFAULT_GRAPHIC_THICKNESS
Class LSET is a set of PCB_LAYER_IDs.
#define DEFAULT_GR_MODULE_THICKNESS
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
wxSize m_PcbTextSize
current Pcb (not module) Text size
int m_TrackMinWidth
track min value for width ((min copper size value
int m_ViasMinSize
vias (not micro vias) min diameter
#define DEFAULT_TEXT_PCB_THICKNESS
#define DEFAULT_CUSTOMTRACKWIDTH
int m_DrawSegmentWidth
current graphic line width (not EDGE layer)
int m_ViasMinDrill
vias (not micro vias) min drill diameter
bool m_BlindBuriedViaAllowed
true to allow blind/buried vias
wxString m_ValueDefaultText
Default value text on fp creation.
#define DEFAULT_BOARD_THICKNESS_MM
int m_MicroViasMinSize
micro vias (not vias) min diameter
#define DEFAULT_MICROVIASMINDRILL
int m_visibleElements
Bit-mask for element category visibility.
unsigned m_viaSizeIndex
Index for m_ViasDimensionsList to select the current via size.
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
#define DEFAULT_MICROVIASMINSIZE
int m_RefDefaultlayer
Default ref text layer on fp creation.
#define DEFAULT_SOLDERMASK_MIN_WIDTH
bool m_MicroViasAllowed
true to allow micro vias
int m_MicroViasMinDrill
micro vias (not vias) min drill diameter
int m_EdgeSegmentWidth
current graphic line width (EDGE layer only)
double m_SolderPasteMarginRatio
Solder pask margin ratio value of pad size The final margin is the sum of these 2 values...
#define DEFAULT_TRACKMINWIDTH
LSET m_enabledLayers
Bit-mask for layer enabling.
bool m_RefDefaultVisibility
Default ref text visibility on fp creation.
int m_boardThickness
Board thickness for 3D viewer.
int m_SolderMaskMinWidth
Solder mask min width.
int m_customTrackWidth
Custom track width (used after UseCustomTrackViaSize( true ) was called).
#define DEFAULT_VIASMINSIZE
#define DEFAULT_TEXT_PCB_SIZE

Member Function Documentation

void BOARD_DESIGN_SETTINGS::AppendConfigs ( PARAM_CFG_ARRAY aResult)

Function AppendConfigs appends to aResult the configuration setting accessors which will later allow reading or writing of configuration file information directly into this object.

Definition at line 116 of file class_board_design_settings.cpp.

References D_PAD::AppendConfigs(), DEFAULT_GR_MODULE_THICKNESS, DEFAULT_GRAPHIC_THICKNESS, DEFAULT_PCB_EDGE_THICKNESS, DEFAULT_SOLDERMASK_CLEARANCE, DEFAULT_SOLDERMASK_MIN_WIDTH, DEFAULT_TEXT_MODULE_SIZE, DEFAULT_TEXT_PCB_SIZE, DEFAULT_TEXT_PCB_THICKNESS, m_DrawSegmentWidth, m_EdgeSegmentWidth, m_ModuleSegmentWidth, m_ModuleTextSize, m_ModuleTextWidth, m_Pad_Master, m_PcbTextSize, m_PcbTextWidth, m_SolderMaskMargin, m_SolderMaskMinWidth, TEXTS_MAX_SIZE, TEXTS_MAX_WIDTH, and TEXTS_MIN_SIZE.

Referenced by PCB_EDIT_FRAME::GetProjectFileParameters().

117 {
118  m_Pad_Master.AppendConfigs( aResult );
119 
120  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextSizeV" ),
121  &m_PcbTextSize.y,
123  NULL, MM_PER_IU ) );
124 
125  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextSizeH" ),
126  &m_PcbTextSize.x,
128  NULL, MM_PER_IU ) );
129 
130  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "PcbTextThickness" ),
132  Millimeter2iu(DEFAULT_TEXT_PCB_THICKNESS ),
133  Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
134  NULL, MM_PER_IU ) );
135 
136  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleTextSizeV" ),
137  &m_ModuleTextSize.y,
139  NULL, MM_PER_IU ) );
140 
141  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleTextSizeH" ),
142  &m_ModuleTextSize.x,
144  NULL, MM_PER_IU ) );
145 
146  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleTextSizeThickness" ),
148  Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ), 1, TEXTS_MAX_WIDTH,
149  NULL, MM_PER_IU ) );
150 
151  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskClearance" ),
153  Millimeter2iu( DEFAULT_SOLDERMASK_CLEARANCE ), 0, Millimeter2iu( 1.0 ),
154  NULL, MM_PER_IU ) );
155 
156  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskMinWidth" ),
158  Millimeter2iu( DEFAULT_SOLDERMASK_MIN_WIDTH ), 0, Millimeter2iu( 0.5 ),
159  NULL, MM_PER_IU ) );
160 
161  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "DrawSegmentWidth" ),
163  Millimeter2iu( DEFAULT_GRAPHIC_THICKNESS ),
164  Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
165  NULL, MM_PER_IU ) );
166 
167  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "BoardOutlineThickness" ),
169  Millimeter2iu( DEFAULT_PCB_EDGE_THICKNESS ),
170  Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
171  NULL, MM_PER_IU ) );
172 
173  aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "ModuleOutlineThickness" ),
175  Millimeter2iu( DEFAULT_GR_MODULE_THICKNESS ),
176  Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
177  NULL, MM_PER_IU ) );
178 }
int m_SolderMaskMargin
Solder mask margin.
#define TEXTS_MAX_WIDTH
Maximum text width in Pcbnew units value (0.5 inches)
Definition: pcbnew.h:64
int m_ModuleTextWidth
Default footprint texts thickness.
int m_ModuleSegmentWidth
Default width for all graphic lines.
int m_PcbTextWidth
current Pcb (not module) Text width
#define DEFAULT_SOLDERMASK_CLEARANCE
wxSize m_ModuleTextSize
Default footprint texts size.
Configuration parameter - Integer Class with unit conversion.
#define DEFAULT_PCB_EDGE_THICKNESS
#define DEFAULT_TEXT_MODULE_SIZE
#define DEFAULT_GRAPHIC_THICKNESS
#define DEFAULT_GR_MODULE_THICKNESS
wxSize m_PcbTextSize
current Pcb (not module) Text size
#define DEFAULT_TEXT_PCB_THICKNESS
int m_DrawSegmentWidth
current graphic line width (not EDGE layer)
#define TEXTS_MAX_SIZE
Maximum text size in Pcbnew units value (1 inch) )
Definition: pcbnew.h:63
#define TEXTS_MIN_SIZE
Minimum text size in Pcbnew units value (5 mils)
Definition: pcbnew.h:62
D_PAD m_Pad_Master
A dummy pad to store all default parameters.
#define DEFAULT_SOLDERMASK_MIN_WIDTH
int m_EdgeSegmentWidth
current graphic line width (EDGE layer only)
int m_SolderMaskMinWidth
Solder mask min width.
#define DEFAULT_TEXT_PCB_SIZE
void AppendConfigs(PARAM_CFG_ARRAY *aResult)
Function AppendConfigs appends to aResult the configuration setting accessors which will later allow ...
Definition: class_pad.cpp:468
void BOARD_DESIGN_SETTINGS::formatNetClass ( NETCLASS aNetClass,
OUTPUTFORMATTER aFormatter,
int  aNestLevel,
int  aControlBits 
) const
private
int BOARD_DESIGN_SETTINGS::GetBiggestClearanceValue ( )

Function GetBiggestClearanceValue.

Returns
the biggest clearance value found in NetClasses list

Definition at line 237 of file class_board_design_settings.cpp.

References NETCLASSES::begin(), NETCLASSES::end(), NETCLASSES::GetDefault(), m_NetClasses, and max.

Referenced by ZONE_CONTAINER::buildFeatureHoleList(), BuildUnconnectedThermalStubsPolygonList(), MODULE::GetBoundingBox(), and PNS_KICAD_IFACE::SyncWorld().

238 {
239  int clearance = m_NetClasses.GetDefault()->GetClearance();
240 
241  //Read list of Net Classes
242  for( NETCLASSES::const_iterator nc = m_NetClasses.begin(); nc != m_NetClasses.end(); ++nc )
243  {
244  NETCLASSPTR netclass = nc->second;
245  clearance = std::max( clearance, netclass->GetClearance() );
246  }
247 
248  return clearance;
249 }
iterator end()
NETCLASS_MAP::const_iterator const_iterator
iterator begin()
#define max(a, b)
Definition: auxiliary.h:86
NETCLASSPTR GetDefault() const
Function GetDefault.
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
int BOARD_DESIGN_SETTINGS::GetBoardThickness ( ) const
inline
int BOARD_DESIGN_SETTINGS::GetCopperLayerCount ( ) const
inline

Function GetCopperLayerCount.

Returns
int - the number of neabled copper layers

Definition at line 537 of file class_board_design_settings.h.

References m_copperLayerCount.

Referenced by DRC::doTrackDrc(), BOARD::GetCopperLayerCount(), and ROUTER_TOOL::onViaCommand().

538  {
539  return m_copperLayerCount;
540  }
int m_copperLayerCount
Number of copper layers for this design.
int BOARD_DESIGN_SETTINGS::GetCurrentMicroViaDrill ( )

Function GetCurrentMicroViaDrill.

Returns
the current micro via drill, that is the current netclass value

Definition at line 275 of file class_board_design_settings.cpp.

References NETCLASSES::Find(), m_currentNetClassName, and m_NetClasses.

Referenced by ROUTER_TOOL::onViaCommand().

276 {
277  NETCLASSPTR netclass = m_NetClasses.Find( m_currentNetClassName );
278 
279  return netclass->GetuViaDrill();
280 }
wxString m_currentNetClassName
Current net class name used to display netclass info.
NETCLASSPTR Find(const wxString &aName) const
Function Find searches this container for a NETCLASS given by aName.
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
int BOARD_DESIGN_SETTINGS::GetCurrentMicroViaSize ( )

Function GetCurrentMicroViaSize.

Returns
the current micro via size, that is the current netclass value

Definition at line 267 of file class_board_design_settings.cpp.

References NETCLASSES::Find(), m_currentNetClassName, and m_NetClasses.

Referenced by ROUTER_TOOL::onViaCommand().

268 {
269  NETCLASSPTR netclass = m_NetClasses.Find( m_currentNetClassName );
270 
271  return netclass->GetuViaDiameter();
272 }
wxString m_currentNetClassName
Current net class name used to display netclass info.
NETCLASSPTR Find(const wxString &aName) const
Function Find searches this container for a NETCLASS given by aName.
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
const wxString& BOARD_DESIGN_SETTINGS::GetCurrentNetClassName ( ) const
inline

Function GetCurrentNetClassName.

Returns
the current net class name.

Definition at line 209 of file class_board_design_settings.h.

References m_currentNetClassName.

210  {
211  return m_currentNetClassName;
212  }
wxString m_currentNetClassName
Current net class name used to display netclass info.
int BOARD_DESIGN_SETTINGS::GetCurrentTrackWidth ( ) const
inline

Function GetCurrentTrackWidth.

Returns
the current track width, according to the selected options ( using the default netclass value or a preset/custom value ) the default netclass is always in m_TrackWidthList[0]

Definition at line 288 of file class_board_design_settings.h.

References m_trackWidthIndex.

Referenced by AddNewTrace(), Autoroute_One_Track(), PCB_EDIT_FRAME::Begin_Self(), BOARD::BOARD(), EDIT_TOOL::changeTrackWidthOnClick(), PCB_EDIT_FRAME::Create_MuWaveComponent(), MICROWAVE_TOOL::createInductorBetween(), PCB_EDIT_FRAME::CreateMuWaveBaseFootprint(), PCB_EDIT_FRAME::Edit_Gap(), PCB_IO::formatSetup(), PNS::SIZES_SETTINGS::ImportCurrent(), PNS::SIZES_SETTINGS::Init(), OrCell_Trace(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), ShowNewTrackWhenMovingCursor(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::updateNetInfo().

289  {
291  }
unsigned m_trackWidthIndex
0 is the index selection of the default value Netclass
std::vector< int > m_TrackWidthList
Track width list.
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
int m_customTrackWidth
Custom track width (used after UseCustomTrackViaSize( true ) was called).
int BOARD_DESIGN_SETTINGS::GetCurrentViaDrill ( ) const

Function GetCurrentViaDrill.

Returns
the current via size, according to the selected options ( using the default netclass value or a preset/custom value ) the default netclass is always in m_TrackWidthList[0]

Definition at line 294 of file class_board_design_settings.cpp.

References m_customViaSize, VIA_DIMENSION::m_Drill, m_useCustomTrackVia, m_ViasDimensionsList, and m_viaSizeIndex.

Referenced by BOARD::BOARD(), EDIT_TOOL::changeTrackWidthOnClick(), PNS::SIZES_SETTINGS::ImportCurrent(), PNS::SIZES_SETTINGS::Init(), ROUTER_TOOL::onViaCommand(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::updateNetInfo().

295 {
296  int drill;
297 
298  if( m_useCustomTrackVia )
299  drill = m_customViaSize.m_Drill;
300  else
301  drill = m_ViasDimensionsList[m_viaSizeIndex].m_Drill;
302 
303  return drill > 0 ? drill : -1;
304 }
VIA_DIMENSION m_customViaSize
Custom via size (used after UseCustomTrackViaSize( true ) was called).
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
unsigned m_viaSizeIndex
Index for m_ViasDimensionsList to select the current via size.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
int BOARD_DESIGN_SETTINGS::GetCurrentViaSize ( ) const
inline

Function GetCurrentViaSize.

Returns
the current via size, according to the selected options ( using the default netclass value or a preset/custom value ) the default netclass is always in m_TrackWidthList[0]

Definition at line 337 of file class_board_design_settings.h.

References VIA_DIMENSION::m_Diameter, and m_viaSizeIndex.

Referenced by AddNewTrace(), BOARD::BOARD(), EDIT_TOOL::changeTrackWidthOnClick(), PNS::SIZES_SETTINGS::ImportCurrent(), PNS::SIZES_SETTINGS::Init(), ROUTER_TOOL::onViaCommand(), OrCell_Trace(), PCB_EDIT_FRAME::SetTrackSegmentWidth(), ShowNewTrackWhenMovingCursor(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::updateNetInfo().

338  {
339  if( m_useCustomTrackVia )
341  else
342  return m_ViasDimensionsList[m_viaSizeIndex].m_Diameter;
343  }
VIA_DIMENSION m_customViaSize
Custom via size (used after UseCustomTrackViaSize( true ) was called).
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
unsigned m_viaSizeIndex
Index for m_ViasDimensionsList to select the current via size.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
int BOARD_DESIGN_SETTINGS::GetCustomTrackWidth ( ) const
inline

Function GetCustomTrackWidth.

Returns
Current custom width for a track.

Definition at line 309 of file class_board_design_settings.h.

References m_customTrackWidth.

Referenced by DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE().

310  {
311  return m_customTrackWidth;
312  }
int m_customTrackWidth
Custom track width (used after UseCustomTrackViaSize( true ) was called).
int BOARD_DESIGN_SETTINGS::GetCustomViaDrill ( ) const
inline

Function GetCustomViaDrill.

Returns
Current custom size for the via drill.

Definition at line 390 of file class_board_design_settings.h.

References VIA_DIMENSION::m_Drill.

Referenced by DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE().

391  {
392  return m_customViaSize.m_Drill;
393  }
VIA_DIMENSION m_customViaSize
Custom via size (used after UseCustomTrackViaSize( true ) was called).
int BOARD_DESIGN_SETTINGS::GetCustomViaSize ( ) const
inline

Function GetCustomViaSize.

Returns
Current custom size for the via diameter.

Definition at line 361 of file class_board_design_settings.h.

References VIA_DIMENSION::m_Diameter.

Referenced by DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE().

362  {
364  }
VIA_DIMENSION m_customViaSize
Custom via size (used after UseCustomTrackViaSize( true ) was called).
NETCLASSPTR BOARD_DESIGN_SETTINGS::GetDefault ( ) const
inline
LSET BOARD_DESIGN_SETTINGS::GetEnabledLayers ( ) const
inline

Function GetEnabledLayers returns a bit-mask of all the layers that are enabled.

Returns
int - the enabled layers in bit-mapped form.

Definition at line 510 of file class_board_design_settings.h.

References m_enabledLayers.

Referenced by CreatePadsShapesSection(), CreateRoutesSection(), and BOARD::GetEnabledLayers().

511  {
512  return m_enabledLayers;
513  }
LSET m_enabledLayers
Bit-mask for layer enabling.
int BOARD_DESIGN_SETTINGS::GetSmallestClearanceValue ( )

Function GetSmallestClearanceValue.

Returns
the smallest clearance value found in NetClasses list

Definition at line 252 of file class_board_design_settings.cpp.

References NETCLASSES::begin(), NETCLASSES::end(), NETCLASSES::GetDefault(), m_NetClasses, and min.

Referenced by DIALOG_PLOT::init_Dialog().

253 {
254  int clearance = m_NetClasses.GetDefault()->GetClearance();
255 
256  //Read list of Net Classes
257  for( NETCLASSES::const_iterator nc = m_NetClasses.begin(); nc != m_NetClasses.end(); ++nc )
258  {
259  NETCLASSPTR netclass = nc->second;
260  clearance = std::min( clearance, netclass->GetClearance() );
261  }
262 
263  return clearance;
264 }
iterator end()
NETCLASS_MAP::const_iterator const_iterator
iterator begin()
NETCLASSPTR GetDefault() const
Function GetDefault.
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
#define min(a, b)
Definition: auxiliary.h:85
unsigned BOARD_DESIGN_SETTINGS::GetTrackWidthIndex ( ) const
inline

Function GetTrackWidthIndex.

Returns
the current track width list index.

Definition at line 272 of file class_board_design_settings.h.

References m_trackWidthIndex.

Referenced by Append_Track_Width_List(), PCB_EDIT_FRAME::OnUpdateSelectTrackWidth(), SetCurrentNetClass(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), and DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::updateNetInfo().

272 { return m_trackWidthIndex; }
unsigned m_trackWidthIndex
0 is the index selection of the default value Netclass
unsigned BOARD_DESIGN_SETTINGS::GetViaSizeIndex ( ) const
inline

Function GetViaSizeIndex.

Returns
the current via size list index.

Definition at line 318 of file class_board_design_settings.h.

References m_viaSizeIndex.

Referenced by Append_Track_Width_List(), PCB_EDIT_FRAME::OnUpdateSelectViaSize(), SetCurrentNetClass(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::updateNetInfo(), PCB_EDITOR_CONTROL::ViaSizeDec(), and PCB_EDITOR_CONTROL::ViaSizeInc().

319  {
320  return m_viaSizeIndex;
321  }
unsigned m_viaSizeIndex
Index for m_ViasDimensionsList to select the current via size.
int BOARD_DESIGN_SETTINGS::GetVisibleElements ( ) const
inline

Function GetVisibleElements returns a bit-mask of all the element categories that are visible.

Returns
int - the visible element categories in bit-mapped form.

Definition at line 468 of file class_board_design_settings.h.

References m_visibleElements.

Referenced by PCB_IO::formatSetup(), and BOARD::GetVisibleElements().

469  {
470  return m_visibleElements;
471  }
int m_visibleElements
Bit-mask for element category visibility.
LSET BOARD_DESIGN_SETTINGS::GetVisibleLayers ( ) const
inline

Function GetVisibleLayers returns a bit-mask of all the layers that are visible.

Returns
int - the visible layers in bit-mapped form.

Definition at line 421 of file class_board_design_settings.h.

References m_visibleLayers.

Referenced by BOARD::GetVisibleLayers().

422  {
423  return m_visibleLayers;
424  }
LSET m_visibleLayers
Bit-mask for layer visibility.
bool BOARD_DESIGN_SETTINGS::IsElementVisible ( GAL_LAYER_ID  aElementCategory) const
inline

Function IsElementVisible tests whether a given element category is visible.

Keep this as an inline function.

Parameters
aElementCategoryis from the enum by the same name
Returns
bool - true if the element is visible.
See also
enum GAL_LAYER_ID

Definition at line 491 of file class_board_design_settings.h.

References GAL_LAYER_INDEX.

Referenced by BOARD::IsElementVisible().

492  {
493  return ( m_visibleElements & ( 1 << GAL_LAYER_INDEX( aElementCategory ) ) );
494  }
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
int m_visibleElements
Bit-mask for element category visibility.
bool BOARD_DESIGN_SETTINGS::IsLayerEnabled ( PCB_LAYER_ID  aLayerId) const
inline

Function IsLayerEnabled tests whether a given layer is enabled.

Parameters
aLayerId= The layer to be tested
Returns
bool - true if the layer is enabled

Definition at line 528 of file class_board_design_settings.h.

Referenced by BOARD::IsLayerEnabled(), and SetLayerVisibility().

529  {
530  return m_enabledLayers[aLayerId];
531  }
LSET m_enabledLayers
Bit-mask for layer enabling.
bool BOARD_DESIGN_SETTINGS::IsLayerVisible ( PCB_LAYER_ID  aLayerId) const
inline

Function IsLayerVisible tests whether a given layer is visible.

Parameters
aLayerId= The layer to be tested
Returns
bool - true if the layer is visible.

Definition at line 449 of file class_board_design_settings.h.

Referenced by BOARD::GetVisibleTrack(), CINFO3D_VISU::Is3DLayerEnabled(), and BOARD::IsLayerVisible().

450  {
451  // If a layer is disabled, it is automatically invisible
452  return (m_visibleLayers & m_enabledLayers)[aLayerId];
453  }
LSET m_visibleLayers
Bit-mask for layer visibility.
LSET m_enabledLayers
Bit-mask for layer enabling.
void BOARD_DESIGN_SETTINGS::SetBoardThickness ( int  aThickness)
inline

Definition at line 558 of file class_board_design_settings.h.

Referenced by LEGACY_PLUGIN::loadGENERAL(), and DIALOG_LAYERS_SETUP::TransferDataFromWindow().

558 { m_boardThickness = aThickness; }
int m_boardThickness
Board thickness for 3D viewer.
void BOARD_DESIGN_SETTINGS::SetCopperLayerCount ( int  aNewLayerCount)

Function SetCopperLayerCount do what its name says...

Parameters
aNewLayerCount= The new number of enabled copper layers

Definition at line 343 of file class_board_design_settings.cpp.

References ALL_CU_LAYERS, LSET::AllCuMask(), LAYER_BACK, LAYER_FRONT, LAYER_N_2, m_copperLayerCount, and m_enabledLayers.

Referenced by BOARD_DESIGN_SETTINGS(), and BOARD::SetCopperLayerCount().

344 {
345  // if( aNewLayerCount < 2 ) aNewLayerCount = 2;
346 
347  m_copperLayerCount = aNewLayerCount;
348 
349  // ensure consistency with the m_EnabledLayers member
350 #if 0
351  // was:
354 
355  if( m_copperLayerCount > 1 )
357 
358  for( LAYER_NUM ii = LAYER_N_2; ii < aNewLayerCount - 1; ++ii )
359  m_enabledLayers |= GetLayerSet( ii );
360 #else
361  // Update only enabled copper layers mask
362  m_enabledLayers &= ~LSET::AllCuMask();
363  m_enabledLayers |= LSET::AllCuMask( aNewLayerCount );
364 #endif
365 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:646
#define LAYER_FRONT
bit mask for component layer
Class LSET is a set of PCB_LAYER_IDs.
#define ALL_CU_LAYERS
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
#define LAYER_BACK
bit mask for copper layer
#define LAYER_N_2
int m_copperLayerCount
Number of copper layers for this design.
LSET m_enabledLayers
Bit-mask for layer enabling.
bool BOARD_DESIGN_SETTINGS::SetCurrentNetClass ( const wxString &  aNetClassName)

Function SetCurrentNetClass Must be called after a netclass selection (or after a netclass parameter change Initialize vias and tracks values displayed in comb boxes of the auxiliary toolbar and some others parameters (netclass name ....)

Parameters
aNetClassName= the new netclass name
Returns
true if lists of tracks and vias sizes are modified

Definition at line 181 of file class_board_design_settings.cpp.

References NETCLASSES::Find(), NETCLASSES::GetDefault(), GetTrackWidthIndex(), GetViaSizeIndex(), m_currentNetClassName, m_NetClasses, m_TrackWidthList, m_ViasDimensionsList, SetTrackWidthIndex(), and SetViaSizeIndex().

Referenced by BOARD::BOARD(), SaveBoard(), and DIALOG_DESIGN_RULES::TransferDataFromWindow().

182 {
183  NETCLASSPTR netClass = m_NetClasses.Find( aNetClassName );
184  bool lists_sizes_modified = false;
185 
186  // if not found (should not happen) use the default
187  if( netClass == NULL )
188  netClass = m_NetClasses.GetDefault();
189 
190  m_currentNetClassName = netClass->GetName();
191 
192  // Initialize others values:
193  if( m_ViasDimensionsList.size() == 0 )
194  {
195  VIA_DIMENSION viadim;
196  lists_sizes_modified = true;
197  m_ViasDimensionsList.push_back( viadim );
198  }
199 
200  if( m_TrackWidthList.size() == 0 )
201  {
202  lists_sizes_modified = true;
203  m_TrackWidthList.push_back( 0 );
204  }
205 
206  /* note the m_ViasDimensionsList[0] and m_TrackWidthList[0] values
207  * are always the Netclass values
208  */
209  if( m_ViasDimensionsList[0].m_Diameter != netClass->GetViaDiameter() )
210  {
211  lists_sizes_modified = true;
212  m_ViasDimensionsList[0].m_Diameter = netClass->GetViaDiameter();
213  }
214 
215  if( m_ViasDimensionsList[0].m_Drill != netClass->GetViaDrill() )
216  {
217  lists_sizes_modified = true;
218  m_ViasDimensionsList[0].m_Drill = netClass->GetViaDrill();
219  }
220 
221  if( m_TrackWidthList[0] != netClass->GetTrackWidth() )
222  {
223  lists_sizes_modified = true;
224  m_TrackWidthList[0] = netClass->GetTrackWidth();
225  }
226 
227  if( GetViaSizeIndex() >= m_ViasDimensionsList.size() )
229 
230  if( GetTrackWidthIndex() >= m_TrackWidthList.size() )
232 
233  return lists_sizes_modified;
234 }
Struct VIA_DIMENSION is a small helper container to handle a stock of specific vias each with unique ...
void SetTrackWidthIndex(unsigned aIndex)
Function SetTrackWidthIndex sets the current track width list index to aIndex.
wxString m_currentNetClassName
Current net class name used to display netclass info.
NETCLASSPTR Find(const wxString &aName) const
Function Find searches this container for a NETCLASS given by aName.
std::vector< int > m_TrackWidthList
Track width list.
unsigned GetViaSizeIndex() const
Function GetViaSizeIndex.
void SetViaSizeIndex(unsigned aIndex)
Function SetViaSizeIndex sets the current via size list index to aIndex.
NETCLASSPTR GetDefault() const
Function GetDefault.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
unsigned GetTrackWidthIndex() const
Function GetTrackWidthIndex.
NETCLASSES m_NetClasses
List of current netclasses. There is always the default netclass.
void BOARD_DESIGN_SETTINGS::SetCustomTrackWidth ( int  aWidth)
inline

Function SetCustomTrackWidth Sets custom width for track (i.e.

not available in netclasses or preset list). To have it returned with GetCurrentTrackWidth() you need to enable custom track & via sizes (UseCustomTrackViaSize()).

Parameters
aWidthis the new track width.

Definition at line 300 of file class_board_design_settings.h.

Referenced by BOARD::BOARD(), DIALOG_TRACK_VIA_SIZE::onOkClick(), and BOARD::SynchronizeNetsAndNetClasses().

301  {
302  m_customTrackWidth = aWidth;
303  }
int m_customTrackWidth
Custom track width (used after UseCustomTrackViaSize( true ) was called).
void BOARD_DESIGN_SETTINGS::SetCustomViaDrill ( int  aDrill)
inline

Function SetCustomViaDrill Sets custom size for via drill (i.e.

not available in netclasses or preset list). To have it returned with GetCurrentViaDrill() you need to enable custom track & via sizes (UseCustomTrackViaSize()).

Parameters
aDrillis the new drill size.

Definition at line 381 of file class_board_design_settings.h.

References VIA_DIMENSION::m_Drill.

Referenced by BOARD::BOARD(), DIALOG_TRACK_VIA_SIZE::onOkClick(), and BOARD::SynchronizeNetsAndNetClasses().

382  {
383  m_customViaSize.m_Drill = aDrill;
384  }
VIA_DIMENSION m_customViaSize
Custom via size (used after UseCustomTrackViaSize( true ) was called).
void BOARD_DESIGN_SETTINGS::SetCustomViaSize ( int  aSize)
inline

Function SetCustomViaSize Sets custom size for via diameter (i.e.

not available in netclasses or preset list). To have it returned with GetCurrentViaSize() you need to enable custom track & via sizes (UseCustomTrackViaSize()).

Parameters
aSizeis the new drill diameter.

Definition at line 352 of file class_board_design_settings.h.

References VIA_DIMENSION::m_Diameter.

Referenced by BOARD::BOARD(), DIALOG_TRACK_VIA_SIZE::onOkClick(), and BOARD::SynchronizeNetsAndNetClasses().

353  {
354  m_customViaSize.m_Diameter = aSize;
355  }
VIA_DIMENSION m_customViaSize
Custom via size (used after UseCustomTrackViaSize( true ) was called).
void BOARD_DESIGN_SETTINGS::SetElementVisibility ( GAL_LAYER_ID  aElementCategory,
bool  aNewState 
)

Function SetElementVisibility changes the visibility of an element category.

Parameters
aElementCategoryis from the enum by the same name
aNewState= The new visibility state of the element category
See also
enum GAL_LAYER_ID

Definition at line 334 of file class_board_design_settings.cpp.

References GAL_LAYER_INDEX, and m_visibleElements.

Referenced by BOARD::SetElementVisibility().

335 {
336  if( aNewState )
337  m_visibleElements |= 1 << GAL_LAYER_INDEX( aElementCategory );
338  else
339  m_visibleElements &= ~( 1 << GAL_LAYER_INDEX( aElementCategory ) );
340 }
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
int m_visibleElements
Bit-mask for element category visibility.
void BOARD_DESIGN_SETTINGS::SetEnabledLayers ( LSET  aMask)

Function SetEnabledLayers changes the bit-mask of enabled layers.

Parameters
aMask= The new bit-mask of enabled layers

Definition at line 368 of file class_board_design_settings.cpp.

References LSET::AllCuMask(), B_Cu, F_Cu, m_copperLayerCount, m_enabledLayers, and m_visibleLayers.

Referenced by BOARD::SetEnabledLayers().

369 {
370  // Back and front layers are always enabled.
371  aMask.set( B_Cu ).set( F_Cu );
372 
373  m_enabledLayers = aMask;
374 
375  // A disabled layer cannot be visible
376  m_visibleLayers &= aMask;
377 
378  // update m_CopperLayerCount to ensure its consistency with m_EnabledLayers
379  m_copperLayerCount = ( aMask & LSET::AllCuMask() ).count();
380 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:646
LSET m_visibleLayers
Bit-mask for layer visibility.
int m_copperLayerCount
Number of copper layers for this design.
LSET m_enabledLayers
Bit-mask for layer enabling.
void BOARD_DESIGN_SETTINGS::SetLayerVisibility ( PCB_LAYER_ID  aLayerId,
bool  aNewState 
)

Function SetLayerVisibility changes the visibility of a given layer.

Parameters
aLayerId= The layer to be changed
aNewState= The new visibility state of the layer

Definition at line 325 of file class_board_design_settings.cpp.

References IsLayerEnabled(), and m_visibleLayers.

326 {
327  if( aNewState && IsLayerEnabled( aLayer ) )
328  m_visibleLayers.set( aLayer, true );
329  else
330  m_visibleLayers.set( aLayer, false );
331 }
bool IsLayerEnabled(PCB_LAYER_ID aLayerId) const
Function IsLayerEnabled tests whether a given layer is enabled.
LSET m_visibleLayers
Bit-mask for layer visibility.
void BOARD_DESIGN_SETTINGS::SetTrackWidthIndex ( unsigned  aIndex)

Function SetTrackWidthIndex sets the current track width list index to aIndex.

Parameters
aIndexis the track width list index.

Definition at line 307 of file class_board_design_settings.cpp.

References m_trackWidthIndex, m_TrackWidthList, and m_useCustomTrackVia.

Referenced by TRACK_WIDTH_MENU::eventHandler(), PCB_EDIT_FRAME::OnHotKey(), SetCurrentNetClass(), PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), and PCB_EDIT_FRAME::updateTraceWidthSelectBox().

308 {
309  if( aIndex >= m_TrackWidthList.size() )
311  else
312  m_trackWidthIndex = aIndex;
313 
314  m_useCustomTrackVia = false;
315 }
unsigned m_trackWidthIndex
0 is the index selection of the default value Netclass
std::vector< int > m_TrackWidthList
Track width list.
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
void BOARD_DESIGN_SETTINGS::SetViaSizeIndex ( unsigned  aIndex)

Function SetViaSizeIndex sets the current via size list index to aIndex.

Parameters
aIndexis the via size list index.

Definition at line 283 of file class_board_design_settings.cpp.

References m_useCustomTrackVia, m_ViasDimensionsList, and m_viaSizeIndex.

Referenced by TRACK_WIDTH_MENU::eventHandler(), SetCurrentNetClass(), PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event(), PCB_EDIT_FRAME::updateViaSizeSelectBox(), PCB_EDITOR_CONTROL::ViaSizeDec(), and PCB_EDITOR_CONTROL::ViaSizeInc().

284 {
285  if( aIndex >= m_ViasDimensionsList.size() )
287  else
288  m_viaSizeIndex = aIndex;
289 
290  m_useCustomTrackVia = false;
291 }
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
unsigned m_viaSizeIndex
Index for m_ViasDimensionsList to select the current via size.
std::vector< VIA_DIMENSION > m_ViasDimensionsList
Vias size and drill list.
void BOARD_DESIGN_SETTINGS::SetVisibleAlls ( )

Function SetVisibleAlls Set the bit-mask of all visible elements categories, including enabled layers.

Definition at line 318 of file class_board_design_settings.cpp.

References m_visibleElements, and SetVisibleLayers().

319 {
320  SetVisibleLayers( LSET().set() );
321  m_visibleElements = -1;
322 }
void SetVisibleLayers(LSET aMask)
Function SetVisibleLayers changes the bit-mask of visible layers.
Class LSET is a set of PCB_LAYER_IDs.
int m_visibleElements
Bit-mask for element category visibility.
void BOARD_DESIGN_SETTINGS::SetVisibleElements ( int  aMask)
inline

Function SetVisibleElements changes the bit-mask of visible element categories.

Parameters
aMask= The new bit-mask of visible element categories

Definition at line 478 of file class_board_design_settings.h.

Referenced by LEGACY_PLUGIN::loadSETUP(), and PCB_PARSER::parseSetup().

479  {
480  m_visibleElements = aMask;
481  }
int m_visibleElements
Bit-mask for element category visibility.
void BOARD_DESIGN_SETTINGS::SetVisibleLayers ( LSET  aMask)
inline

Function SetVisibleLayers changes the bit-mask of visible layers.

Parameters
aMask= The new bit-mask of visible layers

Definition at line 438 of file class_board_design_settings.h.

References m_enabledLayers.

Referenced by BOARD_DESIGN_SETTINGS(), SetVisibleAlls(), and BOARD::SetVisibleLayers().

439  {
441  }
LSET m_visibleLayers
Bit-mask for layer visibility.
LSET m_enabledLayers
Bit-mask for layer enabling.
void BOARD_DESIGN_SETTINGS::UseCustomTrackViaSize ( bool  aEnabled)
inline

Function UseCustomTrackViaSize Enables/disables custom track/via size settings.

If enabled, values set with SetCustomTrackWidth()/SetCustomViaSize()/SetCustomViaDrill() are used for newly created tracks and vias.

Parameters
aEnableddecides if custom settings should be used for new tracks/vias.

Definition at line 402 of file class_board_design_settings.h.

Referenced by BOARD::BOARD(), ROUTER_TOOL::CustomTrackWidthDialog(), TRACK_WIDTH_MENU::eventHandler(), PCB_EDIT_FRAME::OnUpdateSelectTrackWidth(), PCB_EDIT_FRAME::OnUpdateSelectViaSize(), BOARD::SynchronizeNetsAndNetClasses(), PCB_EDITOR_CONTROL::TrackWidthDec(), PCB_EDITOR_CONTROL::TrackWidthInc(), PCB_EDITOR_CONTROL::ViaSizeDec(), and PCB_EDITOR_CONTROL::ViaSizeInc().

403  {
404  m_useCustomTrackVia = aEnabled;
405  }
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
bool BOARD_DESIGN_SETTINGS::UseCustomTrackViaSize ( ) const
inline

Function UseCustomTrackViaSize.

Returns
True if custom sizes of tracks & vias are enabled, false otherwise.

Definition at line 411 of file class_board_design_settings.h.

References m_useCustomTrackVia.

412  {
413  return m_useCustomTrackVia;
414  }
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
bool BOARD_DESIGN_SETTINGS::UseNetClassTrack ( ) const
inline

Function UseNetClassTrack returns true if netclass values should be used to obtain appropriate track width.

Definition at line 218 of file class_board_design_settings.h.

Referenced by PNS::SIZES_SETTINGS::Init().

219  {
220  return ( m_trackWidthIndex == 0 && !m_useCustomTrackVia );
221  }
unsigned m_trackWidthIndex
0 is the index selection of the default value Netclass
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
bool BOARD_DESIGN_SETTINGS::UseNetClassVia ( ) const
inline

Function UseNetClassVia returns true if netclass values should be used to obtain appropriate via size.

Definition at line 227 of file class_board_design_settings.h.

Referenced by PNS::SIZES_SETTINGS::Init().

228  {
229  return ( m_viaSizeIndex == 0 && !m_useCustomTrackVia );
230  }
bool m_useCustomTrackVia
Use custom values for track/via sizes (not specified in net class nor in the size lists)...
unsigned m_viaSizeIndex
Index for m_ViasDimensionsList to select the current via size.

Member Data Documentation

wxPoint BOARD_DESIGN_SETTINGS::m_AuxOrigin
bool BOARD_DESIGN_SETTINGS::m_BlindBuriedViaAllowed
int BOARD_DESIGN_SETTINGS::m_boardThickness
private

Board thickness for 3D viewer.

Definition at line 187 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), and GetBoardThickness().

int BOARD_DESIGN_SETTINGS::m_copperLayerCount
private

Number of copper layers for this design.

Definition at line 181 of file class_board_design_settings.h.

Referenced by GetCopperLayerCount(), SetCopperLayerCount(), and SetEnabledLayers().

wxString BOARD_DESIGN_SETTINGS::m_currentNetClassName
private

Current net class name used to display netclass info.

This is also the last used netclass after starting a track.

Definition at line 191 of file class_board_design_settings.h.

Referenced by GetCurrentMicroViaDrill(), GetCurrentMicroViaSize(), GetCurrentNetClassName(), and SetCurrentNetClass().

VIATYPE_T BOARD_DESIGN_SETTINGS::m_CurrentViaType
int BOARD_DESIGN_SETTINGS::m_customTrackWidth
private

Custom track width (used after UseCustomTrackViaSize( true ) was called).

Definition at line 176 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), and GetCustomTrackWidth().

VIA_DIMENSION BOARD_DESIGN_SETTINGS::m_customViaSize
private

Custom via size (used after UseCustomTrackViaSize( true ) was called).

Definition at line 179 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), and GetCurrentViaDrill().

LSET BOARD_DESIGN_SETTINGS::m_enabledLayers
private

Bit-mask for layer enabling.

Definition at line 183 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), GetEnabledLayers(), SetCopperLayerCount(), SetEnabledLayers(), and SetVisibleLayers().

wxPoint BOARD_DESIGN_SETTINGS::m_GridOrigin
wxString BOARD_DESIGN_SETTINGS::m_RefDefaultText
bool BOARD_DESIGN_SETTINGS::m_RefDefaultVisibility
double BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio
unsigned BOARD_DESIGN_SETTINGS::m_trackWidthIndex
private

0 is the index selection of the default value Netclass

Definition at line 170 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), GetCurrentTrackWidth(), GetTrackWidthIndex(), and SetTrackWidthIndex().

bool BOARD_DESIGN_SETTINGS::m_UseConnectedTrackWidth
bool BOARD_DESIGN_SETTINGS::m_useCustomTrackVia
private

Use custom values for track/via sizes (not specified in net class nor in the size lists).

Definition at line 173 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), GetCurrentViaDrill(), SetTrackWidthIndex(), SetViaSizeIndex(), and UseCustomTrackViaSize().

wxString BOARD_DESIGN_SETTINGS::m_ValueDefaultText
bool BOARD_DESIGN_SETTINGS::m_ValueDefaultVisibility
unsigned BOARD_DESIGN_SETTINGS::m_viaSizeIndex
private

Index for m_ViasDimensionsList to select the current via size.

0 is the index selection of the default value Netclass

Definition at line 166 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), GetCurrentViaDrill(), GetCurrentViaSize(), GetViaSizeIndex(), and SetViaSizeIndex().

int BOARD_DESIGN_SETTINGS::m_visibleElements
private

Bit-mask for element category visibility.

Definition at line 186 of file class_board_design_settings.h.

Referenced by BOARD_DESIGN_SETTINGS(), GetVisibleElements(), SetElementVisibility(), and SetVisibleAlls().

LSET BOARD_DESIGN_SETTINGS::m_visibleLayers
private

Bit-mask for layer visibility.

Definition at line 184 of file class_board_design_settings.h.

Referenced by GetVisibleLayers(), SetEnabledLayers(), and SetLayerVisibility().


The documentation for this class was generated from the following files: