43 switch( aItem.
Type() )
53 return text.GetShownText(
true );
69 return textbox.
GetShownText(
nullptr,
nullptr,
true, 0 );
76 return pin.GetShownName();
84 for(
int row = 0; row <
table.GetRowCount(); ++row )
86 for(
int col = 0; col <
table.GetColCount(); ++col )
91 if( col <
table.GetColCount() - 1 )
97 if( row <
table.GetRowCount() - 1 )
110 return wxEmptyString;
116 wxArrayString itemTexts;
120 if( item->IsSCH_ITEM() )
125 itemText.Trim(
false ).Trim(
true );
127 if( !itemText.IsEmpty() )
129 itemTexts.Add( std::move( itemText ) );
134 return wxJoin( itemTexts,
'\n',
'\0' );
152 std::set<int> missingUnits;
154 for(
int unit = 1; unit <= aSym.
GetUnitCount(); ++unit )
155 missingUnits.insert( unit );
159 if( symRefDes == ref.GetRef() )
160 missingUnits.erase( ref.GetUnit() );
168 const wxString& aRef,
int aUnit )
175 if( ref.GetRef() == aRef && ref.GetUnit() == aUnit )
187 std::vector<SCH_SYMBOL*>
result;
194 bool haveRootLibId =
false;
195 size_t rootPinCount = 0;
196 bool haveRootPinCount =
false;
211 wxString ref = sym->
GetRef( &sheet,
false );
213 if( rootRef.IsEmpty() )
226 haveRootLibId =
true;
229 if( libId != rootLibId )
233 size_t pinCount = sym->
GetPins( &sheet ).size();
235 if( !haveRootPinCount )
237 rootPinCount = pinCount;
238 haveRootPinCount =
true;
241 if( pinCount != rootPinCount )
256 wxCHECK_MSG( aFirst && aSecond,
false,
"Invalid pins supplied to SwapPinGeometry" );
275 int secondLength = secondPin->
GetLength();
286 return ( firstPin != aFirst ) || ( secondPin != aSecond );
291 std::set<wxString>* aSheetPaths, std::set<wxString>* aProjectNames )
293 std::set<KIID_PATH> uniquePaths;
294 std::set<wxString> sheetPaths;
295 std::set<wxString> otherProjects;
299 uniquePaths.insert( instance.m_Path );
301 if( !instance.m_Path.empty() )
302 sheetPaths.insert( instance.m_Path.AsString() );
304 if( !instance.m_ProjectName.IsEmpty() )
306 if( aCurrentProject.IsEmpty() || !instance.m_ProjectName.IsSameAs( aCurrentProject ) )
307 otherProjects.insert( instance.m_ProjectName );
311 bool sharedWithinProject = uniquePaths.size() > 1;
312 bool sharedWithOtherProjects = !otherProjects.empty();
316 if( sharedWithinProject )
317 *aSheetPaths = sheetPaths;
319 aSheetPaths->clear();
324 if( sharedWithOtherProjects )
325 *aProjectNames = otherProjects;
327 aProjectNames->clear();
330 return sharedWithinProject || sharedWithOtherProjects;
336 std::set<wxString> friendlyNames;
338 if( aSheetPaths.empty() )
339 return friendlyNames;
343 for(
const wxString& pathStr : aSheetPaths )
345 wxString display = pathStr;
353 if( sheetPath.Path() == kiidPath )
357 for(
size_t ii = 0; ii < sheetPath.size(); ++ii )
374 if( !sheetNames.IsEmpty() )
375 sheetNames << wxS(
"/" );
380 if( sheetNames.IsEmpty() )
381 display = sheetPath.PathHumanReadable(
false,
true );
383 display = sheetNames;
394 friendlyNames.insert( display );
397 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