KiCad PCB EDA Suite
|
Node type: unit of component. More...
#include <lib_tree_model.h>
Public Types | |
enum | TYPE { ROOT , LIB , LIBID , UNIT , INVALID } |
typedef std::vector< std::unique_ptr< LIB_TREE_NODE > > | PTR_VECTOR |
Public Member Functions | |
LIB_TREE_NODE_UNIT (LIB_TREE_NODE_UNIT const &_)=delete | |
The addresses of CMP_TREE_NODEs are used as unique IDs for the wxDataViewModel, so don't let them be copied around. More... | |
void | operator= (LIB_TREE_NODE_UNIT const &_)=delete |
LIB_TREE_NODE_UNIT (LIB_TREE_NODE *aParent, LIB_TREE_ITEM *aItem, int aUnit) | |
Construct a unit node. More... | |
virtual void | UpdateScore (EDA_COMBINED_MATCHER &aMatcher, const wxString &aLib) override |
Do nothing, units just take the parent's score. More... | |
void | ResetScore () |
Initialize score to kLowestDefaultScore, recursively. More... | |
void | AssignIntrinsicRanks (bool presorted=false) |
Store intrinsic ranks on all children of this node. More... | |
void | SortNodes () |
Sort child nodes quickly and recursively (IntrinsicRanks must have been set). More... | |
Static Public Member Functions | |
static bool | Compare (LIB_TREE_NODE const &aNode1, LIB_TREE_NODE const &aNode2) |
Compare two nodes. More... | |
Public Attributes | |
LIB_TREE_NODE * | m_Parent |
PTR_VECTOR | m_Children |
enum TYPE | m_Type |
int | m_IntrinsicRank |
The rank of the item before any search terms are applied. More... | |
int | m_Score |
bool | m_Pinned |
wxString | m_Name |
wxString | m_Desc |
wxString | m_Footprint |
wxString | m_MatchName |
wxString | m_SearchText |
bool | m_Normalized |
std::map< wxString, wxString > | m_Fields |
LIB_ID | m_LibId |
int | m_Unit |
bool | m_IsRoot |
Node type: unit of component.
Definition at line 150 of file lib_tree_model.h.
|
inherited |
Definition at line 115 of file lib_tree_model.h.
|
inherited |
|
delete |
The addresses of CMP_TREE_NODEs are used as unique IDs for the wxDataViewModel, so don't let them be copied around.
LIB_TREE_NODE_UNIT::LIB_TREE_NODE_UNIT | ( | LIB_TREE_NODE * | aParent, |
LIB_TREE_ITEM * | aItem, | ||
int | aUnit | ||
) |
Construct a unit node.
The name of the unit will be "Unit %s", where s is aUnit formatted by LIB_PART::SubReference.
aParent | parent node, should be a CMP_TREE_NODE_ALIAS |
aItem | parent item |
aUnit | unit number |
Definition at line 150 of file lib_tree_model.cpp.
References _, LIB_TREE_ITEM::GetUnitDisplayName(), LIB_TREE_ITEM::GetUnitReference(), LIB_TREE_ITEM::HasUnitDisplayName(), LIB_TREE_NODE::m_Desc, LIB_TREE_NODE::m_IntrinsicRank, LIB_TREE_NODE::m_LibId, LIB_TREE_NODE::m_MatchName, LIB_TREE_NODE::m_Name, LIB_TREE_NODE::m_Parent, LIB_TREE_NODE::m_Type, LIB_TREE_NODE::m_Unit, Pgm(), and LIB_TREE_NODE::UNIT.
|
inherited |
Store intrinsic ranks on all children of this node.
See m_IntrinsicRank member doc for more information.
Definition at line 62 of file lib_tree_model.cpp.
References LIB_TREE_NODE::m_Children, and LIB_TREE_NODE::m_IntrinsicRank.
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), FP_TREE_MODEL_ADAPTER::AddLibraries(), LIB_TREE_MODEL_ADAPTER::AssignIntrinsicRanks(), LIB_TREE_MODEL_ADAPTER::DoAddLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FP_TREE_SYNCHRONIZING_ADAPTER::Sync(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), and FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
|
staticinherited |
Compare two nodes.
Returns true if aNode1 < aNode2.
Definition at line 103 of file lib_tree_model.cpp.
References LIB_TREE_NODE::m_IntrinsicRank, LIB_TREE_NODE::m_Name, LIB_TREE_NODE::m_Pinned, and LIB_TREE_NODE::m_Type.
|
delete |
|
inherited |
Initialize score to kLowestDefaultScore, recursively.
Definition at line 53 of file lib_tree_model.cpp.
References kLowestDefaultScore, LIB_TREE_NODE::m_Children, and LIB_TREE_NODE::m_Score.
Referenced by LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
inherited |
Sort child nodes quickly and recursively (IntrinsicRanks must have been set).
Definition at line 90 of file lib_tree_model.cpp.
References LIB_TREE_NODE::m_Children.
Referenced by LIB_TREE_MODEL_ADAPTER::resortTree(), and LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
inlineoverridevirtual |
Do nothing, units just take the parent's score.
Implements LIB_TREE_NODE.
Definition at line 176 of file lib_tree_model.h.
|
inherited |
Definition at line 118 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE_LIB::AddItem(), LIB_TREE_NODE_ROOT::AddLib(), LIB_TREE_NODE_LIB_ID::AddUnit(), LIB_TREE_NODE::AssignIntrinsicRanks(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::deleteLibrary(), FP_TREE_SYNCHRONIZING_ADAPTER::deleteLibrary(), LIB_TREE_MODEL_ADAPTER::Find(), LIB_TREE_MODEL_ADAPTER::FindItem(), LIB_TREE_MODEL_ADAPTER::GetItemCount(), LIB_TREE_MODEL_ADAPTER::GetLibrariesCount(), LIB_TREE_MODEL_ADAPTER::IntoArray(), LIB_TREE_MODEL_ADAPTER::IsContainer(), LIB_TREE_NODE::ResetScore(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), LIB_TREE_MODEL_ADAPTER::ShowSingleLibrary(), LIB_TREE_NODE::SortNodes(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FP_TREE_SYNCHRONIZING_ADAPTER::Sync(), LIB_TREE_NODE_LIB_ID::Update(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), LIB_TREE_NODE_LIB::UpdateScore(), LIB_TREE_NODE_ROOT::UpdateScore(), and LIB_TREE_MODEL_ADAPTER::UpdateSearchString().
|
inherited |
Definition at line 132 of file lib_tree_model.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetValue(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), LIB_TREE_NODE_LIB::LIB_TREE_NODE_LIB(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_UNIT(), and LIB_TREE_NODE_LIB_ID::Update().
|
inherited |
Definition at line 139 of file lib_tree_model.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetValue(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), and LIB_TREE_NODE_LIB_ID::Update().
|
inherited |
Definition at line 133 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), and DIALOG_CHOOSE_SYMBOL::OnComponentPreselected().
|
inherited |
The rank of the item before any search terms are applied.
This is a fairly expensive sort (involving string compares) so it helps to store the result of that sort.
Definition at line 126 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE::AssignIntrinsicRanks(), LIB_TREE_NODE::Compare(), and LIB_TREE_NODE_UNIT().
|
inherited |
Definition at line 143 of file lib_tree_model.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetAttr(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), and LIB_TREE_NODE_LIB_ID::Update().
|
inherited |
Definition at line 141 of file lib_tree_model.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetAliasFor(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), LIB_TREE_NODE_LIB::LIB_TREE_NODE_LIB(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_UNIT(), DIALOG_CHOOSE_SYMBOL::OnComponentPreselected(), SYMBOL_EDITOR_CONTROL::PinLibrary(), FOOTPRINT_EDITOR_CONTROL::PinLibrary(), LIB_TREE_MODEL_ADAPTER::PinLibrary(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), SYMBOL_EDITOR_CONTROL::UnpinLibrary(), FOOTPRINT_EDITOR_CONTROL::UnpinLibrary(), LIB_TREE_MODEL_ADAPTER::UnpinLibrary(), and LIB_TREE_NODE_LIB_ID::Update().
|
inherited |
Definition at line 134 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE_LIB::LIB_TREE_NODE_LIB(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_UNIT(), LIB_TREE_NODE_LIB_ID::Update(), LIB_TREE_NODE_LIB_ID::UpdateScore(), and LIB_TREE_NODE_LIB::UpdateScore().
|
inherited |
Definition at line 131 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE::Compare(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::deleteLibrary(), FP_TREE_SYNCHRONIZING_ADAPTER::deleteLibrary(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), LIB_TREE_MODEL_ADAPTER::GetValue(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), LIB_TREE_NODE_LIB::LIB_TREE_NODE_LIB(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_UNIT(), LIB_TREE_NODE_LIB_ID::Update(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::updateLibrary(), and FP_TREE_SYNCHRONIZING_ADAPTER::updateLibrary().
|
inherited |
Definition at line 136 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_LIB_ID::Update(), and LIB_TREE_NODE_LIB_ID::UpdateScore().
|
inherited |
Definition at line 117 of file lib_tree_model.h.
Referenced by LIB_TREE::centerIfValid(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), LIB_TREE_MODEL_ADAPTER::GetParent(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), LIB_TREE_NODE_LIB::LIB_TREE_NODE_LIB(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_UNIT(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), LIB_TREE_MODEL_ADAPTER::ShowSingleLibrary(), and LIB_TREE_NODE_LIB_ID::UpdateScore().
|
inherited |
Definition at line 129 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE::Compare(), LIB_TREE_MODEL_ADAPTER::DoAddLibraryNode(), LIB_TREE_MODEL_ADAPTER::GetValue(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_EDITOR_CONTROL::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), LIB_TREE::onItemContextMenu(), SYMBOL_EDITOR_CONTROL::PinLibrary(), FOOTPRINT_EDITOR_CONTROL::PinLibrary(), LIB_TREE_MODEL_ADAPTER::PinLibrary(), SYMBOL_EDITOR_CONTROL::UnpinLibrary(), FOOTPRINT_EDITOR_CONTROL::UnpinLibrary(), and LIB_TREE_MODEL_ADAPTER::UnpinLibrary().
|
inherited |
Definition at line 128 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE::ResetScore(), LIB_TREE_MODEL_ADAPTER::ShowResults(), LIB_TREE_NODE_LIB_ID::UpdateScore(), and LIB_TREE_NODE_LIB::UpdateScore().
|
inherited |
Definition at line 135 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_LIB_ID::Update(), and LIB_TREE_NODE_LIB_ID::UpdateScore().
|
inherited |
Definition at line 119 of file lib_tree_model.h.
Referenced by LIB_TREE_NODE::Compare(), LIB_TREE_MODEL_ADAPTER::GetAttr(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), FP_TREE_SYNCHRONIZING_ADAPTER::GetAttr(), LIB_TREE_MODEL_ADAPTER::GetChildren(), LIB_TREE_MODEL_ADAPTER::GetParent(), LIB_TREE_MODEL_ADAPTER::GetTypeFor(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetValue(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), SYMBOL_EDITOR_CONTROL::Init(), FOOTPRINT_EDITOR_CONTROL::Init(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::IsContainer(), FP_TREE_SYNCHRONIZING_ADAPTER::IsContainer(), LIB_TREE_NODE_LIB::LIB_TREE_NODE_LIB(), LIB_TREE_NODE_LIB_ID::LIB_TREE_NODE_LIB_ID(), LIB_TREE_NODE_ROOT::LIB_TREE_NODE_ROOT(), LIB_TREE_NODE_UNIT(), LIB_TREE::onItemContextMenu(), LIB_TREE_MODEL_ADAPTER::ShowPreselect(), LIB_TREE_MODEL_ADAPTER::ShowResults(), and LIB_TREE_MODEL_ADAPTER::ShowSingleLibrary().
|
inherited |
Definition at line 142 of file lib_tree_model.h.
Referenced by LIB_TREE_MODEL_ADAPTER::GetUnitFor(), LIB_TREE_NODE_UNIT(), DIALOG_CHOOSE_SYMBOL::OnComponentPreselected(), and LIB_TREE_MODEL_ADAPTER::ShowPreselect().