KiCad PCB EDA Suite
SYMBOL_LIBRARY_FILTER Class Reference

Helper object to filter a list of libraries. More...

#include <symbol_library_common.h>

Public Member Functions

 SYMBOL_LIBRARY_FILTER ()
 
void AddLib (const wxString &aLibName)
 Add aLibName to the allowed libraries list. More...
 
void LoadFrom (const wxString &aLibName)
 Add aLibName to the allowed libraries list. More...
 
void ClearLibList ()
 Clear the allowed libraries list (allows all libraries). More...
 
void FilterPowerSymbols (bool aFilterEnable)
 Enable or disable the filtering of power symbols. More...
 
bool GetFilterPowerSymbols () const
 
const wxArrayString & GetAllowedLibList () const
 
const wxString & GetLibSource () const
 

Private Attributes

wxArrayString m_allowedLibs
 List of filtered library names. More...
 
bool m_filterPowerSymbols
 Enable or disable power symbol filtering. More...
 
bool m_forceLoad
 Force loading symbol from library m_allowedLibs[0]. More...
 

Detailed Description

Helper object to filter a list of libraries.

Definition at line 59 of file symbol_library_common.h.

Constructor & Destructor Documentation

◆ SYMBOL_LIBRARY_FILTER()

SYMBOL_LIBRARY_FILTER::SYMBOL_LIBRARY_FILTER ( )
inline

Definition at line 62 of file symbol_library_common.h.

63 {
65 m_forceLoad = false;
66 }
bool m_forceLoad
Force loading symbol from library m_allowedLibs[0].
bool m_filterPowerSymbols
Enable or disable power symbol filtering.

References m_filterPowerSymbols, and m_forceLoad.

Member Function Documentation

◆ AddLib()

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

Add aLibName to the allowed libraries list.

Definition at line 71 of file symbol_library_common.h.

72 {
73 m_allowedLibs.Add( aLibName );
74 m_forceLoad = false;
75 }
wxArrayString m_allowedLibs
List of filtered library names.

References m_allowedLibs, and m_forceLoad.

◆ ClearLibList()

void SYMBOL_LIBRARY_FILTER::ClearLibList ( )
inline

Clear the allowed libraries list (allows all libraries).

Definition at line 91 of file symbol_library_common.h.

92 {
93 m_allowedLibs.Clear();
94 m_forceLoad = false;
95 }

References m_allowedLibs, and m_forceLoad.

◆ FilterPowerSymbols()

void SYMBOL_LIBRARY_FILTER::FilterPowerSymbols ( bool  aFilterEnable)
inline

Enable or disable the filtering of power symbols.

Definition at line 100 of file symbol_library_common.h.

101 {
102 m_filterPowerSymbols = aFilterEnable;
103 }

References m_filterPowerSymbols.

◆ GetAllowedLibList()

const wxArrayString & SYMBOL_LIBRARY_FILTER::GetAllowedLibList ( ) const
inline
Returns
the list of the names of allowed libraries.

Definition at line 114 of file symbol_library_common.h.

114{ return m_allowedLibs; }

References m_allowedLibs.

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

◆ GetFilterPowerSymbols()

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

Definition at line 108 of file symbol_library_common.h.

108{ return m_filterPowerSymbols; }

References m_filterPowerSymbols.

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

◆ GetLibSource()

const wxString & SYMBOL_LIBRARY_FILTER::GetLibSource ( ) const
inline
Returns
the name of the library to use to load a symbol or an a empty string if no library source available.

Definition at line 120 of file symbol_library_common.h.

121 {
122 static wxString dummy;
123
124 if( m_forceLoad && m_allowedLibs.GetCount() > 0 )
125 return m_allowedLibs[0];
126 else
127 return dummy;
128 }
std::vector< FAB_LAYER_COLOR > dummy

References dummy, m_allowedLibs, and m_forceLoad.

◆ LoadFrom()

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

Add aLibName to the allowed libraries list.

Definition at line 81 of file symbol_library_common.h.

82 {
83 m_allowedLibs.Clear();
84 m_allowedLibs.Add( aLibName );
85 m_forceLoad = true;
86 }

References m_allowedLibs, and m_forceLoad.

Member Data Documentation

◆ m_allowedLibs

wxArrayString SYMBOL_LIBRARY_FILTER::m_allowedLibs
private

List of filtered library names.

Definition at line 131 of file symbol_library_common.h.

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

◆ m_filterPowerSymbols

bool SYMBOL_LIBRARY_FILTER::m_filterPowerSymbols
private

Enable or disable power symbol filtering.

Definition at line 132 of file symbol_library_common.h.

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

◆ m_forceLoad

bool SYMBOL_LIBRARY_FILTER::m_forceLoad
private

Force loading symbol from library m_allowedLibs[0].

Definition at line 133 of file symbol_library_common.h.

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


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