KiCad PCB EDA Suite
DIELECTRIC_SUBSTRATE_LIST Class Reference

#include <dielectric_material.h>

Public Types

enum  DL_MATERIAL_LIST_TYPE { DL_MATERIAL_DIELECTRIC, DL_MATERIAL_SOLDERMASK, DL_MATERIAL_SILKSCREEN }
 

Public Member Functions

 DIELECTRIC_SUBSTRATE_LIST (DL_MATERIAL_LIST_TYPE aListType)
 
int GetCount ()
 
DIELECTRIC_SUBSTRATEGetSubstrate (int aIdx)
 
DIELECTRIC_SUBSTRATEGetSubstrate (const wxString &aName)
 The comparison is case insensitive. More...
 
int FindSubstrate (DIELECTRIC_SUBSTRATE *aItem)
 Find a item in list similar to aItem. More...
 
int FindSubstrate (const wxString &aName, double aEpsilonR, double aLossTg)
 Find a item in list having the same parameters. More...
 
int AppendSubstrate (DIELECTRIC_SUBSTRATE &aItem)
 Append a item in list similar to aItem. More...
 

Private Attributes

std::vector< DIELECTRIC_SUBSTRATEm_substrateList
 < The list of available substrates. It contains at least predefined substrates More...
 

Detailed Description

Definition at line 48 of file dielectric_material.h.

Member Enumeration Documentation

◆ DL_MATERIAL_LIST_TYPE

Constructor & Destructor Documentation

◆ DIELECTRIC_SUBSTRATE_LIST()

DIELECTRIC_SUBSTRATE_LIST::DIELECTRIC_SUBSTRATE_LIST ( DL_MATERIAL_LIST_TYPE  aListType)
Parameters
aForDielectricset to DL_MATERIAL_DIELECTRIC to build a dielectric material list or DL_MATERIAL_SOLDERMASK to build a solder mask material list.

Definition at line 87 of file dielectric_material.cpp.

88 {
89  // Fills the m_substrateList with predefined params:
90  switch( aListType )
91  {
93  for( unsigned ii = 0; ii < arrayDim( substrateMaterial ); ++ii )
94  m_substrateList.push_back( substrateMaterial[ii] );
95  break;
96 
98  for( unsigned ii = 0; ii < arrayDim( solderMaskMaterial ); ++ii )
99  m_substrateList.push_back( solderMaskMaterial[ii] );
100  break;
101 
103  for( unsigned ii = 0; ii < arrayDim( silkscreenMaterial ); ++ii )
104  m_substrateList.push_back( silkscreenMaterial[ii] );
105  break;
106  }
107 }
static DIELECTRIC_SUBSTRATE solderMaskMaterial[]
std::vector< DIELECTRIC_SUBSTRATE > m_substrateList
< The list of available substrates. It contains at least predefined substrates
static DIELECTRIC_SUBSTRATE substrateMaterial[]
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
static DIELECTRIC_SUBSTRATE silkscreenMaterial[]

References arrayDim(), DL_MATERIAL_DIELECTRIC, DL_MATERIAL_SILKSCREEN, DL_MATERIAL_SOLDERMASK, m_substrateList, silkscreenMaterial, solderMaskMaterial, and substrateMaterial.

Member Function Documentation

◆ AppendSubstrate()

int DIELECTRIC_SUBSTRATE_LIST::AppendSubstrate ( DIELECTRIC_SUBSTRATE aItem)
inline

Append a item in list similar to aItem.

Parameters
aItemis the item to append.
Returns
the index of the new item in list.

Definition at line 113 of file dielectric_material.h.

114  {
115  m_substrateList.emplace_back( aItem );
116  return GetCount()-1;
117  }
std::vector< DIELECTRIC_SUBSTRATE > m_substrateList
< The list of available substrates. It contains at least predefined substrates

References GetCount(), and m_substrateList.

Referenced by PANEL_SETUP_BOARD_STACKUP::onMaterialChange().

◆ FindSubstrate() [1/2]

int DIELECTRIC_SUBSTRATE_LIST::FindSubstrate ( DIELECTRIC_SUBSTRATE aItem)

Find a item in list similar to aItem.

The comparison is for the name case insensitive, and EpsilonR and LossTg must match.

Parameters
aItemis the item to match.
Returns
the index of similar item in list or -1 if not found.

Definition at line 131 of file dielectric_material.cpp.

132 {
133  // Find a item matching aItem. The comparison is for the name case insensitive
134  int idx = 0;
135 
137  {
138 
139  if( item.m_EpsilonR == aItem->m_EpsilonR &&
140  item.m_LossTangent == aItem->m_LossTangent &&
141  item.m_Name.CmpNoCase( aItem->m_Name ) == 0 )
142  {
143  return idx;
144  }
145 
146  ++idx;
147  }
148 
149  return -1;
150 }
std::vector< DIELECTRIC_SUBSTRATE > m_substrateList
< The list of available substrates. It contains at least predefined substrates

References DIELECTRIC_SUBSTRATE::m_EpsilonR, DIELECTRIC_SUBSTRATE::m_LossTangent, DIELECTRIC_SUBSTRATE::m_Name, and m_substrateList.

Referenced by PANEL_SETUP_BOARD_STACKUP::onMaterialChange().

◆ FindSubstrate() [2/2]

int DIELECTRIC_SUBSTRATE_LIST::FindSubstrate ( const wxString &  aName,
double  aEpsilonR,
double  aLossTg 
)

Find a item in list having the same parameters.

Parameters
aNameis the name to match (case insensitive).
aEpsilonRis the relative permeability to match.
aLossTgis the loss tangent to match.
Returns
the index of similar item in list or -1 if not found.

Definition at line 153 of file dielectric_material.cpp.

154 {
155  // Find a item matching parameters
156  int idx = 0;
157 
159  {
160 
161  if( item.m_EpsilonR == aEpsilonR &&
162  item.m_LossTangent == aLossTg &&
163  item.m_Name.CmpNoCase( aName ) == 0 )
164  {
165  return idx;
166  }
167 
168  ++idx;
169  }
170 
171  return -1;
172 }
std::vector< DIELECTRIC_SUBSTRATE > m_substrateList
< The list of available substrates. It contains at least predefined substrates

References m_substrateList.

◆ GetCount()

int DIELECTRIC_SUBSTRATE_LIST::GetCount ( )
inline
Returns
the number of substrates in list

Definition at line 70 of file dielectric_material.h.

70 { return (int)m_substrateList.size(); }
std::vector< DIELECTRIC_SUBSTRATE > m_substrateList
< The list of available substrates. It contains at least predefined substrates

References m_substrateList.

Referenced by AppendSubstrate(), GetSubstrate(), and DIALOG_DIELECTRIC_MATERIAL::initMaterialList().

◆ GetSubstrate() [1/2]

DIELECTRIC_SUBSTRATE * DIELECTRIC_SUBSTRATE_LIST::GetSubstrate ( int  aIdx)
Returns
the substrate in list of index aIdx if incorrect return nullptr.
Parameters
aIdxis the index in substrate list.

Definition at line 110 of file dielectric_material.cpp.

111 {
112  if( aIdx >= 0 && aIdx < GetCount() )
113  return &m_substrateList[aIdx];
114 
115  return nullptr;
116 }
std::vector< DIELECTRIC_SUBSTRATE > m_substrateList
< The list of available substrates. It contains at least predefined substrates

References GetCount(), and m_substrateList.

Referenced by DIALOG_DIELECTRIC_MATERIAL::initMaterialList(), and DIALOG_DIELECTRIC_MATERIAL::onListItemSelected().

◆ GetSubstrate() [2/2]

DIELECTRIC_SUBSTRATE * DIELECTRIC_SUBSTRATE_LIST::GetSubstrate ( const wxString &  aName)

The comparison is case insensitive.

Parameters
aNameis the name of the substrate in substrate list.
Returns
the substrate in list of name aName if not found return nullptr.

Definition at line 119 of file dielectric_material.cpp.

120 {
122  {
123  if( item.m_Name.CmpNoCase( aName ) == 0 )
124  return &item;
125  }
126 
127  return nullptr;
128 }
std::vector< DIELECTRIC_SUBSTRATE > m_substrateList
< The list of available substrates. It contains at least predefined substrates

References m_substrateList.

Member Data Documentation

◆ m_substrateList

std::vector<DIELECTRIC_SUBSTRATE> DIELECTRIC_SUBSTRATE_LIST::m_substrateList
private

< The list of available substrates. It contains at least predefined substrates

Definition at line 51 of file dielectric_material.h.

Referenced by AppendSubstrate(), DIELECTRIC_SUBSTRATE_LIST(), FindSubstrate(), GetCount(), and GetSubstrate().


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