From 2ae264751fbee77a1bd3225eca56ff82e51dad96 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Fri, 16 Apr 2021 17:07:06 -0400 Subject: [PATCH] Rename class_board_stackup.{h|cpp} to board_stackup.{h|cpp}. --- 3d-viewer/3d_viewer/eda_3d_viewer.cpp | 4 +- common/CMakeLists.txt | 2 +- include/board_design_settings.h | 4 +- ...ss_board_stackup.cpp => board_stackup.cpp} | 4 +- ...{class_board_stackup.h => board_stackup.h} | 168 +++++++++--------- .../board_stackup_reporter.cpp | 4 +- .../panel_board_stackup.h | 4 +- .../stackup_predefined_prms.cpp | 32 ++-- 8 files changed, 114 insertions(+), 108 deletions(-) rename pcbnew/board_stackup_manager/{class_board_stackup.cpp => board_stackup.cpp} (99%) rename pcbnew/board_stackup_manager/{class_board_stackup.h => board_stackup.h} (88%) diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index 57ac40ed6f..bb7b4f1896 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Mario Luzeiro - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -35,7 +35,7 @@ #include <3d_viewer/tools/3d_controller.h> #include <3d_viewer/tools/3d_conditions.h> #include -#include +#include #include #include #include diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index b3960396f7..0ca0f10ac1 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -522,7 +522,7 @@ set( PCB_COMMON_SRCS ${CMAKE_SOURCE_DIR}/pcbnew/pad.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcb_target.cpp ${CMAKE_SOURCE_DIR}/pcbnew/pcb_text.cpp - ${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/class_board_stackup.cpp + ${CMAKE_SOURCE_DIR}/pcbnew/board_stackup_manager/board_stackup.cpp ${CMAKE_SOURCE_DIR}/pcbnew/fp_text.cpp ${CMAKE_SOURCE_DIR}/pcbnew/track.cpp ${CMAKE_SOURCE_DIR}/pcbnew/zone.cpp diff --git a/include/board_design_settings.h b/include/board_design_settings.h index 98c32233ca..3967ba36bb 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2009-2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/pcbnew/board_stackup_manager/class_board_stackup.cpp b/pcbnew/board_stackup_manager/board_stackup.cpp similarity index 99% rename from pcbnew/board_stackup_manager/class_board_stackup.cpp rename to pcbnew/board_stackup_manager/board_stackup.cpp index 66aed3ed59..9eb747e733 100644 --- a/pcbnew/board_stackup_manager/class_board_stackup.cpp +++ b/pcbnew/board_stackup_manager/board_stackup.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2009-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2009-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,7 +19,7 @@ */ -#include "class_board_stackup.h" +#include "board_stackup.h" #include #include #include diff --git a/pcbnew/board_stackup_manager/class_board_stackup.h b/pcbnew/board_stackup_manager/board_stackup.h similarity index 88% rename from pcbnew/board_stackup_manager/class_board_stackup.h rename to pcbnew/board_stackup_manager/board_stackup.h index 38c12b27bd..3f78a23597 100644 --- a/pcbnew/board_stackup_manager/class_board_stackup.h +++ b/pcbnew/board_stackup_manager/board_stackup.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2009-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2009-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,11 +19,11 @@ */ /** - * @file class_board_stackup.h + * @file board_stackup.h */ -#ifndef CLASS_BOARD_STACKUP_H -#define CLASS_BOARD_STACKUP_H +#ifndef BOARD_STACKUP_H +#define BOARD_STACKUP_H #include @@ -63,27 +63,28 @@ enum BS_EDGE_CONNECTOR_CONSTRAINTS */ class DIELECTRIC_PRMS { - friend class BOARD_STACKUP_ITEM; +public: + DIELECTRIC_PRMS() : + m_Thickness(0), m_ThicknessLocked( false ), + m_EpsilonR( 1.0 ), m_LossTangent( 0.0 ) + {} private: + friend class BOARD_STACKUP_ITEM; + wxString m_Material; /// type of material (for dielectric and solder mask) int m_Thickness; /// the physical layer thickness in internal units bool m_ThicknessLocked; /// true for dielectric layers with a fixed thickness /// (for impedance controlled purposes), unused for other layers double m_EpsilonR; /// For dielectric (and solder mask) the dielectric constant double m_LossTangent; /// For dielectric (and solder mask) the dielectric loss - -public: - DIELECTRIC_PRMS() : - m_Thickness(0), m_ThicknessLocked( false ), - m_EpsilonR( 1.0 ), m_LossTangent( 0.0 ) - {} }; /** - * this class manage one layer needed to make a physical board - * it can be a solder mask, silk screen, copper or a dielectric + * Manage one layer needed to make a physical board. + * + * It can be a solder mask, silk screen, copper or a dielectric. */ class BOARD_STACKUP_ITEM { @@ -91,30 +92,8 @@ public: BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType ); BOARD_STACKUP_ITEM( const BOARD_STACKUP_ITEM& aOther ); - -private: - BOARD_STACKUP_ITEM_TYPE m_Type; - wxString m_LayerName; /// name of layer as shown in layer manager. Useful to create reports - wxString m_TypeName; /// type name of layer (copper, silk screen, core, prepreg ...) - wxString m_Color; /// mainly for silkscreen and solder mask - PCB_LAYER_ID m_LayerId; /// the layer id (F.Cu to B.Cu, F.Silk, B.silk, F.Mask, B.Mask) - /// and UNDEFINED_LAYER (-1) for dielectric layers that are not - /// really layers for the board editor - int m_DielectricLayerId;/// the "layer" id for dielectric layers, - /// from 1 (top) to 31 (bottom) - /// (only 31 dielectric layers for 32 copper layers) - /// List of dielectric parameters - /// usually only one item, but in complex (microwave) boards, one can have - /// more than one dielectric layer between 2 copper layers, and therefore - /// more than one item in list - std::vector m_DielectricPrmsList; - - bool m_enabled; /// true if this stackup item must be taken in account, - /// false to ignore it. Mainly used in dialog stackup editor. - -public: /** - * add (insert) a DIELECTRIC_PRMS item to m_DielectricPrmsList + * Add (insert) a DIELECTRIC_PRMS item to m_DielectricPrmsList * all values are set to default * @param aDielectricPrmsIdx is a index in m_DielectricPrmsList * the new item will be inserted at this position @@ -196,51 +175,40 @@ public: void SetEpsilonR( double aEpsilon, int aDielectricSubLayer = 0 ); void SetLossTangent( double aTg, int aDielectricSubLayer = 0 ); void SetMaterial( const wxString& aName, int aDielectricSubLayer = 0 ); + +private: + BOARD_STACKUP_ITEM_TYPE m_Type; + wxString m_LayerName; /// name of layer as shown in layer manager. Useful to create reports + wxString m_TypeName; /// type name of layer (copper, silk screen, core, prepreg ...) + wxString m_Color; /// mainly for silkscreen and solder mask + PCB_LAYER_ID m_LayerId; /// the layer id (F.Cu to B.Cu, F.Silk, B.silk, F.Mask, B.Mask) + /// and UNDEFINED_LAYER (-1) for dielectric layers that are not + /// really layers for the board editor + int m_DielectricLayerId;/// the "layer" id for dielectric layers, + /// from 1 (top) to 31 (bottom) + /// (only 31 dielectric layers for 32 copper layers) + /// List of dielectric parameters + /// usually only one item, but in complex (microwave) boards, one can have + /// more than one dielectric layer between 2 copper layers, and therefore + /// more than one item in list + std::vector m_DielectricPrmsList; + + bool m_enabled; /// true if this stackup item must be taken in account, + /// false to ignore it. Mainly used in dialog stackup editor. }; /** - * this class manage the 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 - * Note also there are a few other parameters related to the physical stackup, - * like finish type, impedance control and a few others + * 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. + * + * @note There are a few other parameters related to the physical stackup like finish type, + * impedance control and a few others. */ class BOARD_STACKUP { - // The list of items describing the stackup for fabrication. - // this is not just copper layers, but also mask dielectric layers - std::vector m_list; - -public: - /** The name of external copper finish - */ - wxString m_FinishType; - - /** 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. - */ - bool m_HasDielectricConstrains; - - /** True if some layers (copper and/or dielectric) have specific thickness - */ - bool m_HasThicknessConstrains; - - /** 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 - */ - BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints; - - bool m_CastellatedPads; ///< True if castellated pads exist - bool m_EdgePlating; ///< True if the edge board is plated - public: BOARD_STACKUP(); BOARD_STACKUP( const BOARD_STACKUP& aOther ); @@ -253,7 +221,8 @@ public: /// @return a reference to the layer aIndex, or nullptr if not exists BOARD_STACKUP_ITEM* GetStackupLayer( int aIndex ); - /** @return the board layers full mask allowed in the stackup list + /** + * @return the board layers full mask allowed in the stackup list * i.e. the SilkS, Mask, Paste and all copper layers */ static LSET StackupAllowedBrdLayers() @@ -285,7 +254,7 @@ public: bool SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings ); /** - * Creates a default stackup, according to the current BOARD_DESIGN_SETTINGS settings. + * Create a default stackup, according to the current BOARD_DESIGN_SETTINGS settings. * @param aSettings is the current board setting. * if nullptr, build a full stackup (with 32 copper layers) * @param aActiveCopperLayersCount is used only if aSettings == nullptr is the number @@ -296,7 +265,7 @@ public: int aActiveCopperLayersCount = 0 ); /** - * Writes the stackup info on board file + * Write the stackup info on board file * @param aFormatter is the OUTPUTFORMATTER used to create the file * @param aBoard is the board * @param aNestLevel is the index to nest level to indent the lines in file @@ -305,15 +274,52 @@ public: const BOARD* aBoard, int aNestLevel ) const; /** - * Calculates 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, but not the - * height of the given copper layers. + * 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, but not the height of the given copper layers. * @param aFirstLayer is a copper layer * @param aSecondLayer is a different copper layer * @return the height (in IU) between the two layers */ int GetLayerDistance( PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSecondLayer ) const; + + /** + * The name of external copper finish + */ + wxString m_FinishType; + + /** + * 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. + */ + bool m_HasDielectricConstrains; + + /** + * True if some layers (copper and/or dielectric) have specific thickness + */ + bool m_HasThicknessConstrains; + + /** + * 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 + */ + BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints; + + bool m_CastellatedPads; ///< True if castellated pads exist + bool m_EdgePlating; ///< True if the edge board is plated + +private: + // The list of items describing the stackup for fabrication. + // this is not just copper layers, but also mask dielectric layers + std::vector m_list; }; -#endif // CLASS_BOARD_STACKUP_H +#endif // BOARD_STACKUP_H diff --git a/pcbnew/board_stackup_manager/board_stackup_reporter.cpp b/pcbnew/board_stackup_manager/board_stackup_reporter.cpp index cba4351ed3..ce859b95b4 100644 --- a/pcbnew/board_stackup_manager/board_stackup_reporter.cpp +++ b/pcbnew/board_stackup_manager/board_stackup_reporter.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -31,7 +31,7 @@ #include #include -#include "class_board_stackup.h" +#include "board_stackup.h" #include "stackup_predefined_prms.h" #include "board_stackup_reporter.h" diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.h b/pcbnew/board_stackup_manager/panel_board_stackup.h index 374c95e0d3..75d94d986d 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.h +++ b/pcbnew/board_stackup_manager/panel_board_stackup.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2009-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2009-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -31,7 +31,7 @@ #include #include "panel_board_stackup_base.h" -#include "class_board_stackup.h" +#include "board_stackup.h" #include "stackup_predefined_prms.h" #include "dielectric_material.h" diff --git a/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp b/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp index fe34d862c3..2dc812ded8 100644 --- a/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp +++ b/pcbnew/board_stackup_manager/stackup_predefined_prms.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2009-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2009-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -27,7 +27,7 @@ * @file stackup_predefined_prms.cpp */ -#include "class_board_stackup.h" +#include "board_stackup.h" #include #include #include @@ -42,20 +42,20 @@ // These names are in fact usual copper finish names. static wxString CopperFinishType[] = { - NotSpecifiedPrm(), // Not specified, not in .gbrjob file - _HKI("ENIG"), // used in .gbrjob file - _HKI("ENEPIG"), // used in .gbrjob file - _HKI("HAL SnPb"), // used in .gbrjob file - _HKI("HAL lead-free"), // used in .gbrjob file - _HKI("Hard gold"), // used in .gbrjob file - _HKI("Immersion tin"), // used in .gbrjob file - _HKI("Immersion nickel"), // used in .gbrjob file - _HKI("Immersion silver"), // used in .gbrjob file - _HKI("Immersion gold"), // used in .gbrjob file - _HKI("HT_OSP"), // used in .gbrjob file - _HKI("OSP"), // used in .gbrjob file - _HKI("None"), // used in .gbrjob file - _HKI("User defined") // keep this option at end + NotSpecifiedPrm(), // Not specified, not in .gbrjob file + _HKI( "ENIG" ), // used in .gbrjob file + _HKI( "ENEPIG" ), // used in .gbrjob file + _HKI( "HAL SnPb" ), // used in .gbrjob file + _HKI( "HAL lead-free" ), // used in .gbrjob file + _HKI( "Hard gold" ), // used in .gbrjob file + _HKI( "Immersion tin" ), // used in .gbrjob file + _HKI( "Immersion nickel" ), // used in .gbrjob file + _HKI( "Immersion silver" ), // used in .gbrjob file + _HKI( "Immersion gold" ), // used in .gbrjob file + _HKI( "HT_OSP" ), // used in .gbrjob file + _HKI( "OSP" ), // used in .gbrjob file + _HKI( "None" ), // used in .gbrjob file + _HKI( "User defined" ) // keep this option at end };