KiCad PCB EDA Suite
kicad_plugin.cpp File Reference
#include <fctsys.h>
#include <kicad_string.h>
#include <common.h>
#include <build_version.h>
#include <macros.h>
#include <wildcards_and_files_ext.h>
#include <base_units.h>
#include <class_board.h>
#include <class_module.h>
#include <class_pcb_text.h>
#include <class_dimension.h>
#include <class_track.h>
#include <class_zone.h>
#include <class_drawsegment.h>
#include <class_mire.h>
#include <class_edge_mod.h>
#include <pcb_plot_params.h>
#include <zones.h>
#include <kicad_plugin.h>
#include <pcb_parser.h>
#include <wx/dir.h>
#include <wx/filename.h>
#include <wx/wfstream.h>
#include <boost/ptr_container/ptr_map.hpp>
#include <memory.h>
#include <connectivity.h>

Go to the source code of this file.


 Class FP_CACHE_ITEM is helper class for creating a footprint library cache. More...
class  FP_CACHE


#define FMT_IU   BOARD_ITEM::FormatInternalUnits
#define FMT_ANGLE   BOARD_ITEM::FormatAngle


typedef boost::ptr_map< wxString, FP_CACHE_ITEMMODULE_MAP
typedef MODULE_MAP::iterator MODULE_ITER
typedef MODULE_MAP::const_iterator MODULE_CITER


void filterNetClass (const BOARD &aBoard, NETCLASS &aNetClass)

Removes empty nets (i.e. with node count equal zero) from net classes



static const wxString traceFootprintLibrary = wxT( "KICAD_TRACE_FP_PLUGIN" )
 Flag to enable KiCad PCB plugin debug output. More...

Macro Definition Documentation

#define FMT_ANGLE   BOARD_ITEM::FormatAngle

Definition at line 57 of file kicad_plugin.cpp.

Referenced by PCB_IO::format().

#define FMT_IU   BOARD_ITEM::FormatInternalUnits

Definition at line 56 of file kicad_plugin.cpp.

Referenced by PCB_IO::format(), PCB_IO::formatGeneral(), and PCB_IO::formatSetup().

Typedef Documentation

typedef MODULE_MAP::const_iterator MODULE_CITER

Definition at line 141 of file kicad_plugin.cpp.

typedef MODULE_MAP::iterator MODULE_ITER

Definition at line 140 of file kicad_plugin.cpp.

typedef boost::ptr_map< wxString, FP_CACHE_ITEM > MODULE_MAP

Definition at line 139 of file kicad_plugin.cpp.

Function Documentation

void filterNetClass ( const BOARD aBoard,

Removes empty nets (i.e. with node count equal zero) from net classes

Definition at line 68 of file kicad_plugin.cpp.

References NETCLASS::begin(), NETCLASS::end(), BOARD::FindNet(), BOARD::GetConnectivity(), NETINFO_ITEM::GetNet(), and NETCLASS::Remove().

Referenced by PCB_IO::formatNetInformation().

69 {
70  auto connectivity = aBoard.GetConnectivity();
72  for( NETCLASS::iterator it = aNetClass.begin(); it != aNetClass.end(); )
73  {
74  NETINFO_ITEM* netinfo = aBoard.FindNet( *it );
76  if( netinfo && connectivity->GetNodeCount( netinfo->GetNet() ) <= 0 ) // hopefully there are no nets with negative
77  aNetClass.Remove( it++ ); // node count, but you never know..
78  else
79  ++it;
80  }
81 }
iterator begin()
STRINGSET::iterator iterator
iterator end()
int GetNet() const
Function GetNet.
Class NETINFO_ITEM handles the data for a net.
Definition: class_netinfo.h:69
void Remove(iterator aName)
Function Remove will remove NET name aName from the collection of members.
NETINFO_ITEM * FindNet(int aNetcode) const
Function FindNet searches for a net with the given netcode.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290