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 50 of file symbol_editor_pin_tool.cpp.

51 {
52  if( g_LastPinLength == -1 )
53  {
54  auto* settings = Pgm().GetSettingsManager().GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
55  g_LastPinLength = Mils2iu( settings->m_Defaults.pin_length );
56  }
57 
58  return g_LastPinLength;
59 }
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 61 of file symbol_editor_pin_tool.cpp.

62 {
63  if( g_LastPinNameSize == -1 )
64  {
65  auto* settings = Pgm().GetSettingsManager().GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
66  g_LastPinNameSize = Mils2iu( settings->m_Defaults.pin_name_size );
67  }
68 
69  return g_LastPinNameSize;
70 }
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 72 of file symbol_editor_pin_tool.cpp.

73 {
74  if( g_LastPinNumSize == -1 )
75  {
76  auto* settings = Pgm().GetSettingsManager().GetAppSettings<SYMBOL_EDITOR_SETTINGS>();
77  g_LastPinNumSize = Mils2iu( settings->m_Defaults.pin_num_size );
78  }
79 
80  return g_LastPinNumSize;
81 }
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 55 of file sch_text.cpp.

56 {
57  if( name.IsEmpty() )
58  return true;
59 
60  int ii = name.Len() - 1;
61 
62  // Ignore formatting constructs
63  if( name.GetChar( ii ) == '}' )
64  ii--;
65 
66  wxString digits;
67 
68  while( ii >= 0 && wxIsdigit( name.GetChar( ii ) ) )
69  {
70  digits = name.GetChar( ii ) + digits;
71  ii--;
72  }
73 
74  if( digits.IsEmpty() )
75  return true;
76 
77  long number = 0;
78 
79  if( digits.ToLong( &number ) )
80  {
81  number += aIncrement;
82 
83  // Don't let result go below zero
84 
85  if( number > -1 )
86  {
87  name.Remove( ii + 1 );
88  name << number;
89  return true;
90  }
91  }
92 
93  return false;
94 }
const char * name
Definition: DXF_plotter.cpp:56

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