43 switch( aItem.
Type() )
53 return text.GetShownText(
true );
73 return pin.GetShownName();
81 for(
int row = 0; row <
table.GetRowCount(); ++row )
83 for(
int col = 0; col <
table.GetColCount(); ++col )
88 if( col <
table.GetColCount() - 1 )
94 if( row <
table.GetRowCount() - 1 )
107 return wxEmptyString;
113 wxArrayString itemTexts;
117 if( item->IsSCH_ITEM() )
122 itemText.Trim(
false ).Trim(
true );
124 if( !itemText.IsEmpty() )
126 itemTexts.Add( std::move( itemText ) );
131 return wxJoin( itemTexts,
'\n',
'\0' );
149 std::set<int> missingUnits;
151 for(
int unit = 1; unit <= aSym.
GetUnitCount(); ++unit )
152 missingUnits.insert( unit );
156 if( symRefDes == ref.GetRef() )
157 missingUnits.erase( ref.GetUnit() );
165 const wxString& aRef,
int aUnit )
172 if( ref.GetRef() == aRef && ref.GetUnit() == aUnit )
184 std::vector<SCH_SYMBOL*>
result;
191 bool haveRootLibId =
false;
192 size_t rootPinCount = 0;
193 bool haveRootPinCount =
false;
208 wxString ref = sym->
GetRef( &sheet,
false );
210 if( rootRef.IsEmpty() )
223 haveRootLibId =
true;
226 if( libId != rootLibId )
230 size_t pinCount = sym->
GetPins( &sheet ).size();
232 if( !haveRootPinCount )
234 rootPinCount = pinCount;
235 haveRootPinCount =
true;
238 if( pinCount != rootPinCount )
253 wxCHECK_MSG( aFirst && aSecond,
false,
"Invalid pins supplied to SwapPinGeometry" );
272 int secondLength = secondPin->
GetLength();
283 return ( firstPin != aFirst ) || ( secondPin != aSecond );
288 std::set<wxString>* aSheetPaths, std::set<wxString>* aProjectNames )
290 std::set<KIID_PATH> uniquePaths;
291 std::set<wxString> sheetPaths;
292 std::set<wxString> otherProjects;
296 uniquePaths.insert( instance.m_Path );
298 if( !instance.m_Path.empty() )
299 sheetPaths.insert( instance.m_Path.AsString() );
301 if( !instance.m_ProjectName.IsEmpty() )
303 if( aCurrentProject.IsEmpty() || !instance.m_ProjectName.IsSameAs( aCurrentProject ) )
304 otherProjects.insert( instance.m_ProjectName );
308 bool sharedWithinProject = uniquePaths.size() > 1;
309 bool sharedWithOtherProjects = !otherProjects.empty();
313 if( sharedWithinProject )
314 *aSheetPaths = sheetPaths;
316 aSheetPaths->clear();
321 if( sharedWithOtherProjects )
322 *aProjectNames = otherProjects;
324 aProjectNames->clear();
327 return sharedWithinProject || sharedWithOtherProjects;
333 std::set<wxString> friendlyNames;
335 if( aSheetPaths.empty() )
336 return friendlyNames;
340 for(
const wxString& pathStr : aSheetPaths )
342 wxString display = pathStr;
350 if( sheetPath.Path() == kiidPath )
354 for(
size_t ii = 0; ii < sheetPath.size(); ++ii )
371 if( !sheetNames.IsEmpty() )
372 sheetNames << wxS(
"/" );
377 if( sheetNames.IsEmpty() )
378 display = sheetPath.PathHumanReadable(
false,
true );
380 display = sheetNames;
391 friendlyNames.insert( display );
394 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
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