KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ARRAY_PAD_NUMBER_PROVIDER Class Reference

Simple class that sequentially provides numbers from an ARRAY_OPTIONS object, making sure that they do not conflict with numbers already existing in a FOOTPRINT. More...

#include <array_pad_number_provider.h>

Public Member Functions

 ARRAY_PAD_NUMBER_PROVIDER (const FOOTPRINT *aFootprint, const ARRAY_OPTIONS &aArrayOpts)
 
wxString GetNextPadNumber ()
 Get the next available pad name.
 

Private Member Functions

wxString getNextNumber (int &aIndex, const std::set< wxString > &aExisting)
 Get the next number from a given index/list combo.
 

Private Attributes

const ARRAY_OPTIONSm_arrayOpts
 
std::set< wxString > m_existing_pad_numbers
 
int m_current_pad_index
 

Detailed Description

Simple class that sequentially provides numbers from an ARRAY_OPTIONS object, making sure that they do not conflict with numbers already existing in a FOOTPRINT.

Definition at line 35 of file array_pad_number_provider.h.

Constructor & Destructor Documentation

◆ ARRAY_PAD_NUMBER_PROVIDER()

ARRAY_PAD_NUMBER_PROVIDER::ARRAY_PAD_NUMBER_PROVIDER ( const FOOTPRINT aFootprint,
const ARRAY_OPTIONS aArrayOpts 
)
Parameters
aFootprintthe footprint to gather existing numbers from (nullptr for no footprint)
aArrayOptsthe array options that provide the candidate numbers

Definition at line 29 of file array_pad_number_provider.cpp.

References ARRAY_OPTIONS::GetNumberingStartIsSpecified(), m_current_pad_index, m_existing_pad_numbers, pad, and FOOTPRINT::Pads().

Member Function Documentation

◆ getNextNumber()

wxString ARRAY_PAD_NUMBER_PROVIDER::getNextNumber ( int &  aIndex,
const std::set< wxString > &  aExisting 
)
private

Get the next number from a given index/list combo.

Parameters
aIndexindex to start at, will be updated
aExistingthe set of existing numbers to skip
Returns
the first number found that's not in aExisting

Definition at line 61 of file array_pad_number_provider.cpp.

References ARRAY_OPTIONS::GetItemNumber(), and m_arrayOpts.

Referenced by GetNextPadNumber().

◆ GetNextPadNumber()

wxString ARRAY_PAD_NUMBER_PROVIDER::GetNextPadNumber ( )

Get the next available pad name.

Definition at line 55 of file array_pad_number_provider.cpp.

References getNextNumber(), m_current_pad_index, and m_existing_pad_numbers.

Referenced by CheckPadNumberProvider(), and ARRAY_CREATOR::Invoke().

Member Data Documentation

◆ m_arrayOpts

const ARRAY_OPTIONS& ARRAY_PAD_NUMBER_PROVIDER::m_arrayOpts
private

Definition at line 58 of file array_pad_number_provider.h.

Referenced by getNextNumber().

◆ m_current_pad_index

int ARRAY_PAD_NUMBER_PROVIDER::m_current_pad_index
private

Definition at line 60 of file array_pad_number_provider.h.

Referenced by ARRAY_PAD_NUMBER_PROVIDER(), and GetNextPadNumber().

◆ m_existing_pad_numbers

std::set<wxString> ARRAY_PAD_NUMBER_PROVIDER::m_existing_pad_numbers
private

Definition at line 59 of file array_pad_number_provider.h.

Referenced by ARRAY_PAD_NUMBER_PROVIDER(), and GetNextPadNumber().


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