26 #ifndef _SCH_REFERENCE_LIST_H_ 27 #define _SCH_REFERENCE_LIST_H_ 268 for(
unsigned ii = 0; ii <
GetCount(); ii++ )
283 for(
unsigned ii = 0; ii <
GetCount(); ii++ )
316 void Annotate(
bool aUseSheetNum,
int aSheetIntervalId,
int aStartNumber,
405 int FindRef(
const wxString& aPath )
const;
415 int FindUnit(
size_t aIndex,
int aUnit )
const;
433 void GetRefsInUse(
int aIndex, std::vector< int >& aIdList,
int aMinRefId )
const;
447 void Show(
const char* aPrefix =
"" )
449 printf(
"%s\n", aPrefix );
451 for(
unsigned i=0; i <
flatList.size(); ++i )
455 printf(
" [%-2d] ref:%-8s num:%-3d lib_part:%s\n",
468 static wxString
Shorthand( std::vector<SCH_REFERENCE> aList );
501 #endif // _SCH_REFERENCE_LIST_H_ An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
void SetSheetNumber(int aSheetNumber)
static bool sortByTimeStamp(const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
void SortByYCoordinate()
Sort the list of references by Y position.
SCH_REFERENCE & GetItem(int aIdx)
int compare(const std::string &s) const
const UTF8 & GetLibItemName() const
const SCH_REFERENCE & operator[](int aIndex) const
void RemoveItem(unsigned int aIndex)
Remove an item from the list of references.
void Split()
Attempt to split the reference designator into a name (U) and number (1).
int FindRefByPath(const wxString &aPath) const
Search the list for a symbol with the given KIID path.
LIB_SYMBOL * m_libPart
The source symbol from a library.
const SCH_SHEET_PATH & GetSheetPath() const
wxString GetName() const override
void ReannotateDuplicates(const SCH_REFERENCE_LIST &aAdditionalReferences)
Replace any duplicate reference designators with the next available number after the present number.
wxPoint m_symbolPos
The physical position of the symbol in schematic used to annotate by X or Y position.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
int m_sheetNum
The sheet number for the reference.
std::vector< SYMBOL_INSTANCE_REFERENCE > GetSymbolInstances() const
wxString AsString() const
wxString PathAsString() const
Return the path of time stamps which do not changes even when editing sheet parameters.
static wxString Shorthand(std::vector< SCH_REFERENCE > aList)
Return a shorthand string representing all the references in the list.
void AddItem(const SCH_REFERENCE &aItem)
static wxString SubReference(int aUnit, bool aAddSeparator=true)
const wxString GetPath() const
SCH_SYMBOL * GetSymbol() const
wxString GetRefNumber() const
Define a library symbol object.
int GetLastReference(int aIndex, int aMinValue) const
Return the last used (greatest) reference number in the reference list for the prefix used by the sym...
const SCH_REFERENCE & GetItem(int aIdx) const
void SortByRefAndValue()
Sort the list of references by value.
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
int FindRef(const wxString &aPath) const
Search the list for a symbol with a given reference.
This file contains miscellaneous commonly used macros and functions.
void SetRefStr(const std::string &aReference)
const char * c_str() const
int FindUnit(size_t aIndex, int aUnit) const
Search the sorted list of symbols for a another symbol with the same reference and a given part unit.
int m_unit
The unit number for symbol with multiple parts per package.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
void UpdateAnnotation()
Update the symbol references for the schematic project (or the current sheet).
void SortByTimeStamp()
Sort the flat list by Time Stamp (sheet path + timestamp).
friend class BACK_ANNOTATION
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 ...
void SortByXCoordinate()
Sort the list of references by X position.
int CompareValue(const SCH_REFERENCE &item) const
int CompareLibName(const SCH_REFERENCE &item) const
static bool sortByRefAndValue(const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
bool m_isNew
True if not yet annotated.
wxString m_footprint
The footprint assigned.
void Annotate()
Update the annotation of the symbol according the current object state.
KIID m_symbolUuid
UUID of the symbol.
wxString GetFullRef() const
const wxString GetFootprint() const
SCH_SHEET_PATH & GetSheetPath()
static bool sortByYPosition(const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool Contains(const SCH_REFERENCE &aItem)
Return true if aItem exists in this list.
wxString m_value
The symbol value.
static bool sortByReferenceOnly(const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
std::map< wxString, SCH_REFERENCE_LIST > SCH_MULTI_UNIT_REFERENCE_MAP
Container to map reference designators for multi-unit parts.
bool UnitsLocked() const
Check whether symbol units are interchangeable.
int CompareRef(const SCH_REFERENCE &item) const
UTF8 m_ref
Symbol reference prefix, without number (for IC1, this is IC) )
int CheckAnnotation(ANNOTATION_ERROR_HANDLER aErrorHandler)
Check for annotations errors.
SCH_REFERENCE & operator[](int aIndex)
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.
const char * GetRefStr() const
Return reference name with unit altogether.
SCH_SHEET_PATH m_sheetPath
The sheet path for this reference.
void SortByReferenceOnly()
Sort the list of references by reference.
void SplitReferences()
Attempt to split all reference designators into a name (U) and number (1).
int m_numRef
The numeric part of the reference designator.
std::function< void(ERCE_T aType, const wxString &aMsg, SCH_REFERENCE *aItemA, SCH_REFERENCE *aItemB)> ANNOTATION_ERROR_HANDLER
Define a standard error handler for annotation errors.
Back annotation algorithm class used to receive, check, and apply a NETLIST from Pcbnew.
bool IsSameInstance(const SCH_REFERENCE &other) const
Return whether this reference refers to the same symbol instance (symbol and sheet) as another.
void SetFootprint(const wxString &aFP)
int CreateFirstFreeRefId(std::vector< int > &aIdList, int aFirstValue)
Search for the first free reference number in aListId of reference numbers in use.
LIB_SYMBOL * GetLibPart() const
void SetRef(const wxString &aReference)
const wxString GetValue() const
void SetValue(const wxString &aValue)
std::vector< SCH_REFERENCE > flatList
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
SCH_SYMBOL * m_rootSymbol
The symbol associated the reference object.
A helper to define a symbol's reference designator in a schematic.
static bool sortByXPosition(const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)
const LIB_ID & GetLibId() const