KiCad PCB EDA Suite
lib_pin.cpp File Reference
#include <fctsys.h>
#include <pgm_base.h>
#include <gr_basic.h>
#include <macros.h>
#include <trigo.h>
#include <class_drawpanel.h>
#include <drawtxt.h>
#include <plot_common.h>
#include <schframe.h>
#include <richio.h>
#include <base_units.h>
#include <msgpanel.h>
#include <general.h>
#include <libeditframe.h>
#include <class_libentry.h>
#include <lib_pin.h>
#include <transform.h>
#include <sch_component.h>
#include <wx/tokenzr.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 139 of file lib_pin.cpp.

References LIB_PIN::GetNumberTextSize().

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

140 {
141  return aPin.GetNumberTextSize() / 2;
142 }
int GetNumberTextSize() const
Definition: lib_pin.h:215
static const wxString getPinOrientationName ( unsigned  aPinOrientationCode)
static

Definition at line 106 of file lib_pin.cpp.

References PIN_ORIENTATION_CNT.

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

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

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

Definition at line 131 of file lib_pin.cpp.

References LIB_PIN::GetNameTextSize().

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

132 {
133  return aPin.GetNameTextSize() / 2;
134 }
int GetNameTextSize() const
Definition: lib_pin.h:186

Variable Documentation

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

Definition at line 65 of file lib_pin.cpp.

Referenced by LIB_PIN::GetOrientationSymbols().

const int pin_orientation_codes[]
static
Initial value:

Definition at line 51 of file lib_pin.cpp.

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