KiCad PCB EDA Suite
gen_footprints_placefile.cpp File Reference
#include <fctsys.h>
#include <confirm.h>
#include <kicad_string.h>
#include <gestfich.h>
#include <pcb_edit_frame.h>
#include <pgm_base.h>
#include <bitmaps.h>
#include <build_version.h>
#include <macros.h>
#include <reporter.h>
#include <class_board.h>
#include <class_module.h>
#include <pcbnew.h>
#include <wildcards_and_files_ext.h>
#include <kiface_i.h>
#include <wx_html_report_panel.h>
#include <dialog_gen_footprint_position_file_base.h>

Go to the source code of this file.


class  LIST_MOD
 The dialog to create footprint position files and choose options (one or 2 files, units and force all SMD footprints in list) More...


#define PLACEFILE_UNITS_KEY   wxT( "PlaceFileUnits" )
#define PLACEFILE_OPT_KEY   wxT( "PlaceFileOpts" )
#define PLACEFILE_FORMAT_KEY   wxT( "PlaceFileFormat" )
#define PCB_BACK_SIDE   0
#define PCB_FRONT_SIDE   1
#define PCB_BOTH_SIDES   2


static bool sortFPlist (const LIST_MOD &ref, const LIST_MOD &tst)
static bool HasNonSMDPins (MODULE *aModule)
 Helper function HasNonSMDPins returns true if the given module has any non smd pins, such as through hole and therefore cannot be placed automatically. More...


const wxString frontSideName = wxT( "top" )
const wxString backSideName = wxT( "bottom" )
static const double conv_unit_inch = 0.001 / IU_PER_MILS
static const char unit_text_inch [] = "## Unit = inches, Angle = deg.\n"
static const double conv_unit_mm = 1.0 / IU_PER_MM
static const char unit_text_mm [] = "## Unit = mm, Angle = deg.\n"
static wxPoint File_Place_Offset

Macro Definition Documentation

#define PCB_BACK_SIDE   0
#define PCB_BOTH_SIDES   2
#define PCB_FRONT_SIDE   1
#define PLACEFILE_FORMAT_KEY   wxT( "PlaceFileFormat" )
#define PLACEFILE_OPT_KEY   wxT( "PlaceFileOpts" )
#define PLACEFILE_UNITS_KEY   wxT( "PlaceFileUnits" )

Function Documentation

static bool HasNonSMDPins ( MODULE aModule)

Helper function HasNonSMDPins returns true if the given module has any non smd pins, such as through hole and therefore cannot be placed automatically.

Definition at line 402 of file gen_footprints_placefile.cpp.

References D_PAD::GetAttribute(), D_PAD::Next(), PAD_ATTRIB_SMD, and MODULE::PadsList().

Referenced by PCB_EDIT_FRAME::DoGenFootprintsPositionFile().

403 {
404  D_PAD* pad;
406  for( pad = aModule->PadsList(); pad; pad = pad->Next() )
407  {
408  if( pad->GetAttribute() != PAD_ATTRIB_SMD )
409  return true;
410  }
412  return false;
413 }
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:405
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:61
D_PAD * Next() const
Definition: class_pad.h:160
DLIST< D_PAD > & PadsList()
Definition: class_module.h:163
static bool sortFPlist ( const LIST_MOD ref,
const LIST_MOD tst 

Definition at line 388 of file gen_footprints_placefile.cpp.

References LIST_MOD::m_Layer, LIST_MOD::m_Reference, and StrNumCmp().

Referenced by PCB_EDIT_FRAME::DoGenFootprintsPositionFile().

389 {
390  if( ref.m_Layer == tst.m_Layer )
391  return StrNumCmp( ref.m_Reference, tst.m_Reference, 16 ) < 0;
393  return ref.m_Layer > tst.m_Layer;
394 }
int StrNumCmp(const wxString &aString1, const wxString &aString2, int aLength, bool aIgnoreCase)
Function StrNumCmp is a routine compatible with qsort() to sort by alphabetical order.
Definition: string.cpp:315

Variable Documentation

const wxString backSideName = wxT( "bottom" )
const double conv_unit_inch = 0.001 / IU_PER_MILS
const double conv_unit_mm = 1.0 / IU_PER_MM
wxPoint File_Place_Offset
const wxString frontSideName = wxT( "top" )
const char unit_text_inch[] = "## Unit = inches, Angle = deg.\n"
const char unit_text_mm[] = "## Unit = mm, Angle = deg.\n"