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:
parent
e4530fcf0d
commit
10e60acf34
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.cppdialogs
dialog_board_setup.cppdialog_board_statistics.cppdialog_drc.cppdialog_exchange_footprints.cppdialog_export_svg.cppdialog_gendrill.cppdialog_global_edit_text_and_graphics.cppdialog_global_edit_tracks_and_vias.cppdialog_net_inspector.cppdialog_pad_properties.cppdialog_pad_properties.hdialog_plot.cppdialog_position_relative.cppdialog_track_via_properties.cpp
dimension.cppdrc
drc_engine.cppdrc_results_provider.cppdrc_results_provider.hdrc_test_provider_annulus.cppdrc_test_provider_connectivity.cppdrc_test_provider_copper_clearance.cppdrc_test_provider_courtyard_clearance.cppdrc_test_provider_disallow.cppdrc_test_provider_hole_size.cppdrc_test_provider_hole_to_hole.cppdrc_test_provider_lvs.cppdrc_test_provider_matched_length.cppdrc_test_provider_misc.cppdrc_test_provider_silk_clearance.cppdrc_test_provider_silk_to_mask.cppdrc_test_provider_track_width.cppdrc_test_provider_via_diameter.cpp
edit.cppedit_track_width.cppexporters
export_d356.cppexport_footprints_placefile.cppexport_gencad.cppexport_hyperlynx.cppexport_idf.cppexport_vrml.cppgendrill_file_writer_base.cppgendrill_gerber_writer.cppgerber_jobfile_writer.cppgerber_placefile_writer.cpp
files.cppfootprint.cppfp_text.cppinitpcb.cppkicad_clipboard.cppmicrowave
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.cppplugins
altium
cadstar
eagle
fabmaster
geda
kicad
legacy
python
router
specctra_import_export
toolbars_pcb_editor.cpptools
board_editor_control.cppboard_inspection_tool.cppboard_inspection_tool.hconvert_tool.cppdrawing_stackup_table_tool.cppdrawing_tool.cppdrc_tool.cppedit_tool.cppfootprint_editor_control.cpppad_tool.cpppcb_control.cpppcb_grid_helper.cpppcb_point_editor.cpppcb_selection_tool.cppposition_relative_tool.cppzone_create_helper.cppzone_filler_tool.cppzone_filler_tool.h
track.cppundo_redo.cppwidgets
zone.cppzone_filler.cpp@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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 )
|
||||
|
@ -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; }
|
||||
|
@ -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>
|
||||
|
@ -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 ) );
|
||||
}
|
||||
}, {} ) );
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <bezier_curves.h>
|
||||
#include <board_design_settings.h>
|
||||
#include <trigo.h>
|
||||
#include <board.h>
|
||||
#include <pad.h>
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user