KiCad PCB EDA Suite
Loading...
Searching...
No Matches
JOB_PCB_IMPORT Class Reference

Job to import a non-KiCad PCB file to KiCad format. More...

#include <job_pcb_import.h>

Inheritance diagram for JOB_PCB_IMPORT:
JOB

Public Types

enum class  FORMAT {
  AUTO , PADS_ASCII , ALTIUM , EAGLE ,
  CADSTAR , FABMASTER , PCAD , SOLIDWORKS ,
  EASYPC , TARGET3001
}
 

Public Member Functions

 JOB_PCB_IMPORT ()
 
wxString GetDefaultDescription () const override
 
wxString GetSettingsDialogTitle () const override
 
const std::string & GetType () const
 
const std::map< wxString, wxString > & GetVarOverrides () const
 
void SetVarOverrides (const std::map< wxString, wxString > &aVarOverrides)
 
void SetTitleBlock (const TITLE_BLOCK &aTitleBlock)
 
virtual void FromJson (const nlohmann::json &j)
 
virtual void ToJson (nlohmann::json &j) const
 
const std::vector< JOB_PARAM_BASE * > & GetParams ()
 
void ClearExistingOutputs ()
 
const std::vector< JOB_OUTPUT > & GetOutputs ()
 
void AddOutput (wxString aOutputPath)
 
void SetTempOutputDirectory (const wxString &aBase)
 Sets the temporary output directory for the job, this is used to prefix with a given output path when GetFullOutputPath is called.
 
void SetConfiguredOutputPath (const wxString &aPath)
 Sets the configured output path for the job, this path is always saved to file.
 
wxString GetConfiguredOutputPath () const
 Returns the configured output path for the job.
 
void SetWorkingOutputPath (const wxString &aPath)
 Sets a transient output path for the job, it takes priority over the configured output path when GetFullOutputPath is called.
 
wxString GetWorkingOutputPath () const
 Returns the working output path for the job, if one has been set.
 
wxString GetFullOutputPath (PROJECT *aProject) const
 Returns the full output path for the job, taking into account the configured output path, any configured working path and the temporary output directory.
 
wxString ResolveOutputPath (const wxString &aPath, bool aPathIsDirectory, PROJECT *aProject) const
 
bool GetOutputPathIsDirectory () const
 

Static Public Member Functions

static wxString AppendDefaultFileName (const wxString &aPath, const wxString &aDefaultName)
 Complete a resolved file output path that names a folder, either by a trailing separator or by being an existing directory, with a default file name.
 

Public Attributes

wxString m_inputFile
 
FORMAT m_format = FORMAT::AUTO
 
IMPORT_REPORT_FORMAT m_reportFormat = IMPORT_REPORT_FORMAT::NONE
 
wxString m_reportFile
 
std::map< wxString, wxString > m_layerMap
 Explicit overrides from source layer name to KiCad layer name (canonical board-file name, e.g.
 
std::map< wxString, wxString > m_netNameMap
 
bool m_probeOnly = false
 
wxString m_importPcbId
 EasyEDA Pro PCB document identifier selected by project-level import.
 
bool m_isPartOfMultiBoardProject = false
 Avoid promoting an individual board's source settings into shared project settings.
 
wxString m_netlistFile
 Netlist of the imported schematic, whose net names the board takes where the two agree.
 
std::map< std::string, UTF8 > m_properties
 Library coordination properties, as IMPORT_PROJ_HELPER hands them to the editor.
 
wxString m_sourceProjectDir
 Directory of the source project and the footprint libraries it names, registered before the import.
 
std::vector< wxString > m_localLibraries
 
std::map< wxString, wxString > m_footprintIds
 Board reference to footprint LIB_ID, filled in by an import.
 
bool m_projectHasNoBoard = false
 Set by a probe of a project archive that holds no board.
 
std::vector< std::pair< wxString, wxString > > m_projectBoards
 PCB document identifier and source name pairs found during a probe.
 
std::vector< IMPORT_PROJECT_DESC > m_projectEntries
 KiCad projects the source project splits into, found during a probe.
 

Protected Attributes

std::string m_type
 
std::map< wxString, wxString > m_varOverrides
 
TITLE_BLOCK m_titleBlock
 
wxString m_tempOutputDirectory
 
wxString m_outputPath
 
bool m_outputPathIsDirectory
 
wxString m_description
 
wxString m_workingOutputPath
 The working output path is a transient path that takes priority over the configured output path when determining where to write output files.
 
std::vector< JOB_PARAM_BASE * > m_params
 
std::vector< JOB_OUTPUT > m_outputs
 

Detailed Description

Job to import a non-KiCad PCB file to KiCad format.

Supports importing from PADS, Altium, Eagle, and other formats supported by the PCB_IO plugins.

Definition at line 41 of file job_pcb_import.h.

Member Enumeration Documentation

◆ FORMAT

enum class JOB_PCB_IMPORT::FORMAT
strong
Enumerator
AUTO 
PADS_ASCII 
ALTIUM 
EAGLE 
CADSTAR 
FABMASTER 
PCAD 
SOLIDWORKS 
EASYPC 
TARGET3001 

Definition at line 49 of file job_pcb_import.h.

Constructor & Destructor Documentation

◆ JOB_PCB_IMPORT()

JOB_PCB_IMPORT::JOB_PCB_IMPORT ( )

Member Function Documentation

◆ AddOutput()

◆ AppendDefaultFileName()

wxString JOB::AppendDefaultFileName ( const wxString & aPath,
const wxString & aDefaultName )
staticinherited

Complete a resolved file output path that names a folder, either by a trailing separator or by being an existing directory, with a default file name.

Returns
aPath unchanged when it already names a file.

Definition at line 152 of file job.cpp.

Referenced by EESCHEMA_JOBS_HANDLER::JobExportBom(), EESCHEMA_JOBS_HANDLER::JobExportNetlist(), EESCHEMA_JOBS_HANDLER::JobExportPlot(), EESCHEMA_JOBS_HANDLER::JobExportPythonBom(), EESCHEMA_JOBS_HANDLER::JobSchErc(), and JOBS_RUNNER::runSpecialExecute().

◆ ClearExistingOutputs()

void JOB::ClearExistingOutputs ( )
inlineinherited

Definition at line 214 of file job.h.

References m_outputs.

Referenced by JOB_DISPATCHER::RunJob().

◆ FromJson()

◆ GetConfiguredOutputPath()

◆ GetDefaultDescription()

wxString JOB_PCB_IMPORT::GetDefaultDescription ( ) const
overridevirtual

Reimplemented from JOB.

Definition at line 49 of file job_pcb_import.cpp.

References _.

◆ GetFullOutputPath()

◆ GetOutputPathIsDirectory()

bool JOB::GetOutputPathIsDirectory ( ) const
inlineinherited

◆ GetOutputs()

const std::vector< JOB_OUTPUT > & JOB::GetOutputs ( )
inlineinherited

Definition at line 215 of file job.h.

References m_outputs.

Referenced by ExecuteBoardJob(), and ExecuteSchematicJob().

◆ GetParams()

const std::vector< JOB_PARAM_BASE * > & JOB::GetParams ( )
inlineinherited

Definition at line 212 of file job.h.

References m_params.

◆ GetSettingsDialogTitle()

wxString JOB_PCB_IMPORT::GetSettingsDialogTitle ( ) const
overridevirtual

Reimplemented from JOB.

Definition at line 55 of file job_pcb_import.cpp.

References _.

◆ GetType()

const std::string & JOB::GetType ( ) const
inlineinherited

◆ GetVarOverrides()

◆ GetWorkingOutputPath()

wxString JOB::GetWorkingOutputPath ( ) const
inlineinherited

Returns the working output path for the job, if one has been set.

Definition at line 246 of file job.h.

References m_workingOutputPath.

Referenced by BOOST_AUTO_TEST_CASE(), GenerateODBPPFiles(), PCBNEW_JOBS_HANDLER::JobExportStackup(), and PCBNEW_JOBS_HANDLER::JobExportStats().

◆ ResolveOutputPath()

wxString JOB::ResolveOutputPath ( const wxString & aPath,
bool aPathIsDirectory,
PROJECT * aProject ) const
inherited

◆ SetConfiguredOutputPath()

void JOB::SetConfiguredOutputPath ( const wxString & aPath)
inherited

Sets the configured output path for the job, this path is always saved to file.

Any transient working output path is cleared so the new configured path takes precedence on the next call to GetFullOutputPath().

Definition at line 181 of file job.cpp.

References m_outputPath, and m_workingOutputPath.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CLI::IMPORT_COMMAND::doPerform(), API_HANDLER_PCB::handleRunBoardJobExport3D(), API_HANDLER_PCB::handleRunBoardJobExportDrill(), API_HANDLER_PCB::handleRunBoardJobExportDxf(), API_HANDLER_PCB::handleRunBoardJobExportGencad(), API_HANDLER_PCB::handleRunBoardJobExportGerbers(), API_HANDLER_PCB::handleRunBoardJobExportIdf(), API_HANDLER_PCB::handleRunBoardJobExportIpc2581(), API_HANDLER_PCB::handleRunBoardJobExportIpcD356(), API_HANDLER_PCB::handleRunBoardJobExportODB(), API_HANDLER_PCB::handleRunBoardJobExportPdf(), API_HANDLER_PCB::handleRunBoardJobExportPng(), API_HANDLER_PCB::handleRunBoardJobExportPosition(), API_HANDLER_PCB::handleRunBoardJobExportPs(), API_HANDLER_PCB::handleRunBoardJobExportRender(), API_HANDLER_PCB::handleRunBoardJobExportSpecctraDsn(), API_HANDLER_PCB::handleRunBoardJobExportStats(), API_HANDLER_PCB::handleRunBoardJobExportSvg(), API_HANDLER_SCH::handleRunSchematicJobExportBOM(), API_HANDLER_SCH::handleRunSchematicJobExportNetlist(), EESCHEMA_JOBS_HANDLER::JobExportBom(), PCBNEW_JOBS_HANDLER::JobExportBom(), EESCHEMA_JOBS_HANDLER::JobExportNetlist(), EESCHEMA_JOBS_HANDLER::JobExportPlot(), EESCHEMA_JOBS_HANDLER::JobExportPythonBom(), CLI::PCB_EXPORT_GERBER_COMMAND::populateJob(), DIALOG_EXPORT_ODBPP::populateJob(), JOBS_RUNNER::runSpecialArchive(), DIALOG_FIELDS_TABLE::saveJobSettings(), JOB_EXPORT_PCB_IDF::SetDefaultOutputPath(), JOB_EXPORT_PCB_IPC2581::SetDefaultOutputPath(), JOB_EXPORT_PCB_IPCD356::SetDefaultOutputPath(), JOB_EXPORT_PCB_ODB::SetDefaultOutputPath(), and JOB_EXPORT_PCB_POS::SetDefaultOutputPath().

◆ SetTempOutputDirectory()

void JOB::SetTempOutputDirectory ( const wxString & aBase)
inherited

Sets the temporary output directory for the job, this is used to prefix with a given output path when GetFullOutputPath is called.

This is intended for use with running jobsets and otherwise has no impact on individual job runs outside jobsets.

Definition at line 86 of file job.cpp.

References m_tempOutputDirectory.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SetTitleBlock()

◆ SetVarOverrides()

void JOB::SetVarOverrides ( const std::map< wxString, wxString > & aVarOverrides)
inlineinherited

Definition at line 199 of file job.h.

References m_varOverrides.

Referenced by CLI::PCB_EXPORT_GERBER_COMMAND::populateJob().

◆ SetWorkingOutputPath()

◆ ToJson()

Member Data Documentation

◆ m_description

wxString JOB::m_description
protectedinherited

Definition at line 277 of file job.h.

Referenced by JOB().

◆ m_footprintIds

std::map<wxString, wxString> JOB_PCB_IMPORT::m_footprintIds

Board reference to footprint LIB_ID, filled in by an import.

Definition at line 91 of file job_pcb_import.h.

◆ m_format

FORMAT JOB_PCB_IMPORT::m_format = FORMAT::AUTO

◆ m_importPcbId

wxString JOB_PCB_IMPORT::m_importPcbId

EasyEDA Pro PCB document identifier selected by project-level import.

Definition at line 76 of file job_pcb_import.h.

Referenced by CLI::IMPORT_COMMAND::doPerform(), and PCBNEW_JOBS_HANDLER::JobImport().

◆ m_inputFile

wxString JOB_PCB_IMPORT::m_inputFile

◆ m_isPartOfMultiBoardProject

bool JOB_PCB_IMPORT::m_isPartOfMultiBoardProject = false

Avoid promoting an individual board's source settings into shared project settings.

Definition at line 78 of file job_pcb_import.h.

Referenced by CLI::IMPORT_COMMAND::doPerform(), and PCBNEW_JOBS_HANDLER::JobImport().

◆ m_layerMap

std::map<wxString, wxString> JOB_PCB_IMPORT::m_layerMap

Explicit overrides from source layer name to KiCad layer name (canonical board-file name, e.g.

"F.Cu"). Source layers absent from the map keep the importer's automatic best-guess. An empty map means fully automatic layer mapping.

Definition at line 71 of file job_pcb_import.h.

Referenced by CLI::IMPORT_COMMAND::doPerform(), and PCBNEW_JOBS_HANDLER::JobImport().

◆ m_localLibraries

std::vector<wxString> JOB_PCB_IMPORT::m_localLibraries

Definition at line 88 of file job_pcb_import.h.

◆ m_netlistFile

wxString JOB_PCB_IMPORT::m_netlistFile

Netlist of the imported schematic, whose net names the board takes where the two agree.

Definition at line 81 of file job_pcb_import.h.

◆ m_netNameMap

std::map<wxString, wxString> JOB_PCB_IMPORT::m_netNameMap

◆ m_outputPath

wxString JOB::m_outputPath
protectedinherited

Definition at line 275 of file job.h.

Referenced by GetConfiguredOutputPath(), GetFullOutputPath(), JOB(), and SetConfiguredOutputPath().

◆ m_outputPathIsDirectory

bool JOB::m_outputPathIsDirectory
protectedinherited

Definition at line 276 of file job.h.

Referenced by GetFullOutputPath(), GetOutputPathIsDirectory(), and JOB().

◆ m_outputs

std::vector<JOB_OUTPUT> JOB::m_outputs
protectedinherited

Definition at line 287 of file job.h.

Referenced by AddOutput(), ClearExistingOutputs(), and GetOutputs().

◆ m_params

◆ m_probeOnly

bool JOB_PCB_IMPORT::m_probeOnly = false

◆ m_projectBoards

std::vector<std::pair<wxString, wxString> > JOB_PCB_IMPORT::m_projectBoards

PCB document identifier and source name pairs found during a probe.

Definition at line 97 of file job_pcb_import.h.

Referenced by CLI::IMPORT_COMMAND::doPerform(), and PCBNEW_JOBS_HANDLER::JobImport().

◆ m_projectEntries

std::vector<IMPORT_PROJECT_DESC> JOB_PCB_IMPORT::m_projectEntries

KiCad projects the source project splits into, found during a probe.

Definition at line 100 of file job_pcb_import.h.

◆ m_projectHasNoBoard

bool JOB_PCB_IMPORT::m_projectHasNoBoard = false

Set by a probe of a project archive that holds no board.

Definition at line 94 of file job_pcb_import.h.

◆ m_properties

std::map<std::string, UTF8> JOB_PCB_IMPORT::m_properties

Library coordination properties, as IMPORT_PROJ_HELPER hands them to the editor.

Definition at line 84 of file job_pcb_import.h.

◆ m_reportFile

wxString JOB_PCB_IMPORT::m_reportFile

Definition at line 66 of file job_pcb_import.h.

Referenced by PCBNEW_JOBS_HANDLER::JobImport().

◆ m_reportFormat

IMPORT_REPORT_FORMAT JOB_PCB_IMPORT::m_reportFormat = IMPORT_REPORT_FORMAT::NONE

Definition at line 65 of file job_pcb_import.h.

Referenced by PCBNEW_JOBS_HANDLER::JobImport().

◆ m_sourceProjectDir

wxString JOB_PCB_IMPORT::m_sourceProjectDir

Directory of the source project and the footprint libraries it names, registered before the import.

Definition at line 87 of file job_pcb_import.h.

◆ m_tempOutputDirectory

wxString JOB::m_tempOutputDirectory
protectedinherited

Definition at line 273 of file job.h.

Referenced by JOB(), ResolveOutputPath(), and SetTempOutputDirectory().

◆ m_titleBlock

TITLE_BLOCK JOB::m_titleBlock
protectedinherited

Definition at line 271 of file job.h.

Referenced by ResolveOutputPath(), and SetTitleBlock().

◆ m_type

std::string JOB::m_type
protectedinherited

Definition at line 269 of file job.h.

Referenced by GetType(), and JOB().

◆ m_varOverrides

std::map<wxString, wxString> JOB::m_varOverrides
protectedinherited

Definition at line 270 of file job.h.

Referenced by GetVarOverrides(), JOB(), and SetVarOverrides().

◆ m_workingOutputPath

wxString JOB::m_workingOutputPath
protectedinherited

The working output path is a transient path that takes priority over the configured output path when determining where to write output files.

Definition at line 283 of file job.h.

Referenced by GetFullOutputPath(), GetWorkingOutputPath(), JOB(), SetConfiguredOutputPath(), and SetWorkingOutputPath().


The documentation for this class was generated from the following files: