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 79 of file class_library.h.

Constructor & Destructor Documentation

◆ SCHLIB_FILTER()

SCHLIB_FILTER::SCHLIB_FILTER ( )
inline

Definition at line 88 of file class_library.h.

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

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 97 of file class_library.h.

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

References m_allowedLibs, and m_forceLoad.

◆ ClearLibList()

void SCHLIB_FILTER::ClearLibList ( )
inline

Clear the allowed libraries list (allows all libs)

Definition at line 117 of file class_library.h.

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

References m_allowedLibs, and m_forceLoad.

◆ FilterPowerParts()

void SCHLIB_FILTER::FilterPowerParts ( bool  aFilterEnable)
inline

set the filtering of power parts

Definition at line 126 of file class_library.h.

127  {
128  m_filterPowerParts = aFilterEnable;
129  }
bool m_filterPowerParts
true to filter (show only) power parts
Definition: class_library.h:83

References m_filterPowerParts.

◆ GetAllowedLibList()

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

Definition at line 142 of file class_library.h.

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

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 136 of file class_library.h.

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

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 148 of file class_library.h.

149  {
150  static wxString dummy;
151 
152  if( m_forceLoad && m_allowedLibs.GetCount() > 0 )
153  return m_allowedLibs[0];
154  else
155  return dummy;
156  }
wxArrayString m_allowedLibs
a list of lib names to list some libraries if empty: no filter
Definition: class_library.h:81
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 107 of file class_library.h.

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

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 81 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 83 of file class_library.h.

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

◆ m_forceLoad

bool SCHLIB_FILTER::m_forceLoad
private

Definition at line 84 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: