KiCad PCB EDA Suite
Loading...
Searching...
No Matches
symbol_library_query.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include <vector>
23
24#include <lib_id.h>
25#include <wx/string.h>
26
27
28class KIWAY;
29
30
35{
39
41 bool m_MatchFilters = true;
42
45
47 bool m_MatchPinMaps = true;
48
50 int m_MaxResults = 400;
51
53 wxString ToJsonStr() const;
54
56 static FOOTPRINT_USERS_QUERY FromJsonStr( const wxString& aJson );
57};
58
59
64{
67
69 int m_PinCount = 0;
70
72 bool m_IsDerived = false;
73
77
80
83 std::vector<wxString> m_MatchedPinMaps;
84};
85
86
90{
92 bool m_Success = false;
93
95 std::vector<FOOTPRINT_USER_MATCH> m_Matches;
96
98 bool m_IsLimited = false;
99
101 wxString ToJsonStr() const;
102
104 static FOOTPRINT_USERS_RESULT FromJsonStr( const wxString& aJson );
105};
106
107
121
122
132bool StartSymbolLibrariesLoad( KIWAY& aKiway );
133
134
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:348
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
All the information needed to query the symbol libraries for the symbols using a footprint.
wxString ToJsonStr() const
Serialise to the JSON object that carries a query over the Eeschema kiface.
static FOOTPRINT_USERS_QUERY FromJsonStr(const wxString &aJson)
Parse the JSON object written by ToJsonStr().
bool m_MatchPinMaps
When true, symbols whose pin maps are bound to the footprint are returned.
int m_MaxResults
Limits the number of returned symbols; zero means no limit.
bool m_MatchFilters
When true, symbols whose footprint filters select the footprint are returned.
bool m_MatchFootprintField
When true, symbols whose footprint field names the footprint are returned.
LIB_ID m_Footprint
The footprint to find the users of.
The outcome of a footprint users query, and the JSON encoding used to move it across the Eeschema kif...
bool m_IsLimited
True if the result set is limited by the maximum number of results.
std::vector< FOOTPRINT_USER_MATCH > m_Matches
The matching symbols, in the order the libraries were searched.
static FOOTPRINT_USERS_RESULT FromJsonStr(const wxString &aJson)
Parse the JSON object written by ToJsonStr().
wxString ToJsonStr() const
Serialise to the JSON object that carries a result over the Eeschema kiface.
bool m_Success
False if the query could not be performed, in which case Matches is empty.
One symbol that uses a footprint, and the reason it matched.
wxString m_MatchedFilter
The footprint filter that selected the footprint, empty when the match did not come from a filter.
int m_PinCount
The number of pins of the matching symbol.
bool m_MatchesFootprintField
True when the symbol's footprint field names the footprint.
LIB_ID m_Symbol
The "library:symbol" name of the matching symbol.
bool m_IsDerived
True when the symbol is derived from another symbol rather than being a root symbol.
std::vector< wxString > m_MatchedPinMaps
The names of the symbol's pin maps that are bound to the footprint, in the order they were found; emp...
FOOTPRINT_USERS_RESULT QueryFootprintUsers(KIWAY &aKiway, const FOOTPRINT_USERS_QUERY &aQuery)
Ask the symbol libraries, for the symbols that use a given footprint (over the Eeschema kiface).
bool StartSymbolLibrariesLoad(KIWAY &aKiway)
Start loading the symbol libraries in the background.
float GetSymbolLibrariesLoadProgress(KIWAY &aKiway)
Return how far the background load of the symbol libraries has got.