KiCAD pcbnew scripting
Public Member Functions | Public Attributes | Static 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 (args)
 
def IsValid (self)
 
def IsLegacy (self)
 
def clear (self)
 
def empty (self)
 
def compare (self, aLibId)
 
def __lt__ (self, aLibId)
 
def __gt__ (self, aLibId)
 
def __eq__ (self, aLibId)
 
def __ne__ (self, aLibId)
 
def HasIllegalChars (aLibItemName)
 
def FixIllegalChars (aLibItemName)
 

Public Attributes

 this
 

Static Public Attributes

tuple Format = staticmethod(Format)
 
tuple HasIllegalChars = staticmethod(HasIllegalChars)
 
tuple FixIllegalChars = staticmethod(FixIllegalChars)
 

Detailed Description

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 8025 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.LIB_ID.__init__ (   self,
  args 
)
__init__(LIB_ID self) -> LIB_ID
__init__(LIB_ID self, UTF8 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 8059 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 8302 of file pcbnew.py.

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

Definition at line 8297 of file pcbnew.py.

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

Definition at line 8292 of file pcbnew.py.

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

Definition at line 8307 of file pcbnew.py.

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

void LIB_ID::clear()

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

Definition at line 8246 of file pcbnew.py.

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

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

Compare 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 8270 of file pcbnew.py.

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

bool LIB_ID::empty() const

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

Definition at line 8258 of file pcbnew.py.

def pcbnew.LIB_ID.FixIllegalChars (   aLibItemName)
FixIllegalChars(UTF8 aLibItemName) -> UTF8

Definition at line 8320 of file pcbnew.py.

def pcbnew.LIB_ID.Format (   args)
Format() -> UTF8
Format(UTF8 aLibNickname, UTF8 aLibItemName, UTF8 aRevision) -> UTF8
Format(UTF8 aLibNickname, UTF8 aLibItemName) -> UTF8

UTF8 LIB_ID::Format() const

the fully formatted text of the LIB_ID. 

Definition at line 8202 of file pcbnew.py.

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

const UTF8&
LIB_ID::GetLibItemName() const

the library item name, i.e. footprintName. 

Definition at line 8142 of file pcbnew.py.

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

UTF8
LIB_ID::GetLibItemNameAndRev() const 

Definition at line 8192 of file pcbnew.py.

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

const UTF8&
LIB_ID::GetLibNickname() const

Return the logical library name portion of a LIB_ID. 

Definition at line 8114 of file pcbnew.py.

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

const UTF8&
LIB_ID::GetRevision() const 

Definition at line 8182 of file pcbnew.py.

def pcbnew.LIB_ID.HasIllegalChars (   aLibItemName)
HasIllegalChars(UTF8 aLibItemName) -> bool

Definition at line 8312 of file pcbnew.py.

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

bool LIB_ID::IsLegacy()
const

true if the LIB_ID only has the item_name name defined. 

Definition at line 8234 of file pcbnew.py.

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

bool LIB_ID::IsValid() const

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 8218 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)

Parse 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 8094 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)

Override 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 8154 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)

Override 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 8126 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 8172 of file pcbnew.py.

Member Data Documentation

tuple pcbnew.LIB_ID.FixIllegalChars = staticmethod(FixIllegalChars)
static

Definition at line 8325 of file pcbnew.py.

tuple pcbnew.LIB_ID.Format = staticmethod(Format)
static

Definition at line 8215 of file pcbnew.py.

tuple pcbnew.LIB_ID.HasIllegalChars = staticmethod(HasIllegalChars)
static

Definition at line 8317 of file pcbnew.py.

pcbnew.LIB_ID.this

Definition at line 8092 of file pcbnew.py.


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