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, 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) |
bool | IsMultiUnit () const |
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 |
const wxString | GetFullPath () const |
bool | operator< (const SCH_REFERENCE &aRef) const |
Compare by full path to make std::set work. | |
void | Annotate () |
Update the annotation of the symbol according the current object state. | |
bool | AlwaysAnnotate () const |
Verify the reference should always be automatically annotated. | |
void | Split () |
Attempt to split the reference designator into a name (U) and number (1). | |
bool | IsSplitNeeded () |
Determine if this reference needs to be split or if it likely already has been. | |
void | SetRef (const wxString &aReference) |
wxString | GetRef () const |
void | SetRefStr (const std::string &aReference) |
const char * | GetRefStr () const |
wxString | GetFullRef (bool aIncludeUnit=true) const |
Return reference name with unit altogether. | |
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. | |
bool | IsUnitsLocked () |
void | SetRefNum (int aNum) |
Private Member Functions | |
wxString | formatRefStr (int aNumber) const |
Private Attributes | |
wxString | m_ref |
Symbol reference prefix, without number (for IC1, this is IC) ) | |
SCH_SYMBOL * | m_rootSymbol |
The symbol associated the reference object. | |
VECTOR2I | m_symbolPos |
The physical position of the symbol in schematic used to annotate by X or Y position. | |
int | m_unit |
The unit number for symbol with multiple parts per package. | |
wxString | m_value |
The symbol value. | |
wxString | m_footprint |
The footprint assigned. | |
SCH_SHEET_PATH | m_sheetPath |
The sheet path for this reference. | |
bool | m_isNew |
True if not yet annotated. | |
int | m_sheetNum |
The sheet number for the reference. | |
KIID | m_symbolUuid |
UUID of the symbol. | |
int | m_numRef |
The numeric part of the reference designator. | |
wxString | m_numRefStr |
The numeric part in original string form (may have leading zeroes). | |
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 77 of file sch_reference_list.h.
|
inline |
Definition at line 80 of file sch_reference_list.h.
References m_flag, m_isNew, m_numRef, m_rootSymbol, m_sheetNum, and m_unit.
SCH_REFERENCE::SCH_REFERENCE | ( | SCH_SYMBOL * | aSymbol, |
const SCH_SHEET_PATH & | aSheetPath | ||
) |
Definition at line 746 of file sch_reference_list.cpp.
References SCH_SYMBOL::GetFootprintFieldText(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetUnitSelection(), SCH_SYMBOL::GetValue(), m_flag, m_footprint, m_isNew, m_numRef, m_rootSymbol, m_sheetNum, m_sheetPath, m_symbolPos, m_symbolUuid, m_unit, EDA_ITEM::m_Uuid, m_value, SCH_SYMBOL::SetRef(), SetRef(), and SCH_SYMBOL::SetValueFieldText().
bool SCH_REFERENCE::AlwaysAnnotate | ( | ) | const |
Verify the reference should always be automatically annotated.
Definition at line 788 of file sch_reference_list.cpp.
References SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetRef(), m_rootSymbol, and m_sheetPath.
Referenced by SCH_DRAWING_TOOLS::PlaceSymbol().
void SCH_REFERENCE::Annotate | ( | ) |
Update the annotation of the symbol according the current object state.
Definition at line 775 of file sch_reference_list.cpp.
References From_UTF8(), GetRef(), GetRefNumber(), m_numRef, m_ref, m_rootSymbol, m_sheetPath, m_unit, SCH_SYMBOL::SetRef(), SCH_ITEM::SetUnit(), SCH_SYMBOL::SetUnitSelection(), and TO_UTF8.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols().
|
inline |
Definition at line 201 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 196 of file sch_reference_list.h.
References m_ref.
Referenced by SCH_REFERENCE_LIST::CheckAnnotation(), SCH_REFERENCE_LIST::sortByRefAndValue(), SCH_REFERENCE_LIST::sortByXPosition(), and SCH_REFERENCE_LIST::sortByYPosition().
|
inline |
Definition at line 191 of file sch_reference_list.h.
References m_value.
Referenced by SCH_REFERENCE_LIST::Annotate(), SCH_REFERENCE_LIST::CheckAnnotation(), and SCH_REFERENCE_LIST::sortByRefAndValue().
|
private |
Definition at line 912 of file sch_reference_list.cpp.
References GetLibPart(), and GetSymbol().
Referenced by SetRefNum().
|
inline |
Definition at line 108 of file sch_reference_list.h.
References m_footprint.
Referenced by BACK_ANNOTATE::applyChangelist(), and ERC_TESTER::TestMultiunitFootprints().
|
inline |
Definition at line 124 of file sch_reference_list.h.
References KIID::AsString(), m_sheetPath, m_symbolUuid, and SCH_SHEET_PATH::PathAsString().
Referenced by operator<().
|
inline |
Return reference name with unit altogether.
Definition at line 170 of file sch_reference_list.h.
References GetRef(), GetSymbol(), GetUnit(), m_numRef, m_numRefStr, and SCH_SYMBOL::SubReference().
Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::RebuildRows().
|
inline |
Definition at line 95 of file sch_reference_list.h.
References SCH_SYMBOL::GetLibSymbolRef(), and m_rootSymbol.
Referenced by SCH_REFERENCE_LIST::CheckAnnotation(), formatRefStr(), IsMultiUnit(), IsUnitsLocked(), and ERC_TESTER::TestMissingUnits().
|
inline |
Definition at line 116 of file sch_reference_list.h.
References m_sheetPath, and SCH_SHEET_PATH::PathAsString().
|
inline |
Definition at line 164 of file sch_reference_list.h.
References m_ref.
Referenced by Annotate(), SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_SHEET_PATH::AppendMultiUnitSymbol(), BACK_ANNOTATE::applyChangelist(), buildFullReference(), SCH_REFERENCE_LIST::CheckAnnotation(), CollectOtherUnits(), findSymbolsAndPins(), GetFullRef(), REFDES_TRACKER::GetNextRefDesForUnits(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), SCH_EDITOR_CONTROL::IncrementAnnotations(), sheetContainsOnlyWantedItems(), SCH_REFERENCE_LIST::sortByReferenceOnly(), and FIELDS_EDITOR_GRID_DATA_MODEL::unitMatch().
|
inline |
Definition at line 183 of file sch_reference_list.h.
References m_numRef, and m_numRefStr.
Referenced by Annotate(), buildFullReference(), findSymbolsAndPins(), SCH_EDITOR_CONTROL::IncrementAnnotations(), sheetContainsOnlyWantedItems(), and FIELDS_EDITOR_GRID_DATA_MODEL::unitMatch().
|
inline |
Definition at line 167 of file sch_reference_list.h.
References m_ref.
Referenced by REFDES_TRACKER::GetNextRefDesForUnits(), IsSplitNeeded(), and Split().
|
inline |
Definition at line 99 of file sch_reference_list.h.
References m_sheetPath.
|
inline |
Definition at line 97 of file sch_reference_list.h.
References m_sheetPath.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), BACK_ANNOTATE::applyChangelist(), DIALOG_TABLE_PROPERTIES::getContextualTextVars(), DIALOG_TABLECELL_PROPERTIES::getContextualTextVars(), DIALOG_TEXT_PROPERTIES::getContextualTextVars(), FIELDS_EDITOR_GRID_DATA_MODEL::getFieldShownText(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), DIALOG_EDIT_SYMBOLS_LIBID::initDlg(), IsSameInstance(), DIALOG_ERC::OnRunERCClick(), SCH_REFERENCE_LIST::ReannotateByOptions(), FIELDS_EDITOR_GRID_DATA_MODEL::RebuildRows(), ERC_TESTER::TestMissingUnits(), and ERC_TESTER::TestMultiunitFootprints().
|
inline |
Definition at line 93 of file sch_reference_list.h.
References m_rootSymbol.
Referenced by SCH_EDIT_FRAME::AnnotateSymbols(), BACK_ANNOTATE::applyChangelist(), SCH_REFERENCE_LIST::CheckAnnotation(), BACK_ANNOTATE::checkForUnusedSymbols(), CollectOtherUnits(), findSymbolsAndPins(), formatRefStr(), DIALOG_TABLE_PROPERTIES::getContextualTextVars(), DIALOG_TABLECELL_PROPERTIES::getContextualTextVars(), DIALOG_TEXT_PROPERTIES::getContextualTextVars(), FIELDS_EDITOR_GRID_DATA_MODEL::getFieldShownText(), GetFullRef(), DIALOG_SYMBOL_FIELDS_TABLE::getSymbolReferences(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), FIELDS_EDITOR_GRID_DATA_MODEL::groupMatch(), DIALOG_EDIT_SYMBOLS_LIBID::initDlg(), IsSameInstance(), DIALOG_ERC::OnRunERCClick(), SCH_REFERENCE_LIST::ReannotateByOptions(), FIELDS_EDITOR_GRID_DATA_MODEL::RebuildRows(), FIELDS_EDITOR_GRID_DATA_MODEL::SetValue(), ERC_TESTER::TestMissingUnits(), and ERC_TESTER::TestMultiunitFootprints().
|
inline |
Definition at line 101 of file sch_reference_list.h.
References m_unit.
Referenced by buildFullReference(), SCH_REFERENCE_LIST::CheckAnnotation(), CollectOtherUnits(), findSymbolsAndPins(), GetFullRef(), SCH_DRAWING_TOOLS::PlaceSymbol(), and ERC_TESTER::TestMissingUnits().
|
inline |
Definition at line 105 of file sch_reference_list.h.
References m_value.
Referenced by BACK_ANNOTATE::applyChangelist().
|
inline |
Definition at line 103 of file sch_reference_list.h.
References GetLibPart(), and LIB_SYMBOL::GetUnitCount().
Referenced by FIELDS_EDITOR_GRID_DATA_MODEL::RebuildRows().
|
inline |
Return whether this reference refers to the same symbol instance (symbol and sheet) as another.
Definition at line 211 of file sch_reference_list.h.
References GetSheetPath(), GetSymbol(), and SCH_SHEET_PATH::Path().
Referenced by SCH_REFERENCE_LIST::Annotate().
bool SCH_REFERENCE::IsSplitNeeded | ( | ) |
Determine if this reference needs to be split or if it likely already has been.
Definition at line 848 of file sch_reference_list.cpp.
References GetRefStr().
Referenced by findSymbolsAndPins(), SCH_EDITOR_CONTROL::IncrementAnnotations(), and sheetContainsOnlyWantedItems().
|
inline |
Definition at line 220 of file sch_reference_list.h.
References GetLibPart(), and LIB_SYMBOL::UnitsLocked().
|
inline |
Compare by full path to make std::set work.
Definition at line 132 of file sch_reference_list.h.
References GetFullPath().
|
inline |
Definition at line 109 of file sch_reference_list.h.
References m_footprint.
|
inline |
Definition at line 163 of file sch_reference_list.h.
References m_ref.
Referenced by SCH_SHEET_LIST::AnnotatePowerSymbols(), TEST_REFDES_TRACKER_UNITS::createTestReference(), TEST_ANNOTATION_UNITS_CONFLICTS::createTestReference(), TEST_ANNOTATION_UNITS_INTEGRATION::createTestReference(), SCH_EDITOR_CONTROL::IncrementAnnotations(), and SCH_REFERENCE().
|
inline |
Definition at line 228 of file sch_reference_list.h.
References formatRefStr(), m_numRef, and m_numRefStr.
Referenced by SCH_SHEET_LIST::AnnotatePowerSymbols().
|
inline |
|
inline |
Definition at line 111 of file sch_reference_list.h.
References m_sheetNum.
Referenced by SCH_SHEET_PATH::AppendMultiUnitSymbol(), SCH_SHEET_PATH::AppendSymbol(), SCH_EDITOR_CONTROL::Paste(), and SCH_REFERENCE_LIST::ReannotateByOptions().
|
inline |
Definition at line 102 of file sch_reference_list.h.
References m_unit.
Referenced by TEST_REFDES_TRACKER_UNITS::createTestReference(), TEST_ANNOTATION_UNITS_CONFLICTS::createTestReference(), TEST_ANNOTATION_UNITS_INTEGRATION::createTestReference(), and SCH_DRAWING_TOOLS::PlaceSymbol().
|
inline |
Definition at line 106 of file sch_reference_list.h.
References m_value.
Referenced by TEST_REFDES_TRACKER_UNITS::createTestReference(), TEST_ANNOTATION_UNITS_CONFLICTS::createTestReference(), and TEST_ANNOTATION_UNITS_INTEGRATION::createTestReference().
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 798 of file sch_reference_list.cpp.
References GetRefStr(), m_isNew, m_numRef, m_numRefStr, and SetRefStr().
Referenced by SCH_REFERENCE_LIST::Annotate(), findSymbolsAndPins(), DIALOG_SYMBOL_FIELDS_TABLE::getSymbolReferences(), SCH_EDITOR_CONTROL::IncrementAnnotations(), and sheetContainsOnlyWantedItems().
|
friend |
Definition at line 238 of file sch_reference_list.h.
|
private |
Definition at line 256 of file sch_reference_list.h.
Referenced by SCH_REFERENCE().
|
private |
The footprint assigned.
Definition at line 248 of file sch_reference_list.h.
Referenced by GetFootprint(), SCH_REFERENCE(), and SetFootprint().
|
private |
True if not yet annotated.
Definition at line 250 of file sch_reference_list.h.
Referenced by SCH_REFERENCE_LIST::Annotate(), SCH_REFERENCE_LIST::ReannotateByOptions(), SCH_REFERENCE(), and Split().
|
private |
The numeric part of the reference designator.
Definition at line 253 of file sch_reference_list.h.
Referenced by Annotate(), SCH_REFERENCE_LIST::CheckAnnotation(), GetFullRef(), GetRefNumber(), SCH_REFERENCE_LIST::GetUnitsMatchingRef(), SCH_REFERENCE(), SetRefNum(), and Split().
|
private |
The numeric part in original string form (may have leading zeroes).
Definition at line 254 of file sch_reference_list.h.
Referenced by SCH_REFERENCE_LIST::CheckAnnotation(), GetFullRef(), GetRefNumber(), SetRefNum(), and Split().
|
private |
Symbol reference prefix, without number (for IC1, this is IC) )
Definition at line 241 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 242 of file sch_reference_list.h.
Referenced by AlwaysAnnotate(), Annotate(), CompareLibName(), GetLibPart(), GetSymbol(), and SCH_REFERENCE().
|
private |
The sheet number for the reference.
Definition at line 251 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 249 of file sch_reference_list.h.
Referenced by AlwaysAnnotate(), Annotate(), GetFullPath(), 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 243 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 252 of file sch_reference_list.h.
Referenced by GetFullPath(), 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 245 of file sch_reference_list.h.
Referenced by Annotate(), SCH_REFERENCE_LIST::Annotate(), SCH_REFERENCE_LIST::CheckAnnotation(), GetUnit(), SCH_REFERENCE_LIST::GetUnitsMatchingRef(), SCH_REFERENCE(), SetUnit(), SCH_REFERENCE_LIST::sortByRefAndValue(), and SCH_REFERENCE_LIST::sortByReferenceOnly().
|
private |
The symbol value.
Definition at line 247 of file sch_reference_list.h.
Referenced by SCH_REFERENCE_LIST::CheckAnnotation(), CompareValue(), GetValue(), SCH_REFERENCE(), and SetValue().