|
KiCad PCB EDA Suite
|
functions to create a symbol flat list and to annotate schematic. More...
#include <sch_reference_list.h>#include <core/kicad_algo.h>#include <wx/regex.h>#include <algorithm>#include <map>#include <optional>#include <set>#include <vector>#include <unordered_set>#include <string_utils.h>#include <erc/erc_settings.h>#include <refdes_tracker.h>#include <sch_symbol.h>#include <schematic.h>#include <sch_edit_frame.h>Go to the source code of this file.
Functions | |
| static bool | sharesReusedBase (const SCH_REFERENCE &aRef) |
| static std::pair< const SCH_SYMBOL *, KIID_PATH > | packageMemberKey (const SCH_REFERENCE &aRef) |
| wxString | buildFullReference (const SCH_REFERENCE &aItem, int aUnitNumber=-1) |
| void | AnnotateNewSymbol (SCH_SYMBOL *aSymbol, const std::vector< SCH_SHEET_PATH > &aPaths, SCH_REFERENCE_LIST &aExistingRefs, const SCHEMATIC_SETTINGS &aSettings, SCH_SHEET_LIST *aHierarchy) |
| Annotate a newly placed symbol on each of aPaths in turn, avoiding aExistingRefs and adding the results to it. | |
| std::optional< std::pair< SCH_SHEET_PATH, SCH_SHEET_PATH > > | FindRefSuffixCollision (const SCH_REFERENCE_LIST &aRefs, const SCHEMATIC &aSchematic) |
| Find two instances of a reused sheet that aRefs reaches and that compose the same reference suffix. | |
| static void | removeUnitConflicts (SCH_MULTI_UNIT_REFERENCE_MAP &aLocked) |
| std::set< const SCH_SCREEN * > | AnnotateReferences (SCH_REFERENCE_LIST &aRefs, SCH_MULTI_UNIT_REFERENCE_MAP aLocked, const SCHEMATIC &aSchematic, ANNOTATE_SCOPE_T aScope, ANNOTATE_ORDER_T aSortOption, ANNOTATE_ALGO_T aAlgoOption, int aStartNumber, bool aResetAnnotation, const std::function< void(SCH_REFERENCE &)> &aBeforeAnnotate) |
| Annotate aRefs, the references in aScope, around every other symbol of aSchematic. | |
functions to create a symbol flat list and to annotate schematic.
Definition in file sch_reference_list.cpp.
| void AnnotateNewSymbol | ( | SCH_SYMBOL * | aSymbol, |
| const std::vector< SCH_SHEET_PATH > & | aPaths, | ||
| SCH_REFERENCE_LIST & | aExistingRefs, | ||
| const SCHEMATIC_SETTINGS & | aSettings, | ||
| SCH_SHEET_LIST * | aHierarchy ) |
Annotate a newly placed symbol on each of aPaths in turn, avoiding aExistingRefs and adding the results to it.
In suffix annotation mode the first path picks the base and the others share it.
Definition at line 1419 of file sch_reference_list.cpp.
References SCH_REFERENCE_LIST::AddItem(), SCH_REFERENCE_LIST::begin(), SCH_REFERENCE::CompareLibId(), SCH_REFERENCE::CompareValue(), end, SCH_SYMBOL::GetBaseRef(), SCH_REFERENCE_LIST::GetCount(), SCH_REFERENCE::GetUnit(), SCHEMATIC_SETTINGS::m_AnnotateMethod, SCHEMATIC_SETTINGS::m_AnnotateReusedSheetSuffixes, SCHEMATIC_SETTINGS::m_AnnotateSortOrder, SCHEMATIC_SETTINGS::m_AnnotateStartNum, SCHEMATIC_SETTINGS::m_refDesTracker, path, SCH_REFERENCE_LIST::ReannotateByOptions(), SCH_REFERENCE_LIST::SCH_REFERENCE_LIST(), SCH_SYMBOL::SetRef(), SCH_REFERENCE_LIST::SetRefDesTracker(), SCH_REFERENCE::SetUnit(), and SCH_REFERENCE_LIST::UpdateAnnotation().
Referenced by REF_SUFFIX_FIXTURE::AnnotatePlaced(), API_HANDLER_SCH::handlePlaceSymbolFromLibrary(), and SCH_DRAWING_TOOLS::PlaceSymbol().
| std::set< const SCH_SCREEN * > AnnotateReferences | ( | SCH_REFERENCE_LIST & | aRefs, |
| SCH_MULTI_UNIT_REFERENCE_MAP | aLocked, | ||
| const SCHEMATIC & | aSchematic, | ||
| ANNOTATE_SCOPE_T | aScope, | ||
| ANNOTATE_ORDER_T | aSortOption, | ||
| ANNOTATE_ALGO_T | aAlgoOption, | ||
| int | aStartNumber, | ||
| bool | aResetAnnotation, | ||
| const std::function< void(SCH_REFERENCE &)> & | aBeforeAnnotate = {} ) |
Annotate aRefs, the references in aScope, around every other symbol of aSchematic.
In suffix annotation mode each symbol of a reused sheet annotates on its first instance and every other instance takes that base. Check FindRefSuffixCollision() first, since instances that compose alike cannot share a base.
| aLocked | the multi-unit groups in scope that stay together, or none to regroup units. |
| aResetAnnotation | renumber every reference instead of only the unannotated ones. |
| aBeforeAnnotate | called with each reference before its symbol changes. |
Definition at line 1561 of file sch_reference_list.cpp.
References SCH_REFERENCE_LIST::AddItem(), ANNOTATE_ALL, SCH_REFERENCE_LIST::AnnotateByOptions(), SCH_REFERENCE_LIST::Contains(), SCHEMATIC::CopiesSelectDifferentUnits(), SCH_SHEET_LIST::GetSymbols(), SCHEMATIC::Hierarchy(), SCH_REFERENCE_LIST::LockedForRepresentatives(), SCHEMATIC_SETTINGS::m_AnnotateReusedSheetSuffixes, SCHEMATIC_SETTINGS::m_refDesTracker, SCH_REFERENCE_LIST::RemoveAnnotation(), removeUnitConflicts(), SCH_REFERENCE_LIST::RenumberBasesUsedBy(), SCH_REFERENCE_LIST::SetRefDesTracker(), SCHEMATIC::Settings(), SCH_SHEET_LIST::ShareReusedSheetRef(), SCH_REFERENCE_LIST::SplitReferences(), SCHEMATIC::SplitUnitSymbols(), SYMBOL_FILTER_NON_POWER, and SCH_REFERENCE_LIST::UseReusedSheetRepresentatives().
Referenced by REF_SUFFIX_FIXTURE::Annotate(), SCH_EDIT_FRAME::AnnotateSymbols(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
| wxString buildFullReference | ( | const SCH_REFERENCE & | aItem, |
| int | aUnitNumber = -1 ) |
Definition at line 633 of file sch_reference_list.cpp.
References SCH_REFERENCE::GetRef(), SCH_REFERENCE::GetRefNumber(), and SCH_REFERENCE::GetUnit().
Referenced by SCH_REFERENCE_LIST::Annotate().
| std::optional< std::pair< SCH_SHEET_PATH, SCH_SHEET_PATH > > FindRefSuffixCollision | ( | const SCH_REFERENCE_LIST & | aRefs, |
| const SCHEMATIC & | aSchematic ) |
Find two instances of a reused sheet that aRefs reaches and that compose the same reference suffix.
Suffix annotation mode gives every instance one base, so only their suffixes keep their references apart.
Definition at line 1522 of file sch_reference_list.cpp.
References SCHEMATIC_SETTINGS::m_AnnotateReusedSheetSuffixes, SCHEMATIC::RefSuffixCollisions(), and SCHEMATIC::Settings().
Referenced by REF_SUFFIX_FIXTURE::Annotate(), and SCH_EDIT_FRAME::AnnotateSymbols().
|
static |
Definition at line 261 of file sch_reference_list.cpp.
References SCH_REFERENCE::GetSheetPath(), SCH_REFERENCE::GetSymbol(), SCH_SHEET_PATH::Path(), and sharesReusedBase().
Referenced by SCH_REFERENCE_LIST::LockedForRepresentatives(), and SCH_REFERENCE_LIST::RenumberBasesUsedBy().
|
static |
Definition at line 1543 of file sch_reference_list.cpp.
References SCH_REFERENCE::GetUnit().
Referenced by AnnotateReferences().
|
static |
Definition at line 253 of file sch_reference_list.cpp.
References SCHEMATIC::CopiesSelectDifferentUnits(), SCH_REFERENCE::GetSymbol(), and SCH_ITEM::Schematic().
Referenced by SCH_REFERENCE_LIST::Annotate(), packageMemberKey(), SCH_REFERENCE_LIST::RenumberBasesUsedBy(), and SCH_REFERENCE_LIST::UseReusedSheetRepresentatives().