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' );
155 std::set<int> missingUnits;
157 for(
int unit = 1; unit <= aSym.
GetUnitCount(); ++unit )
158 missingUnits.insert( unit );
162 if( symRefDes == ref.GetRef() )
163 missingUnits.erase( ref.GetUnit() );
171 const wxString& aRef,
int aUnit )
178 if( ref.GetRef() == aRef && ref.GetUnit() == aUnit )
190 std::vector<SCH_SYMBOL*>
result;
197 bool haveRootLibId =
false;
198 size_t rootPinCount = 0;
199 bool haveRootPinCount =
false;
214 wxString ref = sym->
GetRef( &sheet,
false );
216 if( rootRef.IsEmpty() )
229 haveRootLibId =
true;
232 if( libId != rootLibId )
236 size_t pinCount = sym->
GetPins( &sheet ).size();
238 if( !haveRootPinCount )
240 rootPinCount = pinCount;
241 haveRootPinCount =
true;
244 if( pinCount != rootPinCount )
259 wxCHECK_MSG( aFirst && aSecond,
false,
"Invalid pins supplied to SwapPinGeometry" );
278 int secondLength = secondPin->
GetLength();
289 return ( firstPin != aFirst ) || ( secondPin != aSecond );
294 std::set<wxString>* aSheetPaths, std::set<wxString>* aProjectNames )
296 std::set<KIID_PATH> uniquePaths;
297 std::set<wxString> sheetPaths;
298 std::set<wxString> otherProjects;
302 uniquePaths.insert( instance.m_Path );
304 if( !instance.m_Path.empty() )
305 sheetPaths.insert( instance.m_Path.AsString() );
307 if( !instance.m_ProjectName.IsEmpty() )
309 if( aCurrentProject.IsEmpty() || !instance.m_ProjectName.IsSameAs( aCurrentProject ) )
310 otherProjects.insert( instance.m_ProjectName );
314 bool sharedWithinProject = uniquePaths.size() > 1;
315 bool sharedWithOtherProjects = !otherProjects.empty();
319 if( sharedWithinProject )
320 *aSheetPaths = sheetPaths;
322 aSheetPaths->clear();
327 if( sharedWithOtherProjects )
328 *aProjectNames = otherProjects;
330 aProjectNames->clear();
333 return sharedWithinProject || sharedWithOtherProjects;
339 std::set<wxString> friendlyNames;
341 if( aSheetPaths.empty() )
342 return friendlyNames;
346 for(
const wxString& pathStr : aSheetPaths )
348 wxString display = pathStr;
356 if( sheetPath.Path() == kiidPath )
360 for(
size_t ii = 0; ii < sheetPath.size(); ++ii )
377 if( !sheetNames.IsEmpty() )
378 sheetNames << wxS(
"/" );
383 if( sheetNames.IsEmpty() )
384 display = sheetPath.PathHumanReadable(
false,
true );
386 display = sheetNames;
397 friendlyNames.insert( display );
400 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
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.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, 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< 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.
wxString result
Test unit parsing edge cases and error handling.
VECTOR2< int32_t > VECTOR2I