KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_REFERENCE_LIST Class Reference

Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used more than once and its reference designator is dependent on the sheet path for the same symbol. More...

#include <sch_reference_list.h>

Public Types

typedef std::vector< SCH_REFERENCE >::iterator iterator
 
typedef std::vector< SCH_REFERENCE >::const_iterator const_iterator
 

Public Member Functions

 SCH_REFERENCE_LIST ()
 
SCH_REFERENCE & operator[] (int aIndex)
 
const SCH_REFERENCE & operator[] (int aIndex) const
 
void Clear ()
 
size_t GetCount () const
 
SCH_REFERENCE & GetItem (size_t aIdx)
 
const SCH_REFERENCE & GetItem (size_t aIdx) const
 
SCH_REFERENCE * FindItem (const SCH_REFERENCE &aItem)
 
void AddItem (const SCH_REFERENCE &aItem)
 
void RemoveItem (unsigned int aIndex)
 Remove an item from the list of references.
 
bool Contains (const SCH_REFERENCE &aItem) const
 Return true if aItem exists in this list.
 
void SplitReferences ()
 Attempt to split all reference designators into a name (U) and number (1).
 
void UseReusedSheetRepresentatives (const SCH_SHEET_LIST &aSheets)
 Replace the references of each reused sheet symbol with one reference on the first instance of its sheet in aSheets, which carries the base every instance shares in suffix mode.
 
SCH_MULTI_UNIT_REFERENCE_MAP LockedForRepresentatives (const SCH_MULTI_UNIT_REFERENCE_MAP &aLocked) const
 Move locked multi-unit groups onto the representatives in this list.
 
void RenumberBasesUsedBy (const SCH_REFERENCE_LIST &aOthers, const SCH_MULTI_UNIT_REFERENCE_MAP &aLocked, const SCH_SHEET_LIST &aSheets)
 Mark unsplit references for renumbering where their kept base would collide once suffix mode copies it to every instance of its sheet in aSheets.
 
void RemoveAnnotation ()
 Treat all symbols in this list as non-annotated.
 
void UpdateAnnotation ()
 Update the symbol references for the schematic project (or the current sheet).
 
void ReannotateByOptions (ANNOTATE_ORDER_T aSortOption, ANNOTATE_ALGO_T aAlgoOption, int aStartNumber, const SCH_REFERENCE_LIST &aAdditionalRefs, bool aStartAtCurrent, SCH_SHEET_LIST *aHierarchy)
 Forces reannotation of the provided references.
 
void ReannotateDuplicates (const SCH_REFERENCE_LIST &aAdditionalReferences, ANNOTATE_ALGO_T aAlgoOption)
 Convenience function for the Paste Unique functionality.
 
void AnnotateByOptions (enum ANNOTATE_ORDER_T aSortOption, enum ANNOTATE_ALGO_T aAlgoOption, int aStartNumber, const SCH_MULTI_UNIT_REFERENCE_MAP &aLockedUnitMap, const SCH_REFERENCE_LIST &aAdditionalRefs, bool aStartAtCurrent, const SCH_SHEET_LIST *aSharedSheets=nullptr)
 Annotate the references by the provided options.
 
void Annotate (bool aUseSheetNum, int aSheetIntervalId, int aStartNumber, const SCH_MULTI_UNIT_REFERENCE_MAP &aLockedUnitMap, const SCH_REFERENCE_LIST &aAdditionalRefs, bool aStartAtCurrent=false, const SCH_SHEET_LIST *aSharedSheets=nullptr)
 Set the reference designators in the list that have not been annotated.
 
int CheckAnnotation (ANNOTATION_ERROR_HANDLER aErrorHandler)
 Check for annotations errors.
 
void SortByXCoordinate ()
 Sort the list of references by X position.
 
void SortByYCoordinate ()
 Sort the list of references by Y position.
 
void SortByTimeStamp ()
 Sort the flat list by Time Stamp (sheet path + timestamp).
 
void SortByRefAndValue ()
 Sort the list of references by value.
 
void SortByReferenceOnly ()
 Sort the list of references by reference.
 
void SortBySymbolPtr ()
 Sort the list by the symbol pointer.
 
int FindRef (const wxString &aRef) const
 Search the list for a symbol with a given reference, as shown with its sheet suffix.
 
int FindRefByFullPath (const wxString &aFullPath) const
 Search the list for a symbol with the given KIID path (as string).
 
void GetRefsInUse (int aIndex, std::vector< int > &aIdList, int aMinRefId) const
 Add all the reference designator numbers greater than aMinRefId to aIdList skipping the reference at aIndex.
 
std::vector< int > GetPackageUnits (const SCH_REFERENCE &aRef) const
 Return the units a locked package needs free when aRef is numbered, which are the units of every member with the same library symbol and value.
 
int FindFirstUnusedReference (const SCH_REFERENCE &aRef, int aMinValue, const std::vector< int > &aRequiredUnits, const std::map< const SCH_REFERENCE *, std::vector< SCH_REFERENCE > > &aDestinations={}, const SCH_REFERENCE_LIST *aLocked=nullptr) const
 Return the first unused reference number from the properties given in aRef, ensuring all of the units in aRequiredUnits are also unused.
 
std::vector< SCH_SYMBOL_INSTANCE > GetSymbolInstances () const
 
std::shared_ptr< REFDES_TRACKER > GetRefDesTracker () const
 
void SetRefDesTracker (std::shared_ptr< REFDES_TRACKER > aTracker)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
iterator erase (iterator position)
 
iterator erase (iterator first, iterator last)
 

Static Private Member Functions

static bool sortByRefAndValue (const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
 
static bool sortByXPosition (const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
 
static bool sortByYPosition (const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
 
static bool sortByTimeStamp (const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
 
static bool sortByReferenceOnly (const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
 
static bool sortBySymbolPtr (const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
 

Private Attributes

std::vector< SCH_REFERENCE > m_flatList
 
std::shared_ptr< REFDES_TRACKER > m_refDesTracker
 A list of previously used reference designators.
 

Friends

class BACK_ANNOTATION
 
class BACK_ANNOTATE
 

Detailed Description

Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used more than once and its reference designator is dependent on the sheet path for the same symbol.

This flattened list is used for netlist generation, BOM generation, and schematic annotation.

Definition at line 335 of file sch_reference_list.h.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<SCH_REFERENCE>::const_iterator SCH_REFERENCE_LIST::const_iterator

Definition at line 682 of file sch_reference_list.h.

◆ iterator

typedef std::vector<SCH_REFERENCE>::iterator SCH_REFERENCE_LIST::iterator

Definition at line 681 of file sch_reference_list.h.

Constructor & Destructor Documentation

◆ SCH_REFERENCE_LIST()

Member Function Documentation

◆ AddItem()

◆ Annotate()

void SCH_REFERENCE_LIST::Annotate ( bool aUseSheetNum,
int aSheetIntervalId,
int aStartNumber,
const SCH_MULTI_UNIT_REFERENCE_MAP & aLockedUnitMap,
const SCH_REFERENCE_LIST & aAdditionalRefs,
bool aStartAtCurrent = false,
const SCH_SHEET_LIST * aSharedSheets = nullptr )

Set the reference designators in the list that have not been annotated.

If a the sheet number is 2 and aSheetIntervalId is 100, then the first reference designator would be 201 and the last reference designator would be 299 when no overlap occurs with sheet number 3. If there are 150 items in sheet number 2, then items are referenced U201 to U351, and items in sheet 3 start from U352

Parameters
aUseSheetNumSet to true to start annotation for each sheet at the sheet number times aSheetIntervalId. Otherwise annotate incrementally.
aSheetIntervalIdThe per sheet reference designator multiplier.
aStartNumberThe number to start with if NOT numbering based on sheet number.
aLockedUnitMapA SCH_MULTI_UNIT_REFERENCE_MAP of reference designator wxStrings to SCH_REFERENCE_LISTs. May be an empty map. If not empty, any multi-unit parts found in this map will be annotated as a group rather than individually.
aAdditionalRefsAdditional references to use for checking that there a reference designator doesn't already exist. The caller must ensure that none of the references in aAdditionalRefs exist in this list.
aStartAtCurrentUse m_numRef for each reference as the start number (overrides aStartNumber)
aSharedSheetsHierarchy to check when one base is shared by reused sheet instances

Definition at line 737 of file sch_reference_list.cpp.

References AddItem(), buildFullReference(), SCH_REFERENCE::CompareLibId(), SCH_REFERENCE::CompareValue(), FindFirstUnusedReference(), GetCount(), GetPackageUnits(), SCH_REFERENCE::GetSheetPath(), SCH_REFERENCE::GetSymbol(), SCH_REFERENCE::IsSameInstance(), SCH_SHEET_PATH::LastScreen(), m_flatList, SCH_REFERENCE::m_isNew, m_refDesTracker, SCH_REFERENCE::m_unit, path, SCH_REFERENCE_LIST(), sharesReusedBase(), and SCH_REFERENCE::Split().

Referenced by AnnotateByOptions(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and UpdateAnnotation().

◆ AnnotateByOptions()

void SCH_REFERENCE_LIST::AnnotateByOptions ( enum ANNOTATE_ORDER_T aSortOption,
enum ANNOTATE_ALGO_T aAlgoOption,
int aStartNumber,
const SCH_MULTI_UNIT_REFERENCE_MAP & aLockedUnitMap,
const SCH_REFERENCE_LIST & aAdditionalRefs,
bool aStartAtCurrent,
const SCH_SHEET_LIST * aSharedSheets = nullptr )

Annotate the references by the provided options.

Parameters
aSortOptionDefine the annotation order. See ANNOTATE_ORDER_T.
aAlgoOptionDefine the annotation style. See ANNOTATE_ALGO_T.
aStartNumberThe start number for non-sheet-based annotation styles.
aLockedUnitMapA SCH_MULTI_UNIT_REFERENCE_MAP of reference designator wxStrings to SCH_REFERENCE_LISTs. May be an empty map. If not empty, any multi-unit parts found in this map will be annotated as a group rather than individually.
aAdditionalRefsAdditional references to check for duplicates
aStartAtCurrentUse m_numRef for each reference as the start number (overrides aStartNumber)
aSharedSheetsHierarchy to check when one base is shared by reused sheet instances

Definition at line 697 of file sch_reference_list.cpp.

References Annotate(), INCREMENTAL_BY_REF, SCH_REFERENCE_LIST(), SHEET_NUMBER_X_100, SHEET_NUMBER_X_1000, SORT_BY_X_POSITION, SORT_BY_Y_POSITION, SortByXCoordinate(), and SortByYCoordinate().

Referenced by AnnotateReferences(), and ReannotateByOptions().

◆ begin() [1/2]

iterator SCH_REFERENCE_LIST::begin ( )
inline

◆ begin() [2/2]

const_iterator SCH_REFERENCE_LIST::begin ( ) const
inline

Definition at line 688 of file sch_reference_list.h.

References m_flatList.

◆ CheckAnnotation()

int SCH_REFERENCE_LIST::CheckAnnotation ( ANNOTATION_ERROR_HANDLER aErrorHandler)

Check for annotations errors.

The following annotation error conditions are tested:

  • Symbols not annotated.
  • Symbols having the same reference designator (duplicates).
  • Symbols with multiple parts per package having different reference designators.
  • Symbols with multiple parts per package with invalid part count.
Parameters
aErrorHandlerA handler for errors.
Returns
The number of errors found.

Definition at line 970 of file sch_reference_list.cpp.

References _, SCH_REFERENCE::CompareRef(), SCH_REFERENCE::CompareValue(), ERCE_DIFFERENT_UNIT_VALUE, ERCE_DUPLICATE_REFERENCE, ERCE_EXTRA_UNITS, ERCE_UNANNOTATED, SCH_REFERENCE::GetLibPart(), SCH_REFERENCE::GetRef(), SCH_REFERENCE::GetRefSuffix(), SCH_REFERENCE::GetSymbol(), SCH_REFERENCE::GetUnit(), LIB_SYMBOL::GetUnitCount(), m_flatList, SCH_REFERENCE::m_numRef, SCH_REFERENCE::m_numRefStr, SCH_REFERENCE::m_unit, SCH_REFERENCE::m_value, SortByRefAndValue(), SplitReferences(), and SCH_SYMBOL::SubReference().

Referenced by BOOST_AUTO_TEST_CASE(), SCH_EDIT_FRAME::CheckAnnotate(), REF_SUFFIX_FIXTURE::CountDuplicates(), EESCHEMA_JOBS_HANDLER::JobExportNetlist(), EESCHEMA_JOBS_HANDLER::JobExportPythonBom(), and ERC_TESTER::TestAnnotation().

◆ Clear()

void SCH_REFERENCE_LIST::Clear ( )
inline

Definition at line 351 of file sch_reference_list.h.

References m_flatList.

Referenced by BOOST_AUTO_TEST_CASE(), and SCH_DRAWING_TOOLS::PlaceSymbol().

◆ Contains()

bool SCH_REFERENCE_LIST::Contains ( const SCH_REFERENCE & aItem) const

Return true if aItem exists in this list.

Parameters
aItemReference to check.
Returns
true if aItem exists in this list.

Definition at line 53 of file sch_reference_list.cpp.

References GetCount(), and m_flatList.

Referenced by AnnotateReferences(), BOOST_AUTO_TEST_CASE(), and FindFirstUnusedReference().

◆ end() [1/2]

iterator SCH_REFERENCE_LIST::end ( )
inline

Definition at line 686 of file sch_reference_list.h.

References m_flatList.

Referenced by SCHEMATIC::Contains(), FindFirstUnusedReference(), and RenumberBasesUsedBy().

◆ end() [2/2]

const_iterator SCH_REFERENCE_LIST::end ( ) const
inline

Definition at line 690 of file sch_reference_list.h.

References m_flatList.

◆ erase() [1/2]

iterator SCH_REFERENCE_LIST::erase ( iterator first,
iterator last )
inline

Definition at line 694 of file sch_reference_list.h.

References m_flatList.

◆ erase() [2/2]

iterator SCH_REFERENCE_LIST::erase ( iterator position)
inline

Definition at line 692 of file sch_reference_list.h.

References m_flatList.

◆ FindFirstUnusedReference()

int SCH_REFERENCE_LIST::FindFirstUnusedReference ( const SCH_REFERENCE & aRef,
int aMinValue,
const std::vector< int > & aRequiredUnits,
const std::map< const SCH_REFERENCE *, std::vector< SCH_REFERENCE > > & aDestinations = {},
const SCH_REFERENCE_LIST * aLocked = nullptr ) const

Return the first unused reference number from the properties given in aRef, ensuring all of the units in aRequiredUnits are also unused.

Parameters
aRefis the reference item used for the search pattern.
aMinValueThe minimum value for the current search.
aRequiredUnitsList of units to ensure are free
aDestinationsInstances affected by each reference in this list
aLockedPackage whose members will receive the same number

Definition at line 530 of file sch_reference_list.cpp.

References begin(), candidates(), SCH_REFERENCE::CompareLibId(), SCH_REFERENCE::CompareValue(), Contains(), end(), SCH_REFERENCE::formatRefStr(), SCH_REFERENCE::GetRef(), SCH_REFERENCE::GetUnit(), m_flatList, m_refDesTracker, and SCH_REFERENCE_LIST().

Referenced by Annotate().

◆ FindItem()

SCH_REFERENCE * SCH_REFERENCE_LIST::FindItem ( const SCH_REFERENCE & aItem)

Definition at line 65 of file sch_reference_list.cpp.

References GetCount(), and m_flatList.

◆ FindRef()

int SCH_REFERENCE_LIST::FindRef ( const wxString & aRef) const

Search the list for a symbol with a given reference, as shown with its sheet suffix.

Definition at line 193 of file sch_reference_list.cpp.

References m_flatList.

◆ FindRefByFullPath()

int SCH_REFERENCE_LIST::FindRefByFullPath ( const wxString & aFullPath) const

Search the list for a symbol with the given KIID path (as string).

Parameters
aFullPathis the path of the symbol item to search.
Returns
an index in m_flatList if found or -1 if not found.

Definition at line 181 of file sch_reference_list.cpp.

References m_flatList.

◆ GetCount()

◆ GetItem() [1/2]

SCH_REFERENCE & SCH_REFERENCE_LIST::GetItem ( size_t aIdx)
inline

Definition at line 358 of file sch_reference_list.h.

References m_flatList.

◆ GetItem() [2/2]

const SCH_REFERENCE & SCH_REFERENCE_LIST::GetItem ( size_t aIdx) const
inline

Definition at line 359 of file sch_reference_list.h.

References m_flatList.

◆ GetPackageUnits()

std::vector< int > SCH_REFERENCE_LIST::GetPackageUnits ( const SCH_REFERENCE & aRef) const

Return the units a locked package needs free when aRef is numbered, which are the units of every member with the same library symbol and value.

Members may still carry different references when suffix mode merged packages of reused sheets.

Definition at line 225 of file sch_reference_list.cpp.

References m_flatList, SCH_REFERENCE::m_unit, and alg::remove_duplicates().

Referenced by Annotate().

◆ GetRefDesTracker()

std::shared_ptr< REFDES_TRACKER > SCH_REFERENCE_LIST::GetRefDesTracker ( ) const
inline

Definition at line 676 of file sch_reference_list.h.

References m_refDesTracker.

◆ GetRefsInUse()

void SCH_REFERENCE_LIST::GetRefsInUse ( int aIndex,
std::vector< int > & aIdList,
int aMinRefId ) const

Add all the reference designator numbers greater than aMinRefId to aIdList skipping the reference at aIndex.

Parameters
aIndexis the current symbol's index to use for reference prefix filtering.
aIdListis the buffer to fill.
aMinRefIdis the minimum ID value to store. All values < aMinRefId are ignored.

Definition at line 205 of file sch_reference_list.cpp.

References m_flatList, and alg::remove_duplicates().

◆ GetSymbolInstances()

std::vector< SCH_SYMBOL_INSTANCE > SCH_REFERENCE_LIST::GetSymbolInstances ( ) const

◆ LockedForRepresentatives()

SCH_MULTI_UNIT_REFERENCE_MAP SCH_REFERENCE_LIST::LockedForRepresentatives ( const SCH_MULTI_UNIT_REFERENCE_MAP & aLocked) const

Move locked multi-unit groups onto the representatives in this list.

Groups that share a symbol merge, because a representative's base reaches every instance and so every package its units belong to.

Definition at line 302 of file sch_reference_list.cpp.

References group, index, locked, m_flatList, packageMemberKey(), and result.

Referenced by AnnotateReferences().

◆ operator[]() [1/2]

SCH_REFERENCE & SCH_REFERENCE_LIST::operator[] ( int aIndex)
inline

Definition at line 341 of file sch_reference_list.h.

References m_flatList.

◆ operator[]() [2/2]

const SCH_REFERENCE & SCH_REFERENCE_LIST::operator[] ( int aIndex) const
inline

Definition at line 346 of file sch_reference_list.h.

References m_flatList.

◆ ReannotateByOptions()

void SCH_REFERENCE_LIST::ReannotateByOptions ( ANNOTATE_ORDER_T aSortOption,
ANNOTATE_ALGO_T aAlgoOption,
int aStartNumber,
const SCH_REFERENCE_LIST & aAdditionalRefs,
bool aStartAtCurrent,
SCH_SHEET_LIST * aHierarchy )

Forces reannotation of the provided references.

Will also reannotate associated multi-unit symbols.

Parameters
aSortOptionDefine the annotation order. See ANNOTATE_ORDER_T.
aAlgoOptionDefine the annotation style. See ANNOTATE_ALGO_T.
aStartNumberThe start number for non-sheet-based annotation styles.
aAdditionalRefsAdditional references to check for duplicates,
aStartAtCurrentUse m_numRef for each reference as the start number (overrides aStartNumber).
aHierarchyOptional sheet path hierarchy for resetting the references' sheet numbers based on their sheet's place in the hierarchy. Set nullptr if not desired.

Definition at line 647 of file sch_reference_list.cpp.

References AnnotateByOptions(), SCH_SHEET_LIST::FindSheetForPath(), GetCount(), SCH_SYMBOL::GetRef(), SCH_REFERENCE::GetSheetPath(), SCH_REFERENCE::GetSymbol(), m_flatList, SCH_REFERENCE::m_isNew, path, SCH_REFERENCE_LIST(), SCH_REFERENCE::SetSheetNumber(), and SplitReferences().

Referenced by AnnotateNewSymbol(), and ReannotateDuplicates().

◆ ReannotateDuplicates()

void SCH_REFERENCE_LIST::ReannotateDuplicates ( const SCH_REFERENCE_LIST & aAdditionalReferences,
ANNOTATE_ALGO_T aAlgoOption )

Convenience function for the Paste Unique functionality.

Note
Do not use as a general reannotation method.

Replaces any duplicate reference designators with the next available number after the present number obeying the current annotation style.

Multi-unit symbols are reannotated together.

Definition at line 691 of file sch_reference_list.cpp.

References ReannotateByOptions(), SCH_REFERENCE_LIST(), and UNSORTED.

◆ RemoveAnnotation()

void SCH_REFERENCE_LIST::RemoveAnnotation ( )
inline

Treat all symbols in this list as non-annotated.

Does not update annotation state of the symbols.

See also
SCH_REFERENCE_LIST::UpdateAnnotation()

Definition at line 435 of file sch_reference_list.h.

References GetCount(), and m_flatList.

Referenced by AnnotateReferences(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ RemoveItem()

void SCH_REFERENCE_LIST::RemoveItem ( unsigned int aIndex)

Remove an item from the list of references.

Parameters
aIndexis the index of the item to be removed.

Definition at line 46 of file sch_reference_list.cpp.

References m_flatList.

◆ RenumberBasesUsedBy()

void SCH_REFERENCE_LIST::RenumberBasesUsedBy ( const SCH_REFERENCE_LIST & aOthers,
const SCH_MULTI_UNIT_REFERENCE_MAP & aLocked,
const SCH_SHEET_LIST & aSheets )

Mark unsplit references for renumbering where their kept base would collide once suffix mode copies it to every instance of its sheet in aSheets.

A base collides when aOthers, the references this annotation does not touch, use it or one of its composed references for anything but a free unit of the same part, or when an earlier package in this list holds it. A colliding package renumbers whole.

Parameters
aLockedthe groups from LockedForRepresentatives(), which define the packages.

Definition at line 357 of file sch_reference_list.cpp.

References begin(), end(), SCH_REFERENCE::GetComposedRef(), SCHEMATIC::GetPackageRefSuffix(), SCH_REFERENCE::GetRef(), SCH_REFERENCE::GetSheetPath(), SCH_REFERENCE::GetSymbol(), SCH_REFERENCE::GetUnit(), group, SCH_SHEET_PATH::LastScreen(), m_flatList, packageMemberKey(), path, result, SCH_REFERENCE_LIST(), SCH_ITEM::Schematic(), and sharesReusedBase().

Referenced by AnnotateReferences().

◆ SetRefDesTracker()

void SCH_REFERENCE_LIST::SetRefDesTracker ( std::shared_ptr< REFDES_TRACKER > aTracker)
inline

◆ SortByRefAndValue()

void SCH_REFERENCE_LIST::SortByRefAndValue ( )
inline

Sort the list of references by value.

Symbols are sorted in the following order:

  • Numeric value of reference designator.
  • Value of symbol.
  • Unit number when symbol has multiple parts.
  • Sheet number.
  • X coordinate position.
  • Y coordinate position.

Definition at line 597 of file sch_reference_list.h.

References m_flatList, and sortByRefAndValue().

Referenced by CheckAnnotation().

◆ sortByRefAndValue()

◆ SortByReferenceOnly()

void SCH_REFERENCE_LIST::SortByReferenceOnly ( )
inline

Sort the list of references by reference.

Symbols are sorted in the following order:

  • Numeric value of reference designator.
  • Unit number when symbol has multiple parts.

Definition at line 609 of file sch_reference_list.h.

References m_flatList, and sortByReferenceOnly().

Referenced by REF_SUFFIX_FIXTURE::AnnotatePlaced(), API_HANDLER_SCH::handlePlaceSymbolFromLibrary(), SCH_EDITOR_CONTROL::Paste(), and SCH_DRAWING_TOOLS::PlaceSymbol().

◆ sortByReferenceOnly()

bool SCH_REFERENCE_LIST::sortByReferenceOnly ( const SCH_REFERENCE & item1,
const SCH_REFERENCE & item2 )
staticprivate

◆ SortBySymbolPtr()

void SCH_REFERENCE_LIST::SortBySymbolPtr ( )
inline

Sort the list by the symbol pointer.

Because symbols are shared in complex hierarchies, this sorting can be used to coalesce symbol instance changes into a single commit instead of per instances commits.

Definition at line 620 of file sch_reference_list.h.

References m_flatList, and sortBySymbolPtr().

◆ sortBySymbolPtr()

bool SCH_REFERENCE_LIST::sortBySymbolPtr ( const SCH_REFERENCE & item1,
const SCH_REFERENCE & item2 )
staticprivate

Definition at line 175 of file sch_reference_list.cpp.

References SCH_REFERENCE::m_rootSymbol.

Referenced by SortBySymbolPtr().

◆ SortByTimeStamp()

void SCH_REFERENCE_LIST::SortByTimeStamp ( )
inline

Sort the flat list by Time Stamp (sheet path + timestamp).

Useful to detect duplicate Time Stamps

Definition at line 581 of file sch_reference_list.h.

References m_flatList, and sortByTimeStamp().

◆ sortByTimeStamp()

bool SCH_REFERENCE_LIST::sortByTimeStamp ( const SCH_REFERENCE & item1,
const SCH_REFERENCE & item2 )
staticprivate

◆ SortByXCoordinate()

void SCH_REFERENCE_LIST::SortByXCoordinate ( )
inline

Sort the list of references by X position.

Symbols are sorted as follows:

  • Numeric value of reference designator.
  • Sheet number.
  • X coordinate position.
  • Y coordinate position.
  • Time stamp.

Definition at line 556 of file sch_reference_list.h.

References m_flatList, and sortByXPosition().

Referenced by AnnotateByOptions().

◆ sortByXPosition()

bool SCH_REFERENCE_LIST::sortByXPosition ( const SCH_REFERENCE & item1,
const SCH_REFERENCE & item2 )
staticprivate

◆ SortByYCoordinate()

void SCH_REFERENCE_LIST::SortByYCoordinate ( )
inline

Sort the list of references by Y position.

Symbols are sorted as follows:

  • Numeric value of reference designator.
  • Sheet number.
  • Y coordinate position.
  • X coordinate position.
  • Time stamp.

Definition at line 571 of file sch_reference_list.h.

References m_flatList, and sortByYPosition().

Referenced by AnnotateByOptions().

◆ sortByYPosition()

bool SCH_REFERENCE_LIST::sortByYPosition ( const SCH_REFERENCE & item1,
const SCH_REFERENCE & item2 )
staticprivate

◆ SplitReferences()

void SCH_REFERENCE_LIST::SplitReferences ( )
inline

Attempt to split all reference designators into a name (U) and number (1).

If the last character is '?' or not a digit, the reference is tagged as not annotated. For symbols with multiple parts, keeps the unit number intact

See also
SCH_REFERENCE::Split()

Definition at line 396 of file sch_reference_list.h.

References GetCount(), and m_flatList.

Referenced by AnnotateReferences(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CheckAnnotation(), SCH_EDITOR_CONTROL::IncrementAnnotations(), and ReannotateByOptions().

◆ UpdateAnnotation()

void SCH_REFERENCE_LIST::UpdateAnnotation ( )
inline

Update the symbol references for the schematic project (or the current sheet).

Note
This function does not calculate the reference numbers stored in m_numRef so it must be called after calculation of new reference numbers.
See also
SCH_REFERENCE::Annotate()

Definition at line 449 of file sch_reference_list.h.

References Annotate(), GetCount(), and m_flatList.

Referenced by AnnotateNewSymbol(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ UseReusedSheetRepresentatives()

void SCH_REFERENCE_LIST::UseReusedSheetRepresentatives ( const SCH_SHEET_LIST & aSheets)

Replace the references of each reused sheet symbol with one reference on the first instance of its sheet in aSheets, which carries the base every instance shares in suffix mode.

Definition at line 267 of file sch_reference_list.cpp.

References AddItem(), m_flatList, path, SCH_REFERENCE_LIST(), sharesReusedBase(), and SYMBOL_FILTER_ALL.

Referenced by AnnotateReferences().

Friends And Related Symbol Documentation

◆ BACK_ANNOTATE

friend class BACK_ANNOTATE
friend

Definition at line 710 of file sch_reference_list.h.

References BACK_ANNOTATE.

Referenced by BACK_ANNOTATE.

◆ BACK_ANNOTATION

friend class BACK_ANNOTATION
friend

Definition at line 679 of file sch_reference_list.h.

References BACK_ANNOTATION.

Referenced by BACK_ANNOTATION.

Member Data Documentation

◆ m_flatList

◆ m_refDesTracker

std::shared_ptr<REFDES_TRACKER> SCH_REFERENCE_LIST::m_refDesTracker
private

A list of previously used reference designators.

Definition at line 714 of file sch_reference_list.h.

Referenced by Annotate(), FindFirstUnusedReference(), GetRefDesTracker(), and SetRefDesTracker().


The documentation for this class was generated from the following files: