KiCad PCB EDA Suite
SCHLIB_FILTER Class Reference

#include <class_library.h>

Public Member Functions

 SCHLIB_FILTER ()
 
void AddLib (const wxString &aLibName)
 add a lib name to the allowed libraries More...
 
void LoadFrom (const wxString &aLibName)
 add a lib name to the allowed libraries More...
 
void ClearLibList ()
 Clear the allowed libraries list (allows all libs) More...
 
void FilterPowerParts (bool aFilterEnable)
 set the filtering of power parts More...
 
bool GetFilterPowerParts () const
 
const wxArrayString & GetAllowedLibList () const
 
const wxString & GetLibSource () const
 

Private Attributes

wxArrayString m_allowedLibs
 a list of lib names to list some libraries if empty: no filter More...
 
bool m_filterPowerParts
 true to filter (show only) power parts More...
 
bool m_forceLoad
 

Detailed Description

Definition at line 81 of file class_library.h.

Constructor & Destructor Documentation

◆ SCHLIB_FILTER()

SCHLIB_FILTER::SCHLIB_FILTER ( )
inline

Definition at line 90 of file class_library.h.

91  {
92  m_filterPowerParts = false;
93  m_forceLoad = false;
94  }
bool m_filterPowerParts
true to filter (show only) power parts
Definition: class_library.h:85

References m_filterPowerParts, and m_forceLoad.

Member Function Documentation

◆ AddLib()

void SCHLIB_FILTER::AddLib ( const wxString &  aLibName)
inline

add a lib name to the allowed libraries

Definition at line 99 of file class_library.h.

100  {
101  m_allowedLibs.Add( aLibName );
102  m_forceLoad = false;
103  }
wxArrayString m_allowedLibs
a list of lib names to list some libraries if empty: no filter
Definition: class_library.h:83

References m_allowedLibs, and m_forceLoad.

◆ ClearLibList()

void SCHLIB_FILTER::ClearLibList ( )
inline

Clear the allowed libraries list (allows all libs)

Definition at line 119 of file class_library.h.

120  {
121  m_allowedLibs.Clear();
122  m_forceLoad = false;
123  }
wxArrayString m_allowedLibs
a list of lib names to list some libraries if empty: no filter
Definition: class_library.h:83

References m_allowedLibs, and m_forceLoad.

◆ FilterPowerParts()

void SCHLIB_FILTER::FilterPowerParts ( bool  aFilterEnable)
inline

set the filtering of power parts

Definition at line 128 of file class_library.h.

129  {
130  m_filterPowerParts = aFilterEnable;
131  }
bool m_filterPowerParts
true to filter (show only) power parts
Definition: class_library.h:85

References m_filterPowerParts.

◆ GetAllowedLibList()

const wxArrayString& SCHLIB_FILTER::GetAllowedLibList ( ) const
inline
Returns
am wxArrayString of the names of allowed libs

Definition at line 144 of file class_library.h.

144 { return m_allowedLibs; }
wxArrayString m_allowedLibs
a list of lib names to list some libraries if empty: no filter
Definition: class_library.h:83

References m_allowedLibs.

Referenced by SCH_BASE_FRAME::SelectCompFromLibTree(), and LIB_VIEW_FRAME::SetFilter().

◆ GetFilterPowerParts()

bool SCHLIB_FILTER::GetFilterPowerParts ( ) const
inline
Returns
true if the filtering of power parts is on

Definition at line 138 of file class_library.h.

138 { return m_filterPowerParts; }
bool m_filterPowerParts
true to filter (show only) power parts
Definition: class_library.h:85

References m_filterPowerParts.

Referenced by SCH_BASE_FRAME::SelectCompFromLibTree(), and LIB_VIEW_FRAME::SetFilter().

◆ GetLibSource()

const wxString& SCHLIB_FILTER::GetLibSource ( ) const
inline
Returns
the name of the lib to use to load a part, or an a empty string Useful to load (in lib editor or lib viewer) a part from a given library

Definition at line 150 of file class_library.h.

151  {
152  static wxString dummy;
153 
154  if( m_forceLoad && m_allowedLibs.GetCount() > 0 )
155  return m_allowedLibs[0];
156  else
157  return dummy;
158  }
wxArrayString m_allowedLibs
a list of lib names to list some libraries if empty: no filter
Definition: class_library.h:83
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.

References dummy(), m_allowedLibs, and m_forceLoad.

◆ LoadFrom()

void SCHLIB_FILTER::LoadFrom ( const wxString &  aLibName)
inline

add a lib name to the allowed libraries

Definition at line 109 of file class_library.h.

110  {
111  m_allowedLibs.Clear();
112  m_allowedLibs.Add( aLibName );
113  m_forceLoad = true;
114  }
wxArrayString m_allowedLibs
a list of lib names to list some libraries if empty: no filter
Definition: class_library.h:83

References m_allowedLibs, and m_forceLoad.

Member Data Documentation

◆ m_allowedLibs

wxArrayString SCHLIB_FILTER::m_allowedLibs
private

a list of lib names to list some libraries if empty: no filter

Definition at line 83 of file class_library.h.

Referenced by AddLib(), ClearLibList(), GetAllowedLibList(), GetLibSource(), and LoadFrom().

◆ m_filterPowerParts

bool SCHLIB_FILTER::m_filterPowerParts
private

true to filter (show only) power parts

Definition at line 85 of file class_library.h.

Referenced by FilterPowerParts(), GetFilterPowerParts(), and SCHLIB_FILTER().

◆ m_forceLoad

bool SCHLIB_FILTER::m_forceLoad
private

Definition at line 86 of file class_library.h.

Referenced by AddLib(), ClearLibList(), GetLibSource(), LoadFrom(), and SCHLIB_FILTER().


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