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.

Classes

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

Macros

#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
 

Functions

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

Variables

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

◆ PCB_BACK_SIDE

#define PCB_BACK_SIDE   0

◆ PCB_BOTH_SIDES

#define PCB_BOTH_SIDES   2

◆ PCB_FRONT_SIDE

#define PCB_FRONT_SIDE   1

◆ PLACEFILE_FORMAT_KEY

#define PLACEFILE_FORMAT_KEY   wxT( "PlaceFileFormat" )

◆ PLACEFILE_OPT_KEY

#define PLACEFILE_OPT_KEY   wxT( "PlaceFileOpts" )

◆ PLACEFILE_UNITS_KEY

#define PLACEFILE_UNITS_KEY   wxT( "PlaceFileUnits" )

Function Documentation

◆ HasNonSMDPins()

static bool HasNonSMDPins ( MODULE aModule)
static

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;
405 
406  for( pad = aModule->PadsList(); pad; pad = pad->Next() )
407  {
408  if( pad->GetAttribute() != PAD_ATTRIB_SMD )
409  return true;
410  }
411 
412  return false;
413 }
D_PAD * Next() const
Definition: class_pad.h:160
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:61
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:412
DLIST< D_PAD > & PadsList()
Definition: class_module.h:162

◆ sortFPlist()

static bool sortFPlist ( const LIST_MOD ref,
const LIST_MOD tst 
)
static

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;
392 
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

◆ backSideName

const wxString backSideName = wxT( "bottom" )

◆ conv_unit_inch

const double conv_unit_inch = 0.001 / IU_PER_MILS
static

◆ conv_unit_mm

const double conv_unit_mm = 1.0 / IU_PER_MM
static

◆ File_Place_Offset

wxPoint File_Place_Offset
static

◆ frontSideName

const wxString frontSideName = wxT( "top" )

◆ unit_text_inch

const char unit_text_inch[] = "## Unit = inches, Angle = deg.\n"
static

◆ unit_text_mm

const char unit_text_mm[] = "## Unit = mm, Angle = deg.\n"
static