KiCad PCB EDA Suite
|
Manage layers needed to make a physical board. More...
#include <board_stackup.h>
Public Member Functions | |
BOARD_STACKUP () | |
BOARD_STACKUP (const BOARD_STACKUP &aOther) | |
BOARD_STACKUP & | operator= (const BOARD_STACKUP &aOther) |
bool | operator== (const BOARD_STACKUP &aOther) const |
bool | operator!= (const BOARD_STACKUP &aOther) const |
~BOARD_STACKUP () | |
void | Serialize (google::protobuf::Any &aContainer) const override |
Serializes this object to the given Any message. | |
bool | Deserialize (const google::protobuf::Any &aContainer) override |
Deserializes the given protobuf message into this object. | |
const std::vector< BOARD_STACKUP_ITEM * > & | GetList () const |
BOARD_STACKUP_ITEM * | GetStackupLayer (int aIndex) |
void | RemoveAll () |
Delete all items in list and clear the list. | |
int | GetCount () const |
int | BuildBoardThicknessFromStackup () const |
void | Add (BOARD_STACKUP_ITEM *aItem) |
Add a new item in stackup layer. | |
bool | SynchronizeWithBoard (BOARD_DESIGN_SETTINGS *aSettings) |
Synchronize the BOARD_STACKUP_ITEM* list with the board. | |
void | BuildDefaultStackupList (const BOARD_DESIGN_SETTINGS *aSettings, int aActiveCopperLayersCount=0) |
Create a default stackup, according to the current BOARD_DESIGN_SETTINGS settings. | |
void | FormatBoardStackup (OUTPUTFORMATTER *aFormatter, const BOARD *aBoard, int aNestLevel) const |
Write the stackup info on board file. | |
int | GetLayerDistance (PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSecondLayer) const |
Calculate the distance (height) between the two given copper layers. | |
Static Public Member Functions | |
static LSET | StackupAllowedBrdLayers () |
Public Attributes | |
wxString | m_FinishType |
The name of external copper finish. | |
bool | m_HasDielectricConstrains |
True if some layers have impedance controlled tracks or have specific constrains for micro-wave applications If the board has dielectric constrains, the .gbrjob will contain info about dielectric constrains: loss tangent and Epsilon rel. | |
bool | m_HasThicknessConstrains |
True if some layers (copper and/or dielectric) have specific thickness. | |
BS_EDGE_CONNECTOR_CONSTRAINTS | m_EdgeConnectorConstraints |
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTOR_NONE = no edge connector BS_EDGE_CONNECTOR_IN_USE = board has edge connectors BS_EDGE_CONNECTOR_BEVELLED = edge connectors are beveled. | |
bool | m_CastellatedPads |
True if castellated pads exist. | |
bool | m_EdgePlating |
True if the edge board is plated. | |
Private Attributes | |
std::vector< BOARD_STACKUP_ITEM * > | m_list |
Manage layers needed to make a physical board.
They are solder mask, silk screen, copper and dielectric. Some other layers, used in fabrication, are not managed here because they are not used to make a physical board itself.
Definition at line 218 of file board_stackup.h.
BOARD_STACKUP::BOARD_STACKUP | ( | ) |
Definition at line 349 of file board_stackup.cpp.
References BS_EDGE_CONNECTOR_NONE, m_CastellatedPads, m_EdgeConnectorConstraints, m_EdgePlating, m_FinishType, m_HasDielectricConstrains, and m_HasThicknessConstrains.
BOARD_STACKUP::BOARD_STACKUP | ( | const BOARD_STACKUP & | aOther | ) |
Definition at line 361 of file board_stackup.cpp.
References Add(), m_CastellatedPads, m_EdgeConnectorConstraints, m_EdgePlating, m_FinishType, m_HasDielectricConstrains, m_HasThicknessConstrains, and m_list.
|
inline |
Definition at line 228 of file board_stackup.h.
References RemoveAll().
|
inline |
Add a new item in stackup layer.
Definition at line 260 of file board_stackup.h.
References m_list.
Referenced by BOARD_STACKUP(), BuildDefaultStackupList(), operator=(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardStackup(), and PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow().
int BOARD_STACKUP::BuildBoardThicknessFromStackup | ( | ) | const |
Definition at line 481 of file board_stackup.cpp.
References m_list.
Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), and PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow().
void BOARD_STACKUP::BuildDefaultStackupList | ( | const BOARD_DESIGN_SETTINGS * | aSettings, |
int | aActiveCopperLayersCount = 0 |
||
) |
Create a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
aSettings | is the current board setting. if nullptr, build a full stackup (with 32 copper layers) |
aActiveCopperLayersCount | is used only if aSettings == nullptr is the number of copper layers to use to calculate a default dielectric thickness. ((<= 0 to use all copper layers) |
Definition at line 599 of file board_stackup.cpp.
References _HKI, Add(), B_Cu, B_Mask, B_Paste, B_SilkS, BS_ITEM_TYPE_COPPER, BS_ITEM_TYPE_DIELECTRIC, BS_ITEM_TYPE_SILKSCREEN, BS_ITEM_TYPE_SOLDERMASK, BS_ITEM_TYPE_SOLDERPASTE, LSET::CuStack(), F_Mask, F_Paste, F_SilkS, BOARD_DESIGN_SETTINGS::GetBoardThickness(), BOARD_STACKUP_ITEM::GetCopperDefaultThickness(), BOARD_DESIGN_SETTINGS::GetCopperLayerCount(), BOARD_DESIGN_SETTINGS::GetEnabledLayers(), BOARD_STACKUP_ITEM::GetMaskDefaultThickness(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), KEY_COPPER, KEY_CORE, KEY_PREPREG, m_CastellatedPads, m_EdgeConnectorConstraints, m_EdgePlating, m_FinishType, m_HasDielectricConstrains, EDA_IU_SCALE::mmToIU(), pcbIUScale, BOARD_STACKUP_ITEM::SetBrdLayerId(), BOARD_STACKUP_ITEM::SetDielectricLayerId(), BOARD_STACKUP_ITEM::SetMaterial(), BOARD_STACKUP_ITEM::SetThickness(), BOARD_STACKUP_ITEM::SetTypeName(), and StackupAllowedBrdLayers().
Referenced by DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), FOOTPRINT_CHOOSER_FRAME::build3DCanvas(), PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel(), BOARD::GetStackupOrDefault(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), ALTIUM_PCB::ParseBoard6Data(), PCB_IO_KICAD_SEXPR_PARSER::parseSetup(), SynchronizeWithBoard(), and PANEL_PREVIEW_3D_MODEL::View3DSettings().
|
overridevirtual |
Deserializes the given protobuf message into this object.
aContainer | is an Any which should have a concrete type matching this object |
Reimplemented from SERIALIZABLE.
Definition at line 457 of file board_stackup.cpp.
void BOARD_STACKUP::FormatBoardStackup | ( | OUTPUTFORMATTER * | aFormatter, |
const BOARD * | aBoard, | ||
int | aNestLevel | ||
) | const |
Write the stackup info on board file.
aFormatter | is the OUTPUTFORMATTER used to create the file |
aBoard | is the board |
aNestLevel | is the index to nest level to indent the lines in file |
Definition at line 724 of file board_stackup.cpp.
References BS_ITEM_TYPE_DIELECTRIC, FormatDouble2Str(), EDA_UNIT_UTILS::FormatInternalUnits(), IsPrmSpecified(), m_CastellatedPads, m_EdgeConnectorConstraints, m_EdgePlating, m_FinishType, m_HasDielectricConstrains, m_list, LSET::Name(), pcbIUScale, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and UNDEFINED_LAYER.
Referenced by PCB_IO_KICAD_SEXPR::formatSetup(), and PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow().
|
inline |
Definition at line 254 of file board_stackup.h.
References m_list.
Referenced by GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), DRAWING_TOOL::DrawSpecificationStackup(), PCB_IO_IPC2581::generateCadLayers(), GetStackupLayer(), ODB_MATRIX_ENTITY::InitMatrixLayerData(), and BOARD_ADAPTER::InitSettings().
int BOARD_STACKUP::GetLayerDistance | ( | PCB_LAYER_ID | aFirstLayer, |
PCB_LAYER_ID | aSecondLayer | ||
) | const |
Calculate the distance (height) between the two given copper layers.
This factors in the thickness of any dielectric and copper layers between the two given layers, and half the height of the given start and end layers. This half-height calculation allows this to be used for consistent length measurements when calculating net length through a series of vias. A more advanced algorithm would be possible once we have a good concept of the start and end for a length measurement, but for now this will do. See https://gitlab.com/kicad/code/kicad/-/issues/8384 for more background.
aFirstLayer | is a copper layer |
aSecondLayer | is a different copper layer |
Definition at line 816 of file board_stackup.cpp.
References B_Cu, IsCopperLayer(), m_list, and UNDEFINED_LAYER.
Referenced by PCB_NET_INSPECTOR_PANEL::calculateViaLength(), BOARD::GetTrackLength(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), and PNS_KICAD_IFACE_BASE::StackupHeight().
|
inline |
Definition at line 234 of file board_stackup.h.
References m_list.
Referenced by PANEL_SETUP_BOARD_STACKUP::buildLayerStackPanel(), BuildStackupReport(), STEP_PCB_MODEL::CreatePCB(), DRAWING_TOOL::DrawSpecificationStackup(), EXPORTER_PCB_VRML::EXPORTER_PCB_VRML(), PCB_IO_IPC2581::generateCadLayers(), PCB_IO_IPC2581::generateContentStackup(), STEP_PCB_MODEL::getCopperLayerZPlacement(), BOARD_ADAPTER::GetLayerColors(), GetStackupLayer(), ODB_MATRIX_ENTITY::InitMatrixLayerData(), BOARD_ADAPTER::InitSettings(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), PANEL_SETUP_BOARD_STACKUP::onMaterialChange(), PANEL_SETUP_BOARD_STACKUP::onRemoveDielectricLayer(), PANEL_SETUP_BOARD_STACKUP::onRemoveDielUI(), ALTIUM_PCB::ParseBoard6Data(), SynchronizeWithBoard(), PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow(), and HYPERLYNX_EXPORTER::writeStackupInfo().
BOARD_STACKUP_ITEM * BOARD_STACKUP::GetStackupLayer | ( | int | aIndex | ) |
Definition at line 472 of file board_stackup.cpp.
References GetCount(), and GetList().
Referenced by GERBER_JOBFILE_WRITER::addJSONMaterialStackup().
|
inline |
Definition at line 226 of file board_stackup.h.
References operator==().
BOARD_STACKUP & BOARD_STACKUP::operator= | ( | const BOARD_STACKUP & | aOther | ) |
Definition at line 380 of file board_stackup.cpp.
References Add(), m_CastellatedPads, m_EdgeConnectorConstraints, m_EdgePlating, m_FinishType, m_HasDielectricConstrains, m_HasThicknessConstrains, m_list, and RemoveAll().
bool BOARD_STACKUP::operator== | ( | const BOARD_STACKUP & | aOther | ) | const |
Definition at line 403 of file board_stackup.cpp.
References m_CastellatedPads, m_EdgeConnectorConstraints, m_EdgePlating, m_FinishType, m_HasDielectricConstrains, m_HasThicknessConstrains, and m_list.
Referenced by operator!=().
void BOARD_STACKUP::RemoveAll | ( | ) |
Delete all items in list and clear the list.
Definition at line 463 of file board_stackup.cpp.
References m_list.
Referenced by DIALOG_FOOTPRINT_CHOOSER::build3DCanvas(), FOOTPRINT_CHOOSER_FRAME::build3DCanvas(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), operator=(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), ALTIUM_PCB::ParseBoard6Data(), PCB_IO_KICAD_SEXPR_PARSER::parseSetup(), PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow(), PANEL_PREVIEW_3D_MODEL::View3DSettings(), and ~BOARD_STACKUP().
|
overridevirtual |
Serializes this object to the given Any message.
The Any message's concrete type will be specific to the object in question.
aContainer | will be filled with a message describing this object |
Reimplemented from SERIALIZABLE.
Definition at line 425 of file board_stackup.cpp.
References m_list.
Referenced by API_HANDLER_PCB::handleGetStackup().
|
inlinestatic |
Definition at line 243 of file board_stackup.h.
References B_Mask, B_Paste, B_SilkS, LSET::ExternalCuMask(), F_Mask, F_Paste, F_SilkS, and LSET::InternalCuMask().
Referenced by BuildDefaultStackupList(), PANEL_SETUP_BOARD_STACKUP::ImportSettingsFrom(), PANEL_SETUP_BOARD_STACKUP::OnLayersOptionsChanged(), and PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP().
bool BOARD_STACKUP::SynchronizeWithBoard | ( | BOARD_DESIGN_SETTINGS * | aSettings | ) |
Synchronize the BOARD_STACKUP_ITEM* list with the board.
Not enabled layers are removed Missing layers are added
aSettings,is | the current board setting. |
Definition at line 505 of file board_stackup.cpp.
References BuildDefaultStackupList(), GetList(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), m_CastellatedPads, m_EdgeConnectorConstraints, m_EdgePlating, m_FinishType, m_HasDielectricConstrains, m_list, and UNDEFINED_LAYER.
Referenced by GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), DRAWING_TOOL::DrawSpecificationStackup(), PCB_IO_IPC2581::generateCadLayers(), PCB_IO_IPC2581::generateContentStackup(), and ODB_MATRIX_ENTITY::InitMatrixLayerData().
bool BOARD_STACKUP::m_CastellatedPads |
True if castellated pads exist.
Definition at line 335 of file board_stackup.h.
Referenced by GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), BOARD_STACKUP(), BuildDefaultStackupList(), BuildStackupReport(), DRAWING_TOOL::DrawBoardCharacteristics(), FormatBoardStackup(), operator=(), operator==(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardStackup(), PANEL_SETUP_BOARD_FINISH::synchronizeWithBoard(), SynchronizeWithBoard(), and PANEL_SETUP_BOARD_FINISH::TransferDataFromWindow().
BS_EDGE_CONNECTOR_CONSTRAINTS BOARD_STACKUP::m_EdgeConnectorConstraints |
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTOR_NONE = no edge connector BS_EDGE_CONNECTOR_IN_USE = board has edge connectors BS_EDGE_CONNECTOR_BEVELLED = edge connectors are beveled.
Definition at line 333 of file board_stackup.h.
Referenced by GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), BOARD_STACKUP(), BuildDefaultStackupList(), BuildStackupReport(), DRAWING_TOOL::DrawBoardCharacteristics(), FormatBoardStackup(), operator=(), operator==(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardStackup(), PANEL_SETUP_BOARD_FINISH::synchronizeWithBoard(), SynchronizeWithBoard(), and PANEL_SETUP_BOARD_FINISH::TransferDataFromWindow().
bool BOARD_STACKUP::m_EdgePlating |
True if the edge board is plated.
Definition at line 336 of file board_stackup.h.
Referenced by GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), BOARD_STACKUP(), BuildDefaultStackupList(), BuildStackupReport(), DRAWING_TOOL::DrawBoardCharacteristics(), FormatBoardStackup(), operator=(), operator==(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardStackup(), PANEL_SETUP_BOARD_FINISH::synchronizeWithBoard(), SynchronizeWithBoard(), and PANEL_SETUP_BOARD_FINISH::TransferDataFromWindow().
wxString BOARD_STACKUP::m_FinishType |
The name of external copper finish.
Definition at line 310 of file board_stackup.h.
Referenced by GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), BOARD_STACKUP(), BuildDefaultStackupList(), BuildStackupReport(), DRAWING_TOOL::DrawBoardCharacteristics(), EXPORTER_PCB_VRML::EXPORTER_PCB_VRML(), FormatBoardStackup(), BOARD_ADAPTER::GetLayerColors(), operator=(), operator==(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardStackup(), PANEL_SETUP_BOARD_FINISH::synchronizeWithBoard(), SynchronizeWithBoard(), and PANEL_SETUP_BOARD_FINISH::TransferDataFromWindow().
bool BOARD_STACKUP::m_HasDielectricConstrains |
True if some layers have impedance controlled tracks or have specific constrains for micro-wave applications If the board has dielectric constrains, the .gbrjob will contain info about dielectric constrains: loss tangent and Epsilon rel.
If not, these values will be not specified in job file.
Definition at line 319 of file board_stackup.h.
Referenced by GERBER_JOBFILE_WRITER::addJSONGeneralSpecs(), GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), BOARD_STACKUP(), BuildDefaultStackupList(), BuildStackupReport(), DRAWING_TOOL::DrawBoardCharacteristics(), FormatBoardStackup(), operator=(), operator==(), PCB_IO_KICAD_SEXPR_PARSER::parseBoardStackup(), SynchronizeWithBoard(), PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard(), PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup(), and PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow().
bool BOARD_STACKUP::m_HasThicknessConstrains |
True if some layers (copper and/or dielectric) have specific thickness.
Definition at line 324 of file board_stackup.h.
Referenced by BOARD_STACKUP(), operator=(), and operator==().
|
private |
Definition at line 341 of file board_stackup.h.
Referenced by Add(), BOARD_STACKUP(), BuildBoardThicknessFromStackup(), FormatBoardStackup(), GetCount(), GetLayerDistance(), GetList(), operator=(), operator==(), RemoveAll(), Serialize(), and SynchronizeWithBoard().