40#include <wx/filename.h>
58 return _(
"(Deleted Item)" );
63 return wxT(
"DELETED_SHEET_ITEM" );
94 void Show(
int , std::ostream& )
const override {}
111 return path.GetCurrentHash();
139 m_sheets = std::move( aOther.m_sheets );
157 for(
size_t i = 0; i <
size; i++ )
195 if(
size() > aSheetPathToTest.
size() )
198 if(
size() < aSheetPathToTest.
size() )
202 for(
unsigned i = 0; i <
size(); i++ )
204 if(
at( i )->m_Uuid < aSheetPathToTest.
at( i )->
m_Uuid )
207 if(
at( i )->m_Uuid != aSheetPathToTest.
at( i )->
m_Uuid )
222 if( pageNumComp == 0 )
227 if( virtualPageA > virtualPageB )
229 else if( virtualPageA < virtualPageB )
239 if( aSheetPathToTest.
size() >
size() )
242 for(
size_t i = 0; i < aSheetPathToTest.
size(); ++i )
244 if(
at( i )->m_Uuid != aSheetPathToTest.
at( i )->
m_Uuid )
295 if( sheet->GetExcludedFromSim() )
307 if( sheet->GetExcludedFromBOM() )
319 if( sheet->GetExcludedFromBoard() )
331 if( sheet->GetDNP() )
347 for(
unsigned i = 1; i <
size(); i++ )
360 path.push_back( sheet->m_Uuid );
367 bool aStripTrailingSeparator )
const
371 if( aUseShortRootName )
379 if( !
empty() &&
at( 0 )->GetScreen() )
382 wxFileName fn = fileName;
384 s = fn.GetName() + wxS(
"/" );
388 for(
unsigned i = 1; i <
size(); i++ )
391 if( aStripTrailingSeparator && s.EndsWith(
"/" ) )
392 s = s.Left( s.length() - 1 );
400 std::vector<SCH_ITEM*> items;
403 std::back_inserter( items ),
411 std::optional<wxString> variantName;
454 bool aForceIncludeOrphanSymbols )
const
459 AppendSymbol( aReferences, symbol, aIncludePowerSymbols, aForceIncludeOrphanSymbols );
465 bool aIncludePowerSymbols,
466 bool aForceIncludeOrphanSymbols )
const
470 if( aIncludePowerSymbols || aSymbol->
GetRef(
this )[0] != wxT(
'#' ) )
477 aReferences.
AddItem( schReference );
484 bool aIncludePowerSymbols )
const
496 bool aIncludePowerSymbols )
const
500 if( !aIncludePowerSymbols && aSymbol->
GetRef(
this )[0] == wxT(
'#' ) )
509 wxString reference_str = schReference.
GetRef();
512 if( reference_str[reference_str.Len() - 1] ==
'?' )
515 aRefList[reference_str].AddItem( schReference );
528 auto pair = std::make_pair( aSrcFileName, aDestFileName );
535 wxCHECK_MSG( sch,
false,
"No SCHEMATIC found in SCH_SHEET_PATH::TestForRecursion!" );
538 wxFileName srcFn = aSrcFileName;
539 wxFileName destFn = aDestFileName;
541 if( srcFn.IsRelative() )
542 srcFn.MakeAbsolute( rootFn.GetPath() );
544 if( destFn.IsRelative() )
545 destFn.MakeAbsolute( rootFn.GetPath() );
548 if( srcFn == destFn )
563 if( cmpFn.IsRelative() )
564 cmpFn.MakeAbsolute( rootFn.GetPath() );
567 if( cmpFn == destFn )
575 if( i >=
size() || i == 0 )
589 if( cmpFn.IsRelative() )
590 cmpFn.MakeAbsolute( rootFn.GetPath() );
610 wxCHECK( sheet, wxEmptyString );
623 if( pageStr.ToLong( &page ) )
646 const wxString& aProjectName )
648 wxCHECK( !aProjectName.IsEmpty(), );
654 newSheetPath = newSheetPath + currentSheetPath;
660 wxCHECK2( symbol,
continue );
669 newSymbolInstance.
m_Path = newSheetPath.
Path();
678 newSymbolInstance.
m_Path = newSheetPath.
Path();
687 newSymbolInstance.
m_Path = newSheetPath.
Path();
702 wxCHECK2( symbol,
continue );
708 fullSheetPath = fullSheetPath + currentSheetPath;
716 wxCHECK( !aProjectName.IsEmpty() &&
LastScreen(), );
722 wxCHECK2( symbol,
continue );
735 (
LastScreen()->GetFileFormatVersionAtLoad() <= 20200310 ) )
764 if( sheetFileName.IsAbsolute() )
770 wxCHECK( screen && parentScreen, );
773 wxFileName parentFileName = parentScreen->
GetFileName();
777 wxCHECK( fileName.IsAbsolute() && parentFileName.IsAbsolute(), );
779 if( fileName.GetPath() == parentFileName.GetPath() )
783 else if( fileName.MakeRelativeTo( parentFileName.GetPath() ) )
793 wxT(
"\n File name: '%s'"
794 "\n parent file name '%s',"
795 "\n sheet '%s' file name '%s'." ),
797 Last()->GetFileName() );
803 if( aSheet !=
nullptr )
813 std::vector<SCH_SHEET*> badSheets;
822 std::vector<SCH_ITEM*> childSheets;
829 if( aCheckIntegrity )
834 badSheets.push_back( sheet );
841 wxT(
"Recursion prevented in SCH_SHEET_LIST::BuildSheetList" ) );
848 if( aCheckIntegrity )
864 path.CachePageNumber();
866 std::sort( begin(),
end(),
870 size_t common_len = 0;
871 size_t min_len = std::min( a.
size(), b.
size() );
873 while( common_len < min_len && a.
at( common_len )->
m_Uuid == b.
at( common_len )->
m_Uuid )
878 if( common_len == a.
size() )
880 if( common_len == b.
size() )
891 for(
size_t i = 0; i < common_len; i++ )
892 ancestor.push_back( a.
at( i )->
m_Uuid );
913 if( aUpdateVirtualPageNums )
915 int virtualPageNum = 1;
926 path.CachePageNumber();
928 std::sort( begin(),
end(),
936 else if( retval > 0 )
948 if( aUpdateVirtualPageNums )
950 int virtualPageNum = 1;
984 auto it = std::remove_if( begin(),
end(),
987 return std::find( aPageInclusions.begin(),
988 aPageInclusions.end(),
1034 if( aAllowNullptrReturn )
1045 if( aItem->m_Uuid == aID )
1053 if( aChild->
m_Uuid == aID )
1054 childMatch = aChild;
1074 aMap[ aItem->m_Uuid ] = aItem;
1076 aItem->RunOnChildren(
1079 aMap[ aChild->
m_Uuid ] = aChild;
1104 if( libSymbol && libSymbol->
IsPower() )
1107 references.
AddItem( schReference );
1113 std::map<wxString, int> ref_list;
1115 for(
unsigned ii = 0; ii< references.
GetCount(); ++ii )
1117 wxString curr_ref = references[ii].GetRef();
1119 if( curr_ref.IsEmpty() )
1122 if( ref_list.find( curr_ref ) == ref_list.end() )
1124 ref_list[curr_ref] = ii;
1129 if( curr_ref.Last() <
'0' && curr_ref.Last() >
'9' )
1133 while( !curr_ref.IsEmpty() && curr_ref.Last() >=
'0' && curr_ref.Last() <=
'9' )
1134 curr_ref.RemoveLast();
1136 references[ii].SetRef( curr_ref );
1145 for(
unsigned ii = 0; ii< references.
GetCount(); ++ii )
1149 if( ref_unit.
GetRef()[0] !=
'#' )
1151 wxString new_ref =
"#" + ref_unit.
GetRef();
1152 ref_unit.
SetRef( new_ref );
1160 bool aForceIncludeOrphanSymbols )
const
1163 sheet.
GetSymbols( aReferences, aIncludePowerSymbols, aForceIncludeOrphanSymbols );
1169 bool aIncludePowerSymbols,
1170 bool aForceIncludeOrphanSymbols )
const
1175 sheet.
GetSymbols( aReferences, aIncludePowerSymbols, aForceIncludeOrphanSymbols );
1186 aSheets.push_back( sheet );
1192 bool aIncludeLastSheet )
const
1198 if( !aIncludeLastSheet )
1199 testPath.pop_back();
1201 if( testPath == aPath )
1205 return std::nullopt;
1210 bool aIncludePowerSymbols )
const
1212 for(
auto it = begin(); it !=
end(); ++it )
1215 ( *it ).GetMultiUnitSymbols( tempMap, aIncludePowerSymbols );
1217 for( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair : tempMap )
1220 unsigned n_refs = pair.second.GetCount();
1222 for(
unsigned thisRef = 0; thisRef < n_refs; ++thisRef )
1223 aRefList[pair.first].AddItem( pair.second[thisRef] );
1230 const wxString& aDestFileName )
1235 SCHEMATIC* sch = at( 0 ).LastScreen()->Schematic();
1237 wxCHECK_MSG( sch,
false,
"No SCHEMATIC found in SCH_SHEET_LIST::TestForRecursion!" );
1240 wxFileName destFn = aDestFileName;
1242 if( destFn.IsRelative() )
1243 destFn.MakeAbsolute( rootFn.GetPath() );
1246 for(
unsigned i = 0; i < size(); i++ )
1249 for(
unsigned j = 0; j < aSrcSheetHierarchy.size(); j++ )
1253 for(
unsigned k = 0; k < sheetPath->
size(); k++ )
1300 retval.push_back( sheetpath );
1308 const std::vector<SCH_SYMBOL_INSTANCE>& aSymbolInstances )
1316 wxCHECK2( symbol,
continue );
1319 sheetPathWithSymbolUuid.push_back( symbol->
m_Uuid );
1321 auto it = std::find_if( aSymbolInstances.begin(), aSymbolInstances.end(),
1324 return sheetPathWithSymbolUuid == r.m_Path;
1327 if( it == aSymbolInstances.end() )
1330 sheetPathWithSymbolUuid.
AsString() );
1339 if( !it->m_Value.IsEmpty() )
1342 if( !it->m_Footprint.IsEmpty() )
1358 wxCHECK2( sheet &&
path.Last(),
continue );
1360 auto it = std::find_if( aSheetInstances.begin(), aSheetInstances.end(),
1363 return path.Path() == r.m_Path;
1366 if( it == aSheetInstances.end() )
1369 path.Path().AsString() );
1374 ( sheet->
GetName().IsEmpty() ) ? wxString( wxT(
"root" ) ) : sheet->
GetName(),
1375 path.Path().AsString(), it->m_PageNumber );
1376 path.SetPageNumber( it->m_PageNumber );
1383 std::vector<KIID_PATH> paths;
1386 paths.emplace_back( sheetPath.
Path() );
1394 std::vector<SCH_SHEET_INSTANCE> retval;
1400 wxCHECK2( sheet,
continue );
1409 retval.push_back( std::move( instance ) );
1438 tmp.Printf(
"%d", pageNumber );
1446 const wxString& aProjectName )
1461 int aLastVirtualPageNumber )
1463 wxString pageNumber;
1464 int lastUsedPageNumber = 1;
1465 int nextVirtualPageNumber = aLastVirtualPageNumber;
1468 std::vector< wxString > usedPageNumbers;
1470 if( aPrefixSheetPath.
size() )
1476 pageNumber =
path.GetPageNumber();
1478 if( !pageNumber.IsEmpty() )
1479 usedPageNumbers.emplace_back( pageNumber );
1489 newSheetPath = newSheetPath + sheetPath;
1496 wxCHECK2( sheet,
continue );
1498 nextVirtualPageNumber += 1;
1515 pageNumber.Printf( wxT(
"%d" ), lastUsedPageNumber );
1516 lastUsedPageNumber += 1;
1517 }
while( std::find( usedPageNumbers.begin(), usedPageNumbers.end(), pageNumber ) !=
1518 usedPageNumbers.end() );
1539 int lastVirtualPageNumber = 1;
1547 return lastVirtualPageNumber;
1555 if(
path.Path() == aPath )
1567 for(
size_t i = 0; i <
path.size(); i++ )
1569 if(
path.at( i ) == aSheet )
1582 return std::nullopt;
1586 if(
path.LastScreen() == aScreen )
1587 return std::optional<SCH_SHEET_PATH>(
path );
1590 return std::nullopt;
bool IsContentModified() const
void SetContentModified(bool aModified=true)
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 void UpdateHatching() const
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
Helper to retrieve the filename from the root sheet screen.
SCHEMATIC_SETTINGS & Settings() const
wxString GetCurrentVariant() const
Return the current variant being edited.
VECTOR2I GetPosition() const override
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
void SetText(const wxString &aText) override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this label.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode)
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
virtual void SetUnit(int aUnit)
SCH_ITEM(EDA_ITEM *aParent, KICAD_T aType, int aUnit=0, int aBodyStyle=0)
void AutoplaceFields(SCH_SCREEN *aScreen, AUTOPLACE_ALGO aAlgo) 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 SplitReferences()
Attempt to split all reference designators into a name (U) and number (1).
void AddItem(const SCH_REFERENCE &aItem)
A helper to define a symbol's reference designator in a schematic.
void SetRef(const wxString &aReference)
void SetSheetNumber(int aSheetNumber)
EE_RTREE & Items()
Get the full RTree, usually for iterating.
const wxString & GetFileName() const
SCHEMATIC * Schematic() const
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Update aItem's bounding box in the tree.
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 * ResolveItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr, bool aAllowNullptrReturn=false) 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 hierarchy.
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 SortByHierarchicalPageNumbers(bool aUpdateVirtualPageNums=true)
This works like SortByPageNumbers, but it sorts the sheets first by their hierarchical depth and then...
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
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.
SCH_ITEM * ResolveItem(const KIID &aID) const
Fetch a SCH_ITEM by ID.
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
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)
int GetPageNumberAsInt() const
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
SCH_SHEET_PATH operator+(const SCH_SHEET_PATH &aOther)
int m_virtualPageNumber
Page numbers are maintained by the sheet load order.
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.
wxString getPageNumber(const KIID_PATH &aParentPath) const
Return the sheet page number for aParentPath.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
SCH_SCREEN * GetScreen() const
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compare page numbers of schematic sheets.
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
void InitializeAttributes(const SCH_SYMBOL &aSymbol)
void UpdatePrefix()
Set the prefix based on the current reference designator.
bool GetExcludedFromSim(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
void RemoveInstance(const SCH_SHEET_PATH &aInstancePath)
void SetValueFieldText(const wxString &aValue)
bool GetExcludedFromBOM(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
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()
virtual bool GetDNP(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
Set or clear the 'Do Not Populate' flag.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
wxString GetPrefix() const
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
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.
size_t operator()(const SCH_SHEET_PATH &path) const
Definition for symbol library class.
@ INTERSHEET_REFS
Global label cross-reference page numbers.
@ REFERENCE
Field Reference of part, i.e. "IC21".
wxLogTrace helper definitions.
@ NOT_USED
the 3d code uses this value
VECTOR2< int32_t > VECTOR2I