KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_import_reconciler.h File Reference
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <wx/string.h>
#include <reporter.h>

Go to the source code of this file.

Classes

struct  FOOTPRINT_IMPORT_RECONCILE_RESULT
 Outcome of a post-import footprint-library reconciliation pass. More...
 
class  FOOTPRINT_IMPORT_RECONCILER
 Frame-independent, non-interactive service that reconciles the footprint-library references of a freshly imported (non-KiCad) board so that every board footprint FPID resolves to a registered project library. More...
 

Functions

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.
 
FOOTPRINT_IMPORT_RECONCILE_RESULT ReconcileImportedFootprints (PCB_IO &aPlugin, BOARD &aBoard, PROJECT &aProject, const wxString &aBoardPath, const std::map< std::string, UTF8 > *aProperties, REPORTER &aReporter)
 Overload taking the definitions straight from aPlugin, for callers that still hold it.
 

Function Documentation

◆ ReconcileImportedFootprints() [1/2]

FOOTPRINT_IMPORT_RECONCILE_RESULT ReconcileImportedFootprints ( PCB_IO & aPlugin,
BOARD & aBoard,
PROJECT & aProject,
const wxString & aBoardPath,
const std::map< std::string, UTF8 > * aProperties,
REPORTER & aReporter )

Overload taking the definitions straight from aPlugin, for callers that still hold it.

Definition at line 483 of file footprint_import_reconciler.cpp.

References PCB_IO::GetImportedCachedLibraryFootprints(), and ReconcileImportedFootprints().

◆ ReconcileImportedFootprints() [2/2]

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.

Shared by the interactive import and the kicad-cli pcb import job so both materialize the project footprint library and re-point FPIDs. A reconciliation failure is reported rather than thrown so an import is never aborted by it.

Parameters
aPropertiescarries the manager-chosen cache nickname and provenance source libraries; a standalone import passes nullptr and the nickname is derived from aBoardPath.

Definition at line 445 of file footprint_import_reconciler.cpp.

References _, PROJECT_PCB::FootprintLibAdapter(), PROJECT::GetProjectPath(), IMPORT_PROJ_PROPS::MakeCacheNickname(), IMPORT_PROJ_PROPS::ReadFootprintProps(), FOOTPRINT_IMPORT_RECONCILER::Reconcile(), REPORTER::Report(), result, RPT_SEVERITY_ERROR, and IO_ERROR::What().

Referenced by PCBNEW_JOBS_HANDLER::JobImport(), PCB_EDIT_FRAME::reconcileImportedFootprintLibraries(), and ReconcileImportedFootprints().