![]() |
KiCad PCB EDA Suite
|
A helper to define a symbol's reference designator in a schematic. More...
#include <sch_reference_list.h>
Public Member Functions | |
SCH_REFERENCE () | |
SCH_REFERENCE (SCH_SYMBOL *aSymbol, LIB_SYMBOL *aLibSymbol, const SCH_SHEET_PATH &aSheetPath) | |
SCH_SYMBOL * | GetSymbol () const |
LIB_SYMBOL * | GetLibPart () const |
const SCH_SHEET_PATH & | GetSheetPath () const |
SCH_SHEET_PATH & | GetSheetPath () |
int | GetUnit () const |
void | SetUnit (int aUnit) |
const wxString | GetValue () const |
void | SetValue (const wxString &aValue) |
const wxString | GetFootprint () const |
void | SetFootprint (const wxString &aFP) |
void | SetSheetNumber (int aSheetNumber) |
const wxString | GetPath () const |
void | Annotate () |
Update the annotation of the symbol according the current object state. More... | |
void | Split () |
Attempt to split the reference designator into a name (U) and number (1). More... | |
void | SetRef (const wxString &aReference) |
wxString | GetRef () const |
void | SetRefStr (const std::string &aReference) |
const char * | GetRefStr () const |
Return reference name with unit altogether. More... | |
wxString | GetFullRef () const |
wxString | GetRefNumber () const |
int | CompareValue (const SCH_REFERENCE &item) const |
int | CompareRef (const SCH_REFERENCE &item) const |
int | CompareLibName (const SCH_REFERENCE &item) const |
bool | IsSameInstance (const SCH_REFERENCE &other) const |
Return whether this reference refers to the same symbol instance (symbol and sheet) as another. More... | |
bool | IsUnitsLocked () |
Private Attributes | |
UTF8 | m_ref |
Symbol reference prefix, without number (for IC1, this is IC) ) More... | |
SCH_SYMBOL * | m_rootSymbol |
The symbol associated the reference object. More... | |
LIB_SYMBOL * | m_libPart |
The source symbol from a library. More... | |
wxPoint | m_symbolPos |
The physical position of the symbol in schematic used to annotate by X or Y position. More... | |
int | m_unit |
The unit number for symbol with multiple parts per package. More... | |
wxString | m_value |
The symbol value. More... | |
wxString | m_footprint |
The footprint assigned. More... | |
SCH_SHEET_PATH | m_sheetPath |
The sheet path for this reference. More... | |
bool | m_isNew |
True if not yet annotated. More... | |
int | m_sheetNum |
The sheet number for the reference. More... | |
KIID | m_symbolUuid |
UUID of the symbol. More... | |
int | m_numRef |
The numeric part of the reference designator. More... | |
int | m_flag |
Friends | |
class | SCH_REFERENCE_LIST |
A helper to define a symbol's reference designator in a schematic.
This helper is required in a complex hierarchy because a symbol can be used more than once and its reference depends on the sheet path. This class is used to flatten the schematic hierarchy for annotation, net list generation, and bill of material generation.
Definition at line 45 of file sch_reference_list.h.
|
inline |
Definition at line 48 of file sch_reference_list.h.
References m_flag, m_isNew, m_libPart, m_numRef, m_rootSymbol, m_sheetNum, and m_unit.
SCH_REFERENCE::SCH_REFERENCE | ( | SCH_SYMBOL * | aSymbol, |
LIB_SYMBOL * | aLibSymbol, | ||
const SCH_SHEET_PATH & | aSheetPath | ||
) |
Definition at line 736 of file component_references_lister.cpp.
References SCH_SYMBOL::GetFootprint(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetUnitSelection(), SCH_SYMBOL::GetValue(), m_flag, m_footprint, m_isNew, m_libPart, m_numRef, m_rootSymbol, m_sheetNum, m_sheetPath, m_symbolPos, m_symbolUuid, m_unit, EDA_ITEM::m_Uuid, m_value, SetRef(), SCH_SYMBOL::SetRef(), and SCH_SYMBOL::SetValue().
void SCH_REFERENCE::Annotate | ( | ) |
Update the annotation of the symbol according the current object state.
Definition at line 768 of file component_references_lister.cpp.
References UTF8::c_str(), FROM_UTF8(), GetRef(), GetRefNumber(), m_numRef, m_ref, m_rootSymbol, m_sheetPath, m_unit, SCH_SYMBOL::SetRef(), SCH_SYMBOL::SetUnit(), SCH_SYMBOL::SetUnitSelection(), and TO_UTF8.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols().
|
inline |
Definition at line 140 of file sch_reference_list.h.
References UTF8::compare(), SCH_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), and m_rootSymbol.
Referenced by SCH_REFERENCE_LIST::Annotate().
|
inline |
Definition at line 135 of file sch_reference_list.h.
References UTF8::compare(), and m_ref.
Referenced by SCH_REFERENCE_LIST::sortByRefAndValue(), SCH_REFERENCE_LIST::sortByXPosition(), and SCH_REFERENCE_LIST::sortByYPosition().
|
inline |
Definition at line 130 of file sch_reference_list.h.
References m_value.
Referenced by SCH_REFERENCE_LIST::Annotate(), and SCH_REFERENCE_LIST::sortByRefAndValue().
|
inline |
Definition at line 76 of file sch_reference_list.h.
References m_footprint.
Referenced by BACK_ANNOTATE::applyChangelist(), and ERC_TESTER::TestMultiunitFootprints().
|
inline |
Definition at line 107 of file sch_reference_list.h.
References GetRef(), GetSymbol(), GetUnit(), and LIB_SYMBOL::SubReference().
|
inline |
Definition at line 64 of file sch_reference_list.h.
References m_libPart.
Referenced by GetRefNumber().
|
inline |
Definition at line 81 of file sch_reference_list.h.
References KIID::AsString(), m_rootSymbol, m_sheetPath, EDA_ITEM::m_Uuid, and SCH_SHEET_PATH::PathAsString().
|
inline |
Definition at line 101 of file sch_reference_list.h.
References m_ref.
Referenced by Annotate(), SCH_SHEET_PATH::AppendMultiUnitSymbol(), BACK_ANNOTATE::applyChangelist(), buildFullReference(), CollectOtherUnits(), GetFullRef(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), SCH_REFERENCE_LIST::sortByReferenceOnly(), and FIELDS_EDITOR_GRID_DATA_MODEL::unitMatch().
|
inline |
Definition at line 115 of file sch_reference_list.h.
References GetLibPart(), and m_numRef.
Referenced by Annotate(), buildFullReference(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), and FIELDS_EDITOR_GRID_DATA_MODEL::unitMatch().
|
inline |
Return reference name with unit altogether.
Definition at line 104 of file sch_reference_list.h.
References UTF8::c_str(), and m_ref.
Referenced by Split().
|
inline |
Definition at line 66 of file sch_reference_list.h.
References m_sheetPath.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), BACK_ANNOTATE::applyChangelist(), DIALOG_EDIT_SYMBOLS_LIBID::initDlg(), IsSameInstance(), DIALOG_ERC::OnRunERCClick(), SCH_REFERENCE_LIST::ReannotateDuplicates(), and ERC_TESTER::TestMultiunitFootprints().
|
inline |
Definition at line 68 of file sch_reference_list.h.
References m_sheetPath.
|
inline |
Definition at line 62 of file sch_reference_list.h.
References m_rootSymbol.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), BACK_ANNOTATE::applyChangelist(), BACK_ANNOTATE::checkForUnusedSymbols(), CollectOtherUnits(), GetFullRef(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), DIALOG_EDIT_SYMBOLS_LIBID::initDlg(), IsSameInstance(), DIALOG_ERC::OnRunERCClick(), SCH_REFERENCE_LIST::ReannotateDuplicates(), and ERC_TESTER::TestMultiunitFootprints().
|
inline |
Definition at line 70 of file sch_reference_list.h.
References m_unit.
Referenced by buildFullReference(), CollectOtherUnits(), and GetFullRef().
|
inline |
Definition at line 73 of file sch_reference_list.h.
References m_value.
Referenced by BACK_ANNOTATE::applyChangelist().
|
inline |
Return whether this reference refers to the same symbol instance (symbol and sheet) as another.
Definition at line 150 of file sch_reference_list.h.
References GetSheetPath(), GetSymbol(), and SCH_SHEET_PATH::Path().
Referenced by SCH_REFERENCE_LIST::Annotate().
|
inline |
Definition at line 159 of file sch_reference_list.h.
References m_libPart, and LIB_SYMBOL::UnitsLocked().
|
inline |
Definition at line 77 of file sch_reference_list.h.
References m_footprint.
|
inline |
Definition at line 100 of file sch_reference_list.h.
References m_ref.
Referenced by SCH_REFERENCE().
|
inline |
Definition at line 103 of file sch_reference_list.h.
References m_ref.
Referenced by Split().
|
inline |
Definition at line 79 of file sch_reference_list.h.
References m_sheetNum.
Referenced by SCH_SHEET_PATH::AppendMultiUnitSymbol(), SCH_SHEET_PATH::AppendSymbol(), and SCH_EDITOR_CONTROL::Paste().
|
inline |
Definition at line 71 of file sch_reference_list.h.
References m_unit.
|
inline |
void SCH_REFERENCE::Split | ( | ) |
Attempt to split the reference designator 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 per package that are not already annotated, keeps the unit number the same. E.g. U?A or U?B
Definition at line 781 of file component_references_lister.cpp.
References GetRefStr(), m_isNew, m_numRef, and SetRefStr().
Referenced by SCH_REFERENCE_LIST::Annotate().
|
friend |
Definition at line 168 of file sch_reference_list.h.
|
private |
Definition at line 185 of file sch_reference_list.h.
Referenced by SCH_REFERENCE().
|
private |
The footprint assigned.
Definition at line 179 of file sch_reference_list.h.
Referenced by GetFootprint(), SCH_REFERENCE(), and SetFootprint().
|
private |
True if not yet annotated.
Definition at line 181 of file sch_reference_list.h.
Referenced by SCH_REFERENCE_LIST::Annotate(), SCH_REFERENCE_LIST::ReannotateDuplicates(), SCH_REFERENCE(), and Split().
|
private |
The source symbol from a library.
Definition at line 173 of file sch_reference_list.h.
Referenced by GetLibPart(), IsUnitsLocked(), and SCH_REFERENCE().
|
private |
The numeric part of the reference designator.
Definition at line 184 of file sch_reference_list.h.
Referenced by Annotate(), GetRefNumber(), SCH_REFERENCE(), and Split().
|
private |
Symbol reference prefix, without number (for IC1, this is IC) )
Definition at line 171 of file sch_reference_list.h.
Referenced by Annotate(), CompareRef(), GetRef(), GetRefStr(), SetRef(), and SetRefStr().
|
private |
The symbol associated the reference object.
Definition at line 172 of file sch_reference_list.h.
Referenced by Annotate(), CompareLibName(), GetPath(), GetSymbol(), and SCH_REFERENCE().
|
private |
The sheet number for the reference.
Definition at line 182 of file sch_reference_list.h.
Referenced by SCH_REFERENCE(), SetSheetNumber(), SCH_REFERENCE_LIST::sortByRefAndValue(), SCH_REFERENCE_LIST::sortByXPosition(), and SCH_REFERENCE_LIST::sortByYPosition().
|
private |
The sheet path for this reference.
Definition at line 180 of file sch_reference_list.h.
Referenced by Annotate(), GetPath(), GetSheetPath(), SCH_REFERENCE(), and SCH_REFERENCE_LIST::sortByTimeStamp().
|
private |
The physical position of the symbol in schematic used to annotate by X or Y position.
Definition at line 174 of file sch_reference_list.h.
Referenced by SCH_REFERENCE(), SCH_REFERENCE_LIST::sortByRefAndValue(), SCH_REFERENCE_LIST::sortByXPosition(), and SCH_REFERENCE_LIST::sortByYPosition().
|
private |
UUID of the symbol.
Definition at line 183 of file sch_reference_list.h.
Referenced by SCH_REFERENCE(), SCH_REFERENCE_LIST::sortByRefAndValue(), SCH_REFERENCE_LIST::sortByReferenceOnly(), SCH_REFERENCE_LIST::sortByTimeStamp(), SCH_REFERENCE_LIST::sortByXPosition(), and SCH_REFERENCE_LIST::sortByYPosition().
|
private |
The unit number for symbol with multiple parts per package.
Definition at line 176 of file sch_reference_list.h.
Referenced by Annotate(), SCH_REFERENCE_LIST::Annotate(), GetUnit(), SCH_REFERENCE(), SetUnit(), SCH_REFERENCE_LIST::sortByRefAndValue(), and SCH_REFERENCE_LIST::sortByReferenceOnly().
|
private |
The symbol value.
Definition at line 178 of file sch_reference_list.h.
Referenced by CompareValue(), GetValue(), SCH_REFERENCE(), and SetValue().