KiCad PCB EDA Suite
stackup_predefined_prms.cpp File Reference
#include <wx/string.h>
#include <core/arraydim.h>
#include <board_design_settings.h>
#include <i18n_utility.h>
#include "stackup_predefined_prms.h"

Go to the source code of this file.

Functions

wxArrayString GetStandardCopperFinishes (bool aTranslate)
 
const std::vector< FAB_LAYER_COLOR > & GetStandardColors (BOARD_STACKUP_ITEM_TYPE aType)
 
int GetColorUserDefinedListIdx (BOARD_STACKUP_ITEM_TYPE aType)
 
bool IsColorNameNormalized (const wxString &aName)
 

Variables

static wxString copperFinishType []
 
static std::vector< FAB_LAYER_COLORgbrjobColors
 
static std::vector< FAB_LAYER_COLORdielectricColors
 
std::vector< FAB_LAYER_COLORdummy
 

Function Documentation

◆ GetColorUserDefinedListIdx()

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

Definition at line 110 of file stackup_predefined_prms.cpp.

111{
112 // this is the last item in list
113 return GetStandardColors( aType ).size() - 1;
114}
const std::vector< FAB_LAYER_COLOR > & GetStandardColors(BOARD_STACKUP_ITEM_TYPE aType)

References GetStandardColors().

Referenced by PANEL_SETUP_BOARD_STACKUP::createRowData(), GetDefaultUserColor(), IsCustomColorIdx(), and PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard().

◆ GetStandardColors()

const std::vector< FAB_LAYER_COLOR > & GetStandardColors ( BOARD_STACKUP_ITEM_TYPE  aType)
Returns
a list of standard FAB_LAYER_COLOR items for silkscreen and solder mask.

Definition at line 98 of file stackup_predefined_prms.cpp.

99{
100 switch( aType )
101 {
105 default: return dummy;
106 }
107}
@ BS_ITEM_TYPE_SILKSCREEN
Definition: board_stackup.h:49
@ BS_ITEM_TYPE_DIELECTRIC
Definition: board_stackup.h:44
@ BS_ITEM_TYPE_SOLDERMASK
Definition: board_stackup.h:47
std::vector< FAB_LAYER_COLOR > dummy
static std::vector< FAB_LAYER_COLOR > dielectricColors
static std::vector< FAB_LAYER_COLOR > gbrjobColors

References BS_ITEM_TYPE_DIELECTRIC, BS_ITEM_TYPE_SILKSCREEN, BS_ITEM_TYPE_SOLDERMASK, dielectricColors, dummy, and gbrjobColors.

Referenced by GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), PANEL_SETUP_BOARD_STACKUP::createColorBox(), PANEL_SETUP_BOARD_STACKUP::createRowData(), GetColorUserDefinedListIdx(), GetDefaultUserColor(), GetStandardColor(), GetStandardColorName(), PANEL_SETUP_BOARD_STACKUP::onMaterialChange(), and PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard().

◆ GetStandardCopperFinishes()

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

Definition at line 87 of file stackup_predefined_prms.cpp.

88{
89 wxArrayString list;
90
91 for( unsigned ii = 0; ii < arrayDim( copperFinishType ); ii++ )
92 list.Add( aTranslate ? wxGetTranslation( copperFinishType[ii] ) : copperFinishType[ii] );
93
94 return list;
95}
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().

◆ IsColorNameNormalized()

bool IsColorNameNormalized ( const wxString &  aName)
Returns
true if aName is a color name acceptable in gerber job files
Parameters
aNameis a color name like red, blue... (case insensitive)

Definition at line 117 of file stackup_predefined_prms.cpp.

118{
119 static std::vector<wxString> list =
120 {
121 wxT( "Green" ), wxT( "Red" ), wxT( "Blue" ),
122 wxT( "Black" ), wxT( "White" ), wxT( "Yellow" )
123 };
124
125 for( wxString& candidate : list )
126 {
127 if( candidate.CmpNoCase( aName ) == 0 )
128 return true;
129 }
130
131 return false;
132}

Referenced by FAB_LAYER_COLOR::GetColorAsString().

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" )
}
#define _HKI(x)
wxString NotSpecifiedPrm()

Definition at line 35 of file stackup_predefined_prms.cpp.

Referenced by GetStandardCopperFinishes().

◆ dielectricColors

std::vector<FAB_LAYER_COLOR> dielectricColors
static
Initial value:
=
{
{ NotSpecifiedPrm(), wxColor( 80, 80, 80, 255 ) },
{ _HKI( "FR4 natural" ), wxColor( 109, 116, 75, 212 ) },
{ _HKI( "PTFE natural" ), wxColor( 252, 252, 250, 230 ) },
{ _HKI( "Polyimide" ), wxColor( 205, 130, 0, 170 ) },
{ _HKI( "Phenolic natural" ), wxColor( 92, 17, 6, 230 ) },
{ _HKI( "Aluminum" ), wxColor( 213, 213, 213, 255 ) },
{ _HKI( "User defined" ), wxColor( 128, 128, 128, 212 ) }
}

Definition at line 75 of file stackup_predefined_prms.cpp.

Referenced by GetStandardColors().

◆ dummy

std::vector<FAB_LAYER_COLOR> dummy

Definition at line 97 of file stackup_predefined_prms.cpp.

Referenced by SCH_EDITOR_CONTROL::Annotate(), APPEARANCE_CONTROLS::ApplyLayerPreset(), APPEARANCE_CONTROLS::ApplyViewport(), BOOST_FIXTURE_TEST_CASE(), DIALOG_TEMPLATE_SELECTOR::buildPageContent(), EXCELLON_WRITER::createDrillFile(), GERBER_WRITER::createDrillFile(), BOARD_ADAPTER::createPadWithMargin(), ROUTER_TOOL::CustomTrackWidthDialog(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), SCH_EDIT_FRAME::DisplayCurrentSheet(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), CLI::EXPORT_PCB_DXF_COMMAND::doPerform(), CLI::EXPORT_PCB_GERBER_COMMAND::doPerform(), CLI::EXPORT_PCB_GERBERS_COMMAND::doPerform(), CLI::EXPORT_PCB_PDF_COMMAND::doPerform(), CLI::EXPORT_PCB_POS_COMMAND::doPerform(), CLI::EXPORT_PCB_STEP_COMMAND::doPerform(), NETLIST_EXPORTER_SPICE::DoWriteNetlist(), COMMON_TOOLS::doZoomToPreset(), KIGFX::SCH_PAINTER::draw(), EDA_DRAW_FRAME::EDA_DRAW_FRAME(), PCB_EDIT_FRAME::Edit_Zone_Params(), EVT_MENU_RANGE(), GERBER_FILE_IMAGE::ExecuteRS274XCommand(), SCH_EDIT_FRAME::FocusOnItem(), JSON_SETTINGS::FormatAsString(), GENDRILL_WRITER_BASE::genDrillMapFile(), BOARD_EDITOR_CONTROL::GenerateFabFiles(), RENDER_3D_OPENGL::generateViasAndPads(), GERBVIEW_FRAME::GERBVIEW_FRAME(), DS_DRAW_ITEM_PAGE::GetBoundingBox(), EESCHEMA_HELPERS::GetDefaultProject(), GetDefaultProject(), FP_TREE_MODEL_ADAPTER::getFootprints(), FOOTPRINT::GetFpPadsLocalBbox(), SYMBOL_LIBRARY_FILTER::GetLibSource(), NETINFO_ITEM::GetPosition(), X2_ATTRIBUTE::GetPrm(), SCH_SHEET::GetRootInstance(), GetStandardColors(), NUMERIC_EVALUATOR::getToken(), highlightNet(), SCH_NAVIGATE_TOOL::HypertextCommand(), DIALOG_EXPORT_SVG::initDialog(), DIALOG_GENDRILL::InitDisplayParams(), BOARD_INSPECTION_TOOL::InspectClearance(), SHAPE_LINE_CHAIN::Intersects(), isCoupledDiffPairFunc(), DRC_ENGINE::IsNetADiffPair(), PCB_EDIT_FRAME::KiwayMailIn(), LoadBoard(), EXCELLON_IMAGE::LoadFile(), PROJECT_TREE::LoadIcons(), EESCHEMA_HELPERS::LoadSchematic(), PANEL_TRACK_WIDTH::LoadSettings(), ZOOM_TOOL::Main(), PCB_PICKER_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), NewBoard(), DIALOG_PCM::OnApplyChangesClicked(), PANEL_E_SERIES::OnCalculateESeries(), DIALOG_SCH_FIND::OnCancel(), SYMBOL_VIEWER_FRAME::OnCharHook(), FOOTPRINT_VIEWER_FRAME::OnCharHook(), GRID_TRICKS::onCharHook(), DIALOG_DRC::OnClose(), DIALOG_FOOTPRINT_CHECKER::OnClose(), DIALOG_PCM::OnCloseWindow(), PNS::SHOVE::onCollidingSolid(), DIALOG_EXPORT_STEP::onExportButton(), PCB_EDIT_FRAME::OnExportIDF3(), PCB_EDIT_FRAME::OnExportVRML(), DIALOG_LIB_SYMBOL_PROPERTIES::OnFilterDClick(), COMMON_TOOLS::OnGridChanged(), DIALOG_SIM_MODEL< T_symbol, T_field >::onLibraryPathTextKillFocus(), DIALOG_ERC::OnLinkClicked(), DIALOG_CHANGE_SYMBOLS::onOkButtonClicked(), DIALOG_UPDATE_SYMBOL_FIELDS::onOkButtonClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnOKClicked(), SIM_PLOT_FRAME::onPlotChanged(), SIM_PLOT_FRAME::onPlotClosed(), PANEL_SELECTION_FILTER::onPopupSelection(), APPEARANCE_CONTROLS::onReadOnlySwatch(), DIALOG_DRC::OnRunDRCClick(), PCB_EDIT_FRAME::OnRunTeardropTool(), EDA_DRAW_FRAME::OnSelectGrid(), PANEL_PACKAGES_VIEW::OnShowAllVersionsClicked(), COMMON_CONTROL::OpenPreferences(), BM2CMP_FRAME::OpenProjectFiles(), PANEL_SETUP_BUSES::PANEL_SETUP_BUSES(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), LENGTH_TUNER_TOOL::performTuning(), DIALOG_PLOT::Plot(), DIALOG_PLOT_SCHEMATIC::plotSchematic(), PlotStandardLayer(), SCH_PRINTOUT::PrintPage(), PANEL_SETUP_PINMAP::reBuildMatrixPanel(), GERBVIEW_FRAME::ReCreateAuxiliaryToolbar(), PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar(), DIALOG_INSPECTOR::ReCreateDesignList(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), PCB_EDIT_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), EDA_3D_VIEWER_FRAME::ReCreateMainToolbar(), PCB_EDIT_FRAME::ReCreateOptToolbar(), FOOTPRINT_EDIT_FRAME::ReCreateVToolbar(), PCB_EDIT_FRAME::ReCreateVToolbar(), PCB_CONTROL::Redo(), SIM_PLOT_FRAME::removePlot(), PL_EDITOR_FRAME::ReturnCoordOriginCorner(), SaveBoard(), FOOTPRINT_EDIT_FRAME::SaveLibraryAs(), CLIPBOARD_IO::SaveSelection(), JSON_SETTINGS::SaveToFile(), NESTED_SETTINGS::SaveToFile(), FOOTPRINT_VIEWER_FRAME::selectNext(), FOOTPRINT_VIEWER_FRAME::selectPrev(), DS_DATA_ITEM_TEXT::SetConstrainedTextSize(), DIALOG_EDIT_SYMBOLS_LIBID::setLibIdByBrowser(), PANEL_PACKAGES_VIEW::setPackageDetails(), PANEL_PACKAGES_VIEW::SetPackageState(), SCINTILLA_TRICKS::setupStyles(), EDA_LIST_DIALOG::Show(), SCH_EDITOR_CONTROL::ShowCvpcb(), SCH_EDITOR_CONTROL::ShowPcbNew(), SPICE_VALUE::SPICE_VALUE(), BM2CMP_FRAME::ToggleAspectRatioLock(), SYMBOL_EDITOR_CONTROL::ToggleSymbolTree(), EDA_DRAW_FRAME::ToggleUserUnits(), DIALOG_DIELECTRIC_MATERIAL::TransferDataFromWindow(), PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow(), DIALOG_IMPORT_GFX::TransferDataFromWindow(), DIALOG_MIGRATE_SETTINGS::TransferDataToWindow(), DIALOG_PAGES_SETTINGS::TransferDataToWindow(), DIALOG_DIELECTRIC_MATERIAL::TransferDataToWindow(), DIALOG_PRINT_PCBNEW::TransferDataToWindow(), PANEL_SETUP_RULES::TransferDataToWindow(), FOOTPRINT::TransformPadsToPolySet(), SCH_EDITOR_CONTROL::Undo(), PCB_CONTROL::Undo(), FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), SCH_EDITOR_CONTROL::UpdatePCB(), EE_POINT_EDITOR::updatePoints(), LIB_ID_VALIDATOR::Validate(), and GERBER_JOBFILE_WRITER::WriteJSONJobFile().

◆ gbrjobColors

std::vector<FAB_LAYER_COLOR> gbrjobColors
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( "Purple" ), wxColor( 80, 0, 80 ) },
{ _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 ) }
}

Definition at line 59 of file stackup_predefined_prms.cpp.

Referenced by GetStandardColors().