KiCad PCB EDA Suite
stackup_predefined_prms.cpp File Reference
#include "board_stackup.h"
#include <convert_to_biu.h>
#include <core/arraydim.h>
#include <layer_ids.h>
#include <board_design_settings.h>
#include <i18n_utility.h>
#include <macros.h>
#include "stackup_predefined_prms.h"

Go to the source code of this file.

Functions

wxArrayString GetCopperFinishStandardList (bool aTranslate)
 
const FAB_LAYER_COLORGetColorStandardList ()
 
int GetColorStandardListCount ()
 
int GetColorUserDefinedListIdx ()
 

Variables

static wxString CopperFinishType []
 
static FAB_LAYER_COLOR solderMaskColors []
 

Function Documentation

◆ GetColorStandardList()

◆ GetColorStandardListCount()

int GetColorStandardListCount ( )
Returns
the count of colors in ColorStandardList

Definition at line 98 of file stackup_predefined_prms.cpp.

99 {
100  return arrayDim( solderMaskColors );
101 }
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
static FAB_LAYER_COLOR solderMaskColors[]

Referenced by PANEL_SETUP_BOARD_STACKUP::createBmComboBox(), PANEL_SETUP_BOARD_STACKUP::createRowData(), GetColorUserDefinedListIdx(), PANEL_SETUP_BOARD_STACKUP::onColorSelected(), PANEL_3D_COLORS::OnLoadColorsFromBoardStackup(), and PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard().

◆ GetColorUserDefinedListIdx()

int GetColorUserDefinedListIdx ( )
Returns
the index of the user defined color in ColorStandardList

Definition at line 104 of file stackup_predefined_prms.cpp.

105 {
106  // this is the last item in list
107  return GetColorStandardListCount() - 1;
108 }
int GetColorStandardListCount()

References GetColorStandardListCount().

Referenced by PANEL_SETUP_BOARD_STACKUP::createRowData(), PANEL_SETUP_BOARD_STACKUP::GetSelectedColor(), PANEL_SETUP_BOARD_STACKUP::onColorSelected(), PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard(), and PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup().

◆ GetCopperFinishStandardList()

wxArrayString GetCopperFinishStandardList ( bool  aTranslate)
Returns
a wxArray of standard copper finish names.
Parameters
aTranslate= false for the initial names, true for translated names

Definition at line 81 of file stackup_predefined_prms.cpp.

82 {
83  wxArrayString list;
84 
85  for( unsigned ii = 0; ii < arrayDim( CopperFinishType ); ii++ )
86  list.Add( aTranslate ? wxGetTranslation( CopperFinishType[ii] ) : CopperFinishType[ii] );
87 
88  return list;
89 }
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
Definition: arraydim.h:31
static wxString CopperFinishType[]

References arrayDim(), and CopperFinishType.

Referenced by PANEL_SETUP_BOARD_FINISH::PANEL_SETUP_BOARD_FINISH(), PANEL_SETUP_BOARD_FINISH::synchronizeWithBoard(), and PANEL_SETUP_BOARD_FINISH::TransferDataFromWindow().

Variable Documentation

◆ CopperFinishType

wxString CopperFinishType[]
static
Initial value:
=
{
_HKI( "ENIG" ),
_HKI( "ENEPIG" ),
_HKI( "HAL SnPb" ),
_HKI( "HAL lead-free" ),
_HKI( "Hard gold" ),
_HKI( "Immersion tin" ),
_HKI( "Immersion nickel" ),
_HKI( "Immersion silver" ),
_HKI( "Immersion gold" ),
_HKI( "HT_OSP" ),
_HKI( "OSP" ),
_HKI( "None" ),
_HKI( "User defined" )
}
wxString NotSpecifiedPrm()
#define _HKI(x)

Definition at line 43 of file stackup_predefined_prms.cpp.

Referenced by GetCopperFinishStandardList().

◆ solderMaskColors

FAB_LAYER_COLOR solderMaskColors[]
static
Initial value:
=
{
{ NotSpecifiedPrm(), wxColor( 80, 80, 80 ) },
{ _HKI( "Green" ), wxColor( 60, 150, 80 ) },
{ _HKI( "Red" ), wxColor( 128, 0, 0 ) },
{ _HKI( "Blue" ), wxColor( 0, 0, 128 ) },
{ _HKI( "Black" ), wxColor( 20, 20, 20 ) },
{ _HKI( "White" ), wxColor( 200, 200, 200 ) },
{ _HKI( "Yellow" ), wxColor( 128, 128, 0 ) },
{ _HKI( "User defined" ), wxColor( 128, 128, 128 ) }
}
wxString NotSpecifiedPrm()
#define _HKI(x)

Definition at line 68 of file stackup_predefined_prms.cpp.

Referenced by GetColorStandardList(), and GetColorStandardListCount().