43 switch( aItem.
Type() )
53 return text.GetShownText(
true );
71 return textbox.
GetShownText(
nullptr,
nullptr,
true, 0 );
79 return pin.GetShownName();
88 for(
int row = 0; row <
table.GetRowCount(); ++row )
90 for(
int col = 0; col <
table.GetColCount(); ++col )
95 if( col <
table.GetColCount() - 1 )
101 if( row <
table.GetRowCount() - 1 )
113 return wxEmptyString;
119 wxArrayString itemTexts;
123 if( item->IsSCH_ITEM() )
128 itemText.Trim(
false ).Trim(
true );
130 if( !itemText.IsEmpty() )
132 itemTexts.Add( std::move( itemText ) );
137 return wxJoin( itemTexts,
'\n',
'\0' );
142 const LIB_ID& aLibId,
int aUnit )
144 for(
size_t i = 0; i < aRefs.
GetCount(); ++i )
151 if( ref.
GetRef() != aRef )
156 if( refSym && refSym->
GetLibId() == aLibId )
171 const wxString symRefDes = aSym.
GetRef( &schematic->CurrentSheet(),
false );
177 const bool refIsUnannotated = !symRefDes.IsEmpty() && symRefDes.Last() ==
'?';
185 std::set<int> missingUnits;
187 for(
int unit = 1; unit <= aSym.
GetUnitCount(); ++unit )
188 missingUnits.insert( unit );
192 if( symRefDes != ref.GetRef() )
195 if( refIsUnannotated && ref.GetSymbol() && ref.GetSymbol()->GetLibId() != symLibId )
198 missingUnits.erase( ref.GetUnit() );
206 const wxString& aRef,
int aUnit )
213 if( ref.GetRef() == aRef && ref.GetUnit() == aUnit )
225 std::vector<SCH_SYMBOL*>
result;
232 bool haveRootLibId =
false;
233 size_t rootPinCount = 0;
234 bool haveRootPinCount =
false;
249 wxString ref = sym->
GetRef( &sheet,
false );
251 if( rootRef.IsEmpty() )
264 haveRootLibId =
true;
267 if( libId != rootLibId )
271 size_t pinCount = sym->
GetPins( &sheet ).size();
273 if( !haveRootPinCount )
275 rootPinCount = pinCount;
276 haveRootPinCount =
true;
279 if( pinCount != rootPinCount )
294 wxCHECK_MSG( aFirst && aSecond,
false,
"Invalid pins supplied to SwapPinGeometry" );
313 int secondLength = secondPin->
GetLength();
324 return ( firstPin != aFirst ) || ( secondPin != aSecond );
329 std::set<wxString>* aSheetPaths, std::set<wxString>* aProjectNames )
331 std::set<KIID_PATH> uniquePaths;
332 std::set<wxString> sheetPaths;
333 std::set<wxString> otherProjects;
337 uniquePaths.insert( instance.m_Path );
339 if( !instance.m_Path.empty() )
340 sheetPaths.insert( instance.m_Path.AsString() );
342 if( !instance.m_ProjectName.IsEmpty() )
344 if( aCurrentProject.IsEmpty() || !instance.m_ProjectName.IsSameAs( aCurrentProject ) )
345 otherProjects.insert( instance.m_ProjectName );
349 bool sharedWithinProject = uniquePaths.size() > 1;
350 bool sharedWithOtherProjects = !otherProjects.empty();
354 if( sharedWithinProject )
355 *aSheetPaths = sheetPaths;
357 aSheetPaths->clear();
362 if( sharedWithOtherProjects )
363 *aProjectNames = otherProjects;
365 aProjectNames->clear();
368 return sharedWithinProject || sharedWithOtherProjects;
374 std::set<wxString> friendlyNames;
376 if( aSheetPaths.empty() )
377 return friendlyNames;
381 for(
const wxString& pathStr : aSheetPaths )
383 wxString display = pathStr;
391 if( sheetPath.Path() == kiidPath )
395 for(
size_t ii = 0; ii < sheetPath.size(); ++ii )
412 if( !sheetNames.IsEmpty() )
413 sheetNames << wxS(
"/" );
418 if( sheetNames.IsEmpty() )
419 display = sheetPath.PathHumanReadable(
false,
true );
421 display = sheetNames;
432 friendlyNames.insert( display );
435 return friendlyNames;
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
A logical library item identifier and consists of various portions much like a URI.
int GetUnitCount() const override
Holds all the data relating to one schematic.
SCH_SHEET_LIST Hierarchy() const
Return the full schematic flattened hierarchical sheet list.
SCH_SHEET_PATH & CurrentSheet() const
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0, const wxString &aVariantName=wxEmptyString) const
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
VECTOR2I GetLocalPosition() const
const wxString & GetOperatingPoint() const
void SetOrientation(PIN_ORIENTATION aOrientation)
SCH_PIN * GetLibPin() const
void SetPosition(const VECTOR2I &aPos) override
void SetLength(int aLength)
PIN_ORIENTATION GetOrientation() const
void SetOperatingPoint(const wxString &aText)
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
A helper to define a symbol's reference designator in a schematic.
SCH_SYMBOL * GetSymbol() const
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, SYMBOL_FILTER aSymbolFilter, bool aForceIncludeOrphanSymbols=false) const
Add a SCH_REFERENCE object to aReferences for each symbol in the list of sheets.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this sheet.
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
std::vector< const SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
const LIB_ID & GetLibId() const override
int GetUnitCount() const override
Return the number of units per package of the symbol.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
wxString GetShownText(const RENDER_SETTINGS *aSettings, const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
virtual wxString GetShownText(const RENDER_SETTINGS *aSettings, const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const
virtual unsigned int GetSize() const override
Return the number of stored items.
std::vector< EDA_ITEM * > GetItemsSortedBySelectionOrder() const
bool OnlyContains(std::vector< KICAD_T > aList) const
Checks if all items in the selection have a type in aList.
PIN_ORIENTATION
The symbol library pin object orientations.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
A simple container for schematic symbol instance information.
std::vector< std::vector< std::string > > table
wxString result
Test unit parsing edge cases and error handling.
VECTOR2< int32_t > VECTOR2I