From 32eb1ef77edc87f898a52ce61359d2718ed13e26 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 10 Apr 2023 13:10:42 -0400 Subject: [PATCH] Sch->PCB: propagate DNP from symbols to footprints attributes Also add a 3D viewer toggle. --- 3d-viewer/3d_canvas/board_adapter.cpp | 6 + 3d-viewer/3d_viewer/3d_menubar.cpp | 1 + 3d-viewer/3d_viewer/3d_toolbar.cpp | 1 + 3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp | 6 + .../3d_viewer/eda_3d_viewer_settings.cpp | 2 + 3d-viewer/3d_viewer/eda_3d_viewer_settings.h | 1 + 3d-viewer/3d_viewer/tools/eda_3d_actions.cpp | 6 + 3d-viewer/3d_viewer/tools/eda_3d_actions.h | 1 + .../3d_viewer/tools/eda_3d_controller.cpp | 6 + common/bitmap_info.cpp | 2 + common/pcb.keywords | 1 + include/bitmaps/bitmaps_list.h | 1 + .../dialogs/dialog_footprint_properties.cpp | 5 + .../dialog_footprint_properties_base.cpp | 5 +- .../dialog_footprint_properties_base.fbp | 64 ++++++++++ .../dialog_footprint_properties_base.h | 3 +- .../dialog_footprint_properties_fp_editor.cpp | 4 + ...og_footprint_properties_fp_editor_base.cpp | 5 +- ...og_footprint_properties_fp_editor_base.fbp | 64 ++++++++++ ...alog_footprint_properties_fp_editor_base.h | 3 +- pcbnew/footprint.cpp | 6 + pcbnew/footprint.h | 12 +- .../netlist_reader/board_netlist_updater.cpp | 40 ++++++ pcbnew/plugins/kicad/pcb_parser.cpp | 4 + pcbnew/plugins/kicad/pcb_plugin.cpp | 3 + pcbnew/plugins/kicad/pcb_plugin.h | 3 +- resources/bitmaps_png/CMakeLists.txt | 1 + resources/bitmaps_png/png/show_dnp_24.png | Bin 0 -> 307 bytes .../bitmaps_png/png/show_dnp_dark_24.png | Bin 0 -> 283 bytes .../bitmaps_png/sources/dark/show_dnp.svg | 116 +++++++++++++++++ .../bitmaps_png/sources/light/show_dnp.svg | 119 ++++++++++++++++++ 31 files changed, 485 insertions(+), 6 deletions(-) create mode 100644 resources/bitmaps_png/png/show_dnp_24.png create mode 100644 resources/bitmaps_png/png/show_dnp_dark_24.png create mode 100644 resources/bitmaps_png/sources/dark/show_dnp.svg create mode 100644 resources/bitmaps_png/sources/light/show_dnp.svg diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index 941e47e54d..da5c387179 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -272,6 +272,12 @@ bool BOARD_ADAPTER::IsFootprintShown( FOOTPRINT_ATTR_T aFPAttributes ) const return false; } + if( aFPAttributes & FP_DNP ) + { + if( !m_Cfg->m_Render.show_footprints_dnp ) + return false; + } + if( aFPAttributes & FP_SMD ) return m_Cfg->m_Render.show_footprints_insert; diff --git a/3d-viewer/3d_viewer/3d_menubar.cpp b/3d-viewer/3d_viewer/3d_menubar.cpp index 9ba9034691..7b87619668 100644 --- a/3d-viewer/3d_viewer/3d_menubar.cpp +++ b/3d-viewer/3d_viewer/3d_menubar.cpp @@ -122,6 +122,7 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar() prefsMenu->Add( EDA_3D_ACTIONS::showSMD, ACTION_MENU::CHECK ); prefsMenu->Add( EDA_3D_ACTIONS::showVirtual, ACTION_MENU::CHECK ); prefsMenu->Add( EDA_3D_ACTIONS::showNotInPosFile, ACTION_MENU::CHECK ); + prefsMenu->Add( EDA_3D_ACTIONS::showDNP, ACTION_MENU::CHECK ); prefsMenu->AppendSeparator(); diff --git a/3d-viewer/3d_viewer/3d_toolbar.cpp b/3d-viewer/3d_viewer/3d_toolbar.cpp index e1fed0da8f..90a7783b50 100644 --- a/3d-viewer/3d_viewer/3d_toolbar.cpp +++ b/3d-viewer/3d_viewer/3d_toolbar.cpp @@ -127,6 +127,7 @@ void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar() m_mainToolBar->Add( EDA_3D_ACTIONS::showSMD, ACTION_TOOLBAR::TOGGLE ); m_mainToolBar->Add( EDA_3D_ACTIONS::showVirtual, ACTION_TOOLBAR::TOGGLE ); m_mainToolBar->Add( EDA_3D_ACTIONS::showNotInPosFile, ACTION_TOOLBAR::TOGGLE ); + m_mainToolBar->Add( EDA_3D_ACTIONS::showDNP, ACTION_TOOLBAR::TOGGLE ); m_mainToolBar->AddScaledSeparator( this ); m_mainToolBar->AddControl( m_viewportsLabel ); diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp index bdf061e406..e46d1c0613 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp @@ -246,6 +246,11 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions() { return m_boardAdapter.m_Cfg->m_Render.show_footprints_not_in_posfile; }; + auto show_DNP = + [this]( const SELECTION& aSel ) + { + return m_boardAdapter.m_Cfg->m_Render.show_footprints_dnp; + }; auto showBBoxes = [this]( const SELECTION& aSel ) { @@ -268,6 +273,7 @@ void EDA_3D_VIEWER_FRAME::setupUIConditions() mgr->SetConditions( EDA_3D_ACTIONS::showSMD, ACTION_CONDITIONS().Check( showSMD ) ); mgr->SetConditions( EDA_3D_ACTIONS::showVirtual, ACTION_CONDITIONS().Check( showVirtual ) ); mgr->SetConditions( EDA_3D_ACTIONS::showNotInPosFile, ACTION_CONDITIONS().Check( show_NotInPosfile ) ); + mgr->SetConditions( EDA_3D_ACTIONS::showDNP, ACTION_CONDITIONS().Check( show_DNP ) ); mgr->SetConditions( EDA_3D_ACTIONS::showBBoxes, ACTION_CONDITIONS().Check( showBBoxes ) ); diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp index 3c74f141e7..fe8ac2b6d2 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_settings.cpp @@ -182,6 +182,8 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() &m_Render.show_footprints_virtual, true ) ); m_params.emplace_back( new PARAM( "render.show_footprints_not_in_posfile", &m_Render.show_footprints_not_in_posfile, true ) ); + m_params.emplace_back( new PARAM( "render.show_footprints_dnp", + &m_Render.show_footprints_dnp, true ) ); m_params.emplace_back( new PARAM( "render.show_silkscreen", &m_Render.show_silkscreen, true ) ); m_params.emplace_back( new PARAM( "render.show_soldermask", diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_settings.h b/3d-viewer/3d_viewer/eda_3d_viewer_settings.h index 8449115549..7ffd98941d 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_settings.h +++ b/3d-viewer/3d_viewer/eda_3d_viewer_settings.h @@ -84,6 +84,7 @@ public: bool show_footprints_normal; bool show_footprints_virtual; bool show_footprints_not_in_posfile; + bool show_footprints_dnp; bool show_silkscreen; bool show_soldermask; bool show_solderpaste; diff --git a/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp b/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp index 149297d135..3b5c74c0a5 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp +++ b/3d-viewer/3d_viewer/tools/eda_3d_actions.cpp @@ -228,6 +228,12 @@ TOOL_ACTION EDA_3D_ACTIONS::showNotInPosFile( "3DViewer.Control.attribute_not_in _( "Toggle 3D models not in pos file" ), _( "Toggle 3D models not in pos file" ), BITMAPS::show_not_in_posfile, AF_NONE ); +TOOL_ACTION EDA_3D_ACTIONS::showDNP( "3DViewer.Control.attribute_dnp", + AS_ACTIVE, + 'D', "", + _( "Toggle 3D models marked DNP" ), _( "Toggle 3D models for components marked 'Do Not Place'" ), + BITMAPS::show_dnp, AF_NONE ); + TOOL_ACTION EDA_3D_ACTIONS::showBBoxes( "3DViewer.Control.showBoundingBoxes", AS_GLOBAL, 0, "", _( "Show Model Bounding Boxes" ), _( "Show Model Bounding Boxes" ), diff --git a/3d-viewer/3d_viewer/tools/eda_3d_actions.h b/3d-viewer/3d_viewer/tools/eda_3d_actions.h index 4d3af5469d..80dc4511d2 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_actions.h +++ b/3d-viewer/3d_viewer/tools/eda_3d_actions.h @@ -79,6 +79,7 @@ public: static TOOL_ACTION showSMD; static TOOL_ACTION showVirtual; static TOOL_ACTION showNotInPosFile; + static TOOL_ACTION showDNP; static TOOL_ACTION showBBoxes; static TOOL_ACTION toggleRealisticMode; static TOOL_ACTION toggleBoardBody; diff --git a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp index 53019b104b..73870c94ab 100644 --- a/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp +++ b/3d-viewer/3d_viewer/tools/eda_3d_controller.cpp @@ -249,6 +249,11 @@ int EDA_3D_CONTROLLER::ToggleVisibility( const TOOL_EVENT& aEvent ) FLIP( m_boardAdapter->m_Cfg->m_Render.show_footprints_not_in_posfile ); reload = true; } + else if( aEvent.IsAction( &EDA_3D_ACTIONS::showDNP ) ) + { + FLIP( m_boardAdapter->m_Cfg->m_Render.show_footprints_dnp ); + reload = true; + } else if( aEvent.IsAction( &EDA_3D_ACTIONS::showBBoxes ) ) { FLIP( m_boardAdapter->m_Cfg->m_Render.opengl_show_model_bbox ); @@ -437,6 +442,7 @@ void EDA_3D_CONTROLLER::setTransitions() Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showSMD.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showVirtual.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showNotInPosFile.MakeEvent() ); + Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showDNP.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showVirtual.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::showBBoxes.MakeEvent() ); Go( &EDA_3D_CONTROLLER::ToggleVisibility, EDA_3D_ACTIONS::toggleRealisticMode.MakeEvent() ); diff --git a/common/bitmap_info.cpp b/common/bitmap_info.cpp index 5450ec008b..8d864e6bc6 100644 --- a/common/bitmap_info.cpp +++ b/common/bitmap_info.cpp @@ -491,6 +491,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::search_tree].emplace_back( BITMAPS::search_tree, wxT( "search_tree_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::set_origin].emplace_back( BITMAPS::set_origin, wxT( "set_origin_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::show_dcodenumber].emplace_back( BITMAPS::show_dcodenumber, wxT( "show_dcodenumber_24.png" ), 24, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::show_dnp].emplace_back( BITMAPS::show_dnp, wxT( "show_dnp_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::show_footprint].emplace_back( BITMAPS::show_footprint, wxT( "show_footprint_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::show_mod_edge].emplace_back( BITMAPS::show_mod_edge, wxT( "show_mod_edge_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::show_ratsnest].emplace_back( BITMAPS::show_ratsnest, wxT( "show_ratsnest_24.png" ), 24, wxT( "light" ) ); @@ -874,6 +875,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::search_tree].emplace_back( BITMAPS::search_tree, wxT( "search_tree_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::set_origin].emplace_back( BITMAPS::set_origin, wxT( "set_origin_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::show_dcodenumber].emplace_back( BITMAPS::show_dcodenumber, wxT( "show_dcodenumber_dark_24.png" ), 24, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::show_dnp].emplace_back( BITMAPS::show_dnp, wxT( "show_dnp_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::show_footprint].emplace_back( BITMAPS::show_footprint, wxT( "show_footprint_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::show_mod_edge].emplace_back( BITMAPS::show_mod_edge, wxT( "show_mod_edge_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::show_ratsnest].emplace_back( BITMAPS::show_ratsnest, wxT( "show_ratsnest_dark_24.png" ), 24, wxT( "dark" ) ); diff --git a/common/pcb.keywords b/common/pcb.keywords index 2a5b2ff1d3..26524fcc34 100644 --- a/common/pcb.keywords +++ b/common/pcb.keywords @@ -86,6 +86,7 @@ diff_pair_width diff_pair_gap dimension_precision dimension_units +dnp drawings drill edge diff --git a/include/bitmaps/bitmaps_list.h b/include/bitmaps/bitmaps_list.h index 6bfb9eca37..b8a74ac8f7 100644 --- a/include/bitmaps/bitmaps_list.h +++ b/include/bitmaps/bitmaps_list.h @@ -507,6 +507,7 @@ enum class BITMAPS : unsigned int show_all_layers, show_back_assembly_layers, show_dcodenumber, + show_dnp, show_footprint, show_front_assembly_layers, show_graphics_mode, diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index eaf4bccc47..2d6b555ead 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -157,6 +157,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen m_excludeFromPosFiles, m_excludeFromBOM, m_noCourtyards, + m_cbDNP, m_NetClearanceCtrl, m_SolderMaskMarginCtrl, m_allowSolderMaskBridges, @@ -284,6 +285,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow() m_excludeFromPosFiles->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES ); m_excludeFromBOM->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ); m_noCourtyards->SetValue( m_footprint->GetAttributes() & FP_ALLOW_MISSING_COURTYARD ); + m_cbDNP->SetValue( m_footprint->GetAttributes() & FP_DNP ); // Local Clearances @@ -532,6 +534,9 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow() if( m_excludeFromBOM->GetValue() ) attributes |= FP_EXCLUDE_FROM_BOM; + if( m_cbDNP->GetValue() ) + attributes |= FP_DNP; + if( m_noCourtyards->GetValue() ) attributes |= FP_ALLOW_MISSING_COURTYARD; diff --git a/pcbnew/dialogs/dialog_footprint_properties_base.cpp b/pcbnew/dialogs/dialog_footprint_properties_base.cpp index 028cc3ec81..6d2d372ad1 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_base.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -209,6 +209,9 @@ DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE( wxWindow* pa sbFabSizer->Add( m_noCourtyards, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_cbDNP = new wxCheckBox( sbFabSizer->GetStaticBox(), wxID_ANY, _("Do not populate"), wxDefaultPosition, wxDefaultSize, 0 ); + sbFabSizer->Add( m_cbDNP, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + bSizerMiddle->Add( sbFabSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/dialog_footprint_properties_base.fbp b/pcbnew/dialogs/dialog_footprint_properties_base.fbp index 0c46b7bbb1..573fbf89b3 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_base.fbp +++ b/pcbnew/dialogs/dialog_footprint_properties_base.fbp @@ -1625,6 +1625,70 @@ + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Do not populate + + 0 + + + 0 + + 1 + m_cbDNP + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + diff --git a/pcbnew/dialogs/dialog_footprint_properties_base.h b/pcbnew/dialogs/dialog_footprint_properties_base.h index e1ca8347fe..3bac189051 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_base.h +++ b/pcbnew/dialogs/dialog_footprint_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -74,6 +74,7 @@ class DIALOG_FOOTPRINT_PROPERTIES_BASE : public DIALOG_SHIM wxCheckBox* m_excludeFromPosFiles; wxCheckBox* m_excludeFromBOM; wxCheckBox* m_noCourtyards; + wxCheckBox* m_cbDNP; wxButton* m_buttonUpdate; wxButton* m_buttonExchange; wxButton* m_buttonModuleEditor; diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp index fa6b4fcf50..74a8e183d2 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor.cpp @@ -302,6 +302,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow() m_excludeFromPosFiles->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES ); m_excludeFromBOM->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ); m_noCourtyards->SetValue( m_footprint->GetAttributes() & FP_ALLOW_MISSING_COURTYARD ); + m_cbDNP->SetValue( m_footprint->GetAttributes() & FP_DNP ); // Local Clearances @@ -567,6 +568,9 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow() if( m_noCourtyards->GetValue() ) attributes |= FP_ALLOW_MISSING_COURTYARD; + if( m_cbDNP->GetValue() ) + attributes |= FP_DNP; + if( m_allowBridges->GetValue() ) attributes |= FP_ALLOW_SOLDERMASK_BRIDGES; diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp index 63a1c426ee..0e483dc18c 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -213,6 +213,9 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITO sbFabSizer->Add( m_noCourtyards, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_cbDNP = new wxCheckBox( sbFabSizer->GetStaticBox(), wxID_ANY, _("Do not populate"), wxDefaultPosition, wxDefaultSize, 0 ); + sbFabSizer->Add( m_cbDNP, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + bSizerProperties->Add( sbFabSizer, 1, wxEXPAND|wxRIGHT, 5 ); diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp index 8fa479ee56..080323ec10 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.fbp @@ -1531,6 +1531,70 @@ + + 5 + wxBOTTOM|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Do not populate + + 0 + + + 0 + + 1 + m_cbDNP + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + diff --git a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h index 232715dc37..5d5183a38f 100644 --- a/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h +++ b/pcbnew/dialogs/dialog_footprint_properties_fp_editor_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -68,6 +68,7 @@ class DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE : public DIALOG_SHIM wxCheckBox* m_excludeFromPosFiles; wxCheckBox* m_excludeFromBOM; wxCheckBox* m_noCourtyards; + wxCheckBox* m_cbDNP; wxPanel* m_PanelClearances; wxStaticText* m_staticTextInfo; wxStaticText* m_NetClearanceLabel; diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index 586dba5855..e56d0a8ca5 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -1073,6 +1073,9 @@ void FOOTPRINT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector( _HKI( "Exclude from bill of materials" ), &FOOTPRINT::SetExcludedFromBOM, &FOOTPRINT::IsExcludedFromBOM ), groupAttributes ); + propMgr.AddProperty( new PROPERTY( _HKI( "Do not populate" ), + &FOOTPRINT::SetDNP, &FOOTPRINT::IsDNP ), + groupAttributes ); const wxString groupOverrides = _HKI( "Overrides" ); diff --git a/pcbnew/footprint.h b/pcbnew/footprint.h index c468433231..a7cb6e3fa1 100644 --- a/pcbnew/footprint.h +++ b/pcbnew/footprint.h @@ -73,7 +73,8 @@ enum FOOTPRINT_ATTR_T FP_BOARD_ONLY = 0x0010, // Footprint has no corresponding symbol FP_JUST_ADDED = 0x0020, // Footprint just added by netlist update FP_ALLOW_SOLDERMASK_BRIDGES = 0x0040, - FP_ALLOW_MISSING_COURTYARD = 0x0080 + FP_ALLOW_MISSING_COURTYARD = 0x0080, + FP_DNP = 0x0100 }; class FP_3DMODEL @@ -617,6 +618,15 @@ public: m_attributes &= ~FP_ALLOW_MISSING_COURTYARD; } + bool IsDNP() const { return m_attributes & FP_DNP; } + void SetDNP( bool aDNP = true ) + { + if( aDNP ) + m_attributes |= FP_DNP; + else + m_attributes &= ~FP_DNP; + } + void SetFileFormatVersionAtLoad( int aVersion ) { m_fileFormatVersionAtLoad = aVersion; } int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; } diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index 4e140e6c6e..50d90ff62e 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -402,6 +402,46 @@ bool BOARD_NETLIST_UPDATER::updateFootprintParameters( FOOTPRINT* aPcbFootprint, m_reporter->Report( msg, RPT_SEVERITY_ACTION ); } + if( ( aNetlistComponent->GetProperties().count( wxT( "dnp" ) ) > 0 ) + != ( ( aPcbFootprint->GetAttributes() & FP_DNP ) > 0 ) ) + { + if( m_isDryRun ) + { + if( aNetlistComponent->GetProperties().count( wxT( "dnp" ) ) ) + { + msg.Printf( _( "Add %s 'Do not place' fabrication attribute." ), + aPcbFootprint->GetReference() ); + } + else + { + msg.Printf( _( "Remove %s 'Do not place' fabrication attribute." ), + aPcbFootprint->GetReference() ); + } + } + else + { + int attributes = aPcbFootprint->GetAttributes(); + + if( aNetlistComponent->GetProperties().count( wxT( "dnp" ) ) ) + { + attributes |= FP_DNP; + msg.Printf( _( "Added %s 'Do not place' fabrication attribute." ), + aPcbFootprint->GetReference() ); + } + else + { + attributes &= ~FP_DNP; + msg.Printf( _( "Removed %s 'Do not place' fabrication attribute." ), + aPcbFootprint->GetReference() ); + } + + changed = true; + aPcbFootprint->SetAttributes( attributes ); + } + + m_reporter->Report( msg, RPT_SEVERITY_ACTION ); + } + if( changed && copy ) m_commit.Modified( aPcbFootprint, copy ); else if( copy ) diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index f57335ef98..83896f8df2 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -3858,6 +3858,10 @@ FOOTPRINT* PCB_PARSER::parseFOOTPRINT_unchecked( wxArrayString* aInitialComments attributes |= FP_ALLOW_MISSING_COURTYARD; break; + case T_dnp: + attributes |= FP_DNP; + break; + case T_allow_soldermask_bridges: attributes |= FP_ALLOW_SOLDERMASK_BRIDGES; break; diff --git a/pcbnew/plugins/kicad/pcb_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp index 4f42baf0b5..f951774c62 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -1153,6 +1153,9 @@ void PCB_PLUGIN::format( const FOOTPRINT* aFootprint, int aNestLevel ) const if( aFootprint->GetAttributes() & FP_ALLOW_MISSING_COURTYARD ) m_out->Print( 0, " allow_missing_courtyard" ); + if( aFootprint->GetAttributes() & FP_DNP ) + m_out->Print( 0, " dnp" ); + if( aFootprint->GetAttributes() & FP_ALLOW_SOLDERMASK_BRIDGES ) m_out->Print( 0, " allow_soldermask_bridges" ); diff --git a/pcbnew/plugins/kicad/pcb_plugin.h b/pcbnew/plugins/kicad/pcb_plugin.h index 0d33c17a54..01980f1073 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.h +++ b/pcbnew/plugins/kicad/pcb_plugin.h @@ -127,7 +127,8 @@ class PCB_PLUGIN; // forward decl //#define SEXPR_BOARD_FILE_VERSION 20220815 // Add allow-soldermask-bridges-in-FPs flag //#define SEXPR_BOARD_FILE_VERSION 20220818 // First-class storage for net-ties //#define SEXPR_BOARD_FILE_VERSION 20220914 // Number boxes for custom-shape pads -#define SEXPR_BOARD_FILE_VERSION 20221018 // Via & pad zone-layer-connections +//#define SEXPR_BOARD_FILE_VERSION 20221018 // Via & pad zone-layer-connections +#define SEXPR_BOARD_FILE_VERSION 20230410 // DNP attribute propagated from schematic to attr #define BOARD_FILE_HOST_VERSION 20200825 ///< Earlier files than this include the host tag #define LEGACY_ARC_FORMATTING 20210925 ///< These were the last to use old arc formatting diff --git a/resources/bitmaps_png/CMakeLists.txt b/resources/bitmaps_png/CMakeLists.txt index b03b07da25..b807182d15 100644 --- a/resources/bitmaps_png/CMakeLists.txt +++ b/resources/bitmaps_png/CMakeLists.txt @@ -468,6 +468,7 @@ set( BMAPS_MID search_tree set_origin show_dcodenumber + show_dnp show_footprint show_mod_edge show_ratsnest diff --git a/resources/bitmaps_png/png/show_dnp_24.png b/resources/bitmaps_png/png/show_dnp_24.png new file mode 100644 index 0000000000000000000000000000000000000000..89bf49ec6aa5654237bca3ad6747c9845c760727 GIT binary patch literal 307 zcmV-30nGl1P)Q7lNFJgNq~7sANIzZ+q5^|K7OVo|-yjVT>~v|rs#C@hb!%Rb8W0WQgT>)$!0K0l z^b-|Shcs;^_p3XU12sK@8M05!=?l=M=YjM`B!iy=E$Y~-=_F59oUCF9Wdpjl8EEKR zBt!onP<8yePt9@W8DnEEvJA%R19gZG_NzL6K(g!wNj@MZ4)$w1@L-JtRj1X_gyMjl zR0IsFWw2C~4@{~9n-6FLq#BR>r6mSg@Q;>wv;ZD>0076OK#IhZM`r*4002ovPDHLk FV1gzjfA;_Y literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/png/show_dnp_dark_24.png b/resources/bitmaps_png/png/show_dnp_dark_24.png new file mode 100644 index 0000000000000000000000000000000000000000..928256fc84c87bd61af896f10a4c5ab8c6e2f875 GIT binary patch literal 283 zcmV+$0p$LPP)Okrp|AX}7wcyUlDEORr{?qp=+g5*`XiFT&w&wv;ZD>007XNgpe-}M8p69002ovPDHLkV1iHnfU*Dp literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/sources/dark/show_dnp.svg b/resources/bitmaps_png/sources/dark/show_dnp.svg new file mode 100644 index 0000000000..9a05a27e97 --- /dev/null +++ b/resources/bitmaps_png/sources/dark/show_dnp.svg @@ -0,0 +1,116 @@ + + + + + + + + + + image/svg+xml + + show_tht + + + + + + + + + + + + + + + show_tht + + + + + diff --git a/resources/bitmaps_png/sources/light/show_dnp.svg b/resources/bitmaps_png/sources/light/show_dnp.svg new file mode 100644 index 0000000000..bbc77dacb9 --- /dev/null +++ b/resources/bitmaps_png/sources/light/show_dnp.svg @@ -0,0 +1,119 @@ + + + + + + + + + + image/svg+xml + + show_tht + + + + + + + + + + + + + + + show_tht + + + + +