KiCad PCB EDA Suite
eagle_plugin.cpp File Reference
#include <errno.h>
#include <wx/string.h>
#include <wx/xml/xml.h>
#include <common.h>
#include <macros.h>
#include <fctsys.h>
#include <trigo.h>
#include <geometry/geometry_utils.h>
#include <kicad_string.h>
#include <properties.h>
#include <wx/filename.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.

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...
 

Typedef Documentation

typedef MODULE_MAP::const_iterator MODULE_CITER

Definition at line 82 of file eagle_plugin.cpp.

typedef MODULE_MAP::iterator MODULE_ITER

Definition at line 81 of file eagle_plugin.cpp.

Function Documentation

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

Definition at line 101 of file eagle_plugin.cpp.

References max, and min.

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

102 {
103  T ret = std::max( aMin, aValue );
104  return std::min( aMax, ret );
105 }
#define max(a, b)
Definition: auxiliary.h:86
#define min(a, b)
Definition: auxiliary.h:85
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 110 of file eagle_plugin.cpp.

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

111 {
112  wxString key = aFirst + '\x02' + aSecond;
113  return key;
114 }
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 87 of file eagle_plugin.cpp.

References ECOORD::ToPcbUnits().

Referenced by ERULES::parse().

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