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

Member Function Documentation

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
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
void SCHLIB_FILTER::FilterPowerParts ( bool  aFilterEnable)
inline

set the filtering of power parts

Definition at line 127 of file class_library.h.

Referenced by SCH_EDIT_FRAME::OnLeftClick().

128  {
129  m_filterPowerParts = aFilterEnable;
130  }
bool m_filterPowerParts
true to filter (show only) power parts
Definition: class_library.h:84
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.

References m_allowedLibs.

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

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
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.

References m_filterPowerParts.

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

137 { return m_filterPowerParts; }
bool m_filterPowerParts
true to filter (show only) power parts
Definition: class_library.h:84
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.

References dummy().

Referenced by SCH_EDIT_FRAME::Load_Component().

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 when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
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

Member Data Documentation

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 GetAllowedLibList().

bool SCHLIB_FILTER::m_filterPowerParts
private

true to filter (show only) power parts

Definition at line 84 of file class_library.h.

Referenced by GetFilterPowerParts().

bool SCHLIB_FILTER::m_forceLoad
private

Definition at line 85 of file class_library.h.


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