Properties: expose symbol attributes

Flip polarity of exclude-from-BOM and -board for symbols
to match that of footprints and match the GUI display.
This commit is contained in:
Jon Evans 2023-06-24 22:03:06 -04:00
parent f0d8edae1e
commit d4b7144448
20 changed files with 109 additions and 94 deletions

View File

@ -484,7 +484,7 @@ CONNECTION_SUBGRAPH::PRIORITY CONNECTION_SUBGRAPH::GetDriverPriority( SCH_ITEM*
if( sch_pin->IsGlobalPower() )
return PRIORITY::POWER_PIN;
else if( !sym || !sym->GetIncludeOnBoard() || sym->GetLibSymbolRef()->GetReferenceField().GetText().StartsWith( '#' ) )
else if( !sym || sym->GetExcludedFromBoard() || sym->GetLibSymbolRef()->GetReferenceField().GetText().StartsWith( '#' ) )
return PRIORITY::NONE;
else
return PRIORITY::PIN;

View File

@ -591,8 +591,8 @@ int DIALOG_CHANGE_SYMBOLS::processSymbols( SCH_COMMIT* aCommit,
{
// Fetch the attributes from the *flattened* library symbol. They are not supported
// in derived symbols.
symbol->SetIncludeInBom( symbol->GetLibSymbolRef()->GetIncludeInBom() );
symbol->SetIncludeOnBoard( symbol->GetLibSymbolRef()->GetIncludeOnBoard() );
symbol->SetExcludedFromBOM( symbol->GetLibSymbolRef()->GetExcludedFromBOM() );
symbol->SetExcludedFromBoard( symbol->GetLibSymbolRef()->GetExcludedFromBoard() );
}
bool removeExtras = m_removeExtraBox->GetValue();

View File

@ -185,8 +185,8 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
LIB_FIELD* simEnableField = m_libEntry->FindField( SIM_ENABLE_FIELD );
m_excludeFromSim->SetValue( simEnableField && simEnableField->GetText() == wxT( "0" ) );
m_excludeFromBomCheckBox->SetValue( !m_libEntry->GetIncludeInBom() );
m_excludeFromBoardCheckBox->SetValue( !m_libEntry->GetIncludeOnBoard() );
m_excludeFromBomCheckBox->SetValue( !m_libEntry->GetExcludedFromBOM() );
m_excludeFromBoardCheckBox->SetValue( !m_libEntry->GetExcludedFromBoard() );
m_ShowPinNumButt->SetValue( m_libEntry->ShowPinNumbers() );
m_ShowPinNameButt->SetValue( m_libEntry->ShowPinNames() );
@ -437,8 +437,8 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
m_libEntry->SetNormal();
}
m_libEntry->SetIncludeInBom( !m_excludeFromBomCheckBox->GetValue() );
m_libEntry->SetIncludeOnBoard( !m_excludeFromBoardCheckBox->GetValue() );
m_libEntry->SetExcludedFromBOM( m_excludeFromBomCheckBox->GetValue() );
m_libEntry->SetExcludedFromBoard( m_excludeFromBoardCheckBox->GetValue() );
m_libEntry->SetShowPinNumbers( m_ShowPinNumButt->GetValue() );
m_libEntry->SetShowPinNames( m_ShowPinNameButt->GetValue() );

View File

@ -510,8 +510,8 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow()
}
m_cbExcludeFromSim->SetValue( m_symbol->GetFieldText( SIM_ENABLE_FIELD ) == wxS( "0" ) );
m_cbExcludeFromBom->SetValue( !m_symbol->GetIncludeInBom() );
m_cbExcludeFromBoard->SetValue( !m_symbol->GetIncludeOnBoard() );
m_cbExcludeFromBom->SetValue( m_symbol->GetExcludedFromBOM() );
m_cbExcludeFromBoard->SetValue( m_symbol->GetExcludedFromBoard() );
m_cbDNP->SetValue( m_symbol->GetDNP() );
if( m_part )
@ -778,8 +778,8 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
m_symbol->SetValueFieldText( m_fields->at( VALUE_FIELD ).GetText() );
m_symbol->SetFootprintFieldText( m_fields->at( FOOTPRINT_FIELD ).GetText() );
m_symbol->SetIncludeInBom( !m_cbExcludeFromBom->IsChecked() );
m_symbol->SetIncludeOnBoard( !m_cbExcludeFromBoard->IsChecked() );
m_symbol->SetExcludedFromBOM( m_cbExcludeFromBom->IsChecked() );
m_symbol->SetExcludedFromBoard( m_cbExcludeFromBoard->IsChecked() );
m_symbol->SetDNP( m_cbDNP->IsChecked() );
// Update any assignments
@ -845,8 +845,8 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
otherUnit->GetFields().erase( otherUnit->GetFields().begin() + ii );
}
otherUnit->SetIncludeInBom( !m_cbExcludeFromBom->IsChecked() );
otherUnit->SetIncludeOnBoard( !m_cbExcludeFromBoard->IsChecked() );
otherUnit->SetExcludedFromBOM( m_cbExcludeFromBom->IsChecked() );
otherUnit->SetExcludedFromBoard( m_cbExcludeFromBoard->IsChecked() );
otherUnit->SetDNP( m_cbDNP->IsChecked() );
if( m_dataModel )

View File

@ -389,7 +389,7 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RebuildRows()
if( m_excludeDNP && ref.GetSymbol()->GetDNP() )
continue;
if( !m_includeExcluded && !ref.GetSymbol()->GetIncludeInBom() )
if( !m_includeExcluded && ref.GetSymbol()->GetExcludedFromBOM() )
continue;
bool matchFound = false;

View File

@ -108,8 +108,8 @@ struct null_deleter
LIB_SYMBOL::LIB_SYMBOL( const wxString& aName, LIB_SYMBOL* aParent, SYMBOL_LIB* aLibrary ) :
EDA_ITEM( LIB_SYMBOL_T ),
m_me( this, null_deleter() ),
m_includeInBom( true ),
m_includeOnBoard( true )
m_excludedFromBOM( false ),
m_excludedFromBoard( false )
{
m_lastModDate = 0;
m_unitCount = 1;
@ -147,9 +147,9 @@ LIB_SYMBOL::LIB_SYMBOL( const LIB_SYMBOL& aSymbol, SYMBOL_LIB* aLibrary ) :
m_unitsLocked = aSymbol.m_unitsLocked;
m_pinNameOffset = aSymbol.m_pinNameOffset;
m_showPinNumbers = aSymbol.m_showPinNumbers;
m_includeInBom = aSymbol.m_includeInBom;
m_includeOnBoard = aSymbol.m_includeOnBoard;
m_showPinNames = aSymbol.m_showPinNames;
m_excludedFromBOM = aSymbol.m_excludedFromBOM;
m_excludedFromBoard = aSymbol.m_excludedFromBoard;
m_showPinNames = aSymbol.m_showPinNames;
m_lastModDate = aSymbol.m_lastModDate;
m_options = aSymbol.m_options;
m_libId = aSymbol.m_libId;
@ -200,8 +200,8 @@ const LIB_SYMBOL& LIB_SYMBOL::operator=( const LIB_SYMBOL& aSymbol )
m_pinNameOffset = aSymbol.m_pinNameOffset;
m_showPinNumbers = aSymbol.m_showPinNumbers;
m_showPinNames = aSymbol.m_showPinNames;
m_includeInBom = aSymbol.m_includeInBom;
m_includeOnBoard = aSymbol.m_includeOnBoard;
m_excludedFromBOM = aSymbol.m_excludedFromBOM;
m_excludedFromBoard = aSymbol.m_excludedFromBoard;
m_lastModDate = aSymbol.m_lastModDate;
m_options = aSymbol.m_options;
m_libId = aSymbol.m_libId;
@ -467,18 +467,18 @@ int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, int aCompareFlags, REPORTER* aR
return retv;
}
if( m_includeInBom != aRhs.m_includeInBom )
if( m_excludedFromBOM != aRhs.m_excludedFromBOM )
{
retv = ( m_includeInBom ) ? 1 : -1;
retv = ( m_excludedFromBOM ) ? -1 : 1;
REPORT( _( "Exclude from bill of materials settings differ." ) );
if( !aReporter )
return retv;
}
if( m_includeOnBoard != aRhs.m_includeOnBoard )
if( m_excludedFromBoard != aRhs.m_excludedFromBoard )
{
retv = ( m_includeOnBoard ) ? 1 : -1;
retv = ( m_excludedFromBoard ) ? -1 : 1;
REPORT( _( "Exclude from board settings differ." ) );
if( !aReporter )
@ -634,8 +634,8 @@ std::unique_ptr< LIB_SYMBOL > LIB_SYMBOL::Flatten() const
retv->SetKeyWords( m_keyWords.IsEmpty() ? parent->GetKeyWords() : m_keyWords );
retv->SetFPFilters( m_fpFilters.IsEmpty() ? parent->GetFPFilters() : m_fpFilters );
retv->SetIncludeInBom( parent->GetIncludeInBom() );
retv->SetIncludeOnBoard( parent->GetIncludeOnBoard() );
retv->SetExcludedFromBOM( parent->GetExcludedFromBOM() );
retv->SetExcludedFromBoard( parent->GetExcludedFromBoard() );
retv->UpdateFieldOrdinals();
}

View File

@ -649,20 +649,20 @@ public:
bool ShowPinNumbers() const { return m_showPinNumbers; }
/**
* Set or clear the include in schematic bill of materials flag.
* Set or clear the exclude from schematic bill of materials flag.
*
* @param aIncludeInBom true to include symbol in schematic bill of material
* @param aExcludeFromBOM true to exclude symbol from schematic bill of materials
*/
void SetIncludeInBom( bool aIncludeInBom ) { m_includeInBom = aIncludeInBom; }
bool GetIncludeInBom() const { return m_includeInBom; }
void SetExcludedFromBOM( bool aExcludeFromBOM ) { m_excludedFromBOM = aExcludeFromBOM; }
bool GetExcludedFromBOM() const { return m_excludedFromBOM; }
/**
* Set or clear include in board netlist flag.
* Set or clear exclude from board netlist flag.
*
* @param aIncludeOnBoard true to include symbol in the board netlist
* @param aExcludeFromBoard true to exclude symbol from the board netlist
*/
void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_includeOnBoard = aIncludeOnBoard; }
bool GetIncludeOnBoard() const { return m_includeOnBoard; }
void SetExcludedFromBoard( bool aExcludeFromBoard ) { m_excludedFromBoard = aExcludeFromBoard; }
bool GetExcludedFromBoard() const { return m_excludedFromBoard; }
/**
* Comparison test that can be used for operators.
@ -754,8 +754,8 @@ private:
bool m_showPinNames;
bool m_showPinNumbers;
bool m_includeInBom;
bool m_includeOnBoard;
bool m_excludedFromBOM;
bool m_excludedFromBoard;
LIBRENTRYOPTIONS m_options; ///< Special symbol features such as POWER or NORMAL.)
LIB_ITEMS_CONTAINER m_drawings;

View File

@ -76,7 +76,7 @@ bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName,
if( !symbol )
continue;
if( !symbol->GetIncludeOnBoard() )
if( symbol->GetExcludedFromBoard() )
continue;
footprint = symbol->GetFootprintFieldText( true, &sheetList[ i ], false );

View File

@ -76,7 +76,7 @@ bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName,
if( !symbol )
continue;
if( !symbol->GetIncludeOnBoard() )
if( symbol->GetExcludedFromBoard() )
continue;
std::vector<PIN_INFO> pins = CreatePinList( symbol, &sheet, true );

View File

@ -269,8 +269,8 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
SCH_SYMBOL* symbol = findNextSymbol( item, &sheet );
if( !symbol
|| ( ( aCtl & GNL_OPT_BOM ) && !symbol->GetIncludeInBom() )
|| ( ( aCtl & GNL_OPT_KICAD ) && !symbol->GetIncludeOnBoard() ) )
|| ( ( aCtl & GNL_OPT_BOM ) && symbol->GetExcludedFromBOM() )
|| ( ( aCtl & GNL_OPT_KICAD ) && symbol->GetExcludedFromBoard() ) )
{
continue;
}
@ -354,13 +354,13 @@ XNODE* NETLIST_EXPORTER_XML::makeSymbols( unsigned aCtl )
xproperty->AddAttribute( wxT( "value" ), sheetField.GetText() );
}
if( !symbol->GetIncludeInBom() )
if( symbol->GetExcludedFromBOM() )
{
xcomp->AddChild( xproperty = node( wxT( "property" ) ) );
xproperty->AddAttribute( wxT( "name" ), wxT( "exclude_from_bom" ) );
}
if( !symbol->GetIncludeOnBoard() )
if( symbol->GetExcludedFromBoard() )
{
xcomp->AddChild( xproperty = node( wxT( "property" ) ) );
xproperty->AddAttribute( wxT( "name" ), wxT( "exclude_from_board" ) );
@ -708,8 +708,8 @@ XNODE* NETLIST_EXPORTER_XML::makeListOfNets( unsigned aCtl )
SCH_SYMBOL* symbol = pin->GetParentSymbol();
if( !symbol
|| ( ( aCtl & GNL_OPT_BOM ) && !symbol->GetIncludeInBom() )
|| ( ( aCtl & GNL_OPT_KICAD ) && !symbol->GetIncludeOnBoard() ) )
|| ( ( aCtl & GNL_OPT_BOM ) && symbol->GetExcludedFromBOM() )
|| ( ( aCtl & GNL_OPT_KICAD ) && symbol->GetExcludedFromBoard() ) )
{
continue;
}

View File

@ -490,7 +490,7 @@ LIB_SYMBOL* SCH_DATABASE_PLUGIN::loadSymbolFromRow( const wxString& aSymbolName,
if( val )
{
symbol->SetIncludeOnBoard( !( *val ) );
symbol->SetExcludedFromBoard( *val );
}
else
{
@ -506,7 +506,7 @@ LIB_SYMBOL* SCH_DATABASE_PLUGIN::loadSymbolFromRow( const wxString& aSymbolName,
if( val )
{
symbol->SetIncludeInBom( !( *val ) );
symbol->SetExcludedFromBOM( *val );
}
else
{

View File

@ -181,8 +181,8 @@ void SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& a
aFormatter.Print( 0, ")" );
}
aFormatter.Print( 0, " (in_bom %s)", ( aSymbol->GetIncludeInBom() ) ? "yes" : "no" );
aFormatter.Print( 0, " (on_board %s)", ( aSymbol->GetIncludeOnBoard() ) ? "yes" : "no" );
aFormatter.Print( 0, " (in_bom %s)", ( aSymbol->GetExcludedFromBOM() ) ? "no" : "yes" );
aFormatter.Print( 0, " (on_board %s)", ( aSymbol->GetExcludedFromBoard() ) ? "no" : "yes" );
// TODO: add atomic token here.

View File

@ -275,12 +275,12 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::parseLibSymbol( LIB_SYMBOL_MAP& aSymbolLibMap )
break;
case T_in_bom:
symbol->SetIncludeInBom( parseBool() );
symbol->SetExcludedFromBOM( !parseBool() );
NeedRIGHT();
break;
case T_on_board:
symbol->SetIncludeOnBoard( parseBool() );
symbol->SetExcludedFromBoard( !parseBool() );
NeedRIGHT();
break;
@ -2734,12 +2734,12 @@ SCH_SYMBOL* SCH_SEXPR_PARSER::parseSchematicSymbol()
break;
case T_in_bom:
symbol->SetIncludeInBom( parseBool() );
symbol->SetExcludedFromBOM( !parseBool() );
NeedRIGHT();
break;
case T_on_board:
symbol->SetIncludeOnBoard( parseBool() );
symbol->SetExcludedFromBoard( !parseBool() );
NeedRIGHT();
break;

View File

@ -724,8 +724,8 @@ void SCH_SEXPR_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchema
m_out->Print( 0, "\n" );
m_out->Print( aNestLevel + 1, "(in_bom %s)", ( aSymbol->GetIncludeInBom() ) ? "yes" : "no" );
m_out->Print( 0, " (on_board %s)", ( aSymbol->GetIncludeOnBoard() ) ? "yes" : "no" );
m_out->Print( aNestLevel + 1, "(in_bom %s)", ( aSymbol->GetExcludedFromBOM() ) ? "no" : "yes" );
m_out->Print( 0, " (on_board %s)", ( aSymbol->GetExcludedFromBoard() ) ? "no" : "yes" );
m_out->Print( 0, " (dnp %s)", ( aSymbol->GetDNP() ) ? "yes" : "no" );
if( aSymbol->GetFieldsAutoplaced() != FIELDS_AUTOPLACED_NO )

View File

@ -137,8 +137,8 @@ SCH_SYMBOL::SCH_SYMBOL( const LIB_SYMBOL& aSymbol, const LIB_ID& aLibId,
// Inherit the include in bill of materials and board netlist settings from flattened
// library symbol.
m_inBom = m_part->GetIncludeInBom();
m_onBoard = m_part->GetIncludeOnBoard();
m_excludedFromBOM = m_part->GetExcludedFromBOM();
m_excludedFromBoard = m_part->GetExcludedFromBoard();
m_DNP = false;
}
@ -169,8 +169,8 @@ SCH_SYMBOL::SCH_SYMBOL( const SCH_SYMBOL& aSymbol ) :
m_convert = aSymbol.m_convert;
m_lib_id = aSymbol.m_lib_id;
m_isInNetlist = aSymbol.m_isInNetlist;
m_inBom = aSymbol.m_inBom;
m_onBoard = aSymbol.m_onBoard;
m_excludedFromBOM = aSymbol.m_excludedFromBOM;
m_excludedFromBoard = aSymbol.m_excludedFromBoard;
m_DNP = aSymbol.m_DNP;
if( aSymbol.m_part )
@ -217,8 +217,8 @@ void SCH_SYMBOL::Init( const VECTOR2I& pos )
m_prefix = wxString( wxT( "U" ) );
m_isInNetlist = true;
m_inBom = true;
m_onBoard = true;
m_excludedFromBOM = false;
m_excludedFromBoard = false;
}
@ -1152,9 +1152,9 @@ void SCH_SYMBOL::SwapData( SCH_ITEM* aItem )
m_transform = symbol->m_transform;
symbol->m_transform = tmp;
std::swap( m_inBom, symbol->m_inBom );
std::swap( m_excludedFromBOM, symbol->m_excludedFromBOM );
std::swap( m_DNP, symbol->m_DNP );
std::swap( m_onBoard, symbol->m_onBoard );
std::swap( m_excludedFromBoard, symbol->m_excludedFromBoard );
std::swap( m_instanceReferences, symbol->m_instanceReferences );
std::swap( m_schLibSymbolName, symbol->m_schLibSymbolName );
@ -1311,14 +1311,14 @@ bool SCH_SYMBOL::ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, i
}
else if( token->IsSameAs( wxT( "EXCLUDE_FROM_BOM" ) ) )
{
*token = this->GetIncludeInBom() ? wxString( wxT( "" ) )
: _( "Excluded from BOM" );
*token = this->GetExcludedFromBOM() ? _( "Excluded from BOM" )
: wxString( wxT( "" ) );
return true;
}
else if( token->IsSameAs( wxT( "EXCLUDE_FROM_BOARD" ) ) )
{
*token = this->GetIncludeOnBoard() ? wxString( wxT( "" ) )
: _( "Excluded from board" );
*token = this->GetExcludedFromBoard() ? _( "Excluded from board" )
: wxString( wxT( "" ) );
return true;
}
else if( token->IsSameAs( wxT( "DNP" ) ) )
@ -1709,10 +1709,10 @@ void SCH_SYMBOL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_
if( GetExcludeFromSim() )
msgs.Add( _( "Simulation" ) );
if( !GetIncludeInBom() )
if( GetExcludedFromBOM() )
msgs.Add( _( "BOM" ) );
if( !GetIncludeOnBoard() )
if( GetExcludedFromBoard() )
msgs.Add( _( "Board" ) );
if( GetDNP() )
@ -2407,5 +2407,20 @@ static struct SCH_SYMBOL_DESC
PROPERTY_MANAGER& propMgr = PROPERTY_MANAGER::Instance();
REGISTER_TYPE( SCH_SYMBOL );
propMgr.InheritsAfter( TYPE_HASH( SCH_SYMBOL ), TYPE_HASH( SCH_ITEM ) );
const wxString groupAttributes = _HKI( "Attributes" );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude from board" ),
&SCH_SYMBOL::SetExcludedFromBoard, &SCH_SYMBOL::GetExcludedFromBoard ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude from simulation" ),
&SCH_SYMBOL::SetExcludeFromSim, &SCH_SYMBOL::GetExcludeFromSim ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Exclude from bill of materials" ),
&SCH_SYMBOL::SetExcludedFromBOM, &SCH_SYMBOL::GetExcludedFromBOM ),
groupAttributes );
propMgr.AddProperty( new PROPERTY<SCH_SYMBOL, bool>( _HKI( "Do not populate" ),
&SCH_SYMBOL::SetDNP, &SCH_SYMBOL::GetDNP ),
groupAttributes );
}
} _SCH_SYMBOL_DESC;

View File

@ -748,11 +748,11 @@ public:
bool HasBrightenedPins();
bool GetIncludeInBom() const { return m_inBom; }
void SetIncludeInBom( bool aIncludeInBom ) { m_inBom = aIncludeInBom; }
bool GetExcludedFromBOM() const { return m_excludedFromBOM; }
void SetExcludedFromBOM( bool aIncludeInBOM ) { m_excludedFromBOM = aIncludeInBOM; }
bool GetIncludeOnBoard() const { return m_onBoard; }
void SetIncludeOnBoard( bool aIncludeOnBoard ) { m_onBoard = aIncludeOnBoard; }
bool GetExcludedFromBoard() const { return m_excludedFromBoard; }
void SetExcludedFromBoard( bool aIncludeOnBoard ) { m_excludedFromBoard = aIncludeOnBoard; }
bool GetDNP() const { return m_DNP; }
void SetDNP( bool aDNP ) { m_DNP = aDNP; }
@ -804,8 +804,8 @@ private:
std::unordered_map<LIB_PIN*, unsigned> m_pinMap; ///< library pin pointer : SCH_PIN's index
bool m_isInNetlist; ///< True if the symbol should appear in the netlist
bool m_inBom; ///< True to include in bill of materials export.
bool m_onBoard; ///< True to include in netlist when updating board.
bool m_excludedFromBOM; ///< True to include in bill of materials export.
bool m_excludedFromBoard; ///< True to include in netlist when updating board.
bool m_DNP; ///< True if symbol is set to 'Do Not Populate'.
// Defines the hierarchical path and reference of the symbol. This allows support

View File

@ -437,8 +437,8 @@ void SYMBOL_EDIT_FRAME::CreateNewSymbol( const wxString& inheritFromSymbolName )
new_symbol.SetShowPinNumbers( dlg.GetShowPinNumber() );
new_symbol.SetShowPinNames( dlg.GetShowPinName() );
new_symbol.LockUnits( !dlg.GetUnitsInterchangeable() );
new_symbol.SetIncludeInBom( dlg.GetIncludeInBom() );
new_symbol.SetIncludeOnBoard( dlg.GetIncludeOnBoard() );
new_symbol.SetExcludedFromBOM( !dlg.GetIncludeInBom() );
new_symbol.SetExcludedFromBoard( !dlg.GetIncludeOnBoard() );
if( dlg.GetUnitCount() < 2 )
new_symbol.LockUnits( false );

View File

@ -310,7 +310,7 @@ void BACK_ANNOTATE::checkForUnusedSymbols()
{
const SCH_REFERENCE& ref = m_refs[i];
if( ref.GetSymbol()->GetIncludeOnBoard() )
if( ref.GetSymbol()->GetExcludedFromBoard() )
{
wxString msg = wxString::Format( _( "Footprint '%s' is not present on PCB. "
"Corresponding symbols in schematic must be "
@ -348,7 +348,7 @@ void BACK_ANNOTATE::applyChangelist()
wxString oldFootprint = ref.GetFootprint();
wxString oldValue = ref.GetValue();
bool oldDNP = ref.GetSymbol()->GetDNP();
bool oldExBOM = !ref.GetSymbol()->GetIncludeInBom();
bool oldExBOM = ref.GetSymbol()->GetExcludedFromBOM();
bool skip = ( ref.GetSymbol()->GetFlags() & SKIP_STRUCT ) > 0;
auto boolString = []( bool b ) -> wxString
@ -431,7 +431,7 @@ void BACK_ANNOTATE::applyChangelist()
if( !m_dryRun )
{
commit.Modify( symbol, screen );
symbol->SetIncludeInBom( !fpData.m_excludeFromBOM );
symbol->SetExcludedFromBOM( fpData.m_excludeFromBOM );
}
m_reporter.ReportHead( msg, RPT_SEVERITY_ACTION );

View File

@ -2546,10 +2546,10 @@ int SCH_EDIT_TOOL::SetAttribute( const TOOL_EVENT& aEvent )
sym->SetExcludeFromSim( true );
if( aEvent.IsAction( &EE_ACTIONS::setExcludeFromBOM ) )
sym->SetIncludeInBom( false );
sym->SetExcludedFromBOM( true );
if( aEvent.IsAction( &EE_ACTIONS::setExcludeFromBoard ) )
sym->SetIncludeOnBoard( false );
sym->SetExcludedFromBoard( true );
}
}
@ -2579,10 +2579,10 @@ int SCH_EDIT_TOOL::UnsetAttribute( const TOOL_EVENT& aEvent )
sym->SetExcludeFromSim( false );
if( aEvent.IsAction( &EE_ACTIONS::unsetExcludeFromBOM ) )
sym->SetIncludeInBom( true );
sym->SetExcludedFromBOM( false );
if( aEvent.IsAction( &EE_ACTIONS::unsetExcludeFromBoard ) )
sym->SetIncludeOnBoard( true );
sym->SetExcludedFromBoard( false );
}
}
@ -2612,10 +2612,10 @@ int SCH_EDIT_TOOL::ToggleAttribute( const TOOL_EVENT& aEvent )
sym->SetExcludeFromSim( !sym->GetExcludeFromSim() );
if( aEvent.IsAction( &EE_ACTIONS::toggleExcludeFromBOM ) )
sym->SetIncludeInBom( !sym->GetIncludeInBom() );
sym->SetExcludedFromBOM( !sym->GetExcludedFromBOM() );
if( aEvent.IsAction( &EE_ACTIONS::toggleExcludeFromBoard ) )
sym->SetIncludeOnBoard( !sym->GetIncludeOnBoard() );
sym->SetExcludedFromBoard( !sym->GetExcludedFromBoard() );
}
}

View File

@ -486,20 +486,20 @@ BOOST_AUTO_TEST_CASE( Compare )
m_part_no_data.LockUnits( false );
// Include in BOM support tests.
testPart.SetIncludeInBom( false );
testPart.SetExcludedFromBOM( true );
BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
testPart.SetIncludeInBom( true );
m_part_no_data.SetIncludeInBom( false );
testPart.SetExcludedFromBOM( false );
m_part_no_data.SetExcludedFromBOM( true );
BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
m_part_no_data.SetIncludeInBom( true );
m_part_no_data.SetExcludedFromBOM( false );
// Include on board support tests.
testPart.SetIncludeOnBoard( false );
testPart.SetExcludedFromBoard( true );
BOOST_CHECK( m_part_no_data.Compare( testPart ) > 0 );
testPart.SetIncludeOnBoard( true );
m_part_no_data.SetIncludeOnBoard( false );
testPart.SetExcludedFromBoard( false );
m_part_no_data.SetExcludedFromBoard( true );
BOOST_CHECK( m_part_no_data.Compare( testPart ) < 0 );
m_part_no_data.SetIncludeOnBoard( true );
m_part_no_data.SetExcludedFromBoard( false );
// Show pin names flag comparison tests.
m_part_no_data.SetShowPinNames( false );