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>

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 141 of file lib_pin.cpp.

References LIB_PIN::GetNumberTextSize().

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

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

Definition at line 107 of file lib_pin.cpp.

References PIN_ORIENTATION_CNT.

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

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

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

Definition at line 132 of file lib_pin.cpp.

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

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

133 {
134 
135  return aPin.GetNameTextSize() != 0 ? aPin.GetNameTextSize() / 2 : aPin.GetNumberTextSize() / 2;
136 }
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 66 of file lib_pin.cpp.

Referenced by LIB_PIN::GetOrientationSymbols().

const int pin_orientation_codes[]
static
Initial value:

Definition at line 52 of file lib_pin.cpp.

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