Rename SYMBOL_INSTANCE_REFERENCE to SCH_SYMBOL_INSTANCE.
This commit is contained in:
parent
0ddff6b54f
commit
d99e09014b
|
@ -306,13 +306,13 @@ int SCH_REFERENCE_LIST::FindFirstUnusedReference( const SCH_REFERENCE& aRef, int
|
|||
}
|
||||
|
||||
|
||||
std::vector<SYMBOL_INSTANCE_REFERENCE> SCH_REFERENCE_LIST::GetSymbolInstances() const
|
||||
std::vector<SCH_SYMBOL_INSTANCE> SCH_REFERENCE_LIST::GetSymbolInstances() const
|
||||
{
|
||||
std::vector<SYMBOL_INSTANCE_REFERENCE> retval;
|
||||
std::vector<SCH_SYMBOL_INSTANCE> retval;
|
||||
|
||||
for( const SCH_REFERENCE& ref : m_flatList )
|
||||
{
|
||||
SYMBOL_INSTANCE_REFERENCE instance;
|
||||
SCH_SYMBOL_INSTANCE instance;
|
||||
instance.m_Path = ref.GetSheetPath().Path();
|
||||
instance.m_Reference = ref.GetRef();
|
||||
instance.m_Unit = ref.GetUnit();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020-2021 CERN
|
||||
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||
*
|
||||
|
@ -517,7 +517,7 @@ bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_
|
|||
wxString msg;
|
||||
wxString references;
|
||||
|
||||
for( SYMBOL_INSTANCE_REFERENCE instance : aSymbol->GetInstanceReferences() )
|
||||
for( SCH_SYMBOL_INSTANCE instance : aSymbol->GetInstanceReferences() )
|
||||
{
|
||||
if( references.IsEmpty() )
|
||||
references = instance.m_Reference;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 CERN
|
||||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2022-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||
*
|
||||
|
@ -2225,7 +2225,7 @@ void SCH_SEXPR_PARSER::parseSchSymbolInstances( SCH_SCREEN* aScreen )
|
|||
{
|
||||
NeedSYMBOL();
|
||||
|
||||
SYMBOL_INSTANCE_REFERENCE instance;
|
||||
SCH_SYMBOL_INSTANCE instance;
|
||||
|
||||
instance.m_Path = KIID_PATH( FromUTF8() );
|
||||
|
||||
|
@ -2695,7 +2695,7 @@ SCH_SYMBOL* SCH_SEXPR_PARSER::parseSchematicSymbol()
|
|||
|
||||
case T_default_instance:
|
||||
{
|
||||
SYMBOL_INSTANCE_REFERENCE defaultInstance;
|
||||
SCH_SYMBOL_INSTANCE defaultInstance;
|
||||
|
||||
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
|
||||
{
|
||||
|
@ -2763,7 +2763,7 @@ SCH_SYMBOL* SCH_SEXPR_PARSER::parseSchematicSymbol()
|
|||
if( token != T_path )
|
||||
Expecting( "path" );
|
||||
|
||||
SYMBOL_INSTANCE_REFERENCE instance;
|
||||
SCH_SYMBOL_INSTANCE instance;
|
||||
|
||||
instance.m_ProjectName = projectName;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 CERN
|
||||
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||
*
|
||||
|
@ -631,9 +631,9 @@ void SCH_SEXPR_PLUGIN::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelect
|
|||
|
||||
selectionPath = aSelectionPath->Path();
|
||||
selectedSymbols.SortByReferenceOnly();
|
||||
std::vector<SYMBOL_INSTANCE_REFERENCE> symbolInstances = selectedSymbols.GetSymbolInstances();
|
||||
std::vector<SCH_SYMBOL_INSTANCE> symbolInstances = selectedSymbols.GetSymbolInstances();
|
||||
|
||||
for( SYMBOL_INSTANCE_REFERENCE& symbolInstance : symbolInstances )
|
||||
for( SCH_SYMBOL_INSTANCE& symbolInstance : symbolInstances )
|
||||
{
|
||||
wxASSERT_MSG( symbolInstance.m_Path.MakeRelativeTo( selectionPath ),
|
||||
"Symbol is not inside the selection path?" );
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 CERN
|
||||
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||
*
|
||||
|
@ -45,7 +45,7 @@ class SCH_TEXT;
|
|||
class SCH_TEXTBOX;
|
||||
class SCH_SYMBOL;
|
||||
class SCH_FIELD;
|
||||
struct SYMBOL_INSTANCE_REFERENCE;
|
||||
struct SCH_SYMBOL_INSTANCE;
|
||||
class STRING_UTF8_MAP;
|
||||
class EE_SELECTION;
|
||||
class SCH_SEXPR_PLUGIN_CACHE;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||
*
|
||||
|
@ -1352,7 +1352,7 @@ SCH_SYMBOL* SCH_LEGACY_PLUGIN::loadSymbol( LINE_READER& aReader )
|
|||
KIID_PATH path;
|
||||
path.push_back( m_rootSheet->GetScreen()->GetUuid() );
|
||||
|
||||
SYMBOL_INSTANCE_REFERENCE instance;
|
||||
SCH_SYMBOL_INSTANCE instance;
|
||||
instance.m_Path = path;
|
||||
instance.m_Reference = symbol->GetField( REFERENCE_FIELD )->GetText();
|
||||
instance.m_Unit = symbol->GetUnit();
|
||||
|
@ -1360,9 +1360,9 @@ SCH_SYMBOL* SCH_LEGACY_PLUGIN::loadSymbol( LINE_READER& aReader )
|
|||
}
|
||||
else
|
||||
{
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& instance : symbol->GetInstanceReferences() )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstanceReferences() )
|
||||
{
|
||||
SYMBOL_INSTANCE_REFERENCE tmpInstance = instance;
|
||||
SCH_SYMBOL_INSTANCE tmpInstance = instance;
|
||||
symbol->AddHierarchicalReference( tmpInstance );
|
||||
}
|
||||
}
|
||||
|
@ -1622,7 +1622,7 @@ void SCH_LEGACY_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol )
|
|||
// This is redundant with the AR entries below, but it makes the files backwards-compatible.
|
||||
if( aSymbol->GetInstanceReferences().size() > 0 )
|
||||
{
|
||||
const SYMBOL_INSTANCE_REFERENCE& instance = aSymbol->GetInstanceReferences()[0];
|
||||
const SCH_SYMBOL_INSTANCE& instance = aSymbol->GetInstanceReferences()[0];
|
||||
name1 = toUTFTildaText( instance.m_Reference );
|
||||
}
|
||||
else
|
||||
|
@ -1665,7 +1665,7 @@ void SCH_LEGACY_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol )
|
|||
*/
|
||||
if( aSymbol->GetInstanceReferences().size() > 1 )
|
||||
{
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& instance : aSymbol->GetInstanceReferences() )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : aSymbol->GetInstanceReferences() )
|
||||
{
|
||||
/*format:
|
||||
* AR Path="/140/2" Ref="C99" Part="1"
|
||||
|
|
|
@ -565,7 +565,7 @@ public:
|
|||
int FindFirstUnusedReference( const SCH_REFERENCE& aRef, int aMinValue,
|
||||
const std::vector<int>& aRequiredUnits ) const;
|
||||
|
||||
std::vector<SYMBOL_INSTANCE_REFERENCE> GetSymbolInstances() const;
|
||||
std::vector<SCH_SYMBOL_INSTANCE> GetSymbolInstances() const;
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( const char* aPrefix = "" )
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -1434,7 +1434,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 SYMBOL_INSTANCE_REFERENCE& instance : symbol->GetInstanceReferences() )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : symbol->GetInstanceReferences() )
|
||||
{
|
||||
symbol->AddHierarchicalReference( instance.m_Path, instance.m_Reference,
|
||||
instance.m_Unit );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -45,7 +45,7 @@
|
|||
#include <title_block.h>
|
||||
|
||||
#include <lib_id.h>
|
||||
#include <sch_symbol.h> // SYMBOL_INSTANCE_REFERENCE
|
||||
#include <sch_symbol.h> // SCH_SYMBOL_INSTANCE
|
||||
#include <sch_reference_list.h>
|
||||
#include <sch_rtree.h>
|
||||
#include <sch_sheet.h>
|
||||
|
@ -486,7 +486,7 @@ public:
|
|||
return m_aliases;
|
||||
}
|
||||
|
||||
const std::vector<SYMBOL_INSTANCE_REFERENCE>& GetSymbolInstances() const
|
||||
const std::vector<SCH_SYMBOL_INSTANCE>& GetSymbolInstances() const
|
||||
{
|
||||
return m_symbolInstances;
|
||||
}
|
||||
|
@ -593,7 +593,7 @@ private:
|
|||
* schematic file is loaded. It is read only and it is only written to non-root
|
||||
* schematic files.
|
||||
*/
|
||||
std::vector<SYMBOL_INSTANCE_REFERENCE> m_symbolInstances;
|
||||
std::vector<SCH_SYMBOL_INSTANCE> m_symbolInstances;
|
||||
std::vector<SCH_SHEET_INSTANCE> m_sheetInstances;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -86,8 +86,8 @@ public:
|
|||
};
|
||||
|
||||
|
||||
bool SortSymbolInstancesByProjectUuid( const SYMBOL_INSTANCE_REFERENCE& aLhs,
|
||||
const SYMBOL_INSTANCE_REFERENCE& aRhs )
|
||||
bool SortSymbolInstancesByProjectUuid( const SCH_SYMBOL_INSTANCE& aLhs,
|
||||
const SCH_SYMBOL_INSTANCE& aRhs )
|
||||
{
|
||||
wxCHECK( !aLhs.m_Path.empty() && !aRhs.m_Path.empty(), false );
|
||||
|
||||
|
@ -567,7 +567,7 @@ void SCH_SHEET_PATH::AddNewSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPa
|
|||
|
||||
wxCHECK2( symbol, continue );
|
||||
|
||||
SYMBOL_INSTANCE_REFERENCE newSymbolInstance;
|
||||
SCH_SYMBOL_INSTANCE newSymbolInstance;
|
||||
|
||||
if( symbol->GetInstance( newSymbolInstance, Path(), true ) )
|
||||
{
|
||||
|
@ -1072,7 +1072,7 @@ SCH_SHEET_LIST SCH_SHEET_LIST::FindAllSheetsForScreen( const SCH_SCREEN* aScreen
|
|||
|
||||
|
||||
void SCH_SHEET_LIST::UpdateSymbolInstanceData(
|
||||
const std::vector<SYMBOL_INSTANCE_REFERENCE>& aSymbolInstances )
|
||||
const std::vector<SCH_SYMBOL_INSTANCE>& aSymbolInstances )
|
||||
{
|
||||
for( SCH_SHEET_PATH& sheetPath : *this )
|
||||
{
|
||||
|
@ -1086,7 +1086,7 @@ void SCH_SHEET_LIST::UpdateSymbolInstanceData(
|
|||
sheetPathWithSymbolUuid.push_back( symbol->m_Uuid );
|
||||
|
||||
auto it = std::find_if( aSymbolInstances.begin(), aSymbolInstances.end(),
|
||||
[ sheetPathWithSymbolUuid ]( const SYMBOL_INSTANCE_REFERENCE& r ) -> bool
|
||||
[ sheetPathWithSymbolUuid ]( const SCH_SYMBOL_INSTANCE& r ) -> bool
|
||||
{
|
||||
return sheetPathWithSymbolUuid == r.m_Path;
|
||||
} );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -40,7 +40,7 @@
|
|||
/**
|
||||
* A simple container for schematic symbol instance information.
|
||||
*/
|
||||
struct SYMBOL_INSTANCE_REFERENCE
|
||||
struct SCH_SYMBOL_INSTANCE
|
||||
{
|
||||
KIID_PATH m_Path;
|
||||
|
||||
|
@ -58,8 +58,8 @@ struct SYMBOL_INSTANCE_REFERENCE
|
|||
};
|
||||
|
||||
|
||||
extern bool SortSymbolInstancesByProjectUuid( const SYMBOL_INSTANCE_REFERENCE& aLhs,
|
||||
const SYMBOL_INSTANCE_REFERENCE& aRhs );
|
||||
extern bool SortSymbolInstancesByProjectUuid( const SCH_SYMBOL_INSTANCE& aLhs,
|
||||
const SCH_SYMBOL_INSTANCE& aRhs );
|
||||
|
||||
|
||||
/**
|
||||
|
@ -619,7 +619,7 @@ public:
|
|||
* WARNING: Do not call this on anything other than the full hierarchy.
|
||||
* @param aSymbolInstances is the symbol path information loaded from the root schematic.
|
||||
*/
|
||||
void UpdateSymbolInstanceData( const std::vector<SYMBOL_INSTANCE_REFERENCE>& aSymbolInstances );
|
||||
void UpdateSymbolInstanceData( const std::vector<SCH_SYMBOL_INSTANCE>& aSymbolInstances );
|
||||
|
||||
/**
|
||||
* Update all of the sheet instance information using \a aSheetInstances.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -476,10 +476,10 @@ void SCH_SYMBOL::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffse
|
|||
}
|
||||
|
||||
|
||||
bool SCH_SYMBOL::GetInstance( SYMBOL_INSTANCE_REFERENCE& aInstance,
|
||||
bool SCH_SYMBOL::GetInstance( SCH_SYMBOL_INSTANCE& aInstance,
|
||||
const KIID_PATH& aSheetPath, bool aTestFromEnd ) const
|
||||
{
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( !aTestFromEnd )
|
||||
{
|
||||
|
@ -522,8 +522,8 @@ void SCH_SYMBOL::RemoveInstance( const SCH_SHEET_PATH& aInstancePath )
|
|||
}
|
||||
|
||||
|
||||
void SCH_SYMBOL::SortInstances( bool (*aSortFunction)( const SYMBOL_INSTANCE_REFERENCE& aLhs,
|
||||
const SYMBOL_INSTANCE_REFERENCE& aRhs ) )
|
||||
void SCH_SYMBOL::SortInstances( bool (*aSortFunction)( const SCH_SYMBOL_INSTANCE& aLhs,
|
||||
const SCH_SYMBOL_INSTANCE& aRhs ) )
|
||||
{
|
||||
std::sort( m_instanceReferences.begin(), m_instanceReferences.end(), aSortFunction );
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ void SCH_SYMBOL::AddHierarchicalReference( const KIID_PATH& aPath, const wxStrin
|
|||
}
|
||||
}
|
||||
|
||||
SYMBOL_INSTANCE_REFERENCE instance;
|
||||
SCH_SYMBOL_INSTANCE instance;
|
||||
instance.m_Path = aPath;
|
||||
instance.m_Reference = aRef;
|
||||
instance.m_Unit = aUnit;
|
||||
|
@ -576,11 +576,11 @@ void SCH_SYMBOL::AddHierarchicalReference( const KIID_PATH& aPath, const wxStrin
|
|||
}
|
||||
|
||||
|
||||
void SCH_SYMBOL::AddHierarchicalReference( const SYMBOL_INSTANCE_REFERENCE& aInstance )
|
||||
void SCH_SYMBOL::AddHierarchicalReference( const SCH_SYMBOL_INSTANCE& aInstance )
|
||||
{
|
||||
KIID_PATH searchPath( aInstance.m_Path );
|
||||
|
||||
std::vector<SYMBOL_INSTANCE_REFERENCE>::iterator resultIt;
|
||||
std::vector<SCH_SYMBOL_INSTANCE>::iterator resultIt;
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -607,7 +607,7 @@ void SCH_SYMBOL::AddHierarchicalReference( const SYMBOL_INSTANCE_REFERENCE& aIns
|
|||
}
|
||||
while( resultIt != m_instanceReferences.end() );
|
||||
|
||||
SYMBOL_INSTANCE_REFERENCE instance = aInstance;
|
||||
SCH_SYMBOL_INSTANCE instance = aInstance;
|
||||
|
||||
wxLogTrace( traceSchSheetPaths,
|
||||
"Adding symbol '%s' instance:\n"
|
||||
|
@ -637,7 +637,7 @@ const wxString SCH_SYMBOL::GetRef( const SCH_SHEET_PATH* sheet, bool aIncludeUni
|
|||
wxString ref;
|
||||
wxString subRef;
|
||||
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( instance.m_Path == path )
|
||||
{
|
||||
|
@ -679,7 +679,7 @@ void SCH_SYMBOL::SetRef( const SCH_SHEET_PATH* sheet, const wxString& ref )
|
|||
bool found = false;
|
||||
|
||||
// check to see if it is already there before inserting it
|
||||
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( instance.m_Path == path )
|
||||
{
|
||||
|
@ -713,7 +713,7 @@ bool SCH_SYMBOL::IsAnnotated( const SCH_SHEET_PATH* aSheet )
|
|||
{
|
||||
KIID_PATH path = aSheet->Path();
|
||||
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( instance.m_Path == path )
|
||||
return instance.m_Reference.Last() != '?';
|
||||
|
@ -754,7 +754,7 @@ int SCH_SYMBOL::GetUnitSelection( const SCH_SHEET_PATH* aSheet ) const
|
|||
{
|
||||
KIID_PATH path = aSheet->Path();
|
||||
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( instance.m_Path == path )
|
||||
return instance.m_Unit;
|
||||
|
@ -771,7 +771,7 @@ void SCH_SYMBOL::SetUnitSelection( const SCH_SHEET_PATH* aSheet, int aUnitSelect
|
|||
KIID_PATH path = aSheet->Path();
|
||||
|
||||
// check to see if it is already there before inserting it
|
||||
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( instance.m_Path == path )
|
||||
{
|
||||
|
@ -787,7 +787,7 @@ void SCH_SYMBOL::SetUnitSelection( const SCH_SHEET_PATH* aSheet, int aUnitSelect
|
|||
|
||||
void SCH_SYMBOL::SetUnitSelection( int aUnitSelection )
|
||||
{
|
||||
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
instance.m_Unit = aUnitSelection;
|
||||
}
|
||||
|
||||
|
@ -1233,7 +1233,7 @@ void SCH_SYMBOL::ClearAnnotation( const SCH_SHEET_PATH* aSheetPath, bool aResetP
|
|||
{
|
||||
KIID_PATH path = aSheetPath->Path();
|
||||
|
||||
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( instance.m_Path == path )
|
||||
{
|
||||
|
@ -1246,7 +1246,7 @@ void SCH_SYMBOL::ClearAnnotation( const SCH_SHEET_PATH* aSheetPath, bool aResetP
|
|||
}
|
||||
else
|
||||
{
|
||||
for( SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
if( instance.m_Reference.IsEmpty() || aResetPrefix)
|
||||
instance.m_Reference = UTIL::GetRefDesUnannotated( m_prefix );
|
||||
|
@ -1276,7 +1276,7 @@ bool SCH_SYMBOL::AddSheetPathReferenceEntryIfMissing( const KIID_PATH& aSheetPat
|
|||
// An empty sheet path is illegal, at a minimum the root sheet UUID must be present.
|
||||
wxCHECK( aSheetPath.size() > 0, false );
|
||||
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& instance : m_instanceReferences )
|
||||
for( const SCH_SYMBOL_INSTANCE& instance : m_instanceReferences )
|
||||
{
|
||||
// if aSheetPath is found, nothing to do:
|
||||
if( instance.m_Path == aSheetPath )
|
||||
|
@ -1293,7 +1293,7 @@ bool SCH_SYMBOL::ReplaceInstanceSheetPath( const KIID_PATH& aOldSheetPath,
|
|||
const KIID_PATH& aNewSheetPath )
|
||||
{
|
||||
auto it = std::find_if( m_instanceReferences.begin(), m_instanceReferences.end(),
|
||||
[ aOldSheetPath ]( SYMBOL_INSTANCE_REFERENCE& r )->bool
|
||||
[ aOldSheetPath ]( SCH_SYMBOL_INSTANCE& r )->bool
|
||||
{
|
||||
return aOldSheetPath == r.m_Path;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2014 Dick Hollenbeck, dick@softplc.com
|
||||
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2022 CERN
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -47,7 +47,7 @@
|
|||
#include <sch_field.h>
|
||||
#include <sch_item.h>
|
||||
#include <sch_pin.h>
|
||||
#include <sch_sheet_path.h> // SYMBOL_INSTANCE_REFERENCE
|
||||
#include <sch_sheet_path.h> // SCH_SYMBOL_INSTANCE
|
||||
#include <symbol_lib_table.h>
|
||||
#include <transform.h>
|
||||
|
||||
|
@ -137,20 +137,20 @@ public:
|
|||
*/
|
||||
bool IsMissingLibSymbol() const;
|
||||
|
||||
const std::vector<SYMBOL_INSTANCE_REFERENCE>& GetInstanceReferences()
|
||||
const std::vector<SCH_SYMBOL_INSTANCE>& GetInstanceReferences()
|
||||
{
|
||||
return m_instanceReferences;
|
||||
}
|
||||
|
||||
bool GetInstance( SYMBOL_INSTANCE_REFERENCE& aInstance,
|
||||
bool GetInstance( SCH_SYMBOL_INSTANCE& aInstance,
|
||||
const KIID_PATH& aSheetPath, bool aTestFromEnd = false ) const;
|
||||
|
||||
void RemoveInstance( const SCH_SHEET_PATH& aInstancePath );
|
||||
|
||||
void RemoveAllInstances() { m_instanceReferences.clear(); }
|
||||
|
||||
void SortInstances( bool ( *aSortFunction )( const SYMBOL_INSTANCE_REFERENCE& aLhs,
|
||||
const SYMBOL_INSTANCE_REFERENCE& aRhs ) );
|
||||
void SortInstances( bool ( *aSortFunction )( const SCH_SYMBOL_INSTANCE& aLhs,
|
||||
const SCH_SYMBOL_INSTANCE& aRhs ) );
|
||||
|
||||
void ViewGetLayers( int aLayers[], int& aCount ) const override;
|
||||
|
||||
|
@ -614,7 +614,7 @@ public:
|
|||
const wxString& aRef,
|
||||
int aUnit );
|
||||
|
||||
void AddHierarchicalReference( const SYMBOL_INSTANCE_REFERENCE& aInstance );
|
||||
void AddHierarchicalReference( const SCH_SYMBOL_INSTANCE& aInstance );
|
||||
|
||||
/// Return the instance-specific unit selection for the given sheet path.
|
||||
int GetUnitSelection( const SCH_SHEET_PATH* aSheet ) const;
|
||||
|
@ -789,7 +789,7 @@ private:
|
|||
|
||||
// Defines the hierarchical path and reference of the symbol. This allows support
|
||||
// for multiple references to a single sub-sheet.
|
||||
std::vector<SYMBOL_INSTANCE_REFERENCE> m_instanceReferences;
|
||||
std::vector<SCH_SYMBOL_INSTANCE> m_instanceReferences;
|
||||
};
|
||||
|
||||
#endif /* __SYMBOL_H__ */
|
||||
|
|
|
@ -1684,7 +1684,7 @@ void SCH_EDITOR_CONTROL::updatePastedSymbol( SCH_SYMBOL* aSymbol, SCH_SCREEN* aP
|
|||
|
||||
if( m_clipboardSymbolInstances.count( clipItemPath ) > 0 )
|
||||
{
|
||||
SYMBOL_INSTANCE_REFERENCE instance = m_clipboardSymbolInstances.at( clipItemPath );
|
||||
SCH_SYMBOL_INSTANCE instance = m_clipboardSymbolInstances.at( clipItemPath );
|
||||
|
||||
unit = instance.m_Unit;
|
||||
reference = instance.m_Reference;
|
||||
|
@ -1770,7 +1770,7 @@ void SCH_EDITOR_CONTROL::setClipboardInstances( const SCH_SCREEN* aPastedScreen
|
|||
|
||||
m_clipboardSymbolInstances.clear();
|
||||
|
||||
for( const SYMBOL_INSTANCE_REFERENCE& symbol : aPastedScreen->GetSymbolInstances() )
|
||||
for( const SCH_SYMBOL_INSTANCE& symbol : aPastedScreen->GetSymbolInstances() )
|
||||
m_clipboardSymbolInstances[symbol.m_Path] = symbol;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -237,7 +237,7 @@ private:
|
|||
std::map<wxString, SCH_SCREEN*> m_supplementaryClipboard;
|
||||
|
||||
// A map of KIID_PATH --> symbol instances for the clipboard contents.
|
||||
std::map<KIID_PATH, SYMBOL_INSTANCE_REFERENCE> m_clipboardSymbolInstances;
|
||||
std::map<KIID_PATH, SCH_SYMBOL_INSTANCE> m_clipboardSymbolInstances;
|
||||
|
||||
// A map of KIID_PATH --> sheet instances for the clipboard contents.
|
||||
std::map<KIID_PATH, SCH_SHEET_INSTANCE> m_clipboardSheetInstances;
|
||||
|
|
Loading…
Reference in New Issue