KiCad PCB EDA Suite
ar_autoplacer.cpp File Reference
#include <fctsys.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <pcbnew.h>
#include <pcb_edit_frame.h>
#include <gr_basic.h>
#include <macros.h>
#include <msgpanel.h>
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_drawsegment.h>
#include <class_pad.h>
#include <board_commit.h>
#include <connectivity/connectivity_data.h>
#include <ratsnest_data.h>
#include <widgets/progress_reporter.h>
#include "ar_matrix.h"
#include "ar_cell.h"
#include "ar_autoplacer.h"

Go to the source code of this file.

Macros

#define AR_GAIN   16
 
#define AR_KEEPOUT_MARGIN   500
 
#define AR_ABORT_PLACEMENT   -1
 

Functions

static bool sortFootprintsByComplexity (MODULE *ref, MODULE *compare)
 
static bool sortFootprintsByRatsnestSize (MODULE *ref, MODULE *compare)
 

Variables

static const double OrientationPenalty [11]
 

Macro Definition Documentation

#define AR_ABORT_PLACEMENT   -1
#define AR_GAIN   16
#define AR_KEEPOUT_MARGIN   500

Definition at line 55 of file ar_autoplacer.cpp.

Referenced by AR_AUTOPLACER::genModuleOnRoutingMatrix().

Function Documentation

static bool sortFootprintsByComplexity ( MODULE ref,
MODULE compare 
)
static

Definition at line 725 of file ar_autoplacer.cpp.

References MODULE::GetArea(), and MODULE::GetPadCount().

Referenced by AR_AUTOPLACER::pickModule().

726 {
727  double ff1, ff2;
728 
729  ff1 = ref->GetArea() * ref->GetPadCount();
730  ff2 = compare->GetArea() * compare->GetPadCount();
731 
732  return ff2 < ff1;
733 }
unsigned GetPadCount(INCLUDE_NPTH_T aIncludeNPTH=INCLUDE_NPTH_T(INCLUDE_NPTH)) const
GetPadCount returns the number of pads.
double GetArea(int aPadding=0) const
static bool sortFootprintsByRatsnestSize ( MODULE ref,
MODULE compare 
)
static

Definition at line 736 of file ar_autoplacer.cpp.

References MODULE::GetArea(), and MODULE::GetFlag().

Referenced by AR_AUTOPLACER::pickModule().

737 {
738  double ff1, ff2;
739 
740  ff1 = ref->GetArea() * ref->GetFlag();
741  ff2 = compare->GetArea() * compare->GetFlag();
742  return ff2 < ff1;
743 }
int GetFlag() const
Definition: class_module.h:231
double GetArea(int aPadding=0) const

Variable Documentation

const double OrientationPenalty[11]
static
Initial value:
=
{
2.0,
1.9,
1.8,
1.7,
1.6,
1.5,
1.4,
1.3,
1.2,
1.1,
1.0
}

Definition at line 61 of file ar_autoplacer.cpp.

Referenced by AR_AUTOPLACER::AutoplaceModules().