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:111
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

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}
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 48 of file sch_label.cpp.

49{
50 if( name.IsEmpty() )
51 return true;
52
53 wxString suffix;
54 wxString digits;
55 wxString outputFormat;
56 wxString outputNumber;
57 int ii = name.Len() - 1;
58 int dCount = 0;
59
60 while( ii >= 0 && !wxIsdigit( name.GetChar( ii ) ) )
61 {
62 suffix = name.GetChar( ii ) + suffix;
63 ii--;
64 }
65
66 while( ii >= 0 && wxIsdigit( name.GetChar( ii ) ) )
67 {
68 digits = name.GetChar( ii ) + digits;
69 ii--;
70 dCount++;
71 }
72
73 if( digits.IsEmpty() )
74 return true;
75
76 long number = 0;
77
78 if( digits.ToLong( &number ) )
79 {
80 number += aIncrement;
81
82 // Don't let result go below zero
83
84 if( number > -1 )
85 {
86 name.Remove( ii + 1 );
87 //write out a format string with correct number of leading zeroes
88 outputFormat.Printf( "%%0%dd", dCount );
89 //write out the number using the format string
90 outputNumber.Printf( outputFormat, number );
91 name << outputNumber << suffix;
92 return true;
93 }
94 }
95
96 return false;
97}
const char * name
Definition: DXF_plotter.cpp:56

References name.

Referenced by SCH_LABEL_BASE::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