26 #ifndef _SCH_REFERENCE_LIST_H_ 27 #define _SCH_REFERENCE_LIST_H_ 248 for(
unsigned ii = 0; ii <
GetCount(); ii++ )
263 for(
unsigned ii = 0; ii <
GetCount(); ii++ )
284 void Annotate(
bool aUseSheetNum,
int aSheetIntervalId,
int aStartNumber,
386 int FindRef(
const wxString& aPath )
const;
396 int FindUnit(
size_t aIndex,
int aUnit );
414 void GetRefsInUse(
int aIndex, std::vector< int >& aIdList,
int aMinRefId );
426 void Show(
const char* aPrefix =
"" )
428 printf(
"%s\n", aPrefix );
430 for(
unsigned i=0; i <
flatList.size(); ++i )
434 printf(
" [%-2d] ref:%-8s num:%-3d lib_part:%s\n",
447 static wxString
Shorthand( std::vector<SCH_REFERENCE> aList );
480 #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
void RemoveItem(unsigned int aIndex)
Remove an item from the list of references.
wxString GetName() const override
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.
const SCH_SHEET_PATH & GetSheetPath() const
wxPoint m_symbolPos
The physical position of the symbol in schematic.
KIID_PATH Path() const
Get the sheet path as an KIID_PATH.
int m_sheetNum
The sheet number for the reference.
void AddItem(SCH_REFERENCE &aItem)
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.
const wxString GetPath() const
wxString GetRefNumber() 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.
void SetRefStr(const std::string &aReference)
const char * c_str() const
void GetRefsInUse(int aIndex, std::vector< int > &aIdList, int aMinRefId)
Add all the reference designator numbers greater than aMinRefId to aIdList skipping the reference at ...
int m_unit
The unit number for symbol with multiple parts.
#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 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 the current object state.
KIID m_symbolUuid
UUID of the symbol.
Define a library symbol object.
const wxString GetFootprint() const
void Annotate(bool aUseSheetNum, int aSheetIntervalId, int aStartNumber, SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap)
Set the reference designators in the list that have not been annotated.
int FindUnit(size_t aIndex, int aUnit)
Search the sorted list of symbols for a another symbol with the same reference and a given part unit.
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...
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.
SCH_COMPONENT * GetSymbol() const
unsigned GetCount() const
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)
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.
LIB_PART * GetLibPart() const
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)
static wxString SubReference(int aUnit, bool aAddSeparator=true)
LIB_PART * m_libPart
The source symbol from a library.
int CreateFirstFreeRefId(std::vector< int > &aIdList, int aFirstValue)
Search for the first free reference number in aListId of reference numbers in use.
void SetRef(const wxString &aReference)
SCH_COMPONENT * m_rootSymbol
The symbol associated the reference object.
const wxString GetValue() const
void SetValue(const wxString &aValue)
std::vector< SCH_REFERENCE > flatList
int GetLastReference(int aIndex, int aMinValue)
Return the last used (greatest) reference number in the reference list for the prefix used by the sym...
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
const LIB_ID & GetLibId() const
bool UnitsLocked() const
Check whether part units are interchangeable.
A helper to define a symbol's reference designator in a schematic.
static bool sortByXPosition(const SCH_REFERENCE &item1, const SCH_REFERENCE &item2)