KiCad PCB EDA Suite
SCHLIB_FILTER Class Reference

#include <symbol_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 FilterPowerSymbols (bool aFilterEnable)
 Set the filtering of power symbols. More...
 
bool GetFilterPowerSymbols () 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_filterPowerSymbols
 true to filter (show only) power symbols More...
 
bool m_forceLoad
 

Detailed Description

Definition at line 86 of file symbol_library.h.

Constructor & Destructor Documentation

◆ SCHLIB_FILTER()

SCHLIB_FILTER::SCHLIB_FILTER ( )
inline

Definition at line 89 of file symbol_library.h.

90  {
91  m_filterPowerSymbols = false;
92  m_forceLoad = false;
93  }
bool m_filterPowerSymbols
true to filter (show only) power symbols

References m_filterPowerSymbols, 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 symbol_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

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

References m_allowedLibs, and m_forceLoad.

◆ FilterPowerSymbols()

void SCHLIB_FILTER::FilterPowerSymbols ( bool  aFilterEnable)
inline

Set the filtering of power symbols.

Definition at line 127 of file symbol_library.h.

128  {
129  m_filterPowerSymbols = aFilterEnable;
130  }
bool m_filterPowerSymbols
true to filter (show only) power symbols

References m_filterPowerSymbols.

◆ GetAllowedLibList()

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

Definition at line 143 of file symbol_library.h.

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

References m_allowedLibs.

Referenced by SCH_BASE_FRAME::PickSymbolFromLibTree(), and SYMBOL_VIEWER_FRAME::SetFilter().

◆ GetFilterPowerSymbols()

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

Definition at line 137 of file symbol_library.h.

137 { return m_filterPowerSymbols; }
bool m_filterPowerSymbols
true to filter (show only) power symbols

References m_filterPowerSymbols.

Referenced by SCH_BASE_FRAME::PickSymbolFromLibTree(), and SYMBOL_VIEWER_FRAME::SetFilter().

◆ GetLibSource()

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

Definition at line 149 of file symbol_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  }
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
wxArrayString m_allowedLibs
a list of lib names to list some libraries if empty: no filter

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

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 160 of file symbol_library.h.

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

◆ m_filterPowerSymbols

bool SCHLIB_FILTER::m_filterPowerSymbols
private

true to filter (show only) power symbols

Definition at line 162 of file symbol_library.h.

Referenced by FilterPowerSymbols(), GetFilterPowerSymbols(), and SCHLIB_FILTER().

◆ m_forceLoad

bool SCHLIB_FILTER::m_forceLoad
private

Definition at line 163 of file symbol_library.h.

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


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