|
KiCad PCB EDA Suite
|
#include <kicommon.h>#include <json_common.h>#include <wx/string.h>#include <map>#include <utility>#include <vector>Go to the source code of this file.
Enumerations | |
| enum class | IMPORT_REPORT_FORMAT { NONE , JSON , TEXT } |
| Output format for the report shared by the board and schematic import jobs. More... | |
Functions | |
| NLOHMANN_JSON_SERIALIZE_ENUM (IMPORT_REPORT_FORMAT, { { IMPORT_REPORT_FORMAT::NONE, "none" }, { IMPORT_REPORT_FORMAT::JSON, "json" }, { IMPORT_REPORT_FORMAT::TEXT, "text" } }) struct KICOMMON_API IMPORT_REPORT_DATA | |
| Data describing a completed import, rendered uniformly by WriteImportReport for both the board and schematic import jobs. | |
| KICOMMON_API bool | ParseImportReportFormat (const wxString &aText, IMPORT_REPORT_FORMAT &aFormat) |
| Parse the user-facing report format name ("none", "json" or "text") into its enum. | |
| KICOMMON_API wxString | DefaultImportOutputPath (const wxString &aInputFile, const wxString &aKiCadExt) |
| Build the default output path for an import by swapping the input file's extension for the given KiCad extension, keeping it in the input file's directory. | |
| KICOMMON_API bool | LoadLayerMapFile (const wxString &aFile, std::map< wxString, wxString > &aMap, wxString &aError) |
Load an explicit layer-mapping file into aMap. | |
| KICOMMON_API void | WriteImportReport (REPORTER *aReporter, IMPORT_REPORT_FORMAT aFormat, const wxString &aReportFile, const IMPORT_REPORT_DATA &aData) |
Emit an import report in the requested format to aReportFile, or to aReporter (at INFO severity) when no file is given. | |
|
strong |
Output format for the report shared by the board and schematic import jobs.
| Enumerator | |
|---|---|
| NONE | |
| JSON | |
| TEXT | |
Definition at line 35 of file job_import_utils.h.
| KICOMMON_API wxString DefaultImportOutputPath | ( | const wxString & | aInputFile, |
| const wxString & | aKiCadExt ) |
Build the default output path for an import by swapping the input file's extension for the given KiCad extension, keeping it in the input file's directory.
Definition at line 44 of file job_import_utils.cpp.
Referenced by EESCHEMA_JOBS_HANDLER::JobImport(), and PCBNEW_JOBS_HANDLER::JobImport().
| KICOMMON_API bool LoadLayerMapFile | ( | const wxString & | aFile, |
| std::map< wxString, wxString > & | aMap, | ||
| wxString & | aError ) |
Load an explicit layer-mapping file into aMap.
The file is a flat JSON object whose keys are source (foreign) layer names and whose values are KiCad layer names, e.g.
aMap untouched and a human-readable reason in aError. Definition at line 53 of file job_import_utils.cpp.
References _, and From_UTF8().
Referenced by CLI::IMPORT_COMMAND::doPerform(), and CLI::PCB_IMPORT_COMMAND::doPerform().
| NLOHMANN_JSON_SERIALIZE_ENUM | ( | IMPORT_REPORT_FORMAT | , |
| { { IMPORT_REPORT_FORMAT::NONE, "none" }, { IMPORT_REPORT_FORMAT::JSON, "json" }, { IMPORT_REPORT_FORMAT::TEXT, "text" } } | ) |
Data describing a completed import, rendered uniformly by WriteImportReport for both the board and schematic import jobs.
Statistics keyed by their JSON name (lower case). The text report capitalizes the first letter of each key for display. Order is preserved in both renderings.
Extra members merged verbatim into the JSON report (e.g. layer mapping). The text report ignores them.
Definition at line 43 of file job_import_utils.h.
| KICOMMON_API bool ParseImportReportFormat | ( | const wxString & | aText, |
| IMPORT_REPORT_FORMAT & | aFormat ) |
Parse the user-facing report format name ("none", "json" or "text") into its enum.
aFormat untouched. Definition at line 29 of file job_import_utils.cpp.
References JSON, NONE, and TEXT.
Referenced by CLI::PCB_IMPORT_COMMAND::doPerform(), and CLI::SCH_IMPORT_COMMAND::doPerform().
| KICOMMON_API void WriteImportReport | ( | REPORTER * | aReporter, |
| IMPORT_REPORT_FORMAT | aFormat, | ||
| const wxString & | aReportFile, | ||
| const IMPORT_REPORT_DATA & | aData ) |
Emit an import report in the requested format to aReportFile, or to aReporter (at INFO severity) when no file is given.
A NONE format is a no-op.
Definition at line 110 of file job_import_utils.cpp.
References _, JSON, NONE, output, REPORTER::Report(), RPT_SEVERITY_ERROR, and RPT_SEVERITY_INFO.
Referenced by EESCHEMA_JOBS_HANDLER::JobImport(), and PCBNEW_JOBS_HANDLER::JobImport().