KiCad PCB EDA Suite
gen_modules_placefile.cpp File Reference
#include <fctsys.h>
#include <confirm.h>
#include <kicad_string.h>
#include <gestfich.h>
#include <wxPcbStruct.h>
#include <pgm_base.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_module_position_file_base.h>

Go to the source code of this file.

Classes

class  LIST_MOD
 
class  DIALOG_GEN_MODULE_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

#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)
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 389 of file gen_modules_placefile.cpp.

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

Referenced by PCB_EDIT_FRAME::DoGenFootprintsPositionFile().

390 {
391  D_PAD* pad;
392 
393  for( pad = aModule->Pads(); pad; pad = pad->Next() )
394  {
395  if( pad->GetAttribute() != PAD_ATTRIB_SMD )
396  return true;
397  }
398 
399  return false;
400 }
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:238
Smd pad, appears on the solder paste layer (default)
Definition: pad_shapes.h:59
D_PAD * Next() const
Definition: class_pad.h:106
DLIST< D_PAD > & Pads()
Definition: class_module.h:134
static bool sortFPlist ( const LIST_MOD ref,
const LIST_MOD tst 
)
static

Definition at line 375 of file gen_modules_placefile.cpp.

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

Referenced by PCB_EDIT_FRAME::DoGenFootprintsPositionFile().

376 {
377  if( ref.m_Layer == tst.m_Layer )
378  return StrNumCmp( ref.m_Reference, tst.m_Reference, 16 ) < 0;
379 
380  return ref.m_Layer > tst.m_Layer;
381 }
int StrNumCmp(const wxString &aString1, const wxString &aString2, int aLength, bool aIgnoreCase)
Function StrLenNumCmp is a routine compatible with qsort() to sort by alphabetical order...
Definition: string.cpp:238

Variable Documentation

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