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, const LIB_ID &aLibId, SCH_SHEET_PATH &aSheet, std::vector< SCH_SYMBOL * > *otherUnits)

Function Documentation

◆ CollectOtherUnits()

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

Definition at line 236 of file ee_collectors.cpp.

238 {
239  SCH_REFERENCE_LIST symbols;
240  aSheet.GetSymbols( symbols );
242  for( unsigned i = 0; i < symbols.GetCount(); i++ )
243  {
244  SCH_REFERENCE symbol = symbols[i];
246  if( symbol.GetRef() == aRef && symbol.GetSymbol()->GetLibId() == aLibId
247  && symbol.GetUnit() != aUnit )
248  otherUnits->push_back( symbol.GetSymbol() );
249  }
250 }
int GetUnit() const
SCH_SYMBOL * GetSymbol() const
Container to create a flattened list of symbols because in a complex hierarchy, a symbol can be used ...
wxString GetRef() const
size_t GetCount() const
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanSymbols=false) const
Adds SCH_REFERENCE object to aReferences for each symbol in the sheet.
A helper to define a symbol's reference designator in a schematic.
const LIB_ID & GetLibId() const
Definition: sch_symbol.h:147

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

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