KiCad PCB EDA Suite
eagle_plugin.cpp File Reference
#include <cerrno>
#include <wx/string.h>
#include <wx/xml/xml.h>
#include <common.h>
#include <convert_basic_shapes_to_polygon.h>
#include <fctsys.h>
#include <geometry/geometry_utils.h>
#include <kicad_string.h>
#include <macros.h>
#include <properties.h>
#include <trigo.h>
#include <wx/filename.h>
#include <math/util.h>
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_edge_mod.h>
#include <class_zone.h>
#include <class_pcb_text.h>
#include <class_dimension.h>
#include <eagle_plugin.h>

Go to the source code of this file.

Macros

#define DIMENSION_PRECISION   1
 

Typedefs

typedef MODULE_MAP::iterator MODULE_ITER
 
typedef MODULE_MAP::const_iterator MODULE_CITER
 

Functions

static int parseEagle (const wxString &aDistance)
 Parse an eagle distance which is either mm, or mils if there is "mil" suffix. More...
 
template<typename T >
static T eagleClamp (T aMin, T aValue, T aMax)
 
static wxString makeKey (const wxString &aFirst, const wxString &aSecond)
 Assemble a two part key as a simple concatenation of aFirst and aSecond parts, using a separator. More...
 

Macro Definition Documentation

◆ DIMENSION_PRECISION

#define DIMENSION_PRECISION   1

Definition at line 476 of file eagle_plugin.cpp.

Typedef Documentation

◆ MODULE_CITER

typedef MODULE_MAP::const_iterator MODULE_CITER

Definition at line 83 of file eagle_plugin.cpp.

◆ MODULE_ITER

typedef MODULE_MAP::iterator MODULE_ITER

Definition at line 82 of file eagle_plugin.cpp.

Function Documentation

◆ eagleClamp()

template<typename T >
static T eagleClamp ( aMin,
aValue,
aMax 
)
static

Definition at line 102 of file eagle_plugin.cpp.

103 {
104  T ret = std::max( aMin, aValue );
105  return std::min( aMax, ret );
106 }

Referenced by EAGLE_PLUGIN::loadSignals(), EAGLE_PLUGIN::packagePad(), EAGLE_PLUGIN::packageSMD(), and EAGLE_PLUGIN::transferPad().

◆ makeKey()

static wxString makeKey ( const wxString &  aFirst,
const wxString &  aSecond 
)
static

Assemble a two part key as a simple concatenation of aFirst and aSecond parts, using a separator.

Definition at line 111 of file eagle_plugin.cpp.

112 {
113  wxString key = aFirst + '\x02' + aSecond;
114  return key;
115 }

Referenced by EAGLE_PLUGIN::loadElements(), EAGLE_PLUGIN::loadLibrary(), and EAGLE_PLUGIN::loadSignals().

◆ parseEagle()

static int parseEagle ( const wxString &  aDistance)
static

Parse an eagle distance which is either mm, or mils if there is "mil" suffix.

Return is in BIU.

Definition at line 88 of file eagle_plugin.cpp.

89 {
90  ECOORD::EAGLE_UNIT unit = ( aDistance.npos != aDistance.find( "mil" ) )
91  ? ECOORD::EAGLE_UNIT::EU_MIL : ECOORD::EAGLE_UNIT::EU_MM;
92 
93  ECOORD coord( aDistance, unit );
94 
95  return coord.ToPcbUnits();
96 }

References ECOORD::ToPcbUnits().

Referenced by ERULES::parse().