Rename SCH_SYMBOL::GetInstanceReferences() to GetInstances().

This commit is contained in:
Wayne Stambaugh 2023-12-28 18:25:47 -05:00
parent cdb99de862
commit 04d15026c5
8 changed files with 82 additions and 76 deletions

View File

@ -469,8 +469,6 @@ bool DIALOG_CHANGE_SYMBOLS::isMatch( SCH_SYMBOL* aSymbol, SCH_SHEET_PATH* aInsta
}
int DIALOG_CHANGE_SYMBOLS::processMatchingSymbols( SCH_COMMIT* aCommit )
{
SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( GetParent() );
@ -532,7 +530,8 @@ int DIALOG_CHANGE_SYMBOLS::processMatchingSymbols( SCH_COMMIT* aCommit )
if( symbols.size() > 0 )
matchesProcessed += processSymbols( aCommit, symbols );
else
m_messagePanel->Report( _( "*** No symbols matching criteria found ***" ), RPT_SEVERITY_ERROR );
m_messagePanel->Report( _( "*** No symbols matching criteria found ***" ),
RPT_SEVERITY_ERROR );
frame->GetCurrentSheet().UpdateAllScreenReferences();
@ -755,7 +754,7 @@ wxString DIALOG_CHANGE_SYMBOLS::getSymbolReferences( SCH_SYMBOL& aSymbol, const
SCH_SHEET_LIST sheets = parent->Schematic().GetSheets();
for( const SCH_SYMBOL_INSTANCE& instance : aSymbol.GetInstanceReferences() )
for( const SCH_SYMBOL_INSTANCE& instance : aSymbol.GetInstances() )
{
// Only include the symbol instances for the current project.
if( !sheets.HasPath( instance.m_Path ) )
@ -769,7 +768,7 @@ wxString DIALOG_CHANGE_SYMBOLS::getSymbolReferences( SCH_SYMBOL& aSymbol, const
if( m_mode == MODE::UPDATE )
{
if( aSymbol.GetInstanceReferences().size() == 1 )
if( aSymbol.GetInstances().size() == 1 )
{
msg.Printf( _( "Update symbol %s from '%s' to '%s'" ),
references,
@ -786,7 +785,7 @@ wxString DIALOG_CHANGE_SYMBOLS::getSymbolReferences( SCH_SYMBOL& aSymbol, const
}
else
{
if( aSymbol.GetInstanceReferences().size() == 1 )
if( aSymbol.GetInstances().size() == 1 )
{
msg.Printf( _( "Change symbol %s from '%s' to '%s'" ),
references,

View File

@ -961,7 +961,7 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::RemoveReferences( const SCH_REFERENCE_LIST&
m_symbolsList.RemoveItem( index );
// If we're out of instances then remove the symbol, too
if( ref.GetSymbol()->GetInstanceReferences().empty() )
if( ref.GetSymbol()->GetInstances().empty() )
m_dataStore.erase( ref.GetSymbol()->m_Uuid );
}
}

View File

@ -122,8 +122,8 @@ void SCH_IO_KICAD_LEGACY::checkpoint()
SCH_SHEET* SCH_IO_KICAD_LEGACY::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{
wxASSERT( !aFileName || aSchematic != nullptr );
@ -1368,7 +1368,7 @@ SCH_SYMBOL* SCH_IO_KICAD_LEGACY::loadSymbol( LINE_READER& aReader )
}
else
{
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstanceReferences() )
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstances() )
{
SCH_SYMBOL_INSTANCE tmpInstance = instance;
symbol->AddHierarchicalReference( tmpInstance );
@ -1428,7 +1428,7 @@ SCH_SYMBOL* SCH_IO_KICAD_LEGACY::loadSymbol( LINE_READER& aReader )
std::shared_ptr<BUS_ALIAS> SCH_IO_KICAD_LEGACY::loadBusAlias( LINE_READER& aReader,
SCH_SCREEN* aScreen )
SCH_SCREEN* aScreen )
{
auto busAlias = std::make_shared<BUS_ALIAS>( aScreen );
const char* line = aReader.Line();
@ -1453,8 +1453,8 @@ std::shared_ptr<BUS_ALIAS> SCH_IO_KICAD_LEGACY::loadBusAlias( LINE_READER& aRead
void SCH_IO_KICAD_LEGACY::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties )
SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties )
{
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET object." );
wxCHECK_RET( !aFileName.IsEmpty(), "No schematic file name defined." );
@ -1629,9 +1629,9 @@ void SCH_IO_KICAD_LEGACY::saveSymbol( SCH_SYMBOL* aSymbol )
static wxString delimiters( wxT( " " ) );
// This is redundant with the AR entries below, but it makes the files backwards-compatible.
if( aSymbol->GetInstanceReferences().size() > 0 )
if( aSymbol->GetInstances().size() > 0 )
{
const SCH_SYMBOL_INSTANCE& instance = aSymbol->GetInstanceReferences()[0];
const SCH_SYMBOL_INSTANCE& instance = aSymbol->GetInstances()[0];
name1 = toUTFTildaText( instance.m_Reference );
}
else
@ -1672,9 +1672,9 @@ void SCH_IO_KICAD_LEGACY::saveSymbol( SCH_SYMBOL* aSymbol )
* the reference inf is already saved
* this is useful for old Eeschema version compatibility
*/
if( aSymbol->GetInstanceReferences().size() > 1 )
if( aSymbol->GetInstances().size() > 1 )
{
for( const SCH_SYMBOL_INSTANCE& instance : aSymbol->GetInstanceReferences() )
for( const SCH_SYMBOL_INSTANCE& instance : aSymbol->GetInstances() )
{
/*format:
* AR Path="/140/2" Ref="C99" Part="1"
@ -2048,7 +2048,8 @@ void SCH_IO_KICAD_LEGACY::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
}
void SCH_IO_KICAD_LEGACY::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_LEGACY::cacheLib( const wxString& aLibraryFileName,
const STRING_UTF8_MAP* aProperties )
{
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
{
@ -2090,8 +2091,8 @@ int SCH_IO_KICAD_LEGACY::GetModifyHash() const
void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2111,7 +2112,7 @@ void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2132,8 +2133,8 @@ void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolL
LIB_SYMBOL* SCH_IO_KICAD_LEGACY::LoadSymbol( const wxString& aLibraryPath,
const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2149,7 +2150,7 @@ LIB_SYMBOL* SCH_IO_KICAD_LEGACY::LoadSymbol( const wxString& aLibraryPath,
void SCH_IO_KICAD_LEGACY::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2163,7 +2164,7 @@ void SCH_IO_KICAD_LEGACY::SaveSymbol( const wxString& aLibraryPath, const LIB_SY
void SCH_IO_KICAD_LEGACY::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2221,7 +2222,8 @@ bool SCH_IO_KICAD_LEGACY::DeleteLibrary( const wxString& aLibraryPath,
}
void SCH_IO_KICAD_LEGACY::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_LEGACY::SaveLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
if( !m_cache )
m_cache = new SCH_IO_KICAD_LEGACY_LIB_CACHE( aLibraryPath );

View File

@ -313,7 +313,8 @@ void SCH_IO_KICAD_SEXPR::loadFile( const wxString& aFileName, SCH_SHEET* aSheet
reader.Rewind();
}
SCH_IO_KICAD_SEXPR_PARSER parser( &reader, m_progressReporter, lineCount, m_rootSheet, m_appending );
SCH_IO_KICAD_SEXPR_PARSER parser( &reader, m_progressReporter, lineCount, m_rootSheet,
m_appending );
parser.ParseSchematic( aSheet );
}
@ -503,8 +504,8 @@ void SCH_IO_KICAD_SEXPR::Format( SCH_SHEET* aSheet )
void SCH_IO_KICAD_SEXPR::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelectionPath,
SCHEMATIC& aSchematic, OUTPUTFORMATTER* aFormatter,
bool aForClipboard )
SCHEMATIC& aSchematic, OUTPUTFORMATTER* aFormatter,
bool aForClipboard )
{
wxCHECK( aSelection && aSelectionPath && aFormatter, /* void */ );
@ -548,7 +549,8 @@ void SCH_IO_KICAD_SEXPR::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSele
m_out->Print( 0, "(lib_symbols\n" );
for( const std::pair<const wxString, LIB_SYMBOL*>& libSymbol : libSymbols )
SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol( libSymbol.second, *m_out, 1, libSymbol.first );
SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol( libSymbol.second, *m_out, 1,
libSymbol.first );
m_out->Print( 0, ")\n\n" );
}
@ -613,8 +615,8 @@ void SCH_IO_KICAD_SEXPR::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSele
void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchematic,
int aNestLevel, bool aForClipboard,
const SCH_SHEET_PATH* aRelativePath )
int aNestLevel, bool aForClipboard,
const SCH_SHEET_PATH* aRelativePath )
{
wxCHECK_RET( aSymbol != nullptr && m_out != nullptr, "" );
@ -680,9 +682,9 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
// The symbol unit is always set to the first instance regardless of the current sheet
// instance to prevent file churn.
int unit = ( aSymbol->GetInstanceReferences().size() == 0 ) ?
int unit = ( aSymbol->GetInstances().size() == 0 ) ?
aSymbol->GetUnit() :
aSymbol->GetInstanceReferences()[0].m_Unit;
aSymbol->GetInstances()[0].m_Unit;
if( aForClipboard && aRelativePath )
{
@ -719,13 +721,13 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
int id = field.GetId();
wxString value = field.GetText();
if( !aForClipboard && aSymbol->GetInstanceReferences().size() )
if( !aForClipboard && aSymbol->GetInstances().size() )
{
// The instance fields are always set to the default instance regardless of the
// sheet instance to prevent file churn.
if( id == REFERENCE_FIELD )
{
field.SetText( aSymbol->GetInstanceReferences()[0].m_Reference );
field.SetText( aSymbol->GetInstances()[0].m_Reference );
}
else if( id == VALUE_FIELD )
{
@ -736,7 +738,7 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
field.SetText( aSymbol->GetField( FOOTPRINT_FIELD )->GetText() );
}
}
else if( aForClipboard && aSymbol->GetInstanceReferences().size() && aRelativePath
else if( aForClipboard && aSymbol->GetInstances().size() && aRelativePath
&& ( id == REFERENCE_FIELD ) )
{
SCH_SYMBOL_INSTANCE instance;
@ -779,7 +781,7 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
}
}
if( !aSymbol->GetInstanceReferences().empty() )
if( !aSymbol->GetInstances().empty() )
{
m_out->Print( aNestLevel + 1, "(instances\n" );
@ -788,10 +790,10 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
SCH_SHEET_LIST fullHierarchy = aSchematic.GetSheets();
bool project_open = false;
for( size_t i = 0; i < aSymbol->GetInstanceReferences().size(); i++ )
for( size_t i = 0; i < aSymbol->GetInstances().size(); i++ )
{
// Zero length KIID_PATH objects are not valid and will cause a crash below.
wxCHECK2( aSymbol->GetInstanceReferences()[i].m_Path.size(), continue );
wxCHECK2( aSymbol->GetInstances()[i].m_Path.size(), continue );
// If the instance data is part of this design but no longer has an associated sheet
// path, don't save it. This prevents large amounts of orphaned instance data for the
@ -799,11 +801,11 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
//
// Keep all instance data when copying to the clipboard. It may be needed on paste.
if( !aForClipboard
&& ( aSymbol->GetInstanceReferences()[i].m_Path[0] == rootSheetUuid )
&& !fullHierarchy.GetSheetPathByKIIDPath( aSymbol->GetInstanceReferences()[i].m_Path ) )
&& ( aSymbol->GetInstances()[i].m_Path[0] == rootSheetUuid )
&& !fullHierarchy.GetSheetPathByKIIDPath( aSymbol->GetInstances()[i].m_Path ) )
{
if( project_open && ( ( i + 1 == aSymbol->GetInstanceReferences().size() )
|| lastProjectUuid != aSymbol->GetInstanceReferences()[i+1].m_Path[0] ) )
if( project_open && ( ( i + 1 == aSymbol->GetInstances().size() )
|| lastProjectUuid != aSymbol->GetInstances()[i+1].m_Path[0] ) )
{
m_out->Print( aNestLevel + 2, ")\n" ); // Closes `project`.
project_open = false;
@ -812,23 +814,23 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
continue;
}
if( lastProjectUuid != aSymbol->GetInstanceReferences()[i].m_Path[0] )
if( lastProjectUuid != aSymbol->GetInstances()[i].m_Path[0] )
{
wxString projectName;
if( aSymbol->GetInstanceReferences()[i].m_Path[0] == rootSheetUuid )
if( aSymbol->GetInstances()[i].m_Path[0] == rootSheetUuid )
projectName = aSchematic.Prj().GetProjectName();
else
projectName = aSymbol->GetInstanceReferences()[i].m_ProjectName;
projectName = aSymbol->GetInstances()[i].m_ProjectName;
lastProjectUuid = aSymbol->GetInstanceReferences()[i].m_Path[0];
lastProjectUuid = aSymbol->GetInstances()[i].m_Path[0];
m_out->Print( aNestLevel + 2, "(project %s\n",
m_out->Quotew( projectName ).c_str() );
project_open = true;
}
wxString path;
KIID_PATH tmp = aSymbol->GetInstanceReferences()[i].m_Path;
KIID_PATH tmp = aSymbol->GetInstances()[i].m_Path;
if( aForClipboard && aRelativePath )
tmp.MakeRelativeTo( aRelativePath->Path() );
@ -838,12 +840,12 @@ void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSche
m_out->Print( aNestLevel + 3, "(path %s\n",
m_out->Quotew( path ).c_str() );
m_out->Print( aNestLevel + 4, "(reference %s) (unit %d)\n",
m_out->Quotew( aSymbol->GetInstanceReferences()[i].m_Reference ).c_str(),
aSymbol->GetInstanceReferences()[i].m_Unit );
m_out->Quotew( aSymbol->GetInstances()[i].m_Reference ).c_str(),
aSymbol->GetInstances()[i].m_Unit );
m_out->Print( aNestLevel + 3, ")\n" );
if( project_open && ( ( i + 1 == aSymbol->GetInstanceReferences().size() )
|| lastProjectUuid != aSymbol->GetInstanceReferences()[i+1].m_Path[0] ) )
if( project_open && ( ( i + 1 == aSymbol->GetInstances().size() )
|| lastProjectUuid != aSymbol->GetInstances()[i+1].m_Path[0] ) )
{
m_out->Print( aNestLevel + 2, ")\n" ); // Closes `project`.
project_open = false;
@ -1383,7 +1385,7 @@ void SCH_IO_KICAD_SEXPR::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aN
void SCH_IO_KICAD_SEXPR::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances,
int aNestLevel )
int aNestLevel )
{
if( aInstances.size() )
{
@ -1408,7 +1410,7 @@ void SCH_IO_KICAD_SEXPR::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& a
void SCH_IO_KICAD_SEXPR::cacheLib( const wxString& aLibraryFileName,
const STRING_UTF8_MAP* aProperties )
const STRING_UTF8_MAP* aProperties )
{
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
{
@ -1439,8 +1441,8 @@ int SCH_IO_KICAD_SEXPR::GetModifyHash() const
void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1460,8 +1462,8 @@ void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1480,8 +1482,9 @@ void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolLi
}
LIB_SYMBOL* SCH_IO_KICAD_SEXPR::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
LIB_SYMBOL* SCH_IO_KICAD_SEXPR::LoadSymbol( const wxString& aLibraryPath,
const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1508,7 +1511,7 @@ LIB_SYMBOL* SCH_IO_KICAD_SEXPR::LoadSymbol( const wxString& aLibraryPath, const
void SCH_IO_KICAD_SEXPR::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1522,7 +1525,7 @@ void SCH_IO_KICAD_SEXPR::SaveSymbol( const wxString& aLibraryPath, const LIB_SYM
void SCH_IO_KICAD_SEXPR::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1580,7 +1583,8 @@ bool SCH_IO_KICAD_SEXPR::DeleteLibrary( const wxString& aLibraryPath,
}
void SCH_IO_KICAD_SEXPR::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_SEXPR::SaveLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
if( !m_cache )
m_cache = new SCH_IO_KICAD_SEXPR_LIB_CACHE( aLibraryPath );
@ -1643,8 +1647,8 @@ void SCH_IO_KICAD_SEXPR::GetDefaultSymbolFields( std::vector<wxString>& aNames )
std::vector<LIB_SYMBOL*> SCH_IO_KICAD_SEXPR::ParseLibSymbols( std::string& aSymbolText,
std::string aSource,
int aFileVersion )
std::string aSource,
int aFileVersion )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
LIB_SYMBOL* newSymbol = nullptr;

View File

@ -1587,7 +1587,7 @@ void SCH_SCREEN::SetLegacySymbolInstanceData()
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
// Add missing value and footprint instance data for legacy schematics.
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstanceReferences() )
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstances() )
{
symbol->AddHierarchicalReference( instance.m_Path, instance.m_Reference,
instance.m_Unit );
@ -1655,7 +1655,7 @@ void SCH_SCREEN::PruneOrphanedSymbolInstances( const wxString& aProjectName,
wxCHECK2( symbol, continue );
std::set<KIID_PATH> pathsToPrune;
const std::vector<SCH_SYMBOL_INSTANCE> instances = symbol->GetInstanceReferences();
const std::vector<SCH_SYMBOL_INSTANCE> instances = symbol->GetInstances();
for( const SCH_SYMBOL_INSTANCE& instance : instances )
{

View File

@ -474,7 +474,6 @@ bool SCH_SHEET_PATH::TestForRecursion( const wxString& aSrcFileName, const wxStr
if( destFn.IsRelative() )
destFn.MakeAbsolute( rootFn.GetPath() );
// The source and destination sheet file names cannot be the same.
if( srcFn == destFn )
{
@ -585,10 +584,10 @@ void SCH_SHEET_PATH::AddNewSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPa
newSymbolInstance.m_Path = newSheetPath.Path();
symbol->AddHierarchicalReference( newSymbolInstance );
}
else if( !symbol->GetInstanceReferences().empty() )
else if( !symbol->GetInstances().empty() )
{
// Use the first symbol instance if any symbol instance data exists.
newSymbolInstance = symbol->GetInstanceReferences()[0];
newSymbolInstance = symbol->GetInstances()[0];
newSymbolInstance.m_Path = newSheetPath.Path();
symbol->AddHierarchicalReference( newSymbolInstance );
}

View File

@ -137,7 +137,7 @@ public:
*/
bool IsMissingLibSymbol() const;
const std::vector<SCH_SYMBOL_INSTANCE>& GetInstanceReferences() const
const std::vector<SCH_SYMBOL_INSTANCE>& GetInstances() const
{
return m_instanceReferences;
}

View File

@ -1534,7 +1534,7 @@ void SCH_EDITOR_CONTROL::setPastedSymbolInstances( SCH_SCREENS& aScreenList )
wxCHECK2( symbol, continue );
for( const SCH_SYMBOL_INSTANCE& symbolInstance : symbol->GetInstanceReferences() )
for( const SCH_SYMBOL_INSTANCE& symbolInstance : symbol->GetInstances() )
{
KIID_PATH pathWithSymbol = symbolInstance.m_Path;
@ -1558,7 +1558,7 @@ void SCH_EDITOR_CONTROL::prunePastedSymbolInstances()
std::vector<KIID_PATH> instancePathsToRemove;
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstanceReferences() )
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstances() )
{
if( ( instance.m_ProjectName != m_frame->Prj().GetProjectName() )
|| instance.m_Path.empty() )
@ -2590,12 +2590,14 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::GridFeedback, EVENTS::GridChangedByKeyEvent );
Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, EE_ACTIONS::editWithLibEdit.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, EE_ACTIONS::editLibSymbolWithLibEdit.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor,
EE_ACTIONS::editLibSymbolWithLibEdit.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ShowCvpcb, EE_ACTIONS::assignFootprints.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ImportFPAssignments, EE_ACTIONS::importFPAssignments.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Annotate, EE_ACTIONS::annotate.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditSymbolFields, EE_ACTIONS::editSymbolFields.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditSymbolLibraryLinks,EE_ACTIONS::editSymbolLibraryLinks.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::EditSymbolLibraryLinks,
EE_ACTIONS::editSymbolLibraryLinks.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ShowPcbNew, EE_ACTIONS::showPcbNew.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::UpdatePCB, ACTIONS::updatePcbFromSchematic.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::UpdateFromPCB, ACTIONS::updateSchematicFromPcb.MakeEvent() );