77 _(
"Bidirectional Pin" ),
81 _(
"Unspecified Pin" ),
82 _(
"Power Input Pin" ),
83 _(
"Power Output Pin" ),
84 _(
"Open Collector" ),
94 _(
"Bidirectional Pin" ),
98 _(
"Unspecified Pin" ),
99 _(
"Power Input Pin" ),
100 _(
"Power Output Pin" ),
101 _(
"Open Collector" ),
141 for( screen = screenList.
GetFirst(); screen !=
nullptr; screen = screenList.
GetNext() )
143 std::vector<SCH_SHEET*> list;
146 list.push_back(
static_cast<SCH_SHEET*
>( item ) );
148 for(
size_t i = 0; i < list.size(); i++ )
152 for(
size_t j = i + 1; j < list.size(); j++ )
163 std::shared_ptr<ERC_ITEM> ercItem =
165 ercItem->SetItems( sheet, test_item );
185 auto unresolved = [
this]( wxString str )
188 return str.Matches( wxS(
"*${*}*" ) );
214 if( unresolved( field.GetShownText( &sheet,
true ) ) )
217 ercItem->SetItems( &field );
218 ercItem->SetSheetSpecificPath( sheet );
231 if( unresolved( field.GetShownText( &sheet,
true ) ) )
234 ercItem->SetItems( &field );
235 ercItem->SetSheetSpecificPath( sheet );
247 if(
pin->GetShownText( &subSheetPath,
true ).Matches( wxS(
"*${*}*" ) ) )
250 ercItem->SetItems(
pin );
251 ercItem->SetSheetSpecificPath( sheet );
260 if(
text->GetShownText( &sheet,
true ).Matches( wxS(
"*${*}*" ) ) )
263 ercItem->SetItems(
text );
264 ercItem->SetSheetSpecificPath( sheet );
272 if( textBox->GetShownText( &sheet,
true ).Matches( wxS(
"*${*}*" ) ) )
275 ercItem->SetItems( textBox );
276 ercItem->SetSheetSpecificPath( sheet );
288 if(
text->GetShownText(
true ).Matches( wxS(
"*${*}*" ) ) )
291 erc->SetErrorMessage(
_(
"Unresolved text variable in drawing sheet" ) );
292 erc->SetSheetSpecificPath( sheet );
309 std::vector< std::shared_ptr<BUS_ALIAS> > aliases;
313 const auto& screen_aliases = screen->GetBusAliases();
315 for(
const std::shared_ptr<BUS_ALIAS>& alias : screen_aliases )
317 std::vector<wxString> aliasMembers = alias->Members();
318 std::sort( aliasMembers.begin(), aliasMembers.end() );
320 for(
const std::shared_ptr<BUS_ALIAS>&
test : aliases )
322 std::vector<wxString> testMembers =
test->Members();
323 std::sort( testMembers.begin(), testMembers.end() );
325 if( alias->GetName() ==
test->GetName() && aliasMembers != testMembers )
327 msg.Printf(
_(
"Bus alias %s has conflicting definitions on %s and %s" ),
329 alias->GetParent()->GetFileName(),
330 test->GetParent()->GetFileName() );
333 ercItem->SetErrorMessage( msg );
336 test->GetParent()->Append( marker );
343 aliases.insert( aliases.end(), screen_aliases.begin(), screen_aliases.end() );
358 for( std::pair<const wxString, SCH_REFERENCE_LIST>& symbol : refMap )
373 for(
unsigned i = 0; i < refList.
GetCount(); ++i )
378 if( !unitFP.IsEmpty() )
381 unitName = unit->
GetRef( &sheetPath,
true );
386 for(
unsigned i = 0; i < refList.
GetCount(); ++i )
394 if( unit && !secondFp.IsEmpty() && unitFP != secondFp )
396 msg.Printf(
_(
"Different footprints assigned to %s and %s" ),
397 unitName, secondName );
400 ercItem->SetErrorMessage( msg );
401 ercItem->SetItems( unit, secondUnit );
424 for( std::pair<const wxString, SCH_REFERENCE_LIST>& symbol : refMap )
428 wxCHECK2( refList.
GetCount(),
continue );
438 std::set<int> lib_units;
439 std::set<int> instance_units;
440 std::set<int> missing_units;
442 auto report_missing = [&]( std::set<int>& aMissingUnits, wxString aErrorMsg,
446 wxString missing_pin_units = wxS(
"[ " );
449 for(
int missing_unit : aMissingUnits )
453 missing_pin_units += wxS(
"....." );
460 missing_pin_units.Truncate( missing_pin_units.length() - 2 );
461 missing_pin_units += wxS(
" ]" );
463 msg.Printf( aErrorMsg, symbol.first, missing_pin_units );
466 ercItem->SetErrorMessage( msg );
467 ercItem->SetItems( unit );
475 for(
int ii = 1; ii <= libSymbol->
GetUnitCount(); ++ii )
476 lib_units.insert( lib_units.end(), ii );
478 for(
size_t ii = 0; ii < refList.
GetCount(); ++ii )
479 instance_units.insert( instance_units.end(), refList.
GetItem( ii ).
GetUnit() );
481 std::set_difference( lib_units.begin(), lib_units.end(),
482 instance_units.begin(), instance_units.end(),
483 std::inserter( missing_units, missing_units.begin() ) );
487 report_missing( missing_units,
_(
"Symbol %s has unplaced units %s" ),
491 std::set<int> missing_power;
492 std::set<int> missing_input;
493 std::set<int> missing_bidi;
495 for(
int missing_unit : missing_units )
499 for(
size_t ii = 0; ii < refList.
GetCount(); ++ii )
510 switch(
pin->GetType() )
512 case ELECTRICAL_PINTYPE::PT_POWER_IN:
513 missing_power.insert( missing_unit );
516 case ELECTRICAL_PINTYPE::PT_BIDI:
517 missing_bidi.insert( missing_unit );
520 case ELECTRICAL_PINTYPE::PT_INPUT:
521 missing_input.insert( missing_unit );
532 report_missing( missing_power,
533 _(
"Symbol %s has input power pins in units %s that are not placed." ),
539 report_missing( missing_input,
540 _(
"Symbol %s has input pins in units %s that are not placed." ),
546 report_missing( missing_bidi,
547 _(
"Symbol %s has bidirectional pins in units %s that are not "
561 wxString defaultNetclass = settings->m_DefaultNetClass->GetName();
570 ercItem->SetItems( item );
571 ercItem->SetErrorMessage( wxString::Format(
_(
"Netclass %s is not defined" ),
587 SCH_FIELD* field = static_cast<SCH_FIELD*>( aChild );
589 if( field->GetCanonicalName() == wxT(
"Netclass" ) )
591 wxString netclass = field->GetText();
593 if( !netclass.IsSameAs( defaultNetclass )
594 && settings->m_NetClasses.count( netclass ) == 0 )
596 logError( sheet, item, netclass );
616 std::map<VECTOR2I, std::vector<SCH_ITEM*>> pinMap;
621 if( pinMap.count( pt ) )
622 pinMap[pt].emplace_back( aOther );
631 if(
pin->GetLibPin()->GetType() == ELECTRICAL_PINTYPE::PT_NC )
632 pinMap[
pin->GetPosition()].emplace_back(
pin );
636 for(
SCH_ITEM* item : sheet.LastScreen()->Items() )
644 if(
pin->GetLibPin()->GetType() != ELECTRICAL_PINTYPE::PT_NC )
645 addOther(
pin->GetPosition(),
pin );
648 else if( item->IsConnectable() )
650 for(
const VECTOR2I& pt : item->GetConnectionPoints() )
651 addOther( pt, item );
655 for(
const std::pair<
const VECTOR2I, std::vector<SCH_ITEM*>>& pair : pinMap )
657 if( pair.second.size() > 1 )
663 ercItem->SetItems( pair.second[0], pair.second[1],
664 pair.second.size() > 2 ? pair.second[2] :
nullptr,
665 pair.second.size() > 3 ? pair.second[3] :
nullptr );
666 ercItem->SetErrorMessage(
_(
"Pin with 'no connection' type is connected" ) );
667 ercItem->SetSheetSpecificPath( sheet );
670 sheet.LastScreen()->Append( marker );
688 std::vector<ERC_SCH_PIN_CONTEXT> pins;
689 std::unordered_map<EDA_ITEM*, SCH_SCREEN*> pinToScreenMap;
690 bool has_noconnect =
false;
695 has_noconnect =
true;
701 pins.emplace_back(
static_cast<SCH_PIN*
>( item ), subgraph->
GetSheet() );
708 bool hasDriver =
false;
713 bool ispowerNet =
false;
717 if( refPin.Pin()->GetType() == ELECTRICAL_PINTYPE::PT_POWER_IN )
724 for(
auto refIt = pins.begin(); refIt != pins.end(); ++refIt )
734 if( !needsDriver.
Pin()
738 == ELECTRICAL_PINTYPE::PT_POWER_IN )
739 && ispowerNet == ( refType == ELECTRICAL_PINTYPE::PT_POWER_IN ) ) )
741 needsDriver = refPin;
750 for(
auto testIt = refIt + 1; testIt != pins.end(); ++testIt )
771 std::shared_ptr<ERC_ITEM> ercItem =
774 ercItem->SetItems( refPin.
Pin(), testPin.
Pin() );
775 ercItem->SetSheetSpecificPath( refPin.
Sheet() );
776 ercItem->SetItemsSheetPaths( refPin.
Sheet(), testPin.
Sheet() );
778 ercItem->SetErrorMessage(
779 wxString::Format(
_(
"Pins of type %s and %s are connected" ),
784 pinToScreenMap[refPin.
Pin()]->Append( marker );
790 if( needsDriver.
Pin() && !hasDriver && !has_noconnect )
798 ercItem->SetItems( needsDriver.
Pin() );
799 ercItem->SetSheetSpecificPath( needsDriver.
Sheet() );
800 ercItem->SetItemsSheetPaths( needsDriver.
Sheet() );
803 pinToScreenMap[needsDriver.
Pin()]->Append( marker );
819 std::unordered_map<wxString, std::pair<wxString, SCH_PIN*>> pinToNetMap;
823 const wxString& netName = net.first.Name;
834 if( !
pin->GetLibPin()->GetParentSymbol()->IsMulti() )
837 wxString
name =
pin->GetParentSymbol()->GetRef( &sheet ) +
838 +
":" +
pin->GetShownNumber();
840 if( !pinToNetMap.count(
name ) )
842 pinToNetMap[
name] = std::make_pair( netName,
pin );
844 else if( pinToNetMap[
name].first != netName )
846 std::shared_ptr<ERC_ITEM> ercItem =
849 ercItem->SetErrorMessage( wxString::Format(
850 _(
"Pin %s is connected to both %s and %s" ),
851 pin->GetShownNumber(),
853 pinToNetMap[
name].first ) );
855 ercItem->SetItems(
pin, pinToNetMap[
name].second );
856 ercItem->SetSheetSpecificPath( sheet );
857 ercItem->SetItemsSheetPaths( sheet, sheet );
878 std::unordered_map<wxString, std::pair<SCH_LABEL_BASE*, SCH_SHEET_PATH>> labelMap;
888 switch( item->Type() )
896 wxString normalized = label->
GetShownText( &sheet,
false ).Lower();
898 if( !labelMap.count( normalized ) )
900 labelMap[normalized] = std::make_pair( label, sheet );
904 auto& [ otherLabel, otherSheet ] = labelMap.at( normalized );
906 if( otherLabel->GetShownText( &otherSheet,
false )
910 ercItem->SetItems( label, labelMap.at( normalized ).first );
911 ercItem->SetSheetSpecificPath( sheet );
912 ercItem->SetItemsSheetPaths( sheet, labelMap.
at( normalized ).second );
946 std::vector<SCH_MARKER*> markers;
953 wxCHECK2( libSymbolInSchematic,
continue );
963 ercItem->SetItems( symbol );
964 msg.Printf(
_(
"The current configuration does not include the symbol library '%s'" ),
966 ercItem->SetErrorMessage( msg );
973 else if( !libTable->
HasLibrary( libName,
true ) )
978 ercItem->SetItems( symbol );
979 msg.Printf(
_(
"The library '%s' is not enabled in the current configuration" ),
981 ercItem->SetErrorMessage( msg );
992 if( libSymbol ==
nullptr )
997 ercItem->SetItems( symbol );
998 msg.Printf(
_(
"Symbol '%s' not found in symbol library '%s'" ),
1001 ercItem->SetErrorMessage( msg );
1009 std::unique_ptr<LIB_SYMBOL> flattenedSymbol = libSymbol->
Flatten();
1013 && flattenedSymbol->Compare( *libSymbolInSchematic, flags ) != 0 )
1016 ercItem->SetItems( symbol );
1017 msg.Printf(
_(
"Symbol '%s' doesn't match copy in library '%s'" ),
1020 ercItem->SetErrorMessage( msg );
1028 screen->Append( marker );
1044 typedef int (*TESTER_FN_PTR)(
const wxString&,
PROJECT* );
1050 std::vector<SCH_MARKER*> markers;
1057 if( footprint.IsEmpty() )
1062 if( fpID.
Parse( footprint,
true ) >= 0 )
1065 msg.Printf(
_(
"'%s' is not a valid footprint identifier." ), footprint );
1066 ercItem->SetErrorMessage( msg );
1067 ercItem->SetItems( symbol );
1074 int ret = (linkTester)( footprint, aProject );
1079 msg.Printf(
_(
"The current configuration does not include the footprint library '%s'." ),
1081 ercItem->SetErrorMessage( msg );
1082 ercItem->SetItems( symbol );
1088 msg.Printf(
_(
"The footprint library '%s' is not enabled in the current configuration." ),
1090 ercItem->SetErrorMessage( msg );
1091 ercItem->SetItems( symbol );
1097 msg.Printf(
_(
"Footprint '%s' not found in library '%s'." ),
1100 ercItem->SetErrorMessage( msg );
1101 ercItem->SetItems( symbol );
1108 sheet.LastScreen()->Append( marker );
1126 std::vector<SCH_MARKER*> markers;
1128 for(
SCH_ITEM* item : screen->Items() )
1130 if( item->Type() ==
SCH_LINE_T && item->IsConnectable() )
1138 ercItem->SetItems( line );
1146 ercItem->SetItems( line );
1159 if( ( pinPos.
x % gridSize ) != 0 || ( pinPos.
y % gridSize ) != 0 )
1162 ercItem->SetItems(
pin );
1164 markers.emplace_back(
new SCH_MARKER( ercItem, pinPos ) );
1173 screen->Append( marker );
1192 std::vector<SCH_MARKER*> markers;
1208 if( !msg.IsEmpty() )
1215 ercItem->SetErrorMessage( msg );
1216 ercItem->SetItems( symbol );
1224 sheet.LastScreen()->Append( marker );
1241 std::map<SCH_SCREEN*, std::vector<SCH_RULE_AREA*>> allScreenRuleAreas;
1249 allScreenRuleAreas[screen].push_back(
static_cast<SCH_RULE_AREA*
>( item ) );
1261 std::map<
SCH_SCREEN*, std::vector<SCH_RULE_AREA*>>& allScreenRuleAreas )
1265 for(
auto screenRuleAreas : allScreenRuleAreas )
1267 std::vector<SCH_RULE_AREA*>& ruleAreas = screenRuleAreas.second;
1269 for( std::size_t i = 0; i < ruleAreas.size(); ++i )
1273 for( std::size_t j = i + 1; j < ruleAreas.size(); ++j )
1276 if( polyFirst.
Collide( &polySecond ) )
1283 std::shared_ptr<ERC_ITEM> ercItem =
1285 ercItem->SetItems( ruleAreas[i], ruleAreas[j] );
1286 ercItem->SetSheetSpecificPath( firstSheet );
1287 ercItem->SetItemsSheetPaths( firstSheet, firstSheet );
1290 screen->
Append( marker );
1309 if( aProgressReporter )
1310 aProgressReporter->
AdvancePhase(
_(
"Checking sheet names..." ) );
1317 if( aProgressReporter )
1318 aProgressReporter->
AdvancePhase(
_(
"Checking bus conflicts..." ) );
1324 if( aProgressReporter )
1325 aProgressReporter->
AdvancePhase(
_(
"Checking conflicts..." ) );
1338 if( aProgressReporter )
1339 aProgressReporter->
AdvancePhase(
_(
"Checking rule areas..." ) );
1346 if( aProgressReporter )
1347 aProgressReporter->
AdvancePhase(
_(
"Checking units..." ) );
1352 if( aProgressReporter )
1353 aProgressReporter->
AdvancePhase(
_(
"Checking footprints..." ) );
1366 if( aProgressReporter )
1384 if( aProgressReporter )
1385 aProgressReporter->
AdvancePhase(
_(
"Checking labels..." ) );
1392 if( aProgressReporter )
1393 aProgressReporter->
AdvancePhase(
_(
"Checking for unresolved variables..." ) );
1400 if( aProgressReporter )
1401 aProgressReporter->
AdvancePhase(
_(
"Checking SPICE models..." ) );
1408 if( aProgressReporter )
1409 aProgressReporter->
AdvancePhase(
_(
"Checking no connect pins for connections..." ) );
1417 if( aProgressReporter )
1418 aProgressReporter->
AdvancePhase(
_(
"Checking for library symbol issues..." ) );
1425 if( aProgressReporter )
1426 aProgressReporter->
AdvancePhase(
_(
"Checking for footprint link issues..." ) );
1433 if( aProgressReporter )
1434 aProgressReporter->
AdvancePhase(
_(
"Checking for off grid pins and wires..." ) );
1441 if( aProgressReporter )
1442 aProgressReporter->
AdvancePhase(
_(
"Checking for undefined netclasses..." ) );
constexpr EDA_IU_SCALE schIUScale
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
int RunERC()
Run electrical rule checks on the connectivity graph.
const NET_MAP & GetNetMap() const
A subgraph is a set of items that are electrically connected on a single sheet.
const std::set< SCH_ITEM * > & GetItems() const
Provide a read-only reference to the items in the subgraph.
const SCH_ITEM * GetNoConnect() const
const SCH_SHEET_PATH & GetSheet() const
Base class to handle basic graphic items.
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
DS_DRAW_ITEM_BASE * GetFirst()
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
void SetFileName(const wxString &aFileName)
Set the filename to draw/plot.
void SetSheetName(const wxString &aSheetName)
Set the sheet name to draw/plot.
void SetSheetLayer(const wxString &aSheetLayer)
Set the sheet layer to draw/plot.
void SetSheetCount(int aSheetCount)
Set the value of the count of sheets, for basic inscriptions.
void SetPageNumber(const wxString &aPageNumber)
Set the value of the sheet number.
DS_DRAW_ITEM_BASE * GetNext()
void SetProject(const PROJECT *aProject)
const PAGE_INFO & GetPageInfo()
const TITLE_BLOCK & GetTitleBlock()
KICAD_T Type() const
Returns the type of object.
EE_TYPE OfType(KICAD_T aType) const
static std::shared_ptr< ERC_ITEM > Create(int aErrorCode)
Constructs an ERC_ITEM for the given error code.
A class used to associate a SCH_PIN with its owning SCH_SHEET_PATH, in order to handle ERC checks acr...
SCH_PIN * Pin()
Get the SCH_PIN for this context.
SCH_SHEET_PATH & Sheet()
Get the SCH_SHEET_PATH context for the paired SCH_PIN.
Container for ERC settings.
bool IsTestEnabled(int aErrorCode) const
PIN_ERROR GetPinMapValue(int aFirstType, int aSecondType) const
int TestLibSymbolIssues()
Test symbols for changed library symbols and broken symbol library links.
void TestTextVars(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Check for any unresolved text variable references.
int TestPinToPin()
Checks the full netlist against the pin-to-pin connectivity requirements.
int TestSimilarLabels()
Checks for labels that differ only in capitalization.
int RunRuleAreaERC()
Tests for rule area ERC issues.
int TestFootprintLinkIssues(KIFACE *aCvPcb, PROJECT *aProject)
Test footprint links against the current footprint libraries.
int TestOffGridEndpoints()
Test pins and wire ends for being off grid.
int TestDuplicateSheetNames(bool aCreateMarker)
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).
int TestMultUnitPinConflicts()
Checks if shared pins on multi-unit symbols have been connected to different nets.
int TestConflictingBusAliases()
Check that there are no conflicting bus alias definitions in the schematic.
int TestNoConnectPins()
In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
int TestRuleAreaOverlappingRuleAreasERC(std::map< SCH_SCREEN *, std::vector< SCH_RULE_AREA * > > &allScreenRuleAreas)
Runs ERC to check for overlapping rule areas.
int TestMissingNetclasses()
Tests for netclasses that are referenced but not defined.
int TestSimModelIssues()
Test SPICE models for various issues.
void RunTests(DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter)
int TestMissingUnits()
Test for uninstantiated units of multi unit symbols.
int TestMultiunitFootprints()
Test if all units of each multiunit symbol have the same footprint assigned.
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Define a library symbol object.
std::vector< SCH_PIN * > GetPins(int aUnit=0, int aBodyStyle=0) const
Return a list of pin object pointers from the draw item list.
wxString GetUnitDisplayName(int aUnit) override
Return the user-defined display name for aUnit for symbols with units.
int GetUnitCount() const override
std::unique_ptr< LIB_SYMBOL > Flatten() const
Return a flattened symbol inheritance to the caller.
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
A progress reporter interface for use in multi-threaded environments.
virtual void AdvancePhase()=0
Use the next available virtual zone of the dialog progress bar.
std::shared_ptr< NET_SETTINGS > & NetSettings()
static SYMBOL_LIB_TABLE * SchSymbolLibTable(PROJECT *aProject)
Accessor for project symbol library table.
Container for project specific data.
virtual PROJECT_FILE & GetProjectFile() const
void ResolveERCExclusionsPostUpdate()
Update markers to match recorded exclusions.
SCHEMATIC_SETTINGS & Settings() const
CONNECTION_GRAPH * ConnectionGraph() const override
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
ERC_SETTINGS & ErcSettings() const
Schematic editor (Eeschema) main window.
void RecalculateConnections(SCH_COMMIT *aCommit, SCH_CLEANUP_FLAGS aCleanupFlags)
Generate the connection data for the entire schematic hierarchy.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
wxString GetShownText(const SCH_SHEET_PATH *aPath, bool aAllowExtraText, int aDepth=0) const override
Segment description base class to describe items which have 2 end points (track, wire,...
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
VECTOR2I GetPosition() const override
bool IsStacked(const SCH_PIN *aPin) const
ELECTRICAL_PINTYPE GetType() const
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
SCH_REFERENCE & GetItem(int aIdx)
A helper to define a symbol's reference designator in a schematic.
const SCH_SHEET_PATH & GetSheetPath() const
const wxString GetFootprint() const
SCH_SYMBOL * GetSymbol() const
LIB_SYMBOL * GetLibPart() const
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
std::vector< SCH_SHEET_PATH > & GetClientSheetPaths()
Return the number of times this screen is used.
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void GetMultiUnitSymbols(SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols=true) const
Add a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the li...
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SCREEN * LastScreen()
SCH_SHEET * at(size_t aIndex) const
Forwarded method from std::vector.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
std::vector< SCH_FIELD > & GetFields()
VECTOR2I GetPosition() const override
std::vector< SCH_SHEET_PIN * > & GetPins()
wxString GetShownName(bool aAllowExtraText) const
std::vector< SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet=nullptr) const
Retrieve a list of the SCH_PINs for the given sheet path.
const wxString GetFootprintFieldText(bool aResolve, const SCH_SHEET_PATH *aPath, bool aAllowExtraText) const
VECTOR2I GetPosition() const override
const LIB_ID & GetLibId() const override
void GetFields(std::vector< SCH_FIELD * > &aVector, bool aVisibleOnly)
Populate a std::vector with SCH_FIELDs.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
VECTOR2I GetPosition() const override
Represent a set of closed polygons.
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
SIM_MODEL & CreateModel(SIM_MODEL::TYPE aType, const std::vector< SCH_PIN * > &aPins, REPORTER &aReporter)
SYMBOL_LIB_TABLE_ROW * FindRow(const wxString &aNickName, bool aCheckIfEnabled=false)
Return an SYMBOL_LIB_TABLE_ROW if aNickName is found in this table or in any chained fallBack table f...
bool GetExcludedFromSim() const override
A wrapper for reporting to a wxString object.
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
std::unordered_map< NET_NAME_CODE_CACHE_KEY, std::vector< CONNECTION_SUBGRAPH * > > NET_MAP
Associate a #NET_CODE_NAME with all the subgraphs in that net.
const wxString CommentERC_V[]
const wxString CommentERC_H[]
const std::set< ELECTRICAL_PINTYPE > DrivenPinTypes
const std::set< ELECTRICAL_PINTYPE > DrivingPinTypes
const std::set< ELECTRICAL_PINTYPE > DrivingPowerPinTypes
@ ERCE_POWERPIN_NOT_DRIVEN
Power input pin connected to some others pins but no power out pin to drive it.
@ ERCE_OVERLAPPING_RULE_AREAS
Rule areas are overlapping.
@ ERCE_MISSING_POWER_INPUT_PIN
Symbol has power input pins that are not placed on the schematic.
@ ERCE_SIMILAR_LABELS
2 labels are equal for case insensitive comparisons.
@ ERCE_ENDPOINT_OFF_GRID
Pin or wire-end off grid.
@ ERCE_FOOTPRINT_LINK_ISSUES
The footprint link is invalid, or points to a missing (or inactive) footprint or library.
@ ERCE_DIFFERENT_UNIT_NET
Shared pin in a multi-unit symbol is connected to more than one net.
@ ERCE_UNDEFINED_NETCLASS
A netclass was referenced but not defined.
@ ERCE_UNRESOLVED_VARIABLE
A text variable could not be resolved.
@ ERCE_SIMULATION_MODEL
An error was found in the simulation model.
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
@ ERCE_DIFFERENT_UNIT_FP
Different units of the same symbol have different footprints assigned.
@ ERCE_NOCONNECT_CONNECTED
A no connect symbol is connected to more than 1 pin.
@ ERCE_PIN_TO_PIN_WARNING
@ ERCE_PIN_NOT_DRIVEN
Pin connected to some others pins but no pin to drive it.
@ ERCE_MISSING_INPUT_PIN
Symbol has input pins that are not placed.
@ ERCE_MISSING_UNIT
Symbol has units that are not placed on the schematic.
@ ERCE_DUPLICATE_SHEET_NAME
Duplicate sheet names within a given sheet.
@ ERCE_MISSING_BIDI_PIN
Symbol has bi-directional pins that are not placed.
@ ERCE_LIB_SYMBOL_ISSUES
Symbol not found in active libraries.
@ ERCE_BUS_ALIAS_CONFLICT
Conflicting bus alias definitions across sheets.
PIN_ERROR
The values a pin-to-pin entry in the pin matrix can take on.
@ KIFACE_TEST_FOOTPRINT_LINK_LIBRARY_NOT_ENABLED
@ KIFACE_TEST_FOOTPRINT_LINK
@ KIFACE_TEST_FOOTPRINT_LINK_NO_LIBRARY
@ KIFACE_TEST_FOOTPRINT_LINK_NO_FOOTPRINT
wxString ElectricalPinTypeGetText(ELECTRICAL_PINTYPE aType)
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
@ PT_INPUT
usual pin input: must be connected
@ PT_TRISTATE
tris state bus pin
@ PT_BIDI
input or output (like port for a microprocessor)
@ PT_POWER_OUT
output of a regulator: intended to be connected to power input pins
@ PT_POWER_IN
power input (GND, VCC for ICs). Must be connected to a power output.
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin
LIB_SYMBOL * SchGetLibSymbol(const LIB_ID &aLibId, SYMBOL_LIB_TABLE *aLibTable, SYMBOL_LIB *aCacheLib, wxWindow *aParent, bool aShowErrorMsg)
Load symbol from symbol library table.
std::map< wxString, SCH_REFERENCE_LIST > SCH_MULTI_UNIT_REFERENCE_MAP
Container to map reference designators for multi-unit parts.
wxString UnescapeString(const wxString &aSource)
Implement a participant in the KIWAY alchemy.
virtual void * IfaceOrAddress(int aDataId)=0
Return pointer to the requested object.