KiCad PCB EDA Suite
SCH_SCREENS Class Reference

Container class that holds multiple SCH_SCREEN objects in a hierarchy. More...

#include <sch_screen.h>

Public Member Functions

 SCH_SCREENS (SCH_SHEET *aSheet=NULL)
 
 ~SCH_SCREENS ()
 
int GetCount () const
 
SCH_SCREENGetFirst ()
 
SCH_SCREENGetNext ()
 
SCH_SCREENGetScreen (unsigned int aIndex) const
 
void ClearAnnotation ()
 Clear the annotation for all components in the hierarchy. More...
 
void ClearAnnotationOfNewSheetPaths (SCH_SHEET_LIST &aInitialSheetPathList)
 Clear the annotation for the components inside new sheetpaths when a complex hierarchy is modified and new sheetpaths added when a screen shares more than one sheet path, missing alternate references are added and alternate references of new sheet paths are cleared. More...
 
int ReplaceDuplicateTimeStamps ()
 Test all sheet and component objects in the schematic for duplicate time stamps and replaces them as necessary. More...
 
void DeleteAllMarkers (enum MARKER_BASE::TYPEMARKER aMarkerType)
 Delete all electronic rules check markers of aMarkerType from all the screens in the list. More...
 
int GetMarkerCount (enum MARKER_BASE::TYPEMARKER aMarkerType, enum MARKER_BASE::MARKER_SEVERITY aSeverity)
 Return the number of ERC markers of aMarkerType from all of the screens in the list. More...
 
void UpdateSymbolLinks (bool aForce=false)
 Initialize or reinitialize the weak reference to the LIB_PART for each SCH_COMPONENT found in the full schematic. More...
 
void TestDanglingEnds ()
 
bool HasNoFullyDefinedLibIds ()
 Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set. More...
 
size_t GetLibNicknames (wxArrayString &aLibNicknames)
 Fetch all of the symbol library nickames into aLibNicknames. More...
 
int ChangeSymbolLibNickname (const wxString &aFrom, const wxString &aTo)
 Change all of the symbol library nicknames. More...
 
void BuildClientSheetPathList ()
 built the list of sheet paths sharing a screen for each screen in use More...
 

Private Member Functions

void addScreenToList (SCH_SCREEN *aScreen)
 
void buildScreenList (SCH_SHEET *aSheet)
 

Private Attributes

std::vector< SCH_SCREEN * > m_screens
 
unsigned int m_index
 

Detailed Description

Container class that holds multiple SCH_SCREEN objects in a hierarchy.

Individual SCH_SCREEN objects are unique and correspond to .sch files.

Definition at line 523 of file sch_screen.h.

Constructor & Destructor Documentation

◆ SCH_SCREENS()

SCH_SCREENS::SCH_SCREENS ( SCH_SHEET aSheet = NULL)

Definition at line 1246 of file sch_screen.cpp.

1247 {
1248  m_index = 0;
1249  buildScreenList( ( !aSheet ) ? g_RootSheet : aSheet );
1250 }
unsigned int m_index
Definition: sch_screen.h:527
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
void buildScreenList(SCH_SHEET *aSheet)

References buildScreenList(), g_RootSheet, and m_index.

◆ ~SCH_SCREENS()

SCH_SCREENS::~SCH_SCREENS ( )

Definition at line 1253 of file sch_screen.cpp.

1254 {
1255 }

Member Function Documentation

◆ addScreenToList()

void SCH_SCREENS::addScreenToList ( SCH_SCREEN aScreen)
private

Definition at line 1287 of file sch_screen.cpp.

1288 {
1289  if( aScreen == NULL )
1290  return;
1291 
1292  for( unsigned int i = 0; i < m_screens.size(); i++ )
1293  {
1294  if( m_screens[i] == aScreen )
1295  return;
1296  }
1297 
1298  m_screens.push_back( aScreen );
1299 }
std::vector< SCH_SCREEN * > m_screens
Definition: sch_screen.h:526
size_t i
Definition: json11.cpp:597

References i, and m_screens.

Referenced by buildScreenList().

◆ BuildClientSheetPathList()

void SCH_SCREENS::BuildClientSheetPathList ( )

built the list of sheet paths sharing a screen for each screen in use

Definition at line 1585 of file sch_screen.cpp.

1586 {
1587  SCH_SHEET_LIST sheetList( g_RootSheet );
1588 
1589  for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
1590  curr_screen->GetClientSheetPaths().Clear();
1591 
1592  for( SCH_SHEET_PATH& sheetpath: sheetList )
1593  {
1594  SCH_SCREEN* used_screen = sheetpath.LastScreen();
1595 
1596  // SEarch for the used_screen in list and add this unique sheet path:
1597  for( SCH_SCREEN* curr_screen = GetFirst(); curr_screen; curr_screen = GetNext() )
1598  {
1599  if( used_screen == curr_screen )
1600  {
1601  curr_screen->GetClientSheetPaths().Add( sheetpath.Path() );
1602  break;
1603  }
1604  }
1605  }
1606 }
Class SCH_SHEET_LIST.
SCH_SCREEN * GetNext()
wxArrayString & GetClientSheetPaths()
Definition: sch_screen.h:155
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
Class SCH_SHEET_PATH.
SCH_SCREEN * GetFirst()

References g_RootSheet, SCH_SCREEN::GetClientSheetPaths(), GetFirst(), and GetNext().

Referenced by ClearAnnotationOfNewSheetPaths().

◆ buildScreenList()

void SCH_SCREENS::buildScreenList ( SCH_SHEET aSheet)
private

Definition at line 1302 of file sch_screen.cpp.

1303 {
1304  if( aSheet && aSheet->Type() == SCH_SHEET_T )
1305  {
1306  SCH_SCREEN* screen = aSheet->GetScreen();
1307 
1308  addScreenToList( screen );
1309 
1310  EDA_ITEM* strct = screen->GetDrawItems();
1311 
1312  while( strct )
1313  {
1314  if( strct->Type() == SCH_SHEET_T )
1315  {
1316  buildScreenList( ( SCH_SHEET* )strct );
1317  }
1318 
1319  strct = strct->Next();
1320  }
1321  }
1322 }
SCH_SCREEN * GetScreen()
Definition: sch_sheet.h:279
EDA_ITEM * Next() const
Definition: base_struct.h:209
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
void buildScreenList(SCH_SHEET *aSheet)
void addScreenToList(SCH_SCREEN *aScreen)
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:154
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160

References addScreenToList(), SCH_SCREEN::GetDrawItems(), SCH_SHEET::GetScreen(), EDA_ITEM::Next(), SCH_SHEET_T, and EDA_ITEM::Type().

Referenced by SCH_SCREENS().

◆ ChangeSymbolLibNickname()

int SCH_SCREENS::ChangeSymbolLibNickname ( const wxString &  aFrom,
const wxString &  aTo 
)

Change all of the symbol library nicknames.

Parameters
aFromthe current symbol library name to change.
aTothe new symbol library name.
Returns
the number of symbol library nicknames that were changed.

Definition at line 1551 of file sch_screen.cpp.

1552 {
1553  SCH_COMPONENT* symbol;
1554  SCH_ITEM* item;
1555  SCH_ITEM* nextItem;
1556  SCH_SCREEN* screen;
1557  int cnt = 0;
1558 
1559  for( screen = GetFirst(); screen; screen = GetNext() )
1560  {
1561  for( item = screen->GetDrawItems(); item; item = nextItem )
1562  {
1563  nextItem = item->Next();
1564 
1565  if( item->Type() != SCH_COMPONENT_T )
1566  continue;
1567 
1568  symbol = dynamic_cast< SCH_COMPONENT* >( item );
1569  wxASSERT( symbol );
1570 
1571  if( symbol->GetLibId().GetLibNickname() != aFrom )
1572  continue;
1573 
1574  LIB_ID id = symbol->GetLibId();
1575  id.SetLibNickname( aTo );
1576  symbol->SetLibId( id );
1577  cnt++;
1578  }
1579  }
1580 
1581  return cnt;
1582 }
SCH_SCREEN * GetNext()
SCH_ITEM * Next() const
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
void SetLibId(const LIB_ID &aName, PART_LIBS *aLibs=NULL)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:193
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
SCH_SCREEN * GetFirst()
const LIB_ID & GetLibId() const
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160

References SCH_SCREEN::GetDrawItems(), GetFirst(), SCH_COMPONENT::GetLibId(), LIB_ID::GetLibNickname(), GetNext(), SCH_ITEM::Next(), SCH_COMPONENT_T, SCH_COMPONENT::SetLibId(), LIB_ID::SetLibNickname(), and EDA_ITEM::Type().

◆ ClearAnnotation()

void SCH_SCREENS::ClearAnnotation ( )

Clear the annotation for all components in the hierarchy.

Definition at line 1325 of file sch_screen.cpp.

1326 {
1327  for( size_t i = 0; i < m_screens.size(); i++ )
1328  m_screens[i]->ClearAnnotation( NULL );
1329 }
std::vector< SCH_SCREEN * > m_screens
Definition: sch_screen.h:526
void ClearAnnotation()
Clear the annotation for all components in the hierarchy.
size_t i
Definition: json11.cpp:597

References i, and m_screens.

Referenced by SCH_EDIT_FRAME::DeleteAnnotation().

◆ ClearAnnotationOfNewSheetPaths()

void SCH_SCREENS::ClearAnnotationOfNewSheetPaths ( SCH_SHEET_LIST aInitialSheetPathList)

Clear the annotation for the components inside new sheetpaths when a complex hierarchy is modified and new sheetpaths added when a screen shares more than one sheet path, missing alternate references are added and alternate references of new sheet paths are cleared.

Parameters
aInitialSheetPathListis the initial sheet paths list of hierarchy before changes.

Definition at line 1332 of file sch_screen.cpp.

1333 {
1334  // Clear the annotation for the components inside new sheetpaths
1335  // not already in aInitialSheetList
1336  SCH_SCREENS screensList( g_RootSheet ); // The list of screens, shared by sheet paths
1337  screensList.BuildClientSheetPathList(); // build the shared by sheet paths, by screen
1338 
1339  // Search for new sheet paths, not existing in aInitialSheetPathList
1340  // and existing in sheetpathList
1341  SCH_SHEET_LIST sheetpathList( g_RootSheet );
1342 
1343  for( SCH_SHEET_PATH& sheetpath: sheetpathList )
1344  {
1345  bool path_exists = false;
1346 
1347  for( const SCH_SHEET_PATH& existing_sheetpath: aInitialSheetPathList )
1348  {
1349  if( existing_sheetpath.Path() == sheetpath.Path() )
1350  {
1351  path_exists = true;
1352  break;
1353  }
1354  }
1355 
1356  if( !path_exists )
1357  {
1358  // A new sheet path is found: clear the annotation corresponding to this new path:
1359  SCH_SCREEN* curr_screen = sheetpath.LastScreen();
1360 
1361  // Clear annotation and create the AR for this path, if not exists,
1362  // when the screen is shared by sheet paths.
1363  // Otherwise ClearAnnotation do nothing, because the F1 field is used as
1364  // reference default value and takes the latest displayed value
1365  curr_screen->EnsureAlternateReferencesExist();
1366  curr_screen->ClearAnnotation( &sheetpath );
1367  }
1368  }
1369 }
Class SCH_SHEET_LIST.
void EnsureAlternateReferencesExist()
For screens shared by many sheetpaths (complex hierarchies): to be able to clear or modify any refere...
Definition: sch_screen.cpp:700
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
Class SCH_SHEET_PATH.
void ClearAnnotation(SCH_SHEET_PATH *aSheetPath)
Clear the annotation for the components in aSheetPath on the screen.
Definition: sch_screen.cpp:681
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:523

References BuildClientSheetPathList(), SCH_SCREEN::ClearAnnotation(), SCH_SCREEN::EnsureAlternateReferencesExist(), and g_RootSheet.

Referenced by SCH_EDIT_FRAME::addCurrentItemToScreen(), SCH_EDIT_FRAME::DuplicateItemsInList(), SCH_EDIT_FRAME::OnEditItem(), and SCH_EDIT_FRAME::PasteListOfItems().

◆ DeleteAllMarkers()

void SCH_SCREENS::DeleteAllMarkers ( enum MARKER_BASE::TYPEMARKER  aMarkerType)

Delete all electronic rules check markers of aMarkerType from all the screens in the list.

Parameters
aMarkerTypeType of markers to be deleted.

Definition at line 1415 of file sch_screen.cpp.

1416 {
1417  SCH_ITEM* item;
1418  SCH_ITEM* nextItem;
1419  SCH_MARKER* marker;
1420  SCH_SCREEN* screen;
1421 
1422  for( screen = GetFirst(); screen; screen = GetNext() )
1423  {
1424  for( item = screen->GetDrawItems(); item; item = nextItem )
1425  {
1426  nextItem = item->Next();
1427 
1428  if( item->Type() != SCH_MARKER_T )
1429  continue;
1430 
1431  marker = (SCH_MARKER*) item;
1432 
1433  if( marker->GetMarkerType() != aMarkerType )
1434  continue;
1435 
1436  screen->DeleteItem( marker );
1437  }
1438  }
1439 }
SCH_SCREEN * GetNext()
SCH_ITEM * Next() const
void DeleteItem(SCH_ITEM *aItem)
Removes aItem from the linked list and deletes the object.
Definition: sch_screen.cpp:184
enum TYPEMARKER GetMarkerType() const
Definition: marker_base.h:188
SCH_SCREEN * GetFirst()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160

References SCH_SCREEN::DeleteItem(), SCH_SCREEN::GetDrawItems(), GetFirst(), MARKER_BASE::GetMarkerType(), GetNext(), SCH_ITEM::Next(), SCH_MARKER_T, and EDA_ITEM::Type().

Referenced by DIALOG_ERC::OnEraseDrcMarkersClick(), and DIALOG_ERC::TestErc().

◆ GetCount()

int SCH_SCREENS::GetCount ( ) const
inline

Definition at line 532 of file sch_screen.h.

532 { return m_screens.size(); }
std::vector< SCH_SCREEN * > m_screens
Definition: sch_screen.h:526

References m_screens.

◆ GetFirst()

◆ GetLibNicknames()

size_t SCH_SCREENS::GetLibNicknames ( wxArrayString &  aLibNicknames)

Fetch all of the symbol library nickames into aLibNicknames.

Parameters
aLibNicknamesis the array to populate with all of the unique library nicknames.
Returns
the number of symbol library nicknames found.

Definition at line 1517 of file sch_screen.cpp.

1518 {
1519  SCH_COMPONENT* symbol;
1520  SCH_ITEM* item;
1521  SCH_ITEM* nextItem;
1522  SCH_SCREEN* screen;
1523  wxString nickname;
1524 
1525  for( screen = GetFirst(); screen; screen = GetNext() )
1526  {
1527  for( item = screen->GetDrawItems(); item; item = nextItem )
1528  {
1529  nextItem = item->Next();
1530 
1531  if( item->Type() != SCH_COMPONENT_T )
1532  continue;
1533 
1534  symbol = dynamic_cast< SCH_COMPONENT* >( item );
1535  wxASSERT( symbol );
1536 
1537  if( !symbol )
1538  continue;
1539 
1540  nickname = symbol->GetLibId().GetLibNickname();
1541 
1542  if( !nickname.empty() && ( aLibNicknames.Index( nickname ) == wxNOT_FOUND ) )
1543  aLibNicknames.Add( nickname );;
1544  }
1545  }
1546 
1547  return aLibNicknames.GetCount();
1548 }
SCH_SCREEN * GetNext()
SCH_ITEM * Next() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
SCH_SCREEN * GetFirst()
const LIB_ID & GetLibId() const
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160

References SCH_SCREEN::GetDrawItems(), GetFirst(), SCH_COMPONENT::GetLibId(), LIB_ID::GetLibNickname(), GetNext(), SCH_ITEM::Next(), SCH_COMPONENT_T, and EDA_ITEM::Type().

◆ GetMarkerCount()

int SCH_SCREENS::GetMarkerCount ( enum MARKER_BASE::TYPEMARKER  aMarkerType,
enum MARKER_BASE::MARKER_SEVERITY  aSeverity 
)

Return the number of ERC markers of aMarkerType from all of the screens in the list.

Parameters
aMarkerTypeIndicates the type of marker to count. if MARKER_UNSPEC all markers are counted.
aSeverityIndicates the error level of marker to count. useMARKER_SEVERITY_UNSPEC to count all markersof the specified type
Returns
int count of the markers found.

Definition at line 1442 of file sch_screen.cpp.

1444 {
1445  int count = 0;
1446 
1447  for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
1448  {
1449  for( SCH_ITEM* item = screen->GetDrawItems(); item; item = item->Next() )
1450  {
1451  if( item->Type() != SCH_MARKER_T )
1452  continue;
1453 
1454  SCH_MARKER* marker = (SCH_MARKER*) item;
1455 
1456  if( ( aMarkerType != MARKER_BASE::MARKER_UNSPEC ) &&
1457  ( marker->GetMarkerType() != aMarkerType ) )
1458  continue;
1459 
1460  if( aSeverity == MARKER_BASE::MARKER_SEVERITY_UNSPEC ||
1461  aSeverity == marker->GetErrorLevel() )
1462  count++;
1463  }
1464  }
1465 
1466  return count;
1467 }
SCH_SCREEN * GetNext()
SCH_ITEM * Next() const
MARKER_SEVERITY GetErrorLevel() const
Definition: marker_base.h:176
enum TYPEMARKER GetMarkerType() const
Definition: marker_base.h:188
SCH_SCREEN * GetFirst()
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...

References MARKER_BASE::GetErrorLevel(), GetFirst(), MARKER_BASE::GetMarkerType(), GetNext(), MARKER_BASE::MARKER_SEVERITY_UNSPEC, MARKER_BASE::MARKER_UNSPEC, SCH_ITEM::Next(), and SCH_MARKER_T.

Referenced by DIALOG_ERC::updateMarkerCounts().

◆ GetNext()

◆ GetScreen()

SCH_SCREEN * SCH_SCREENS::GetScreen ( unsigned int  aIndex) const

Definition at line 1278 of file sch_screen.cpp.

1279 {
1280  if( aIndex < m_screens.size() )
1281  return m_screens[ aIndex ];
1282 
1283  return NULL;
1284 }
std::vector< SCH_SCREEN * > m_screens
Definition: sch_screen.h:526

References m_screens.

Referenced by GetNext().

◆ HasNoFullyDefinedLibIds()

bool SCH_SCREENS::HasNoFullyDefinedLibIds ( )

Test all of the schematic symbols to see if all LIB_ID objects library nickname is not set.

If none of the LIB_ID object library nicknames are not set, this indicates that the project was created before the symbol library implementation.

Returns
true in there are any symbols and if all of the LIB_ID object library nicknames are empty, otherwise false.

Definition at line 1484 of file sch_screen.cpp.

1485 {
1486  SCH_COMPONENT* symbol;
1487  SCH_ITEM* item;
1488  SCH_ITEM* nextItem;
1489  SCH_SCREEN* screen;
1490  unsigned cnt = 0;
1491 
1492  for( screen = GetFirst(); screen; screen = GetNext() )
1493  {
1494  for( item = screen->GetDrawItems(); item; item = nextItem )
1495  {
1496  nextItem = item->Next();
1497 
1498  if( item->Type() != SCH_COMPONENT_T )
1499  continue;
1500 
1501  cnt += 1;
1502  symbol = dynamic_cast< SCH_COMPONENT* >( item );
1503  wxASSERT( symbol );
1504 
1505  if( !symbol->GetLibId().GetLibNickname().empty() )
1506  return false;
1507  }
1508  }
1509 
1510  if( cnt == 0 )
1511  return false;
1512 
1513  return true;
1514 }
SCH_SCREEN * GetNext()
SCH_ITEM * Next() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:97
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
SCH_SCREEN * GetFirst()
const LIB_ID & GetLibId() const
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
bool empty() const
Definition: utf8.h:108
SCH_ITEM * GetDrawItems() const
Definition: sch_screen.h:160

References UTF8::empty(), SCH_SCREEN::GetDrawItems(), GetFirst(), SCH_COMPONENT::GetLibId(), LIB_ID::GetLibNickname(), GetNext(), SCH_ITEM::Next(), SCH_COMPONENT_T, and EDA_ITEM::Type().

Referenced by SCH_EDIT_FRAME::EditSheet(), SCH_EDIT_FRAME::OnRescueProject(), SCH_EDIT_FRAME::OnUpdateRemapSymbols(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ ReplaceDuplicateTimeStamps()

int SCH_SCREENS::ReplaceDuplicateTimeStamps ( )

Test all sheet and component objects in the schematic for duplicate time stamps and replaces them as necessary.

Time stamps must be unique in order for complex hierarchies know which components go to which sheets.

Returns
The number of duplicate time stamps replaced.

Definition at line 1372 of file sch_screen.cpp.

1373 {
1374  EDA_ITEMS items;
1375  SCH_ITEM* item;
1376 
1377  for( size_t i = 0; i < m_screens.size(); i++ )
1378  m_screens[i]->GetHierarchicalItems( items );
1379 
1380  if( items.size() < 2 )
1381  return 0;
1382 
1383  sort( items.begin(), items.end(), SortByTimeStamp );
1384 
1385  int count = 0;
1386 
1387  for( size_t ii = 0; ii < items.size() - 1; ii++ )
1388  {
1389  item = (SCH_ITEM*)items[ii];
1390 
1391  SCH_ITEM* nextItem = (SCH_ITEM*)items[ii + 1];
1392 
1393  if( item->GetTimeStamp() == nextItem->GetTimeStamp() )
1394  {
1395  count++;
1396 
1397  // for a component, update its Time stamp and its paths
1398  // (m_PathsAndReferences field)
1399  if( item->Type() == SCH_COMPONENT_T )
1400  ( (SCH_COMPONENT*) item )->SetTimeStamp( GetNewTimeStamp() );
1401 
1402  // for a sheet, update only its time stamp (annotation of its
1403  // components will be lost)
1404  // @todo: see how to change sheet paths for its cmp list (can
1405  // be possible in most cases)
1406  else
1407  item->SetTimeStamp( GetNewTimeStamp() );
1408  }
1409  }
1410 
1411  return count;
1412 }
timestamp_t GetNewTimeStamp()
Definition: common.cpp:216
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Definition: base_struct.h:550
timestamp_t GetTimeStamp() const
Definition: base_struct.h:207
std::vector< SCH_SCREEN * > m_screens
Definition: sch_screen.h:526
size_t i
Definition: json11.cpp:597
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:70
static bool SortByTimeStamp(const EDA_ITEM *item1, const EDA_ITEM *item2)
Sort a list of schematic items by time stamp and type.
Class SCH_ITEM is a base class for any item which can be embedded within the SCHEMATIC container clas...
KICAD_T Type() const
Function Type()
Definition: base_struct.h:201
void SetTimeStamp(timestamp_t aNewTimeStamp)
Definition: base_struct.h:206

References GetNewTimeStamp(), EDA_ITEM::GetTimeStamp(), i, m_screens, SCH_COMPONENT_T, EDA_ITEM::SetTimeStamp(), SortByTimeStamp(), and EDA_ITEM::Type().

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

◆ TestDanglingEnds()

void SCH_SCREENS::TestDanglingEnds ( )

Definition at line 1477 of file sch_screen.cpp.

1478 {
1479  for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
1480  screen->TestDanglingEnds();
1481 }
SCH_SCREEN * GetNext()
SCH_SCREEN * GetFirst()

References GetFirst(), and GetNext().

Referenced by SCH_EDIT_FRAME::AppendSchematic(), and SCH_EDIT_FRAME::KiwayMailIn().

◆ UpdateSymbolLinks()

void SCH_SCREENS::UpdateSymbolLinks ( bool  aForce = false)

Initialize or reinitialize the weak reference to the LIB_PART for each SCH_COMPONENT found in the full schematic.

It must be called from:

  • draw functions
  • when loading a schematic file
  • before creating a netlist (in case a library is modified)
  • whenever any of the libraries are modified.

Definition at line 1470 of file sch_screen.cpp.

1471 {
1472  for( SCH_SCREEN* screen = GetFirst(); screen; screen = GetNext() )
1473  screen->UpdateSymbolLinks( aForce );
1474 }
SCH_SCREEN * GetNext()
SCH_SCREEN * GetFirst()

References GetFirst(), and GetNext().

Referenced by SCH_EDIT_FRAME::AppendSchematic(), SCH_EDIT_FRAME::CreateArchiveLibraryCacheFile(), SCH_EDIT_FRAME::CreateNetlist(), SCH_EDIT_FRAME::doUpdatePcb(), SCH_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::prepareForNetlist(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), DIALOG_EDIT_COMPONENTS_LIBID::revertChanges(), DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow(), LEGACY_RESCUER::WriteRescueLibrary(), and SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary().

Member Data Documentation

◆ m_index

unsigned int SCH_SCREENS::m_index
private

Definition at line 527 of file sch_screen.h.

Referenced by GetFirst(), GetNext(), and SCH_SCREENS().

◆ m_screens

std::vector< SCH_SCREEN* > SCH_SCREENS::m_screens
private

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