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 89 of file dielectric_material.cpp.

90 {
91  // Fills the m_substrateList with predefined params:
92  switch( aListType )
93  {
95  for( unsigned ii = 0; ii < arrayDim( substrateMaterial ); ++ii )
96  m_substrateList.push_back( substrateMaterial[ii] );
97  break;
98 
100  for( unsigned ii = 0; ii < arrayDim( solderMaskMaterial ); ++ii )
101  m_substrateList.push_back( solderMaskMaterial[ii] );
102  break;
103 
105  for( unsigned ii = 0; ii < arrayDim( silkscreenMaterial ); ++ii )
106  m_substrateList.push_back( silkscreenMaterial[ii] );
107  break;
108  }
109 }
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 133 of file dielectric_material.cpp.

134 {
135  // Find a item matching aItem. The comparison is for the name case insensitive
136  int idx = 0;
138  {
139 
140  if( item.m_EpsilonR == aItem->m_EpsilonR &&
141  item.m_LossTangent == aItem->m_LossTangent &&
142  item.m_Name.CmpNoCase( aItem->m_Name ) == 0
143  )
144  return idx;
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;
158  {
159 
160  if( item.m_EpsilonR == aEpsilonR &&
161  item.m_LossTangent == aLossTg &&
162  item.m_Name.CmpNoCase( aName ) == 0
163  )
164  return idx;
165 
166  ++idx;
167  }
168 
169  return -1;
170 }
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 112 of file dielectric_material.cpp.

113 {
114  if( aIdx >= 0 && aIdx < GetCount() )
115  return &m_substrateList[aIdx];
116 
117  return nullptr;
118 }
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 121 of file dielectric_material.cpp.

122 {
124  {
125  if( item.m_Name.CmpNoCase( aName ) == 0 )
126  return &item;
127  }
128 
129  return nullptr;
130 }
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: