KiCad PCB EDA Suite
SCH_SHEET_LIST Class Reference

Class SCH_SHEET_LIST. More...

#include <sch_sheet_path.h>

Inheritance diagram for SCH_SHEET_LIST:

Public Member Functions

 SCH_SHEET_LIST (SCH_SHEET *aSheet=NULL)
 Constructor build a flattened list of SCH_SHEET_PATH objects from aSheet. More...
 
 ~SCH_SHEET_LIST ()
 
SCH_SHEET_PATHGetSheetByPath (const wxString &aPath, bool aHumanReadable=true)
 Function GetSheetByPath returns a sheet matching the path name in aPath. More...
 
bool IsModified ()
 Function IsModified checks the entire hierarchy for any modifications. More...
 
void ClearModifyStatus ()
 
void AnnotatePowerSymbols ()
 Function AnnotatePowerSymbols Silently annotates the not yet annotated power symbols of the entire hierarchy of the sheet path list. More...
 
void GetComponents (SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanComponents=false)
 Function GetComponents adds a SCH_REFERENCE() object to aReferences for each component in the list of sheets. More...
 
void GetMultiUnitComponents (SCH_MULTI_UNIT_REFERENCE_MAP &aRefList, bool aIncludePowerSymbols=true)
 Function GetMultiUnitComponents adds a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the list of sheets. More...
 
SCH_ITEMFindNextItem (KICAD_T aType, SCH_SHEET_PATH **aSheetFound=NULL, SCH_ITEM *aLastItem=NULL, bool aWrap=true)
 Function FindNextItem searches the entire schematic for the next schematic object. More...
 
SCH_ITEMFindPreviousItem (KICAD_T aType, SCH_SHEET_PATH **aSheetFound=NULL, SCH_ITEM *aLastItem=NULL, bool aWrap=true)
 Function FindPreviousItem searches the entire schematic for the previous schematic item. More...
 
bool SetComponentFootprint (const wxString &aReference, const wxString &aFootPrint, bool aSetVisible)
 Function SetFootprintField searches all the sheets for a component with aReference and set the footprint field to aFootPrint if found. More...
 
bool IsComplexHierarchy () const
 Function IsComplexHierarchy searches all of the sheets for duplicate files names which indicates a complex hierarchy. More...
 
bool TestForRecursion (const SCH_SHEET_LIST &aSrcSheetHierarchy, const wxString &aDestFileName) const
 Function TestForRecursion. More...
 
SCH_SHEETFindSheetByName (const wxString &aSheetName)
 Function FindSheetByName. More...
 
void BuildSheetList (SCH_SHEET *aSheet)
 Function BuildSheetList builds the list of sheets and their sheet path from aSheet. More...
 

Private Attributes

bool m_isRootSheet
 
SCH_SHEET_PATH m_currentSheetPath
 

Detailed Description

Class SCH_SHEET_LIST.

handles a list of SCH_SHEET_PATH objects in a flattened hierarchy.

SCH_SHEET objects are not unique, there can be many sheets with the same filename and that share the same SCH_SCREEN reference. Each The schematic file (SCH_SCREEN) may be shared between these sheets and component references are specific to a sheet path. When a sheet is entered, component references and sheet page number are updated.

Definition at line 324 of file sch_sheet_path.h.

Constructor & Destructor Documentation

SCH_SHEET_LIST::SCH_SHEET_LIST ( SCH_SHEET aSheet = NULL)

Constructor build a flattened list of SCH_SHEET_PATH objects from aSheet.

If aSheet == NULL, then this is an empty hierarchy which the user can populate.

Definition at line 429 of file sch_sheet_path.cpp.

430 {
431  m_isRootSheet = false;
432 
433  if( aSheet != NULL )
434  BuildSheetList( aSheet );
435 }
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.

Member Function Documentation

void SCH_SHEET_LIST::AnnotatePowerSymbols ( )

Function AnnotatePowerSymbols Silently annotates the not yet annotated power symbols of the entire hierarchy of the sheet path list.

It is called before creating a netlist, to annotate power symbols, without prompting the user about not annotated or duplicate for these symbols, if only these symbols need annotation ( a very frequent case ).

Definition at line 513 of file sch_sheet_path.cpp.

References SCH_REFERENCE_LIST::AddItem(), SCH_REFERENCE_LIST::Annotate(), SCH_REFERENCE_LIST::GetCount(), SCH_COMPONENT::GetPartRef(), LIB_PART::IsPower(), SCH_SHEET_PATH::LastDrawList(), SCH_ITEM::Next(), SCH_COMPONENT_T, SCH_REFERENCE_LIST::SplitReferences(), and SCH_REFERENCE_LIST::UpdateAnnotation().

Referenced by SCH_EDIT_FRAME::CreateNetlist(), SCH_EDIT_FRAME::doUpdatePcb(), SCH_EDIT_FRAME::prepareForNetlist(), and DIALOG_ERC::TestErc().

514 {
515  // List of reference for power symbols
516  SCH_REFERENCE_LIST references;
517 
518  // Map of locked components (not used, but needed by Annotate()
519  SCH_MULTI_UNIT_REFERENCE_MAP lockedComponents;
520 
521  // Build the list of power components:
522  for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
523  {
524  SCH_SHEET_PATH& spath = *it;
525 
526  for( EDA_ITEM* item = spath.LastDrawList(); item; item = item->Next() )
527  {
528  if( item->Type() != SCH_COMPONENT_T )
529  continue;
530 
531  SCH_COMPONENT* component = (SCH_COMPONENT*) item;
532  LIB_PART* part = component->GetPartRef().lock().get();
533 
534  if( !part || !part->IsPower() )
535  continue;
536 
537  if( part )
538  {
539  SCH_REFERENCE reference( component, part, spath );
540  references.AddItem( reference );
541  }
542  }
543  }
544 
545  // Find duplicate, and silently clear annotation of duplicate
546  std::map<wxString, int> ref_list; // stores the existing references
547 
548  for( unsigned ii = 0; ii< references.GetCount(); ++ii )
549  {
550  wxString curr_ref = references[ii].GetRef();
551 
552  if( ref_list.find( curr_ref ) == ref_list.end() )
553  {
554  ref_list[curr_ref] = ii;
555  continue;
556  }
557 
558  // Possible duplicate, if the ref ends by a number:
559  if( curr_ref.Last() < '0' && curr_ref.Last() > '9' )
560  continue; // not annotated
561 
562  // Duplicate: clear annotation by removing the number ending the ref
563  while( curr_ref.Last() >= '0' && curr_ref.Last() <= '9' )
564  curr_ref.RemoveLast();
565 
566  references[ii].SetRef( curr_ref );
567  }
568 
569 
570  // Break full components reference in name (prefix) and number:
571  // example: IC1 become IC, and 1
572  references.SplitReferences();
573 
574  // Ensure all power symbols have the reference starting by '#'
575  // (No sure this is really useful)
576  for( unsigned ii = 0; ii< references.GetCount(); ++ii )
577  {
578  if( references[ii].GetRef()[0] != '#' )
579  {
580  wxString new_ref = "#" + references[ii].GetRef();
581  references[ii].SetRef( new_ref );
582  }
583  }
584 
585  // Recalculate and update reference numbers in schematic
586  references.Annotate( false, 0, 100, lockedComponents );
587  references.UpdateAnnotation();
588 }
SCH_ITEM * LastDrawList() const
Function LastDrawList.
PART_REF & GetPartRef()
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
bool IsPower() const
void AddItem(SCH_REFERENCE &aItem)
Function AddItem adds a SCH_REFERENCE object to the list of references.
SCH_ITEM * Next() const
Class SCH_REFERENCE_LIST is used to create a flattened list of components because in a complex hierar...
void UpdateAnnotation()
function UpdateAnnotation Updates the reference components for the schematic project (or the current ...
Define a library symbol object.
void Annotate(bool aUseSheetNum, int aSheetIntervalId, int aStartNumber, SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap)
Function Annotate set the reference designators in the list that have not been annotated.
Class SCH_SHEET_PATH.
std::map< wxString, SCH_REFERENCE_LIST > SCH_MULTI_UNIT_REFERENCE_MAP
Type SCH_MULTI_UNIT_REFERENCE_MAP is used to create a map of reference designators for multi-unit par...
void SplitReferences()
Function SplitReferences attempts to split all reference designators into a name (U) and number (1)...
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:69
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:162
unsigned GetCount()
Function GetCount.
Class SCH_REFERENCE is used as a helper to define a component&#39;s reference designator in a schematic...
void SCH_SHEET_LIST::BuildSheetList ( SCH_SHEET aSheet)

Function BuildSheetList builds the list of sheets and their sheet path from aSheet.

If aSheet is the root sheet, the full sheet path and sheet list are built.

Parameters
aSheetis the starting sheet from which the list is built, or NULL indicating that g_RootSheet should be used.
Exceptions
std::bad_allocif the memory for the sheet path list could not be allocated.
Todo:
: Schematic page number is currently a left over relic and is generated as SCH_SHEET_PATH object is pushed to the list. This only has meaning when entire hierarchy is created from the root sheet down.

Definition at line 454 of file sch_sheet_path.cpp.

References g_RootSheet, SCH_SHEET::GetScreen(), EDA_ITEM::Next(), SCH_SHEET_T, and EDA_ITEM::Type().

Referenced by DIALOG_PLOT_SCHEMATIC::CreateDXFFile(), DIALOG_PLOT_SCHEMATIC::createHPGLFile(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_PLOT_SCHEMATIC::createPSFile(), DIALOG_PLOT_SCHEMATIC::createSVGFile(), and SCH_EDIT_FRAME::FindComponentAndItem().

455 {
456  wxCHECK_RET( aSheet != NULL, wxT( "Cannot build sheet list from undefined sheet." ) );
457 
458  if( aSheet == g_RootSheet )
459  m_isRootSheet = true;
460 
461  m_currentSheetPath.push_back( aSheet );
462 
468  m_currentSheetPath.SetPageNumber( size() + 1 );
469  push_back( m_currentSheetPath );
470 
471  if( aSheet->GetScreen() )
472  {
474 
475  while( item )
476  {
477  if( item->Type() == SCH_SHEET_T )
478  {
479  SCH_SHEET* sheet = (SCH_SHEET*) item;
480  BuildSheetList( sheet );
481  }
482 
483  item = item->Next();
484  }
485  }
486 
487  m_currentSheetPath.pop_back();
488 }
SCH_ITEM * LastDrawList() const
Function LastDrawList.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:209
void SetPageNumber(int aPageNumber)
EDA_ITEM * Next() const
Definition: base_struct.h:217
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:279
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:55
SCH_SHEET_PATH m_currentSheetPath
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:162
void SCH_SHEET_LIST::ClearModifyStatus ( )

Definition at line 503 of file sch_sheet_path.cpp.

Referenced by SCH_EDIT_FRAME::OnCloseWindow().

504 {
505  for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
506  {
507  if( (*it).LastScreen() )
508  (*it).LastScreen()->ClrModify();
509  }
510 }
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
SCH_ITEM * SCH_SHEET_LIST::FindNextItem ( KICAD_T  aType,
SCH_SHEET_PATH **  aSheetFound = NULL,
SCH_ITEM aLastItem = NULL,
bool  aWrap = true 
)

Function FindNextItem searches the entire schematic for the next schematic object.

Parameters
aType- The type of schematic item to find.
aSheetFound- The sheet the item was found in. NULL if the next item is not found.
aLastItem- Find next item after aLastItem if not NULL.
aWrap- Wrap past around the end of the list of sheets.
Returns
If found, Returns the next schematic item. Otherwise, returns NULL.

Definition at line 620 of file sch_sheet_path.cpp.

References SCH_ITEM::Next(), and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::OnFindDrcMarker().

622 {
623  bool hasWrapped = false;
624  bool firstItemFound = false;
625 
626  SCH_ITEM* drawItem = NULL;
627  SCH_SHEET_PATHS_ITER it = begin();
628 
629  while( it != end() )
630  {
631  drawItem = (*it).LastDrawList();
632 
633  while( drawItem )
634  {
635  if( drawItem->Type() == aType )
636  {
637  if( aLastItem == NULL || firstItemFound )
638  {
639  if( aSheetFoundIn )
640  *aSheetFoundIn = &(*it);
641 
642  return drawItem;
643  }
644  else if( !firstItemFound && drawItem == aLastItem )
645  {
646  firstItemFound = true;
647  }
648  }
649 
650  drawItem = drawItem->Next();
651  }
652 
653  ++it;
654 
655  if( it == end() && aLastItem && aWrap && !hasWrapped )
656  {
657  hasWrapped = true;
658  it = begin();
659  }
660  }
661 
662  return NULL;
663 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:209
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
SCH_ITEM * Next() const
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
SCH_ITEM * SCH_SHEET_LIST::FindPreviousItem ( KICAD_T  aType,
SCH_SHEET_PATH **  aSheetFound = NULL,
SCH_ITEM aLastItem = NULL,
bool  aWrap = true 
)

Function FindPreviousItem searches the entire schematic for the previous schematic item.

Parameters
aType- The type of schematic item to find.
aSheetFound- The sheet the item was found in. NULL if the previous item is not found.
aLastItem- Find the previous item before aLastItem if not NULL.
aWrap- Wrap past around the beginning of the list of sheets.
Returns
If found, the previous schematic item. Otherwise, NULL.

Definition at line 666 of file sch_sheet_path.cpp.

References SCH_ITEM::Back(), and EDA_ITEM::Type().

668 {
669  bool hasWrapped = false;
670  bool firstItemFound = false;
671  SCH_ITEM* drawItem = NULL;
672  SCH_SHEET_PATHS_RITER it = rbegin();
673 
674  while( it != rend() )
675  {
676  drawItem = (*it).FirstDrawList();
677 
678  while( drawItem )
679  {
680  if( drawItem->Type() == aType )
681  {
682  if( aLastItem == NULL || firstItemFound )
683  {
684  if( aSheetFoundIn )
685  *aSheetFoundIn = &(*it);
686 
687  return drawItem;
688  }
689  else if( !firstItemFound && drawItem == aLastItem )
690  {
691  firstItemFound = true;
692  }
693  }
694 
695  drawItem = drawItem->Back();
696  }
697 
698  ++it;
699 
700  if( it == rend() && aLastItem && aWrap && !hasWrapped )
701  {
702  hasWrapped = true;
703  it = rbegin();
704  }
705  }
706 
707  return NULL;
708 }
KICAD_T Type() const
Function Type()
Definition: base_struct.h:209
SCH_ITEM * Back() const
SCH_SHEET_PATHS::reverse_iterator SCH_SHEET_PATHS_RITER
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
SCH_SHEET * SCH_SHEET_LIST::FindSheetByName ( const wxString &  aSheetName)

Function FindSheetByName.

searches the entire SCH_SHEET_LIST for a sheet named aSheetName.

Parameters
aSheetNameis the name of the sheet to find.
Returns
a pointer to the sheet named aSheetName if found or NULL if not found.

Definition at line 776 of file sch_sheet_path.cpp.

References i.

Referenced by SCH_EDIT_FRAME::EditSheet().

777 {
778  for( unsigned i = 0; i < size(); i++ )
779  {
780  SCH_SHEET* sheet = at( i ).FindSheetByName( aSheetName );
781 
782  if( sheet )
783  return sheet;
784  }
785 
786  return NULL;
787 }
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
size_t i
Definition: json11.cpp:597
void SCH_SHEET_LIST::GetComponents ( SCH_REFERENCE_LIST aReferences,
bool  aIncludePowerSymbols = true,
bool  aForceIncludeOrphanComponents = false 
)

Function GetComponents adds a SCH_REFERENCE() object to aReferences for each component in the list of sheets.

Parameters
aReferencesList of references to populate.
aIncludePowerSymbolsSet to false to only get normal components.
aForceIncludeOrphanComponents: true to include components having no symbol found in lib. ( orphan components) The normal option is false, and set to true only to build the full list of components.

Definition at line 591 of file sch_sheet_path.cpp.

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::backAnnotateFootprints(), SCH_EDIT_FRAME::CheckAnnotate(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_EDIT_COMPONENTS_LIBID::initDlg(), mapExistingAnnotation(), and SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile().

593 {
594  for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
595  (*it).GetComponents( aReferences, aIncludePowerSymbols, aForceIncludeOrphanComponents );
596 }
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
void SCH_SHEET_LIST::GetMultiUnitComponents ( SCH_MULTI_UNIT_REFERENCE_MAP aRefList,
bool  aIncludePowerSymbols = true 
)

Function GetMultiUnitComponents adds a SCH_REFERENCE_LIST object to aRefList for each same-reference set of multi-unit parts in the list of sheets.

The map key for each element will be the reference designator.

Parameters
aRefListMap of reference designators to reference lists
aIncludePowerSymbolsSet to false to only get normal components.

Definition at line 598 of file sch_sheet_path.cpp.

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), and TestMultiunitFootprints().

600 {
601  for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
602  {
604  (*it).GetMultiUnitComponents( tempMap );
605 
606  for( SCH_MULTI_UNIT_REFERENCE_MAP::value_type& pair : tempMap )
607  {
608  // Merge this list into the main one
609  unsigned n_refs = pair.second.GetCount();
610 
611  for( unsigned thisRef = 0; thisRef < n_refs; ++thisRef )
612  {
613  aRefList[pair.first].AddItem( pair.second[thisRef] );
614  }
615  }
616  }
617 }
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
std::map< wxString, SCH_REFERENCE_LIST > SCH_MULTI_UNIT_REFERENCE_MAP
Type SCH_MULTI_UNIT_REFERENCE_MAP is used to create a map of reference designators for multi-unit par...
SCH_SHEET_PATH * SCH_SHEET_LIST::GetSheetByPath ( const wxString &  aPath,
bool  aHumanReadable = true 
)

Function GetSheetByPath returns a sheet matching the path name in aPath.

Parameters
aPathA wxString object containing path of the sheet to get.
aHumanReadableTrue uses the human readable path for comparison. False uses the timestamp generated path.
Returns
The sheet that matches aPath or NULL if no sheet matching aPath is found.

Definition at line 438 of file sch_sheet_path.cpp.

References i, and SCH_SHEET_PATH::PathHumanReadable().

Referenced by SCH_EDIT_FRAME::OnFindReplace(), and SCH_EDIT_FRAME::updateFindReplaceView().

439 {
440  wxString sheetPath;
441 
442  for( unsigned i = 0; i < size(); i++ )
443  {
444  sheetPath = ( aHumanReadable ) ? at( i ).PathHumanReadable() : at( i ).Path();
445 
446  if( sheetPath == aPath )
447  return &at( i );
448  }
449 
450  return NULL;
451 }
size_t i
Definition: json11.cpp:597
bool SCH_SHEET_LIST::IsComplexHierarchy ( ) const

Function IsComplexHierarchy searches all of the sheets for duplicate files names which indicates a complex hierarchy.

Returns
true if the SCH_SHEET_LIST is a complex hierarchy.

Definition at line 723 of file sch_sheet_path.cpp.

References i.

724 {
725  wxString fileName;
726 
727  for( unsigned i = 0; i < size(); i++ )
728  {
729  fileName = at( i ).Last()->GetFileName();
730 
731  for( unsigned j = 0; j < size(); j++ )
732  {
733  if( i == j )
734  continue;
735 
736  if( fileName == at( j ).Last()->GetFileName() )
737  return true;
738  }
739  }
740 
741  return false;
742 }
size_t i
Definition: json11.cpp:597
bool SCH_SHEET_LIST::IsModified ( )

Function IsModified checks the entire hierarchy for any modifications.

Returns
True if the hierarchy is modified otherwise false.

Definition at line 491 of file sch_sheet_path.cpp.

Referenced by SCH_EDIT_FRAME::OnCloseWindow(), and SCH_EDIT_FRAME::OnUpdateSave().

492 {
493  for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
494  {
495  if( (*it).LastScreen() && (*it).LastScreen()->IsModify() )
496  return true;
497  }
498 
499  return false;
500 }
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
bool SCH_SHEET_LIST::SetComponentFootprint ( const wxString &  aReference,
const wxString &  aFootPrint,
bool  aSetVisible 
)

Function SetFootprintField searches all the sheets for a component with aReference and set the footprint field to aFootPrint if found.

Parameters
aReferenceThe reference designator of the component.
aFootPrintThe value to set the footprint field.
aSetVisibleThe value to set the field visibility flag.
Returns
True if aReference was found otherwise false.

Definition at line 711 of file sch_sheet_path.cpp.

713 {
714  bool found = false;
715 
716  for( SCH_SHEET_PATHS_ITER it = begin(); it != end(); ++it )
717  found = (*it).SetComponentFootprint( aReference, aFootPrint, aSetVisible );
718 
719  return found;
720 }
SCH_SHEET_PATHS::iterator SCH_SHEET_PATHS_ITER
bool SCH_SHEET_LIST::TestForRecursion ( const SCH_SHEET_LIST aSrcSheetHierarchy,
const wxString &  aDestFileName 
) const

Function TestForRecursion.

test every SCH_SHEET_PATH in the SCH_SHEET_LIST to verify if adding the sheets stored in aSrcSheetHierarchy to the sheet stored in aDestFileName will cause recursion.

Parameters
aSrcSheetHierarchyis the SCH_SHEET_LIST of the source sheet add to aDestFileName.
aDestFileNameis the file name of the destination sheet for aSrcFileName.
Returns
true if aFileName will cause recursion in the sheet path. Otherwise false.

Definition at line 745 of file sch_sheet_path.cpp.

References g_RootSheet, SCH_SHEET::GetFileName(), SCH_SHEET_PATH::GetSheet(), and i.

Referenced by SCH_EDIT_FRAME::AppendSchematic(), SCH_EDIT_FRAME::EditSheet(), and SCH_EDIT_FRAME::PasteListOfItems().

747 {
748  wxFileName rootFn = g_RootSheet->GetFileName();
749  wxFileName destFn = aDestFileName;
750 
751  if( destFn.IsRelative() )
752  destFn.MakeAbsolute( rootFn.GetPath() );
753 
754  // Test each SCH_SHEET_PATH in this SCH_SHEET_LIST for potential recursion.
755  for( unsigned i = 0; i < size(); i++ )
756  {
757  // Test each SCH_SHEET_PATH in the source sheet.
758  for( unsigned j = 0; j < aSrcSheetHierarchy.size(); j++ )
759  {
760  const SCH_SHEET_PATH* sheetPath = &aSrcSheetHierarchy[j];
761 
762  for( unsigned k = 0; k < sheetPath->size(); k++ )
763  {
764  if( at( i ).TestForRecursion( sheetPath->GetSheet( k )->GetFileName(),
765  aDestFileName ) )
766  return true;
767  }
768  }
769  }
770 
771  // The source sheet file can safely be added to the destination sheet file.
772  return false;
773 }
const SCH_SHEET * GetSheet(unsigned aIndex) const
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:55
Class SCH_SHEET_PATH.
wxString GetFileName(void) const
Return the filename corresponding to this sheet.
Definition: sch_sheet.cpp:646
size_t i
Definition: json11.cpp:597

Member Data Documentation

SCH_SHEET_PATH SCH_SHEET_LIST::m_currentSheetPath
private

Definition at line 328 of file sch_sheet_path.h.

bool SCH_SHEET_LIST::m_isRootSheet
private

Definition at line 327 of file sch_sheet_path.h.


The documentation for this class was generated from the following files: