41#include <wx/filename.h>
58 return _(
"(Deleted Item)" );
63 return wxT(
"DELETED_SHEET_ITEM" );
94 void Show(
int , std::ostream& )
const override {}
102 return path.GetCurrentHash();
133 for(
size_t i = 0; i <
size; i++ )
170 if(
size() > aSheetPathToTest.
size() )
173 if(
size() < aSheetPathToTest.
size() )
177 for(
unsigned i = 0; i <
size(); i++ )
197 if( pageNumComp == 0 )
202 if( virtualPageA > virtualPageB )
204 else if( virtualPageA < virtualPageB )
214 if( aSheetPathToTest.
size() >
size() )
217 for(
size_t i = 0; i < aSheetPathToTest.
size(); ++i )
219 if(
at( i )->m_Uuid != aSheetPathToTest.
at( i )->
m_Uuid )
270 if( sheet->GetExcludedFromSim() )
282 if( sheet->GetExcludedFromBOM() )
294 if( sheet->GetExcludedFromBoard() )
306 if( sheet->GetDNP() )
322 for(
unsigned i = 1; i <
size(); i++ )
335 path.push_back( sheet->m_Uuid );
342 bool aStripTrailingSeparator )
const
346 if( aUseShortRootName )
354 if( !
empty() &&
at( 0 )->GetScreen() )
357 wxFileName fn = fileName;
359 s = fn.GetName() + wxS(
"/" );
363 for(
unsigned i = 1; i <
size(); i++ )
366 if( aStripTrailingSeparator && s.EndsWith(
"/" ) )
367 s = s.Left( s.length() - 1 );
375 std::vector<SCH_ITEM*> items;
378 std::back_inserter( items ),
422 bool aForceIncludeOrphanSymbols )
const
427 AppendSymbol( aReferences, symbol, aIncludePowerSymbols, aForceIncludeOrphanSymbols );
433 bool aIncludePowerSymbols,
434 bool aForceIncludeOrphanSymbols )
const
438 if( aIncludePowerSymbols || aSymbol->
GetRef(
this )[0] != wxT(
'#' ) )
445 aReferences.
AddItem( schReference );
452 bool aIncludePowerSymbols )
const
464 bool aIncludePowerSymbols )
const
468 if( !aIncludePowerSymbols && aSymbol->
GetRef(
this )[0] == wxT(
'#' ) )
477 wxString reference_str = schReference.
GetRef();
480 if( reference_str[reference_str.Len() - 1] ==
'?' )
483 aRefList[reference_str].AddItem( schReference );
496 auto pair = std::make_pair( aSrcFileName, aDestFileName );
503 wxCHECK_MSG( sch,
false,
"No SCHEMATIC found in SCH_SHEET_PATH::TestForRecursion!" );
506 wxFileName srcFn = aSrcFileName;
507 wxFileName destFn = aDestFileName;
509 if( srcFn.IsRelative() )
510 srcFn.MakeAbsolute( rootFn.GetPath() );
512 if( destFn.IsRelative() )
513 destFn.MakeAbsolute( rootFn.GetPath() );
516 if( srcFn == destFn )
531 if( cmpFn.IsRelative() )
532 cmpFn.MakeAbsolute( rootFn.GetPath() );
535 if( cmpFn == destFn )
543 if( i >=
size() || i == 0 )
557 if( cmpFn.IsRelative() )
558 cmpFn.MakeAbsolute( rootFn.GetPath() );
578 wxCHECK( sheet, wxEmptyString );
603 const wxString& aProjectName )
605 wxCHECK( !aProjectName.IsEmpty(), );
611 newSheetPath = newSheetPath + currentSheetPath;
617 wxCHECK2( symbol,
continue );
626 newSymbolInstance.
m_Path = newSheetPath.
Path();
635 newSymbolInstance.
m_Path = newSheetPath.
Path();
644 newSymbolInstance.
m_Path = newSheetPath.
Path();
659 wxCHECK2( symbol,
continue );
665 fullSheetPath = fullSheetPath + currentSheetPath;
673 wxCHECK( !aProjectName.IsEmpty() &&
LastScreen(), );
679 wxCHECK2( symbol,
continue );
692 (
LastScreen()->GetFileFormatVersionAtLoad() <= 20200310 ) )
721 if( sheetFileName.IsAbsolute() )
727 wxCHECK( screen && parentScreen, );
730 wxFileName parentFileName = parentScreen->
GetFileName();
734 wxCHECK( fileName.IsAbsolute() && parentFileName.IsAbsolute(), );
736 if( fileName.GetPath() == parentFileName.GetPath() )
740 else if( fileName.MakeRelativeTo( parentFileName.GetPath() ) )
750 wxT(
"\n File name: '%s'"
751 "\n parent file name '%s',"
752 "\n sheet '%s' file name '%s'." ),
754 Last()->GetFileName() );
760 if( aSheet !=
nullptr )
767 wxCHECK_RET( aSheet !=
nullptr, wxT(
"Cannot build sheet list from undefined sheet." ) );
769 std::vector<SCH_SHEET*> badSheets;
778 std::vector<SCH_ITEM*> childSheets;
785 if( aCheckIntegrity )
790 badSheets.push_back( sheet );
797 wxT(
"Recursion prevented in SCH_SHEET_LIST::BuildSheetList" ) );
804 if( aCheckIntegrity )
820 path.CachePageNumber();
822 std::sort( begin(), end(),
830 else if( retval > 0 )
842 if( aUpdateVirtualPageNums )
844 int virtualPageNum = 1;
878 auto it = std::remove_if( begin(), end(),
881 return std::find( aPageInclusions.begin(), aPageInclusions.end(),
883 == aPageInclusions.end();
936 if( aItem->m_Uuid == aID )
944 if( aChild->
m_Uuid == aID )
964 aMap[ aItem->m_Uuid ] = aItem;
966 aItem->RunOnChildren(
969 aMap[ aChild->
m_Uuid ] = aChild;
993 if( libSymbol && libSymbol->
IsPower() )
996 references.
AddItem( schReference );
1002 std::map<wxString, int> ref_list;
1004 for(
unsigned ii = 0; ii< references.
GetCount(); ++ii )
1006 wxString curr_ref = references[ii].GetRef();
1008 if( ref_list.find( curr_ref ) == ref_list.end() )
1010 ref_list[curr_ref] = ii;
1015 if( curr_ref.Last() <
'0' && curr_ref.Last() >
'9' )
1019 while( curr_ref.Last() >=
'0' && curr_ref.Last() <=
'9' )
1020 curr_ref.RemoveLast();
1022 references[ii].SetRef( curr_ref );
1031 for(
unsigned ii = 0; ii< references.
GetCount(); ++ii )
1033 if( references[ii].GetRef()[0] !=
'#' )
1035 wxString new_ref =
"#" + references[ii].GetRef();
1036 references[ii].SetRef( new_ref );
1041 references.
Annotate(
false, 0, 100, lockedSymbols, additionalreferences );
1047 bool aForceIncludeOrphanSymbols )
const
1050 sheet.
GetSymbols( aReferences, aIncludePowerSymbols, aForceIncludeOrphanSymbols );
1056 bool aIncludePowerSymbols,
1057 bool aForceIncludeOrphanSymbols )
const
1062 sheet.
GetSymbols( aReferences, aIncludePowerSymbols, aForceIncludeOrphanSymbols );
1073 aSheets.push_back( sheet );
1079 bool aIncludeLastSheet )
const
1085 if( !aIncludeLastSheet )
1086 testPath.pop_back();
1088 if( testPath == aPath )
1092 return std::nullopt;
1097 bool aIncludePowerSymbols )
const
1099 for(
auto it = begin(); it != end(); ++it )
1102 ( *it ).GetMultiUnitSymbols( tempMap, aIncludePowerSymbols );
1104 for( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair : tempMap )
1107 unsigned n_refs = pair.second.GetCount();
1109 for(
unsigned thisRef = 0; thisRef < n_refs; ++thisRef )
1110 aRefList[pair.first].AddItem( pair.second[thisRef] );
1117 const wxString& aDestFileName )
1122 SCHEMATIC* sch = at( 0 ).LastScreen()->Schematic();
1124 wxCHECK_MSG( sch,
false,
"No SCHEMATIC found in SCH_SHEET_LIST::TestForRecursion!" );
1127 wxFileName destFn = aDestFileName;
1129 if( destFn.IsRelative() )
1130 destFn.MakeAbsolute( rootFn.GetPath() );
1133 for(
unsigned i = 0; i < size(); i++ )
1136 for(
unsigned j = 0; j < aSrcSheetHierarchy.size(); j++ )
1140 for(
unsigned k = 0; k < sheetPath->
size(); k++ )
1187 retval.push_back( sheetpath );
1195 const std::vector<SCH_SYMBOL_INSTANCE>& aSymbolInstances )
1203 wxCHECK2( symbol,
continue );
1206 sheetPathWithSymbolUuid.push_back( symbol->
m_Uuid );
1208 auto it = std::find_if( aSymbolInstances.begin(), aSymbolInstances.end(),
1211 return sheetPathWithSymbolUuid == r.m_Path;
1214 if( it == aSymbolInstances.end() )
1217 sheetPathWithSymbolUuid.
AsString() );
1226 if( !it->m_Value.IsEmpty() )
1229 if( !it->m_Footprint.IsEmpty() )
1245 wxCHECK2( sheet &&
path.Last(),
continue );
1247 auto it = std::find_if( aSheetInstances.begin(), aSheetInstances.end(),
1250 return path.Path() == r.m_Path;
1253 if( it == aSheetInstances.end() )
1256 path.Path().AsString() );
1261 ( sheet->
GetName().IsEmpty() ) ? wxString( wxT(
"root" ) ) : sheet->
GetName(),
1262 path.Path().AsString(), it->m_PageNumber );
1263 path.SetPageNumber( it->m_PageNumber );
1270 std::vector<KIID_PATH> paths;
1273 paths.emplace_back( sheetPath.
Path() );
1281 std::vector<SCH_SHEET_INSTANCE> retval;
1287 wxCHECK2( sheet,
continue );
1296 retval.push_back( instance );
1325 tmp.Printf(
"%d", pageNumber );
1333 const wxString& aProjectName )
1348 int aLastVirtualPageNumber )
1350 wxString pageNumber;
1351 int lastUsedPageNumber = 1;
1352 int nextVirtualPageNumber = aLastVirtualPageNumber;
1355 std::vector< wxString > usedPageNumbers;
1357 if( aPrefixSheetPath.
size() )
1363 pageNumber =
path.GetPageNumber();
1365 if( !pageNumber.IsEmpty() )
1366 usedPageNumbers.emplace_back( pageNumber );
1376 newSheetPath = newSheetPath + sheetPath;
1383 wxCHECK2( sheet,
continue );
1385 nextVirtualPageNumber += 1;
1402 pageNumber.Printf( wxT(
"%d" ), lastUsedPageNumber );
1403 lastUsedPageNumber += 1;
1404 }
while( std::find( usedPageNumbers.begin(), usedPageNumbers.end(), pageNumber ) !=
1405 usedPageNumbers.end() );
1426 int lastVirtualPageNumber = 1;
1434 return lastVirtualPageNumber;
1442 if(
path.Path() == aPath )
1454 for(
size_t i = 0; i <
path.size(); i++ )
1456 if(
path.at( i ) == aSheet )
1469 return std::nullopt;
1473 if(
path.LastScreen() == aScreen )
1474 return std::optional<SCH_SHEET_PATH>(
path );
1477 return std::nullopt;
bool IsContentModified() const
void SetContentModified(bool aModified=true)
A singleton item of this class is returned for a weak reference that no longer exists.
wxString GetClass() const override
Return the class name.
void SetPosition(const VECTOR2I &) override
static DELETED_SHEET_ITEM * GetInstance()
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool operator==(const SCH_ITEM &aOther) const override
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
KICAD_T Type() const
Returns the type of object.
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual bool IsVisible() const
virtual void SetVisible(bool aVisible)
EE_TYPE OfType(KICAD_T aType) const
wxString AsString() const
wxString AsString() const
Define a library symbol object.
bool IsPower() const override
int GetUnitCount() const override
bool m_IntersheetRefsShow
Holds all the data relating to one schematic.
wxString GetFileName() const override
Helper to retrieve the filename from the root sheet screen.
SCHEMATIC_SETTINGS & Settings() const
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
VECTOR2I GetPosition() const override
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
void SetText(const wxString &aText) override
const wxString & GetInternalName()
Get the initial name of the field set at creation (or set by SetName()).
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
virtual void SetUnit(int aUnit)
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
std::vector< SCH_FIELD > & GetFields()
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
void Annotate(bool aUseSheetNum, int aSheetIntervalId, int aStartNumber, SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap, const SCH_REFERENCE_LIST &aAdditionalRefs, bool aStartAtCurrent=false)
Set the reference designators in the list that have not been annotated.
void SplitReferences()
Attempt to split all reference designators into a name (U) and number (1).
void AddItem(const SCH_REFERENCE &aItem)
void UpdateAnnotation()
Update the symbol references for the schematic project (or the current sheet).
A helper to define a symbol's reference designator in a schematic.
void SetSheetNumber(int aSheetNumber)
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
const wxString & GetFileName() const
bool Remove(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Remove aItem from the schematic associated with this screen.
SCHEMATIC * Schematic() const
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Update aItem's bounding box in the tree.
void GetSheets(std::vector< SCH_ITEM * > *aItems) const
Similar to Items().OfType( SCH_SHEET_T ), but return the sheets in a deterministic order (L-R,...
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
std::optional< SCH_SHEET_PATH > GetSheetPathByKIIDPath(const KIID_PATH &aPath, bool aIncludeLastSheet=true) const
Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
Fetch a SCH_ITEM by ID.
void GetMultiUnitSymbols(SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols=true) const
Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the li...
std::optional< SCH_SHEET_PATH > GetOrdinalPath(const SCH_SCREEN *aScreen) const
Return the ordinal sheet path of aScreen.
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Fill an item cache for temporary use when many items need to be fetched.
SCH_SHEET_PATH m_currentSheetPath
void TrimToPageNumbers(const std::vector< wxString > &aPageInclusions)
Truncates the list by removing sheet's with page numbers not in the given list.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
void AddNewSymbolInstances(const SCH_SHEET_PATH &aPrefixSheetPath, const wxString &aProjectName)
Attempt to add new symbol instances for all symbols in this list of sheet paths prefixed with aPrefix...
bool NameExists(const wxString &aSheetName) const
std::vector< SCH_SHEET_INSTANCE > GetSheetInstances() const
Fetch the instance information for all of the sheets in the hiearchy.
void UpdateSheetInstanceData(const std::vector< SCH_SHEET_INSTANCE > &aSheetInstances)
Update all of the sheet instance information using aSheetInstances.
void SetInitialPageNumbers()
Set initial sheet page numbers.
void RemoveSymbolInstances(const SCH_SHEET_PATH &aPrefixSheetPath)
SCH_SHEET_LIST FindAllSheetsForScreen(const SCH_SCREEN *aScreen) const
Return a SCH_SHEET_LIST with a copy of all the SCH_SHEET_PATH using a particular screen.
bool AllSheetPageNumbersEmpty() const
Check all of the sheet instance for empty page numbers.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
bool IsModified() const
Check the entire hierarchy for any modifications.
SCH_SHEET_LIST(SCH_SHEET *aSheet=nullptr)
Construct a flattened list of SCH_SHEET_PATH objects from aSheet.
void AnnotatePowerSymbols()
Silently annotate the not yet annotated power symbols of the entire hierarchy of the sheet path list.
int GetLastVirtualPageNumber() const
void UpdateSymbolInstanceData(const std::vector< SCH_SYMBOL_INSTANCE > &aSymbolInstances)
Update all of the symbol instance information using aSymbolInstances.
void GetSheetsWithinPath(std::vector< SCH_SHEET_PATH > &aSheets, const SCH_SHEET_PATH &aSheetPath) const
Add a SCH_SHEET_PATH object to aSheets for each sheet in the list that are contained within aSheetPat...
bool PageNumberExists(const wxString &aPageNumber) const
void AddNewSheetInstances(const SCH_SHEET_PATH &aPrefixSheetPath, int aLastVirtualPageNumber)
bool ContainsSheet(const SCH_SHEET *aSheet) const
std::vector< KIID_PATH > GetPaths() const
void GetSymbolsWithinPath(SCH_REFERENCE_LIST &aReferences, const SCH_SHEET_PATH &aSheetPath, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets that are contained wi...
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
SCH_SHEET_PATH FindSheetForScreen(const SCH_SCREEN *aScreen)
Return the first SCH_SHEET_PATH object (not necessarily the only one) using a particular screen.
void CheckForMissingSymbolInstances(const wxString &aProjectName)
bool HasPath(const KIID_PATH &aPath) const
SCH_SHEET_PATH * FindSheetForPath(const SCH_SHEET_PATH *aPath)
Return a pointer to the first SCH_SHEET_PATH object (not necessarily the only one) matching the provi...
bool TestForRecursion(const SCH_SHEET_LIST &aSrcSheetHierarchy, const wxString &aDestFileName)
Test every SCH_SHEET_PATH in this SCH_SHEET_LIST to verify if adding the sheets stored in aSrcSheetHi...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool GetExcludedFromBOM() const
SCH_ITEM * GetItem(const KIID &aID) const
Fetch a SCH_ITEM by ID.
void AppendMultiUnitSymbol(SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, SCH_SYMBOL *aSymbol, bool aIncludePowerSymbols=true) const
Append a SCH_REFERENCE_LIST object to aRefList based on aSymbol, storing same-reference set of multi-...
const SCH_SHEET * GetSheet(unsigned aIndex) const
bool empty() const
Forwarded method from std::vector.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Adds SCH_REFERENCE object to aReferences for each symbol in the sheet.
int ComparePageNum(const SCH_SHEET_PATH &aSheetPathToTest) const
Compare sheets by their page number.
size_t GetCurrentHash() const
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const
Return the sheet path in a human readable form made from the sheet names.
bool operator==(const SCH_SHEET_PATH &d1) const
void AddNewSymbolInstances(const SCH_SHEET_PATH &aPrefixSheetPath, const wxString &aProjectName)
Attempt to add new symbol instances for all symbols in this sheet path prefixed with aPrefixSheetPath...
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
bool TestForRecursion(const wxString &aSrcFileName, const wxString &aDestFileName)
Test the SCH_SHEET_PATH file names to check adding the sheet stored in the file aSrcFileName to the s...
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
void MakeFilePathRelativeToParentSheet()
Make the sheet file name relative to its parent sheet.
wxString GetCachedPageNumber() const
std::vector< SCH_SHEET * > m_sheets
SCH_SCREEN * LastScreen()
int Cmp(const SCH_SHEET_PATH &aSheetPathToTest) const
Compare if this is the same sheet path as aSheetPathToTest.
void GetMultiUnitSymbols(SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols=true) const
Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the sh...
void initFromOther(const SCH_SHEET_PATH &aOther)
wxString m_cached_page_number
wxString GetPageNumber() const
void RemoveSymbolInstances(const SCH_SHEET_PATH &aPrefixSheetPath)
void CheckForMissingSymbolInstances(const wxString &aProjectName)
bool IsContainedWithin(const SCH_SHEET_PATH &aSheetPathToTest) const
Check if this path is contained inside aSheetPathToTest.
SCH_SHEET * at(size_t aIndex) const
Forwarded method from std::vector.
void SetVirtualPageNumber(int aPageNumber)
Set the sheet instance virtual page number.
void AppendSymbol(SCH_REFERENCE_LIST &aReferences, SCH_SYMBOL *aSymbol, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Append a SCH_REFERENCE object to aReferences based on aSymbol.
std::map< std::pair< wxString, wxString >, bool > m_recursion_test_cache
Page numbers are maintained by the sheet load order.
bool GetExcludedFromSim() const
wxString PathAsString() const
Return the path of time stamps which do not changes even when editing sheet parameters.
bool GetExcludedFromBoard() const
void SetPageNumber(const wxString &aPageNumber)
Set the sheet instance user definable page number.
SCH_SHEET_PATH & operator=(const SCH_SHEET_PATH &aOther)
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
SCH_SHEET_PATH operator+(const SCH_SHEET_PATH &aOther)
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
size_t size() const
Forwarded method from std::vector.
int GetVirtualPageNumber() const
void pop_back()
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetFileName(const wxString &aFilename)
wxString GetFileName() const
Return the filename corresponding to this sheet.
bool getInstance(SCH_SHEET_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
bool addInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
std::vector< SCH_FIELD > & GetFields()
SCH_SCREEN * GetScreen() const
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compares page numbers of schematic sheets.
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
wxString getPageNumber(const KIID_PATH &aInstance) const
Return the sheet page number for aInstance.
void UpdatePrefix()
Set the prefix based on the current reference designator.
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
void RemoveInstance(const SCH_SHEET_PATH &aInstancePath)
void SetValueFieldText(const wxString &aValue)
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
void SetFootprintFieldText(const wxString &aFootprint)
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit)
Add a full hierarchical reference to this symbol.
bool GetInstance(SCH_SYMBOL_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
int GetUnitSelection(const SCH_SHEET_PATH *aSheet) const
Return the instance-specific unit selection for the given sheet path.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
wxString GetPrefix() const
static bool empty(const wxTextEntryBase *aCtrl)
const wxChar *const tracePathsAndFiles
Flag to enable path and file name debug output.
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
static constexpr void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
wxString GetRefDesUnannotated(const wxString &aSource)
Return an unannotated refdes from either a prefix or an existing refdes.
Collection of utility functions for component reference designators (refdes)
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
std::map< wxString, SCH_REFERENCE_LIST > SCH_MULTI_UNIT_REFERENCE_MAP
Container to map reference designators for multi-unit parts.
A simple container for sheet instance information.
A simple container for schematic symbol instance information.
Definition for symbol library class.
@ REFERENCE_FIELD
Field Reference of part, i.e. "IC21".
wxLogTrace helper definitions.
@ NOT_USED
the 3d code uses this value
VECTOR2< int32_t > VECTOR2I