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

Public Member Functions

def __init__ (self, args)
 
def Parse (self, aId)
 
def GetLibNickname (self)
 
def SetLibNickname (self, aNickname)
 
def GetLibItemName (self)
 
def SetLibItemName
 
def SetRevision (self, aRevision)
 
def GetRevision (self)
 
def GetLibItemNameAndRev (self)
 
def Format (self)
 
def IsValid (self)
 
def IsLegacy (self)
 
def clear (self)
 
def empty (self)
 
def compare (self, aLIB_ID)
 
def __lt__ (self, aLibId)
 
def __gt__ (self, aLibId)
 
def __eq__ (self, aLibId)
 
def __ne__ (self, aLibId)
 

Public Attributes

 this
 

Detailed Description

Class LIB_ID.

is a logical library item identifier and consists of various portions
much like a URI. It consists of of triad of the library nickname, the
name of the item in the library, and an optional revision of the item.
This is a generic library identifier that can be used for any type of
library that contains multiple named items such as footprint or symbol
libraries.

Example LIB_ID string: "smt:R_0805/rev0".

"smt" is the logical library name used to look up library
information saved in the LIB_TABLE.

"R" is the name of the item within the library.

"rev0" is the revision, which is optional. If missing then its /
delimiter should also not be present. A revision must begin with
"rev" and be followed by at least one or more decimal digits.

Dick Hollenbeck

C++ includes: lib_id.h 

Definition at line 6400 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.LIB_ID.__init__ (   self,
  args 
)
__init__(LIB_ID self) -> LIB_ID
__init__(LIB_ID self, string aId) -> LIB_ID
__init__(LIB_ID self, wxString aId) -> LIB_ID
__init__(LIB_ID self, wxString aLibName, wxString aLibItemName, wxString aRevision) -> LIB_ID
__init__(LIB_ID self, wxString aLibName, wxString aLibItemName) -> LIB_ID

LIB_ID::LIB_ID(const wxString
&aLibName, const wxString &aLibItemName, const wxString
&aRevision=wxEmptyString)

This LIB_ID ctor is a special version which ignores the parsing due to
symbol names allowing '/' as a valid character.

This was causing the symbol names to be truncated at the first
occurrence of '/' in the symbol name.

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

aLibName:  is the library nickname used to look up the library item in
the LIB_TABLE.

aLibItemName:  is the name of the library item which is not parsed by
the standard LIB_ID::Parse() function.

aRevision:  is the revision of the library item. 

Definition at line 6434 of file pcbnew.py.

Member Function Documentation

def pcbnew.LIB_ID.__eq__ (   self,
  aLibId 
)
__eq__(LIB_ID self, LIB_ID aLibId) -> bool

Definition at line 6704 of file pcbnew.py.

def pcbnew.LIB_ID.__gt__ (   self,
  aLibId 
)
__gt__(LIB_ID self, LIB_ID aLibId) -> bool

Definition at line 6699 of file pcbnew.py.

def pcbnew.LIB_ID.__lt__ (   self,
  aLibId 
)
__lt__(LIB_ID self, LIB_ID aLibId) -> bool

Definition at line 6694 of file pcbnew.py.

def pcbnew.LIB_ID.__ne__ (   self,
  aLibId 
)
__ne__(LIB_ID self, LIB_ID aLibId) -> bool

Definition at line 6709 of file pcbnew.py.

def pcbnew.LIB_ID.clear (   self)
clear(LIB_ID self)

void LIB_ID::clear()

Function clear.

clears the contents of the library nickname, library entry name, and
revision strings. 

Definition at line 6642 of file pcbnew.py.

def pcbnew.LIB_ID.compare (   self,
  aLIB_ID 
)
compare(LIB_ID self, LIB_ID aLIB_ID) -> int

int LIB_ID::compare(const
LIB_ID &aLIB_ID) const

Function Compare.

compares the contents of LIB_ID objects by performing a std::string
comparison of the library nickname, library entry name, and revision
strings respectively.

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

aLibId:  is the LIB_ID to compare against.

-1 if less than aLibId, 1 if greater than aLibId, and 0 if equal to
aLibId. 

Definition at line 6670 of file pcbnew.py.

def pcbnew.LIB_ID.empty (   self)
empty(LIB_ID self) -> bool

bool LIB_ID::empty() const

Function empty.

a boolean true value if the LIB_ID is empty. Otherwise return false.

Definition at line 6656 of file pcbnew.py.

def pcbnew.LIB_ID.Format (   self)
Format(LIB_ID self) -> UTF8

UTF8 LIB_ID::Format() const

Function Format.

the fully formatted text of the LIB_ID. 

Definition at line 6587 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.LIB_ID.GetLibItemName (   self)
GetLibItemName(LIB_ID self) -> UTF8

const UTF8&
LIB_ID::GetLibItemName() const

Function GetLibItemName.

the library item name, i.e. footprintName. 

Definition at line 6523 of file pcbnew.py.

def pcbnew.LIB_ID.GetLibItemNameAndRev (   self)
GetLibItemNameAndRev(LIB_ID self) -> UTF8

UTF8
LIB_ID::GetLibItemNameAndRev() const 

Definition at line 6577 of file pcbnew.py.

def pcbnew.LIB_ID.GetLibNickname (   self)
GetLibNickname(LIB_ID self) -> UTF8

const UTF8&
LIB_ID::GetLibNickname() const

Function GetLibNickname.

returns the logical library name portion of a LIB_ID. 

Definition at line 6491 of file pcbnew.py.

def pcbnew.LIB_ID.GetRevision (   self)
GetRevision(LIB_ID self) -> UTF8

const UTF8&
LIB_ID::GetRevision() const 

Definition at line 6567 of file pcbnew.py.

def pcbnew.LIB_ID.IsLegacy (   self)
IsLegacy(LIB_ID self) -> bool

bool LIB_ID::IsLegacy()
const

Function IsLegacy.

true if the LIB_ID only has the item_name name defined. 

Definition at line 6628 of file pcbnew.py.

def pcbnew.LIB_ID.IsValid (   self)
IsValid(LIB_ID self) -> bool

bool LIB_ID::IsValid() const

Function Format.

a string in the proper format as an LIB_ID for a combination of
aLibNickname, aLibItemName, and aRevision.

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

???:  if any of the pieces are illegal. static UTF8 Format( const
UTF8& aLibNickname, const UTF8& aLibItemName, const UTF8& aRevision =
"" ) throw( PARSE_ERROR ); Function IsValid

true is the LIB_ID is valid.  A valid LIB_ID must have both the
library nickname and the library item name defined. The revision field
is optional.

A return value of true does not indicated that the LIB_ID is a valid
LIB_TABLE entry. 

Definition at line 6600 of file pcbnew.py.

def pcbnew.LIB_ID.Parse (   self,
  aId 
)
Parse(LIB_ID self, UTF8 aId) -> int

int LIB_ID::Parse(const UTF8
&aId)

Function Parse.

[re-]stuffs this LIB_ID with the information from aId.

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

aId:  is the string to populate the LIB_ID object.

int - minus 1 (i.e. -1) means success, >= 0 indicates the character
offset into aId at which an error was detected. 

Definition at line 6469 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.LIB_ID.SetLibItemName (   self,
  aLibItemName,
  aTestForRev = True 
)
SetLibItemName(LIB_ID self, UTF8 aLibItemName, bool aTestForRev=True) -> int
SetLibItemName(LIB_ID self, UTF8 aLibItemName) -> int

int
LIB_ID::SetLibItemName(const UTF8 &aLibItemName, bool
aTestForRev=true)

Function SetLibItemName.

overrides the library item name portion of the LIB_ID to aLibItemName

int - minus 1 (i.e. -1) means success, >= 0 indicates the character
offset into the parameter at which an error was detected, usually
because it contained '/'. 

Definition at line 6537 of file pcbnew.py.

def pcbnew.LIB_ID.SetLibNickname (   self,
  aNickname 
)
SetLibNickname(LIB_ID self, UTF8 aNickname) -> int

int
LIB_ID::SetLibNickname(const UTF8 &aNickname)

Function SetLibNickname.

overrides the logical library name portion of the LIB_ID to aNickname.

int - minus 1 (i.e. -1) means success, >= 0 indicates the character
offset into the parameter at which an error was detected, usually
because it contained '/' or ':'. 

Definition at line 6505 of file pcbnew.py.

def pcbnew.LIB_ID.SetRevision (   self,
  aRevision 
)
SetRevision(LIB_ID self, UTF8 aRevision) -> int

int
LIB_ID::SetRevision(const UTF8 &aRevision) 

Definition at line 6557 of file pcbnew.py.

Member Data Documentation

pcbnew.LIB_ID.this

Definition at line 6467 of file pcbnew.py.


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