KiCAD pcbnew scripting
Public Member Functions | Public Attributes | List of all members
pcbnew.PCB_IO Class Reference
Inheritance diagram for pcbnew.PCB_IO:
Inheritance graph
[legend]

Public Member Functions

def PluginName (self)
 
def GetFileExtension (self)
 
def Save
 
def Load
 
def FootprintEnumerate
 
def FootprintLoad
 
def FootprintSave
 
def FootprintDelete
 
def FootprintLibCreate
 
def FootprintLibDelete
 
def IsFootprintLibWritable (self, aLibraryPath)
 
def __init__ (self, args)
 
def Format
 
def GetStringOutput (self, doClear)
 
def SetOutputFormatter (self, aFormatter)
 
def Parse (self, aClipboardSourceInput)
 
- Public Member Functions inherited from pcbnew.PLUGIN
def __init__ (self, args, kwargs)
 
def PluginName (self)
 
def GetFileExtension (self)
 
def Load
 
def Save
 
def FootprintEnumerate
 
def PrefetchLib
 
def FootprintLoad
 
def FootprintSave
 
def FootprintDelete
 
def FootprintLibCreate
 
def FootprintLibDelete
 
def IsFootprintLibWritable (self, aLibraryPath)
 
def FootprintLibOptions (self, aListToAppendTo)
 

Public Attributes

 this
 

Detailed Description

Class PCB_IO is a PLUGIN derivation for saving and loading Pcbnew
s-expression formatted files.

This class is not thread safe, but it is re-entrant multiple times in
sequence.

C++ includes: kicad_plugin.h 

Definition at line 7332 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.PCB_IO.__init__ (   self,
  args 
)
__init__(PCB_IO self, int aControlFlags) -> PCB_IO
__init__(PCB_IO self) -> PCB_IO

PCB_IO::PCB_IO(int
aControlFlags=CTL_FOR_BOARD) 

Definition at line 7707 of file pcbnew.py.

Member Function Documentation

def pcbnew.PCB_IO.FootprintDelete (   self,
  aLibraryPath,
  aFootprintName,
  aProperties = None 
)
FootprintDelete(PCB_IO self, wxString aLibraryPath, wxString aFootprintName, PROPERTIES const * aProperties=None)
FootprintDelete(PCB_IO self, wxString aLibraryPath, wxString aFootprintName)

void
PCB_IO::FootprintDelete(const wxString &aLibraryPath, const wxString
&aFootprintName, const PROPERTIES *aProperties=NULL) override

Function FootprintDelete deletes aFootprintName from the library at
aLibraryPath.

Parameters:
-----------

aLibraryPath:  is a locator for the "library", usually a directory,
file, or URL containing several footprints.

aFootprintName:  is the name of a footprint to delete from the
specified library.

aProperties:  is an associative array that can be used to tell the
library delete function anything special, because it can take any
number of additional named tuning arguments that the plugin is known
to support. The caller continues to own this object (plugin may not
delete it), and plugins should expect it to be optionally NULL.

Parameters:
-----------

???:  if there is a problem finding the footprint or the library, or
deleting it. 

Definition at line 7572 of file pcbnew.py.

def pcbnew.PCB_IO.FootprintEnumerate (   self,
  aLibraryPath,
  aProperties = None 
)
FootprintEnumerate(PCB_IO self, wxString aLibraryPath, PROPERTIES const * aProperties=None) -> wxArrayString
FootprintEnumerate(PCB_IO self, wxString aLibraryPath) -> wxArrayString

wxArrayString
PCB_IO::FootprintEnumerate(const wxString &aLibraryPath, const
PROPERTIES *aProperties=NULL) override

Function FootprintEnumerate returns a list of footprint names
contained within the library at aLibraryPath.

Parameters:
-----------

aLibraryPath:  is a locator for the "library", usually a directory,
file, or URL containing several footprints.

aProperties:  is an associative array that can be used to tell the
plugin anything needed about how to perform with respect to
aLibraryPath. The caller continues to own this object (plugin may not
delete it), and plugins should expect it to be optionally NULL.

wxArrayString - is the array of available footprint names inside a
library

Parameters:
-----------

???:  if the library cannot be found, or footprint cannot be loaded.

Definition at line 7462 of file pcbnew.py.

def pcbnew.PCB_IO.FootprintLibCreate (   self,
  aLibraryPath,
  aProperties = None 
)
FootprintLibCreate(PCB_IO self, wxString aLibraryPath, PROPERTIES const * aProperties=None)
FootprintLibCreate(PCB_IO self, wxString aLibraryPath)

void
PCB_IO::FootprintLibCreate(const wxString &aLibraryPath, const
PROPERTIES *aProperties=NULL) override

Function FootprintLibCreate creates a new empty footprint library at
aLibraryPath empty.

It is an error to attempt to create an existing library or to attempt
to create on a "read only" location.

Parameters:
-----------

aLibraryPath:  is a locator for the "library", usually a directory,
file, or URL containing several footprints.

aProperties:  is an associative array that can be used to tell the
library create function anything special, because it can take any
number of additional named tuning arguments that the plugin is known
to support. The caller continues to own this object (plugin may not
delete it), and plugins should expect it to be optionally NULL.

Parameters:
-----------

???:  if there is a problem finding the library, or creating it. 

Definition at line 7608 of file pcbnew.py.

def pcbnew.PCB_IO.FootprintLibDelete (   self,
  aLibraryPath,
  aProperties = None 
)
FootprintLibDelete(PCB_IO self, wxString aLibraryPath, PROPERTIES const * aProperties=None) -> bool
FootprintLibDelete(PCB_IO self, wxString aLibraryPath) -> bool

bool
PCB_IO::FootprintLibDelete(const wxString &aLibraryPath, const
PROPERTIES *aProperties=NULL) override

Function FootprintLibDelete deletes an existing footprint library and
returns true, or if library does not exist returns false, or throws an
exception if library exists but is read only or cannot be deleted for
some other reason.

Parameters:
-----------

aLibraryPath:  is a locator for the "library", usually a directory
or file which will contain footprints.

aProperties:  is an associative array that can be used to tell the
library delete implementation function anything special, because it
can take any number of additional named tuning arguments that the
plugin is known to support. The caller continues to own this object
(plugin may not delete it), and plugins should expect it to be
optionally NULL.

bool - true if library deleted, false if library did not exist.

Parameters:
-----------

???:  if there is a problem deleting an existing library. 

Definition at line 7643 of file pcbnew.py.

def pcbnew.PCB_IO.FootprintLoad (   self,
  aLibraryPath,
  aFootprintName,
  aProperties = None 
)
FootprintLoad(PCB_IO self, wxString aLibraryPath, wxString aFootprintName, PROPERTIES const * aProperties=None) -> MODULE
FootprintLoad(PCB_IO self, wxString aLibraryPath, wxString aFootprintName) -> MODULE

MODULE *
PCB_IO::FootprintLoad(const wxString &aLibraryPath, const wxString
&aFootprintName, const PROPERTIES *aProperties=NULL) override

Function FootprintLoad loads a footprint having aFootprintName from
the aLibraryPath containing a library format that this PLUGIN knows
about.

Parameters:
-----------

aLibraryPath:  is a locator for the "library", usually a directory,
file, or URL containing several footprints.

aFootprintName:  is the name of the footprint to load.

aProperties:  is an associative array that can be used to tell the
loader implementation to do something special, because it can take any
number of additional named tuning arguments that the plugin is known
to support. The caller continues to own this object (plugin may not
delete it), and plugins should expect it to be optionally NULL.

MODULE* - if found caller owns it, else NULL if not found.

Parameters:
-----------

???:  if the library cannot be found or read. No exception is thrown
in the case where aFootprintName cannot be found. 

Definition at line 7497 of file pcbnew.py.

def pcbnew.PCB_IO.FootprintSave (   self,
  aLibraryPath,
  aFootprint,
  aProperties = None 
)
FootprintSave(PCB_IO self, wxString aLibraryPath, MODULE aFootprint, PROPERTIES const * aProperties=None)
FootprintSave(PCB_IO self, wxString aLibraryPath, MODULE aFootprint)

void
PCB_IO::FootprintSave(const wxString &aLibraryPath, const MODULE
*aFootprint, const PROPERTIES *aProperties=NULL) override

Function FootprintSave will write aModule to an existing library
located at aLibraryPath.

If a footprint by the same name already exists, it is replaced.

Parameters:
-----------

aLibraryPath:  is a locator for the "library", usually a directory,
file, or URL containing several footprints.

aFootprint:  is what to store in the library. The caller continues to
own the footprint after this call.

aProperties:  is an associative array that can be used to tell the
saver how to save the footprint, because it can take any number of
additional named tuning arguments that the plugin is known to support.
The caller continues to own this object (plugin may not delete it),
and plugins should expect it to be optionally NULL.

Parameters:
-----------

???:  if there is a problem saving. 

Definition at line 7535 of file pcbnew.py.

def pcbnew.PCB_IO.Format (   self,
  aItem,
  aNestLevel = 0 
)
Format(PCB_IO self, BOARD_ITEM aItem, int aNestLevel=0)
Format(PCB_IO self, BOARD_ITEM aItem)

void PCB_IO::Format(BOARD_ITEM
*aItem, int aNestLevel=0) const  throw ( IO_ERROR ) Function Format
outputs aItem to aFormatter in s-expression format.

Parameters:
-----------

aItem:  A pointer the an BOARD_ITEM object to format.

aNestLevel:  The indentation nest level.

Parameters:
-----------

???:  on write error. 

Definition at line 7723 of file pcbnew.py.

def pcbnew.PCB_IO.GetFileExtension (   self)
GetFileExtension(PCB_IO self) -> wxString

const wxString
PCB_IO::GetFileExtension() const override

Function GetFileExtension returns the file extension for the PLUGIN.

Definition at line 7367 of file pcbnew.py.

def pcbnew.PCB_IO.GetStringOutput (   self,
  doClear 
)
GetStringOutput(PCB_IO self, bool doClear) -> string

std::string
PCB_IO::GetStringOutput(bool doClear) 

Definition at line 7747 of file pcbnew.py.

def pcbnew.PCB_IO.IsFootprintLibWritable (   self,
  aLibraryPath 
)
IsFootprintLibWritable(PCB_IO self, wxString aLibraryPath) -> bool

bool
PCB_IO::IsFootprintLibWritable(const wxString &aLibraryPath) override

Function IsFootprintLibWritable returns true iff the library at
aLibraryPath is writable.

(Often system libraries are read only because of where they are
installed.)

Parameters:
-----------

aLibraryPath:  is a locator for the "library", usually a directory,
file, or URL containing several footprints.

Parameters:
-----------

???:  if no library at aLibraryPath exists. 

Definition at line 7680 of file pcbnew.py.

def pcbnew.PCB_IO.Load (   self,
  aFileName,
  aAppendToMe,
  aProperties = None 
)
Load(PCB_IO self, wxString aFileName, BOARD aAppendToMe, PROPERTIES const * aProperties=None) -> BOARD
Load(PCB_IO self, wxString aFileName, BOARD aAppendToMe) -> BOARD

BOARD * PCB_IO::Load(const
wxString &aFileName, BOARD *aAppendToMe, const PROPERTIES
*aProperties=NULL) override

Function Load loads information from some input file format that this
PLUGIN implementation knows about, into either a new BOARD or an
existing one.

This may be used to load an entire new BOARD, or to augment an
existing one if aAppendToMe is not NULL.

Parameters:
-----------

aFileName:  is the name of the file to use as input and may be foreign
in nature or native in nature.

aAppendToMe:  is an existing BOARD to append to, but if NULL then this
means "do not append, rather load anew".

aProperties:  is an associative array that can be used to tell the
loader how to load the file, because it can take any number of
additional named arguments that the plugin is known to support. These
are tuning parameters for the import or load. The caller continues to
own this object (plugin may not delete it), and plugins should expect
it to be optionally NULL.

BOARD* - the successfully loaded board, or the same one as aAppendToMe
if aAppendToMe was not NULL, and caller owns it.

Parameters:
-----------

???:  if there is a problem loading, and its contents should say what
went wrong, using line number and character offsets of the input file
if possible. 

Definition at line 7417 of file pcbnew.py.

def pcbnew.PCB_IO.Parse (   self,
  aClipboardSourceInput 
)
Parse(PCB_IO self, wxString aClipboardSourceInput) -> BOARD_ITEM

BOARD_ITEM *
PCB_IO::Parse(const wxString &aClipboardSourceInput)  throw (
FUTURE_FORMAT_ERROR, PARSE_ERROR, IO_ERROR )

Definition at line 7767 of file pcbnew.py.

def pcbnew.PCB_IO.PluginName (   self)
PluginName(PCB_IO self) -> wxString

const wxString
PCB_IO::PluginName() const override

Function PluginName returns a brief hard coded name for this PLUGIN.

Definition at line 7354 of file pcbnew.py.

def pcbnew.PCB_IO.Save (   self,
  aFileName,
  aBoard,
  aProperties = None 
)
Save(PCB_IO self, wxString aFileName, BOARD aBoard, PROPERTIES const * aProperties=None)
Save(PCB_IO self, wxString aFileName, BOARD aBoard)

void PCB_IO::Save(const wxString
&aFileName, BOARD *aBoard, const PROPERTIES *aProperties=NULL)
override

Function Save will write aBoard to a storage file in a format that
this PLUGIN implementation knows about, or it can be used to write a
portion of aBoard to a special kind of export file.

Parameters:
-----------

aFileName:  is the name of a file to save to on disk.

aBoard:  is the class BOARD in memory document tree from which to
extract information when writing to aFileName. The caller continues to
own the BOARD, and the plugin should refrain from modifying the BOARD
if possible.

aProperties:  is an associative array that can be used to tell the
saver how to save the file, because it can take any number of
additional named tuning arguments that the plugin is known to support.
The caller continues to own this object (plugin may not delete it),
and plugins should expect it to be optionally NULL.

Parameters:
-----------

???:  if there is a problem saving or exporting. 

Definition at line 7380 of file pcbnew.py.

def pcbnew.PCB_IO.SetOutputFormatter (   self,
  aFormatter 
)
SetOutputFormatter(PCB_IO self, OUTPUTFORMATTER * aFormatter)

void
PCB_IO::SetOutputFormatter(OUTPUTFORMATTER *aFormatter) 

Definition at line 7757 of file pcbnew.py.

Member Data Documentation

pcbnew.PCB_IO.this

Definition at line 7719 of file pcbnew.py.


The documentation for this class was generated from the following file: