From e04f8737657d90d513ad9835f5bbb1cda507a575 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 22 Dec 2024 21:19:04 +0000 Subject: [PATCH] Honour sheet-level DNP & Exclude from BOM in symbol fields table. (And also in netlist exporter.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/18717 --- eeschema/fields_data_model.cpp | 10 ++++++++-- eeschema/netlist_exporters/netlist_exporter_xml.cpp | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/eeschema/fields_data_model.cpp b/eeschema/fields_data_model.cpp index c2cd94a65e..2afd89c5de 100644 --- a/eeschema/fields_data_model.cpp +++ b/eeschema/fields_data_model.cpp @@ -555,11 +555,17 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RebuildRows() if( !m_filter.IsEmpty() && !WildCompareString( m_filter, ref.GetFullRef(), false ) ) continue; - if( m_excludeDNP && ref.GetSymbol()->GetDNP() ) + if( m_excludeDNP && ( ref.GetSymbol()->GetDNP() + || ref.GetSheetPath().GetDNP() ) ) + { continue; + } - if( !m_includeExcluded && ref.GetSymbol()->GetExcludedFromBOM() ) + if( !m_includeExcluded && ( ref.GetSymbol()->GetExcludedFromBOM() + || ref.GetSheetPath().GetExcludedFromBOM() ) ) + { continue; + } // Check if the symbol if on the current sheet or, in the sheet path somewhere // depending on scope diff --git a/eeschema/netlist_exporters/netlist_exporter_xml.cpp b/eeschema/netlist_exporters/netlist_exporter_xml.cpp index 4e780b3ea1..3af68654c0 100644 --- a/eeschema/netlist_exporters/netlist_exporter_xml.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_xml.cpp @@ -368,19 +368,19 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl ) xproperty->AddAttribute( wxT( "value" ), sheetField.GetText() ); } - if( symbol->GetExcludedFromBOM() ) + if( symbol->GetExcludedFromBOM() || sheet.GetExcludedFromBOM() ) { xcomp->AddChild( xproperty = node( wxT( "property" ) ) ); xproperty->AddAttribute( wxT( "name" ), wxT( "exclude_from_bom" ) ); } - if( symbol->GetExcludedFromBoard() ) + if( symbol->GetExcludedFromBoard() || sheet.GetExcludedFromBoard() ) { xcomp->AddChild( xproperty = node( wxT( "property" ) ) ); xproperty->AddAttribute( wxT( "name" ), wxT( "exclude_from_board" ) ); } - if( symbol->GetDNP() ) + if( symbol->GetDNP() || sheet.GetDNP() ) { xcomp->AddChild( xproperty = node( wxT( "property" ) ) ); xproperty->AddAttribute( wxT( "name" ), wxT( "dnp" ) );