KiCad PCB EDA Suite
symbol_editor_pin_tool.cpp File Reference

Go to the source code of this file.

Functions

static int GetLastPinLength ()
 
static int GetLastPinNameSize ()
 
static int GetLastPinNumSize ()
 
bool 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 symbol_editor_pin_tool.cpp.

50 {
51  if( g_LastPinLength == -1 )
52  {
53  auto* settings = Pgm().GetSettingsManager().GetAppSettings<SYMBOL_EDITOR_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:106
static int g_LastPinLength

References g_LastPinLength, and Pgm().

Referenced by SYMBOL_EDITOR_PIN_TOOL::CreatePin().

◆ GetLastPinNameSize()

static int GetLastPinNameSize ( )
static

Definition at line 60 of file symbol_editor_pin_tool.cpp.

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

References g_LastPinNameSize, and Pgm().

Referenced by SYMBOL_EDITOR_PIN_TOOL::CreatePin().

◆ GetLastPinNumSize()

static int GetLastPinNumSize ( )
static

Definition at line 71 of file symbol_editor_pin_tool.cpp.

72 {
73  if( g_LastPinNumSize == -1 )
74  {
75  auto* settings = Pgm().GetSettingsManager().GetAppSettings<SYMBOL_EDITOR_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:106
static int g_LastPinNumSize

References g_LastPinNumSize, and Pgm().

Referenced by SYMBOL_EDITOR_PIN_TOOL::CreatePin().

◆ IncrementLabelMember()

bool IncrementLabelMember ( wxString &  name,
int  aIncrement 
)

Definition at line 54 of file sch_text.cpp.

55 {
56  int ii, nn;
57  long number = 0;
58 
59  ii = name.Len() - 1;
60  nn = 0;
61 
62  // No number found, but simply repeating the same label is valid
63 
64  if( !wxIsdigit( name.GetChar( ii ) ) )
65  return true;
66 
67  while( ii >= 0 && wxIsdigit( name.GetChar( ii ) ) )
68  {
69  ii--;
70  nn++;
71  }
72 
73  ii++; /* digits are starting at ii position */
74  wxString litt_number = name.Right( nn );
75 
76  if( litt_number.ToLong( &number ) )
77  {
78  number += aIncrement;
79 
80  // Don't let result go below zero
81 
82  if( number > -1 )
83  {
84  name.Remove( ii );
85  name << number;
86  return true;
87  }
88  }
89  return false;
90 }
const char * name
Definition: DXF_plotter.cpp:59

References name.

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

Variable Documentation

◆ g_LastPinCommonConvert

bool g_LastPinCommonConvert = false
static

◆ g_LastPinCommonUnit

bool g_LastPinCommonUnit = false
static

◆ g_LastPinLength

int g_LastPinLength = -1
static

◆ g_LastPinNameSize

int g_LastPinNameSize = -1
static

◆ g_LastPinNumSize

int g_LastPinNumSize = -1
static

◆ g_LastPinOrient

◆ g_LastPinShape

◆ g_LastPinType

◆ g_LastPinVisible

bool g_LastPinVisible = true
static