KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_import_reconciler.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
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU 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
#ifndef FOOTPRINT_IMPORT_RECONCILER_H
21
#define FOOTPRINT_IMPORT_RECONCILER_H
22
23
#include <map>
24
#include <memory>
25
#include <vector>
26
#include <wx/string.h>
27
28
class
BOARD
;
29
class
FOOTPRINT
;
30
class
FOOTPRINT_LIBRARY_ADAPTER
;
31
class
REPORTER
;
32
36
struct
FOOTPRINT_IMPORT_RECONCILE_RESULT
37
{
38
int
m_linkedToSource
= 0;
39
int
m_linkedToCache
= 0;
40
int
m_unresolved
= 0;
41
int
m_savedToCache
= 0;
42
wxString
m_cacheNickname
;
43
wxString
m_cacheLibraryPath
;
44
45
bool
Ok
()
const
{
return
m_unresolved
== 0; }
46
};
47
61
class
FOOTPRINT_IMPORT_RECONCILER
62
{
63
public
:
64
FOOTPRINT_IMPORT_RECONCILER
(
FOOTPRINT_LIBRARY_ADAPTER
& aAdapter,
const
wxString& aProjectPath,
65
REPORTER
* aReporter =
nullptr
);
66
78
FOOTPRINT_IMPORT_RECONCILE_RESULT
79
Reconcile
(
BOARD
* aBoard, std::vector<std::unique_ptr<FOOTPRINT>> aDefinitions,
80
const
wxString& aCacheNickname,
const
std::vector<wxString>& aSourceLibNicknames );
81
83
static
const
wxString&
ManagedCacheOption
();
84
85
private
:
87
void
writeAndRegisterCache
(
const
wxString& aCacheNickname,
88
const
std::map<wxString, FOOTPRINT*>& aCacheDefs,
89
FOOTPRINT_IMPORT_RECONCILE_RESULT
& aResult );
90
93
bool
registerCacheRow
(
const
wxString& aCacheNickname );
94
95
FOOTPRINT_LIBRARY_ADAPTER
&
m_adapter
;
96
wxString
m_projectPath
;
97
REPORTER
*
m_reporter
;
98
};
99
100
#endif
// FOOTPRINT_IMPORT_RECONCILER_H
BOARD
Information pertinent to a Pcbnew printed circuit board.
Definition
board.h:373
FOOTPRINT_IMPORT_RECONCILER::writeAndRegisterCache
void writeAndRegisterCache(const wxString &aCacheNickname, const std::map< wxString, FOOTPRINT * > &aCacheDefs, FOOTPRINT_IMPORT_RECONCILE_RESULT &aResult)
Write the residual definitions into an atomically-published .pretty and register its row.
Definition
footprint_import_reconciler.cpp:258
FOOTPRINT_IMPORT_RECONCILER::m_projectPath
wxString m_projectPath
Definition
footprint_import_reconciler.h:96
FOOTPRINT_IMPORT_RECONCILER::ManagedCacheOption
static const wxString & ManagedCacheOption()
Options string identifying a footprint-library table row as a generated import cache.
Definition
footprint_import_reconciler.cpp:41
FOOTPRINT_IMPORT_RECONCILER::Reconcile
FOOTPRINT_IMPORT_RECONCILE_RESULT Reconcile(BOARD *aBoard, std::vector< std::unique_ptr< FOOTPRINT > > aDefinitions, const wxString &aCacheNickname, const std::vector< wxString > &aSourceLibNicknames)
Reconcile aBoard against the importer definitions and the provenance source libraries.
Definition
footprint_import_reconciler.cpp:91
FOOTPRINT_IMPORT_RECONCILER::m_adapter
FOOTPRINT_LIBRARY_ADAPTER & m_adapter
Definition
footprint_import_reconciler.h:95
FOOTPRINT_IMPORT_RECONCILER::m_reporter
REPORTER * m_reporter
Definition
footprint_import_reconciler.h:97
FOOTPRINT_IMPORT_RECONCILER::registerCacheRow
bool registerCacheRow(const wxString &aCacheNickname)
Insert or refresh the project footprint-library-table row for the generated cache.
Definition
footprint_import_reconciler.cpp:363
FOOTPRINT_IMPORT_RECONCILER::FOOTPRINT_IMPORT_RECONCILER
FOOTPRINT_IMPORT_RECONCILER(FOOTPRINT_LIBRARY_ADAPTER &aAdapter, const wxString &aProjectPath, REPORTER *aReporter=nullptr)
Definition
footprint_import_reconciler.cpp:48
FOOTPRINT_LIBRARY_ADAPTER
An interface to the global shared library manager that is schematic-specific and linked to one projec...
Definition
footprint_library_adapter.h:43
FOOTPRINT
Definition
footprint.h:288
REPORTER
A pure virtual class used to derive REPORTER objects from.
Definition
reporter.h:72
FOOTPRINT_IMPORT_RECONCILE_RESULT
Outcome of a post-import footprint-library reconciliation pass.
Definition
footprint_import_reconciler.h:37
FOOTPRINT_IMPORT_RECONCILE_RESULT::m_linkedToSource
int m_linkedToSource
board FPIDs re-pointed at a provenance source library
Definition
footprint_import_reconciler.h:38
FOOTPRINT_IMPORT_RECONCILE_RESULT::m_savedToCache
int m_savedToCache
distinct definitions written into the cache library
Definition
footprint_import_reconciler.h:41
FOOTPRINT_IMPORT_RECONCILE_RESULT::m_cacheNickname
wxString m_cacheNickname
nickname of the generated cache, empty if none written
Definition
footprint_import_reconciler.h:42
FOOTPRINT_IMPORT_RECONCILE_RESULT::m_linkedToCache
int m_linkedToCache
board FPIDs re-pointed at the generated cache
Definition
footprint_import_reconciler.h:39
FOOTPRINT_IMPORT_RECONCILE_RESULT::Ok
bool Ok() const
Definition
footprint_import_reconciler.h:45
FOOTPRINT_IMPORT_RECONCILE_RESULT::m_cacheLibraryPath
wxString m_cacheLibraryPath
absolute path to the generated .pretty, empty if none
Definition
footprint_import_reconciler.h:43
FOOTPRINT_IMPORT_RECONCILE_RESULT::m_unresolved
int m_unresolved
board FPIDs left unresolved
Definition
footprint_import_reconciler.h:40
src
pcbnew
footprint_import_reconciler.h
Generated on Sat Jul 25 2026 00:06:00 for KiCad PCB EDA Suite by
1.13.2