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>

Go to the source code of this file.

Classes

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

Macros

#define FMTIU   BOARD_ITEM::FormatInternalUnits
 

Typedefs

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

Functions

static const wxString traceFootprintLibrary (wxT("KicadFootprintLib"))
 Definition for enabling and disabling footprint library trace output. More...
 
void filterNetClass (const BOARD &aBoard, NETCLASS &aNetClass)
 

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

More...
 

Macro Definition Documentation

#define FMTIU   BOARD_ITEM::FormatInternalUnits

Definition at line 55 of file kicad_plugin.cpp.

Referenced by PCB_IO::format().

Typedef Documentation

typedef MODULE_MAP::const_iterator MODULE_CITER

Definition at line 135 of file kicad_plugin.cpp.

typedef MODULE_MAP::iterator MODULE_ITER

Definition at line 134 of file kicad_plugin.cpp.

typedef boost::ptr_map< std::string, FP_CACHE_ITEM > MODULE_MAP

Definition at line 133 of file kicad_plugin.cpp.

Function Documentation

void filterNetClass ( const BOARD aBoard,
NETCLASS aNetClass 
)

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

Definition at line 64 of file kicad_plugin.cpp.

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

Referenced by PCB_IO::format().

65 {
66  for( NETCLASS::iterator it = aNetClass.begin(); it != aNetClass.end(); )
67  {
68  NETINFO_ITEM* netinfo = aBoard.FindNet( *it );
69 
70  if( netinfo && netinfo->GetNodesCount() <= 0 ) // hopefully there are no nets with negative
71  aNetClass.Remove( it++ ); // node count, but you never know..
72  else
73  ++it;
74  }
75 }
int GetNodesCount() const
Function GetNodesCount.
iterator begin()
STRINGSET::iterator iterator
iterator end()
Class NETINFO_ITEM handles the data for a net.
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.
static const wxString traceFootprintLibrary ( wxT("KicadFootprintLib")  )
static

Definition for enabling and disabling footprint library trace output.

See the wxWidgets documentation on using the WXTRACE environment variable.

Referenced by PCB_IO::FootprintLibDelete(), PCB_IO::FootprintSave(), FP_CACHE_ITEM::IsModified(), FP_CACHE::IsModified(), and FP_CACHE::Save().