KiCad PCB EDA Suite
lib_pin.cpp File Reference
#include <wx/tokenzr.h>
#include <fctsys.h>
#include <pgm_base.h>
#include <gr_basic.h>
#include <macros.h>
#include <trigo.h>
#include <class_drawpanel.h>
#include <draw_graphic_text.h>
#include <plotter.h>
#include <sch_edit_frame.h>
#include <base_units.h>
#include <msgpanel.h>
#include <general.h>
#include <lib_edit_frame.h>
#include <class_libentry.h>
#include <lib_pin.h>
#include <transform.h>
#include <sch_component.h>
#include <trace_helpers.h>

Go to the source code of this file.

Macros

#define PIN_ORIENTATION_CNT   DIM( pin_orientation_codes )
 
#define PIN_TEXT_MARGIN   4
 
#define NCSYMB_PIN_DIM   TARGET_PIN_RADIUS
 
#define ETXT_MAX_SIZE   Millimeter2iu(0.7 )
 

Functions

static const wxString getPinOrientationName (unsigned aPinOrientationCode)
 
static int InternalPinDecoSize (const LIB_PIN &aPin)
 Utility for getting the size of the 'internal' pin decorators (as a radius) More...
 
static int ExternalPinDecoSize (const LIB_PIN &aPin)
 Utility for getting the size of the 'external' pin decorators (as a radius) More...
 

Variables

static const int pin_orientation_codes []
 
static const BITMAP_DEF iconsPinsOrientations []
 

Macro Definition Documentation

#define ETXT_MAX_SIZE   Millimeter2iu(0.7 )
#define NCSYMB_PIN_DIM   TARGET_PIN_RADIUS
#define PIN_TEXT_MARGIN   4

Function Documentation

static int ExternalPinDecoSize ( const LIB_PIN aPin)
static

Utility for getting the size of the 'external' pin decorators (as a radius)

Definition at line 142 of file lib_pin.cpp.

References LIB_PIN::GetNumberTextSize().

Referenced by LIB_PIN::DrawPinSymbol(), LIB_PIN::GetBoundingBox(), and LIB_PIN::PlotSymbol().

143 {
144  return aPin.GetNumberTextSize() / 2;
145 }
int GetNumberTextSize() const
Definition: lib_pin.h:218
static const wxString getPinOrientationName ( unsigned  aPinOrientationCode)
static

Definition at line 108 of file lib_pin.cpp.

References PIN_ORIENTATION_CNT.

Referenced by LIB_PIN::getMsgPanelInfoBase(), and LIB_PIN::GetOrientationNames().

109 {
110  /* Note: The following name lists are sentence capitalized per the GNOME UI
111  * standards for list controls. Please do not change the capitalization
112  * of these strings unless the GNOME UI standards are changed.
113  */
114  const wxString pin_orientation_names[] =
115  {
116  _( "Right" ),
117  _( "Left" ),
118  _( "Up" ),
119  _( "Down" ),
120  wxT( "???" )
121  };
122 
123  if( aPinOrientationCode > PIN_ORIENTATION_CNT )
124  aPinOrientationCode = PIN_ORIENTATION_CNT;
125 
126  return pin_orientation_names[ aPinOrientationCode ];
127 }
#define PIN_ORIENTATION_CNT
Definition: lib_pin.cpp:60
static int InternalPinDecoSize ( const LIB_PIN aPin)
static

Utility for getting the size of the 'internal' pin decorators (as a radius)

Definition at line 133 of file lib_pin.cpp.

References LIB_PIN::GetNameTextSize(), and LIB_PIN::GetNumberTextSize().

Referenced by LIB_PIN::DrawPinSymbol(), and LIB_PIN::PlotSymbol().

134 {
135 
136  return aPin.GetNameTextSize() != 0 ? aPin.GetNameTextSize() / 2 : aPin.GetNumberTextSize() / 2;
137 }
int GetNameTextSize() const
Definition: lib_pin.h:191
int GetNumberTextSize() const
Definition: lib_pin.h:218

Variable Documentation

const BITMAP_DEF iconsPinsOrientations[]
static
Initial value:
=
{
pinorient_right_xpm,
pinorient_left_xpm,
pinorient_up_xpm,
pinorient_down_xpm,
}

Definition at line 67 of file lib_pin.cpp.

Referenced by LIB_PIN::GetOrientationSymbols().

const int pin_orientation_codes[]
static
Initial value:

Definition at line 53 of file lib_pin.cpp.

Referenced by LIB_PIN::GetOrientationCode(), and LIB_PIN::GetOrientationCodeIndex().