KiCad PCB EDA Suite
lib_pin_tool.cpp File Reference

Go to the source code of this file.

Functions

static int GetLastPinLength ()
 
static int GetLastPinNameSize ()
 
static int GetLastPinNumSize ()
 
void IncrementLabelMember (wxString &name, int aIncrement)
 

Variables

static ELECTRICAL_PINTYPE g_LastPinType = ELECTRICAL_PINTYPE::PT_INPUT
 
static int g_LastPinOrient = PIN_RIGHT
 
static GRAPHIC_PINSHAPE g_LastPinShape = GRAPHIC_PINSHAPE::LINE
 
static bool g_LastPinCommonConvert = false
 
static bool g_LastPinCommonUnit = false
 
static bool g_LastPinVisible = true
 
static int g_LastPinLength = -1
 
static int g_LastPinNameSize = -1
 
static int g_LastPinNumSize = -1
 

Function Documentation

◆ GetLastPinLength()

static int GetLastPinLength ( )
static

Definition at line 49 of file lib_pin_tool.cpp.

50 {
51  if( g_LastPinLength == -1 )
52  {
53  LIBEDIT_SETTINGS* settings = Pgm().GetSettingsManager().GetAppSettings<LIBEDIT_SETTINGS>();
54  g_LastPinLength = Mils2iu( settings->m_Defaults.pin_length );
55  }
56 
57  return g_LastPinLength;
58 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
static int g_LastPinLength

References g_LastPinLength, LIBEDIT_SETTINGS::m_Defaults, Pgm(), and LIBEDIT_SETTINGS::DEFAULTS::pin_length.

Referenced by LIB_PIN_TOOL::CreatePin().

◆ GetLastPinNameSize()

static int GetLastPinNameSize ( )
static

Definition at line 60 of file lib_pin_tool.cpp.

61 {
62  if( g_LastPinNameSize == -1 )
63  {
64  LIBEDIT_SETTINGS* settings = Pgm().GetSettingsManager().GetAppSettings<LIBEDIT_SETTINGS>();
65  g_LastPinNameSize = Mils2iu( settings->m_Defaults.pin_name_size );
66  }
67 
68  return g_LastPinNameSize;
69 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
static int g_LastPinNameSize

References g_LastPinNameSize, LIBEDIT_SETTINGS::m_Defaults, Pgm(), and LIBEDIT_SETTINGS::DEFAULTS::pin_name_size.

Referenced by LIB_PIN_TOOL::CreatePin().

◆ GetLastPinNumSize()

static int GetLastPinNumSize ( )
static

Definition at line 71 of file lib_pin_tool.cpp.

72 {
73  if( g_LastPinNumSize == -1 )
74  {
75  LIBEDIT_SETTINGS* settings = Pgm().GetSettingsManager().GetAppSettings<LIBEDIT_SETTINGS>();
76  g_LastPinNumSize = Mils2iu( settings->m_Defaults.pin_num_size );
77  }
78 
79  return g_LastPinNumSize;
80 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
static int g_LastPinNumSize

References g_LastPinNumSize, LIBEDIT_SETTINGS::m_Defaults, Pgm(), and LIBEDIT_SETTINGS::DEFAULTS::pin_num_size.

Referenced by LIB_PIN_TOOL::CreatePin().

◆ IncrementLabelMember()

void IncrementLabelMember ( wxString &  name,
int  aIncrement 
)

Definition at line 52 of file sch_text.cpp.

53 {
54  int ii, nn;
55  long number = 0;
56 
57  ii = name.Len() - 1; nn = 0;
58 
59  if( !wxIsdigit( name.GetChar( ii ) ) )
60  return;
61 
62  while( ii >= 0 && wxIsdigit( name.GetChar( ii ) ) )
63  {
64  ii--;
65  nn++;
66  }
67 
68  ii++; /* digits are starting at ii position */
69  wxString litt_number = name.Right( nn );
70 
71  if( litt_number.ToLong( &number ) )
72  {
73  number += aIncrement;
74  name.Remove( ii ); name << number;
75  }
76 }
const char * name
Definition: DXF_plotter.cpp:60

References name.

Referenced by SCH_TEXT::IncrementLabel(), and LIB_PIN_TOOL::RepeatPin().

Variable Documentation

◆ g_LastPinCommonConvert

bool g_LastPinCommonConvert = false
static

Definition at line 40 of file lib_pin_tool.cpp.

Referenced by LIB_PIN_TOOL::CreatePin(), and LIB_PIN_TOOL::EditPinProperties().

◆ g_LastPinCommonUnit

bool g_LastPinCommonUnit = false
static

Definition at line 41 of file lib_pin_tool.cpp.

Referenced by LIB_PIN_TOOL::CreatePin(), and LIB_PIN_TOOL::EditPinProperties().

◆ g_LastPinLength

int g_LastPinLength = -1
static

Definition at line 45 of file lib_pin_tool.cpp.

Referenced by LIB_PIN_TOOL::EditPinProperties(), and GetLastPinLength().

◆ g_LastPinNameSize

int g_LastPinNameSize = -1
static

Definition at line 46 of file lib_pin_tool.cpp.

Referenced by LIB_PIN_TOOL::EditPinProperties(), and GetLastPinNameSize().

◆ g_LastPinNumSize

int g_LastPinNumSize = -1
static

Definition at line 47 of file lib_pin_tool.cpp.

Referenced by LIB_PIN_TOOL::EditPinProperties(), and GetLastPinNumSize().

◆ g_LastPinOrient

int g_LastPinOrient = PIN_RIGHT
static

◆ g_LastPinShape

◆ g_LastPinType

◆ g_LastPinVisible

bool g_LastPinVisible = true
static

Definition at line 42 of file lib_pin_tool.cpp.

Referenced by LIB_PIN_TOOL::CreatePin(), and LIB_PIN_TOOL::EditPinProperties().