KiCad PCB EDA Suite
pad_edit_functions.cpp File Reference
#include <fctsys.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <trigo.h>
#include <macros.h>
#include <pcb_base_frame.h>
#include <pcb_edit_frame.h>
#include <footprint_edit_frame.h>
#include <pcbnew.h>
#include <class_board.h>
#include <class_module.h>
#include <class_pad.h>
#include <board_design_settings.h>
#include <dialog_push_pad_properties.h>

Go to the source code of this file.

Functions

static wxString GetNextPadName (wxString aPadName)
 

Function Documentation

static wxString GetNextPadName ( wxString  aPadName)
static

Definition at line 88 of file pad_edit_functions.cpp.

Referenced by PCB_BASE_FRAME::AddPad(), D_PAD::IncrementPadName(), and MODULE::Reference().

89 {
90  // Automatically increment the current pad number.
91  int num = 0;
92  int ponder = 1;
93 
94  // Trim and extract the trailing numeric part
95  while( aPadName.Len() && aPadName.Last() >= '0' && aPadName.Last() <= '9' )
96  {
97  num += ( aPadName.Last() - '0' ) * ponder;
98  aPadName.RemoveLast();
99  ponder *= 10;
100  }
101 
102  num++; // Use next number for the new pad
103  aPadName << num;
104 
105  return aPadName;
106 }