KiCad PCB EDA Suite
annotate.cpp File Reference

Component annotation. More...

#include <algorithm>
#include <fctsys.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <reporter.h>
#include <sch_edit_frame.h>
#include <sch_reference_list.h>
#include <class_library.h>

Go to the source code of this file.

Functions

void mapExistingAnnotation (std::map< timestamp_t, wxString > &aMap)
 

Detailed Description

Component annotation.

Definition in file annotate.cpp.

Function Documentation

void mapExistingAnnotation ( std::map< timestamp_t, wxString > &  aMap)

Definition at line 41 of file annotate.cpp.

References g_RootSheet, SCH_SHEET_LIST::GetComponents(), SCH_REFERENCE_LIST::GetCount(), SCH_COMPONENT::GetField(), SCH_FIELD::GetFullyQualifiedText(), EDA_ITEM::GetTimeStamp(), i, and REFERENCE.

Referenced by SCH_EDIT_FRAME::AnnotateComponents().

42 {
43  SCH_SHEET_LIST sheets( g_RootSheet );
44  SCH_REFERENCE_LIST references;
45 
46  sheets.GetComponents( references );
47 
48  for( size_t i = 0; i < references.GetCount(); i++ )
49  {
50  SCH_COMPONENT* comp = references[ i ].GetComp();
51  wxString ref = comp->GetField( REFERENCE )->GetFullyQualifiedText();
52 
53  if( !ref.Contains( wxT( "?" ) ) )
54  aMap[ comp->GetTimeStamp() ] = ref;
55  }
56 }
Class SCH_SHEET_LIST.
const wxString GetFullyQualifiedText() const
Function GetFullyQualifiedText returns the fully qualified field text by allowing for the part suffix...
Definition: sch_field.cpp:80
Field Reference of part, i.e. "IC21".
Class SCH_REFERENCE_LIST is used to create a flattened list of components because in a complex hierar...
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:56
SCH_FIELD * GetField(int aFieldNdx) const
Returns a field in this symbol.
size_t i
Definition: json11.cpp:597
Class SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:69
unsigned GetCount()
Function GetCount.
timestamp_t GetTimeStamp() const
Definition: base_struct.h:204