KiCad PCB EDA Suite
|
Go to the source code of this file.
Functions | |
wxString | GetSchItemAsText (const SCH_ITEM &aItem) |
wxString | GetSelectedItemsAsText (const SELECTION &aSel) |
std::set< int > | GetUnplacedUnitsForSymbol (const SCH_SYMBOL &aSym) |
Get a list of unplaced (i.e. | |
std::optional< SCH_REFERENCE > | FindSymbolByRefAndUnit (const SCHEMATIC &aSheet, const wxString &aRef, int aUnit) |
Find a symbol by reference and unit. | |
std::vector< SCH_SYMBOL * > | GetSameSymbolMultiUnitSelection (const SELECTION &aSel) |
Validates and gathers a selection containing multiple symbol units that all belong to the same reference designator and originate from the same library symbol (LIB_ID). | |
bool | SwapPinGeometry (SCH_PIN *aFirst, SCH_PIN *aSecond) |
Swap the positions/lengths/etc. | |
bool | SymbolHasSheetInstances (const SCH_SYMBOL &aSymbol, const wxString &aCurrentProject, std::set< wxString > *aSheetPaths=nullptr, std::set< wxString > *aProjectNames=nullptr) |
Returns true when the given symbol has instances, e.g. | |
std::set< wxString > | GetSheetNamesFromPaths (const std::set< wxString > &aSheetPaths, const SCHEMATIC &aSchematic) |
Get human-readable sheet names from a set of sheet paths, e.g. | |
std::optional< SCH_REFERENCE > FindSymbolByRefAndUnit | ( | const SCHEMATIC & | aSheet, |
const wxString & | aRef, | ||
int | aUnit ) |
Find a symbol by reference and unit.
Definition at line 164 of file sch_tool_utils.cpp.
References SCH_SHEET_LIST::GetSymbols(), and SCHEMATIC::Hierarchy().
Referenced by SCH_EDIT_FRAME::SelectUnit().
std::vector< SCH_SYMBOL * > GetSameSymbolMultiUnitSelection | ( | const SELECTION & | aSel | ) |
Validates and gathers a selection containing multiple symbol units that all belong to the same reference designator and originate from the same library symbol (LIB_ID).
Used by gate label swap.
Definition at line 182 of file sch_tool_utils.cpp.
References SCHEMATIC::CurrentSheet(), SELECTION::GetItemsSortedBySelectionOrder(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), SELECTION::GetSize(), LIB_SYMBOL::GetUnitCount(), SELECTION::OnlyContains(), result, and SCH_ITEM::Schematic().
Referenced by SCH_SELECTION_TOOL::Init(), and SCH_EDIT_TOOL::SwapUnitLabels().
wxString GetSchItemAsText | ( | const SCH_ITEM & | aItem | ) |
Definition at line 41 of file sch_tool_utils.cpp.
References SCH_FIELD::GetShownText(), SCH_TEXTBOX::GetShownText(), pin, SCH_DIRECTIVE_LABEL_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, SCH_SHEET_PIN_T, SCH_TABLE_T, SCH_TABLECELL_T, SCH_TEXT_T, SCH_TEXTBOX_T, table, text, and EDA_ITEM::Type().
Referenced by GetSelectedItemsAsText().
wxString GetSelectedItemsAsText | ( | const SELECTION & | aSel | ) |
Definition at line 111 of file sch_tool_utils.cpp.
References GetSchItemAsText().
Referenced by SCH_EDITOR_CONTROL::CopyAsText(), and SYMBOL_EDITOR_EDIT_TOOL::CopyAsText().
std::set< wxString > GetSheetNamesFromPaths | ( | const std::set< wxString > & | aSheetPaths, |
const SCHEMATIC & | aSchematic ) |
Get human-readable sheet names from a set of sheet paths, e.g.
the SHEETNAME field
aSheetPaths | set of sheet paths to convert |
aSchematic | the schematic to search for sheet names |
Definition at line 331 of file sch_tool_utils.cpp.
References SCH_SHEET::GetField(), SCH_FIELD::GetShownText(), SCHEMATIC::Hierarchy(), name, and SHEET_NAME.
Referenced by BACK_ANNOTATE::applyPinSwaps(), and SCH_EDIT_TOOL::SwapPins().
std::set< int > GetUnplacedUnitsForSymbol | ( | const SCH_SYMBOL & | aSym | ) |
Get a list of unplaced (i.e.
not in schamtic) unit numbers for a symbol.
Definition at line 135 of file sch_tool_utils.cpp.
References SCHEMATIC::CurrentSheet(), SCH_SYMBOL::GetRef(), SCH_SHEET_LIST::GetSymbols(), SCH_SYMBOL::GetUnitCount(), SCHEMATIC::Hierarchy(), and SCH_ITEM::Schematic().
Referenced by SCH_DRAWING_TOOLS::PlaceNextSymbolUnit(), and SYMBOL_UNIT_MENU::update().
Swap the positions/lengths/etc.
between two pins in a symbol in such a way that connectivity is maintained.
The swap operates on the owning library pins when available so that callers may refresh symbol instances afterwards via SCH_SYMBOL::UpdatePins().
Definition at line 251 of file sch_tool_utils.cpp.
References SCH_PIN::GetLength(), SCH_PIN::GetLibPin(), SCH_PIN::GetLocalPosition(), SCH_PIN::GetOperatingPoint(), SCH_PIN::GetOrientation(), SCH_PIN::SetLength(), SCH_PIN::SetOperatingPoint(), SCH_PIN::SetOrientation(), and SCH_PIN::SetPosition().
Referenced by BACK_ANNOTATE::applyPinSwaps(), and SCH_EDIT_TOOL::SwapPins().
bool SymbolHasSheetInstances | ( | const SCH_SYMBOL & | aSymbol, |
const wxString & | aCurrentProject, | ||
std::set< wxString > * | aSheetPaths = nullptr, | ||
std::set< wxString > * | aProjectNames = nullptr ) |
Returns true when the given symbol has instances, e.g.
is used by more than one sheet instance in this project or by more than one project.
aSheetNames | if not nullptr, will be filled with the sheet paths that have instances of aSymbol. |
aProjectNames | if not nullptr, will be filled with the names of other projects that have instances of aSymbol. |
Definition at line 287 of file sch_tool_utils.cpp.
References SCH_SYMBOL::GetInstances().
Referenced by BACK_ANNOTATE::applyPinSwaps(), and SCH_EDIT_TOOL::SwapPins().