KiCad PCB EDA Suite
ee_collectors.cpp File Reference
#include <macros.h>
#include <trace_helpers.h>
#include <ee_collectors.h>
#include <lib_item.h>
#include <sch_bus_entry.h>
#include <sch_symbol.h>
#include <sch_line.h>
#include <sch_screen.h>
#include <sch_sheet_path.h>
#include <transform.h>
#include "sch_reference_list.h"

Go to the source code of this file.


void CollectOtherUnits (const wxString &aRef, int aUnit, SCH_SHEET_PATH &aSheet, std::vector< SCH_COMPONENT * > *otherUnits)

Function Documentation

◆ CollectOtherUnits()

void CollectOtherUnits ( const wxString &  aRef,
int  aUnit,
std::vector< SCH_COMPONENT * > *  otherUnits 

Definition at line 234 of file ee_collectors.cpp.

236 {
237  SCH_REFERENCE_LIST components;
238  aSheet.GetSymbols( components );
240  for( unsigned i = 0; i < components.GetCount(); i++ )
241  {
242  SCH_REFERENCE component = components[i];
244  if( component.GetRef() == aRef && component.GetUnit() != aUnit )
245  otherUnits->push_back( component.GetSymbol() );
246  }
247 }
int GetUnit() const
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
wxString GetRef() const
SCH_COMPONENT * GetSymbol() const
unsigned GetCount() const
A helper to define a symbol's reference designator in a schematic.
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanComponents=false) const
Adds SCH_REFERENCE object to aReferences for each component in the sheet.

References SCH_REFERENCE_LIST::GetCount(), SCH_REFERENCE::GetRef(), SCH_REFERENCE::GetSymbol(), SCH_SHEET_PATH::GetSymbols(), and SCH_REFERENCE::GetUnit().

Referenced by DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), and DIALOG_SCH_EDIT_ONE_FIELD::UpdateField().