7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-14 17:09:36 +00:00

Clean up including of board_design_settings.h

This commit is contained in:
Marek Roszko 2021-06-06 15:03:10 -04:00
parent e4530fcf0d
commit 10e60acf34
122 changed files with 347 additions and 133 deletions
3d-viewer
common/widgets
include
pcbnew
CMakeLists.txtboard.cppboard.hboard_connected_item.cppboard_design_settings.cppboard_items_to_polygon_shape_transform.cpp
board_stackup_manager
convert_drawsegment_list_to_polygon.cppcross-probing.cpp
dialogs
dimension.cpp
drc
edit.cppedit_track_width.cpp
exporters
files.cppfootprint.cppfp_text.cppinitpcb.cppkicad_clipboard.cpp
microwave
netinfo_item.cpppad.cpppad_custom_shape_functions.cpppcb_base_edit_frame.cpppcb_display_options.cpppcb_edit_frame.cpppcb_expr_evaluator.cpppcb_marker.cpppcb_painter.cpppcb_shape.cpppcb_target.cpppcb_text.cpppcbnew_config.cpppcbplot.cppplot_board_layers.cpp
plugins
python
router
specctra_import_export
toolbars_pcb_editor.cpp
tools
track.cppundo_redo.cpp
widgets
zone.cppzone_filler.cpp

View File

@ -29,6 +29,7 @@
#include "../3d_rendering/camera.h"
#include "board_adapter.h"
#include <board_design_settings.h>
#include <3d_rendering/3d_render_raytracing/shapes2D/polygon_2d.h>
#include <board.h>
#include <3d_math.h>

View File

@ -37,6 +37,7 @@
#include "../3d_rendering/3d_render_raytracing/shapes3D/cylinder_3d.h"
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_text.h>

View File

@ -36,6 +36,7 @@
#include <3d_viewer/tools/3d_controller.h>
#include <3d_viewer/tools/3d_conditions.h>
#include <bitmaps.h>
#include <board_design_settings.h>
#include <board_stackup_manager/board_stackup.h>
#include <board_stackup_manager/stackup_predefined_prms.h>
#include <board.h>

View File

@ -24,6 +24,7 @@
#include <kicad_string.h>
#include <kiplatform/ui.h>
#include <widgets/ui_common.h>
#include <widgets/net_selector.h>
#include <board.h>

View File

@ -25,7 +25,8 @@
#ifndef BOARD_DESIGN_SETTINGS_H_
#define BOARD_DESIGN_SETTINGS_H_
#include <pad.h>
#include <memory>
#include <netclass.h>
#include <config_params.h>
#include <board_stackup_manager/board_stackup.h>
@ -211,6 +212,7 @@ enum class DIM_UNITS_FORMAT : int;
enum class DIM_TEXT_POSITION : int;
enum class DIM_UNITS_MODE : int;
class PAD;
/**
* Container for design settings for a #BOARD object.
@ -750,8 +752,8 @@ public:
wxPoint m_AuxOrigin; ///< origin for plot exports
wxPoint m_GridOrigin; ///< origin for grid offsets
PAD m_Pad_Master; // A dummy pad to store all default parameters
// when importing values or creating a new pad
std::unique_ptr<PAD> m_Pad_Master; // A dummy pad to store all default parameters
// when importing values or creating a new pad
// Set to true if the board has a stackup management.
// If not set a default basic stackup will be used to generate the gbrjob file.

View File

@ -226,6 +226,7 @@ set( PCBNEW_MICROWAVE_SRCS
)
set( PCBNEW_DRC_SRCS
drc/drc_results_provider.cpp
drc/drc_test_provider.cpp
drc/drc_test_provider_annulus.cpp
drc/drc_test_provider_disallow.cpp

View File

@ -29,6 +29,7 @@
#include <iterator>
#include <drc/drc_rtree.h>
#include <pcb_base_frame.h>
#include <board_design_settings.h>
#include <reporter.h>
#include <board_commit.h>
#include <board.h>
@ -487,6 +488,12 @@ void BOARD::SetEnabledLayers( LSET aLayerSet )
}
bool BOARD::IsLayerEnabled( PCB_LAYER_ID aLayer ) const
{
return GetDesignSettings().IsLayerEnabled( aLayer );
}
void BOARD::SetVisibleLayers( LSET aLayerSet )
{
if( m_project )
@ -577,6 +584,25 @@ bool BOARD::IsFootprintLayerVisible( PCB_LAYER_ID aLayer ) const
}
BOARD_DESIGN_SETTINGS& BOARD::GetDesignSettings() const
{
return *m_designSettings;
}
const ZONE_SETTINGS& BOARD::GetZoneSettings() const
{
return GetDesignSettings().GetDefaultZoneSettings();
}
void BOARD::SetZoneSettings( const ZONE_SETTINGS& aSettings )
{
GetDesignSettings().SetDefaultZoneSettings( aSettings );
}
void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode )
{
if( aBoardItem == nullptr )

View File

@ -25,7 +25,6 @@
#ifndef CLASS_BOARD_H_
#define CLASS_BOARD_H_
#include <board_design_settings.h>
#include <board_item_container.h>
#include <common.h> // Needed for stl hash extensions
#include <convert_drawsegment_list_to_polygon.h> // for OUTLINE_ERROR_HANDLER
@ -35,7 +34,10 @@
#include <pcb_plot_params.h>
#include <title_block.h>
#include <tools/pcb_selection.h>
#include <mutex>
class BOARD_DESIGN_SETTINGS;
class BOARD_CONNECTED_ITEM;
class BOARD_COMMIT;
class DRC_RTREE;
class PCB_BASE_FRAME;
@ -438,10 +440,7 @@ public:
* @param aLayer = The layer to be tested
* @return true if the layer is visible.
*/
bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const
{
return GetDesignSettings().IsLayerEnabled( aLayer );
}
bool IsLayerEnabled( PCB_LAYER_ID aLayer ) const;
/**
* A proxy function that calls the correspondent function in m_BoardSettings
@ -523,20 +522,11 @@ public:
/**
* @return the BOARD_DESIGN_SETTINGS for this BOARD
*/
BOARD_DESIGN_SETTINGS& GetDesignSettings() const
{
return *m_designSettings;
}
BOARD_DESIGN_SETTINGS& GetDesignSettings() const;
const ZONE_SETTINGS& GetZoneSettings() const override
{
return GetDesignSettings().GetDefaultZoneSettings();
}
const ZONE_SETTINGS& GetZoneSettings() const override;
void SetZoneSettings( const ZONE_SETTINGS& aSettings ) override
{
GetDesignSettings().SetDefaultZoneSettings( aSettings );
}
void SetZoneSettings( const ZONE_SETTINGS& aSettings ) override;
const PAGE_INFO& GetPageSettings() const { return m_paper; }
void SetPageSettings( const PAGE_INFO& aPageSettings ) { m_paper = aPageSettings; }

View File

@ -24,7 +24,8 @@
*/
#include <board.h>
#include <board_item.h>
#include <board_connected_item.h>
#include <board_design_settings.h>
#include <connectivity/connectivity_data.h>
#include <drc/drc_engine.h>
#include <kicad_string.h>

View File

@ -25,6 +25,7 @@
#include <track.h>
#include <layers_id_colors_and_visibility.h>
#include <kiface_i.h>
#include <pad.h>
#include <board_design_settings.h>
#include <drc/drc_item.h>
#include <drc/drc_engine.h>
@ -32,14 +33,14 @@
#include <settings/parameters.h>
#include <project/project_file.h>
#include <advanced_config.h>
#include <board_design_settings.h>
#include <pcbnew.h>
const int bdsSchemaVersion = 2;
BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) :
NESTED_SETTINGS( "board_design_settings", bdsSchemaVersion, aParent, aPath ),
m_Pad_Master( NULL )
NESTED_SETTINGS( "board_design_settings", bdsSchemaVersion, aParent, aPath )
{
// We want to leave alone parameters that aren't found in the project JSON as they may be
// initialized by the board file parser before NESTED_SETTINGS::LoadFromFile is called.
@ -53,6 +54,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std:
m_HasStackup = false; // no stackup defined by default
m_Pad_Master = std::make_unique<PAD>( nullptr );
LSET all_set = LSET().set();
m_enabledLayers = all_set; // All layers enabled at first.
// SetCopperLayerCount() will adjust this.
@ -560,9 +563,9 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std:
{
nlohmann::json ret =
{
{ "width", Iu2Millimeter( m_Pad_Master.GetSize().x ) },
{ "height", Iu2Millimeter( m_Pad_Master.GetSize().y ) },
{ "drill", Iu2Millimeter( m_Pad_Master.GetDrillSize().x ) }
{ "width", Iu2Millimeter( m_Pad_Master->GetSize().x ) },
{ "height", Iu2Millimeter( m_Pad_Master->GetSize().y ) },
{ "drill", Iu2Millimeter( m_Pad_Master->GetDrillSize().x ) }
};
return ret;
@ -576,11 +579,11 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std:
sz.SetWidth( Millimeter2iu( aJson["width"].get<double>() ) );
sz.SetHeight( Millimeter2iu( aJson["height"].get<double>() ) );
m_Pad_Master.SetSize( sz );
m_Pad_Master->SetSize( sz );
int drill = Millimeter2iu( aJson["drill"].get<double>() );
m_Pad_Master.SetDrillSize( wxSize( drill, drill ) );
m_Pad_Master->SetDrillSize( wxSize( drill, drill ) );
}
}, {} ) );

View File

@ -24,6 +24,7 @@
#include <vector>
#include <bezier_curves.h>
#include <board_design_settings.h>
#include <trigo.h>
#include <board.h>
#include <pad.h>

View File

@ -24,6 +24,7 @@
#include <widgets/paged_dialog.h>
#include <pcb_edit_frame.h>
#include <board_design_settings.h>
#include <board_stackup_manager/stackup_predefined_prms.h>
#include "panel_board_finish.h"

View File

@ -26,6 +26,7 @@
#include <macros.h> // arrayDim definition
#include <pcb_edit_frame.h>
#include <board.h>
#include <board_design_settings.h>
#include <dialogs/dialog_color_picker.h>
#include <widgets/paged_dialog.h>
#include <widgets/layer_box_selector.h>

View File

@ -29,6 +29,7 @@
#include <math/vector2d.h>
#include <pcb_shape.h>
#include <footprint.h>
#include <pad.h>
#include <base_units.h>
#include <convert_basic_shapes_to_polygon.h>
#include <geometry/shape_poly_set.h>

View File

@ -32,7 +32,9 @@
*/
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <track.h>
#include <zone.h>
#include <collectors.h>

View File

@ -26,6 +26,7 @@
#include <../board_stackup_manager/panel_board_stackup.h>
#include <../board_stackup_manager/panel_board_finish.h>
#include <confirm.h>
#include <board_design_settings.h>
#include <kiface_i.h>
#include <drc/drc_item.h>
#include <dialog_import_settings.h>

View File

@ -25,6 +25,7 @@
#include "dialog_board_statistics.h"
#include "base_units.h"
#include <pad.h>
#include <macros.h>
#include <wildcards_and_files_ext.h>
#include <wx/filedlg.h>

View File

@ -25,8 +25,10 @@
#include <confirm.h>
#include <dialog_drc.h>
#include <board_design_settings.h>
#include <kiface_i.h>
#include <macros.h>
#include <pad.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <pgm_base.h>

View File

@ -28,6 +28,7 @@
#include <board_commit.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <dialog_exchange_footprints.h>
#include <kicad_string.h>
#include <kiway.h>

View File

@ -27,6 +27,7 @@
#include <pcbnew_settings.h>
#include <wildcards_and_files_ext.h>
#include <reporter.h>
#include <board_design_settings.h>
#include <confirm.h>
#include <core/arraydim.h>
#include <core/kicad_algo.h>

View File

@ -32,8 +32,10 @@
#include <bitmaps.h>
#include <tools/board_editor_control.h>
#include <board.h>
#include <track.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <track.h>
#include <paths.h>
#include <dialog_gendrill.h>
#include <wildcards_and_files_ext.h>

View File

@ -28,6 +28,7 @@
#include <pcb_layer_box_selector.h>
#include <pcbnew.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <dimension.h>
#include <fp_shape.h>

View File

@ -24,6 +24,7 @@
#include <pcb_edit_frame.h>
#include <board.h>
#include <board_design_settings.h>
#include <track.h>
#include <connectivity/connectivity_data.h>
#include <pcb_layer_box_selector.h>

View File

@ -26,6 +26,7 @@
#include <kicad_string.h>
#include <tools/board_inspection_tool.h>
#include <board.h>
#include <board_design_settings.h>
#include <track.h>
#include <dialog_net_inspector.h>
#include <eda_pattern_match.h>

View File

@ -28,6 +28,7 @@
#include <bitmaps.h>
#include <board_commit.h>
#include <board.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <confirm.h>
#include <core/arraydim.h>
@ -37,6 +38,7 @@
#include <gal/graphics_abstraction_layer.h>
#include <dialogs/html_messagebox.h>
#include <macros.h>
#include <pad.h>
#include <pcb_base_frame.h>
#include <footprint_edit_frame.h>
#include <pcb_painter.h>
@ -161,7 +163,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad
m_FlippedWarningIcon->SetBitmap( KiBitmap( BITMAPS::dialog_warning ) );
m_nonCopperWarningIcon->SetBitmap( KiBitmap( BITMAPS::dialog_warning ) );
m_padMaster = &m_parent->GetDesignSettings().m_Pad_Master;
m_padMaster = m_parent->GetDesignSettings().m_Pad_Master.get();
m_dummyPad = new PAD( (FOOTPRINT*) NULL );
if( aPad )
@ -1072,6 +1074,13 @@ void DIALOG_PAD_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
}
void DIALOG_PAD_PROPERTIES::OnUpdateUINonCopperWarning( wxUpdateUIEvent& event )
{
bool isOnCopperLayer = ( m_dummyPad->GetLayerSet() & LSET::AllCuMask() ).any();
m_nonCopperWarningBook->SetSelection( isOnCopperLayer ? 0 : 1 );
}
void DIALOG_PAD_PROPERTIES::updatePadLayersList( LSET layer_mask, bool remove_unconnected,
bool keep_top_bottom )
{

Some files were not shown because too many files have changed in this diff Show More