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

Constructor & Destructor Documentation

◆ SCHLIB_FILTER()

SCHLIB_FILTER::SCHLIB_FILTER ( )
inline

Definition at line 89 of file class_library.h.

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

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

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

References m_allowedLibs, and m_forceLoad.

◆ ClearLibList()

void SCHLIB_FILTER::ClearLibList ( )
inline

Clear the allowed libraries list (allows all libs)

Definition at line 118 of file class_library.h.

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

References m_allowedLibs, and m_forceLoad.

◆ FilterPowerParts()

void SCHLIB_FILTER::FilterPowerParts ( bool  aFilterEnable)
inline

set the filtering of power parts

Definition at line 127 of file class_library.h.

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

References m_filterPowerParts.

◆ GetAllowedLibList()

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

Definition at line 143 of file class_library.h.

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

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

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

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

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

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

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

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

◆ m_forceLoad

bool SCHLIB_FILTER::m_forceLoad
private

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