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 <string>
26#include <vector>
27#include <wx/string.h>
28
29#include <reporter.h>
30
31class BOARD;
32class FOOTPRINT;
34class PCB_IO;
35class PROJECT;
36class UTF8;
37
49
64{
65public:
66 FOOTPRINT_IMPORT_RECONCILER( FOOTPRINT_LIBRARY_ADAPTER& aAdapter, const wxString& aProjectPath,
67 REPORTER& aReporter = NULL_REPORTER::GetInstance() );
68
81 Reconcile( BOARD* aBoard, std::vector<std::unique_ptr<FOOTPRINT>> aDefinitions,
82 const wxString& aCacheNickname, const std::vector<wxString>& aSourceLibNicknames );
83
84private:
86 void writeAndRegisterCache( const wxString& aCacheNickname,
87 const std::map<wxString, FOOTPRINT*>& aCacheDefs,
89
92 bool registerCacheRow( const wxString& aCacheNickname );
93
95 wxString m_projectPath;
97};
98
111ReconcileImportedFootprints( std::vector<std::unique_ptr<FOOTPRINT>> aDefinitions, BOARD& aBoard,
112 PROJECT& aProject, const wxString& aBoardPath,
113 const std::map<std::string, UTF8>* aProperties, REPORTER& aReporter );
114
119ReconcileImportedFootprints( PCB_IO& aPlugin, BOARD& aBoard, PROJECT& aProject,
120 const wxString& aBoardPath,
121 const std::map<std::string, UTF8>* aProperties, REPORTER& aReporter );
122
123#endif // FOOTPRINT_IMPORT_RECONCILER_H
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
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.
FOOTPRINT_IMPORT_RECONCILER(FOOTPRINT_LIBRARY_ADAPTER &aAdapter, const wxString &aProjectPath, REPORTER &aReporter=NULL_REPORTER::GetInstance())
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.
FOOTPRINT_LIBRARY_ADAPTER & m_adapter
bool registerCacheRow(const wxString &aCacheNickname)
Insert or refresh the project footprint-library-table row for the generated cache.
An interface to the global shared library manager that is schematic-specific and linked to one projec...
static REPORTER & GetInstance()
Definition reporter.cpp:179
A base class that BOARD loading and saving plugins should derive from.
Definition pcb_io.h:75
Container for project specific data.
Definition project.h:63
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:72
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
Definition utf8.h:67
FOOTPRINT_IMPORT_RECONCILE_RESULT ReconcileImportedFootprints(std::vector< std::unique_ptr< FOOTPRINT > > aDefinitions, BOARD &aBoard, PROJECT &aProject, const wxString &aBoardPath, const std::map< std::string, UTF8 > *aProperties, REPORTER &aReporter)
Reconcile aBoard against the definitions an importer retained while loading it.
Outcome of a post-import footprint-library reconciliation pass.
int m_linkedToSource
board FPIDs re-pointed at a provenance source library
int m_savedToCache
distinct definitions written into the cache library
wxString m_cacheNickname
nickname of the generated cache, empty if none written
int m_linkedToCache
board FPIDs re-pointed at the generated cache
int m_unresolved
board FPIDs left unresolved