|
KiCad PCB EDA Suite
|
A factory which returns an instance of a #PLUGIN. More...
#include <pcb_io_mgr.h>
Classes | |
| class | PLUGIN_REGISTRY |
| Hold a list of available plugins, created using a singleton REGISTER_PLUGIN object. More... | |
| struct | REGISTER_PLUGIN |
| Register a plugin. More... | |
Public Types | |
| enum | PCB_FILE_T { PCB_FILE_UNKNOWN = 0 , KICAD_SEXP , LEGACY , ALLEGRO , ALTIUM_CIRCUIT_MAKER , ALTIUM_CIRCUIT_STUDIO , ALTIUM_DESIGNER , CADSTAR_PCB_ARCHIVE , EAGLE , EASYEDA , EASYEDAPRO , EASYEDAPRO_V3 , FABMASTER , GEDA_PCB , PCAD , SOLIDWORKS_PCB , IPC2581 , ODBPP , PADS , SPRINT_LAYOUT , DIPTRACE , AUTOTRAX , FILE_TYPE_NONE , NESTED_TABLE } |
| The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written, in alphabetical order. More... | |
Static Public Member Functions | |
| static PCB_IO * | FindPlugin (PCB_FILE_T aFileType) |
| Return a #PLUGIN which the caller can use to import, export, save, or load design documents. | |
| static const wxString | ShowType (PCB_FILE_T aFileType) |
| Return a brief name for a plugin given aFileType enum. | |
| static PCB_FILE_T | EnumFromStr (const wxString &aFileType) |
| Return the PCB_FILE_T from the corresponding plugin type name: "kicad", "legacy", etc. | |
| static PCB_FILE_T | FindPluginTypeFromBoardPath (const wxString &aFileName, int aCtl=0) |
| Return a plugin type given a path for a board file. | |
| static bool | ImportGeneratesProjectLibrary (PCB_FILE_T aFileType) |
| Return true when importing aFileType should materialize a project footprint library. | |
| static PCB_FILE_T | GuessPluginTypeFromLibPath (const wxString &aLibPath, int aCtl=0) |
| Return a plugin type given a footprint library's libPath. | |
| static BOARD * | Load (PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) |
| Find the requested #PLUGIN and if found, calls the #PLUGIN::LoadBoard() function on it using the arguments passed to this function. | |
| static void | Save (PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Write either a full aBoard to a storage file in a format that this implementation knows about, or it can be used to write a portion ofaBoard to a special kind of export file. | |
| static bool | ConvertLibrary (const std::map< std::string, UTF8 > &aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilePath, REPORTER *aReporter) |
| Convert a schematic symbol library to the latest KiCad format. | |
A factory which returns an instance of a #PLUGIN.
Definition at line 43 of file pcb_io_mgr.h.
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written, in alphabetical order.
| Enumerator | |
|---|---|
| PCB_FILE_UNKNOWN | 0 is not a legal menu id on Mac |
| KICAD_SEXP | S-expression Pcbnew file format. |
| LEGACY | Legacy Pcbnew file formats prior to s-expression. |
| ALLEGRO | |
| ALTIUM_CIRCUIT_MAKER | |
| ALTIUM_CIRCUIT_STUDIO | |
| ALTIUM_DESIGNER | |
| CADSTAR_PCB_ARCHIVE | |
| EAGLE | |
| EASYEDA | |
| EASYEDAPRO | |
| EASYEDAPRO_V3 | |
| FABMASTER | |
| GEDA_PCB | Geda PCB file formats. |
| PCAD | |
| SOLIDWORKS_PCB | |
| IPC2581 | |
| ODBPP | |
| PADS | |
| SPRINT_LAYOUT | |
| DIPTRACE | |
| AUTOTRAX | |
| FILE_TYPE_NONE | |
| NESTED_TABLE | |
Definition at line 51 of file pcb_io_mgr.h.
|
static |
Convert a schematic symbol library to the latest KiCad format.
Definition at line 223 of file pcb_io_mgr.cpp.
References FILE_TYPE_NONE, FindPlugin(), GuessPluginTypeFromLibPath(), KICAD_SEXP, NESTED_TABLE, REPORTER::Report(), RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, and IO_ERROR::What().
Referenced by BOOST_AUTO_TEST_CASE(), PCBNEW_JOBS_HANDLER::JobExportFpUpgrade(), and PANEL_FP_LIB_TABLE::onMigrateLibraries().
|
static |
Return the PCB_FILE_T from the corresponding plugin type name: "kicad", "legacy", etc.
Definition at line 98 of file pcb_io_mgr.cpp.
References PCB_IO_MGR::PLUGIN_REGISTRY::AllPlugins(), PCB_IO_MGR::PLUGIN_REGISTRY::Instance(), NESTED_TABLE, PCB_FILE_UNKNOWN, and LIBRARY_TABLE_ROW::TABLE_TYPE_NAME.
Referenced by FOOTPRINT_LIBRARY_ADAPTER::createPlugin(), FP_LIB_TABLE_GRID_DATA_MODEL::getFileTypes(), and FP_GRID_TRICKS::optionsEditor().
|
static |
Return a #PLUGIN which the caller can use to import, export, save, or load design documents.
| aFileType | is from PCB_FILE_T and tells which plugin to find. |
Definition at line 72 of file pcb_io_mgr.cpp.
References PCB_IO_MGR::PLUGIN_REGISTRY::Create(), and PCB_IO_MGR::PLUGIN_REGISTRY::Instance().
Referenced by PCB_CONTROL::AppendBoardFromFile(), PCB_CONTROL::AppendDesignBlock(), PCB_CONTROL::ApplyDesignBlockLayout(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ConvertLibrary(), PCB_BASE_EDIT_FRAME::createNewLibrary(), FOOTPRINT_LIBRARY_ADAPTER::createPlugin(), PCB_CONTROL::DdAppendBoard(), PCB_DESIGN_BLOCK_PREVIEW_WIDGET::DisplayDesignBlock(), for(), DIALOG_EXPORT_2581::GenerateFile(), DIALOG_EXPORT_ODBPP::GenerateODBPPFiles(), FOOTPRINT_EDIT_FRAME::ImportFootprint(), PCBNEW_JOBS_HANDLER::JobImport(), PCBNEW_JOBS_HANDLER::JobUpgrade(), BOARD_LOADER::Load(), Load(), DIALOG_BOARD_SETUP::onAuxiliaryAction(), FP_GRID_TRICKS::optionsEditor(), PCB_CONTROL::PlaceLinkedDesignBlock(), Save(), PCB_EDIT_FRAME::saveBoardAsFile(), DRC_BASE_FIXTURE::SaveBoardToFile(), FOOTPRINT_EDIT_FRAME::SaveLibraryAs(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), DIALOG_EXPORT_STEP::StageBoardForExport(), and FOOTPRINT_IMPORT_RECONCILER::writeAndRegisterCache().
|
static |
Return a plugin type given a path for a board file.
FILE_TYPE_NONE if the file is not known.
Definition at line 139 of file pcb_io_mgr.cpp.
References PCB_IO_MGR::PLUGIN_REGISTRY::AllPlugins(), FILE_TYPE_NONE, PCB_IO_MGR::PLUGIN_REGISTRY::Instance(), KICAD_SEXP, KICTL_KICAD_ONLY, KICTL_NONKICAD_ONLY, and LEGACY.
Referenced by PCB_CONTROL::AppendBoardFromFile(), BOOST_CHECK_EQUAL(), BOARD_INSPECTION_TOOL::CompareBoardWithHistory(), PCB_CONTROL::DdAppendBoard(), FindPluginTypeFromParams(), PCBNEW_JOBS_HANDLER::getBoard(), PCB::IFACE::handleOpenPcb(), PCBNEW_JOBS_HANDLER::JobImport(), loadScratchBoard(), PCB_EDIT_FRAME::OpenProjectFiles(), and BOARD_INSPECTION_TOOL::showBoardComparison().
|
static |
Return a plugin type given a footprint library's libPath.
Definition at line 163 of file pcb_io_mgr.cpp.
References PCB_IO_MGR::PLUGIN_REGISTRY::AllPlugins(), FILE_TYPE_NONE, PCB_IO_MGR::PLUGIN_REGISTRY::Instance(), KICAD_SEXP, KICTL_KICAD_ONLY, KICTL_NONKICAD_ONLY, LEGACY, NESTED_TABLE, and LIBRARY_TABLE_PARSER::Parse().
Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), ConvertLibrary(), FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), FOOTPRINT_EDIT_FRAME::DuplicateFootprint(), PCBNEW_JOBS_HANDLER::JobExportFpUpgrade(), PCB_EDIT_FRAME::KiwayMailIn(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveLibraryAs(), and FP_LIB_TABLE_GRID_DATA_MODEL::SetValue().
|
static |
Return true when importing aFileType should materialize a project footprint library.
Single source for the board editor's import gate and the kicad-cli pcb import job so the two cannot drift.
Definition at line 115 of file pcb_io_mgr.cpp.
References ALTIUM_CIRCUIT_MAKER, ALTIUM_CIRCUIT_STUDIO, ALTIUM_DESIGNER, CADSTAR_PCB_ARCHIVE, EAGLE, EASYEDAPRO_V3, and GEDA_PCB.
Referenced by PCB_EDIT_FRAME::importFile(), and PCBNEW_JOBS_HANDLER::JobImport().
|
static |
Find the requested #PLUGIN and if found, calls the #PLUGIN::LoadBoard() function on it using the arguments passed to this function.
After the #PLUGIN::LoadBoard() function returns, the #PLUGIN is Released() as part of this call.
| aFileType | is the PCB_FILE_T of file to load. |
| aFileName | is the name of the file to load. |
| aAppendToMe | is an existing BOARD to append to, use NULL if fresh board load is wanted. |
| aProperties | is an associative array that allows the caller to pass additional tuning parameters to the PLUGIN. |
| aProject | is the optional PROJECT object primarily used by third party importers. |
| IO_ERROR | if the #PLUGIN cannot be found, file cannot be found, or file cannot be loaded. |
Definition at line 192 of file pcb_io_mgr.cpp.
References FindPlugin(), FMT_NOTFOUND, ShowType(), and THROW_IO_ERROR.
Referenced by fill_bench_main_func(), BOARD_LOADER::Load(), and FILE_PARSER::Parse().
|
static |
Write either a full aBoard to a storage file in a format that this implementation knows about, or it can be used to write a portion ofaBoard to a special kind of export file.
| aFileType | is the PCB_FILE_T of file to save. |
| aFileName | is the name of a file to save to on disk. |
| aBoard | is the BOARD document (data tree) to save or export to disk. |
| aBoard | is the in memory document tree from which to extract information when writing to aFileName. The caller continues to own the BOARD, and the plugin should refrain from modifying the BOARD if possible. |
| aProperties | is an associative array that can be used to tell the saver how to save the file, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL. |
| IO_ERROR | if there is a problem saving or exporting. |
Definition at line 208 of file pcb_io_mgr.cpp.
References FindPlugin(), FMT_NOTFOUND, ShowType(), and THROW_IO_ERROR.
Referenced by BOARD_LOADER::SaveBoard().
|
static |
Return a brief name for a plugin given aFileType enum.
Definition at line 81 of file pcb_io_mgr.cpp.
References _, PCB_IO_MGR::PLUGIN_REGISTRY::AllPlugins(), PCB_IO_MGR::PLUGIN_REGISTRY::Instance(), NESTED_TABLE, and LIBRARY_TABLE_ROW::TABLE_TYPE_NAME.
Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), PCBNEW_JOBS_HANDLER::JobImport(), PCB_EDIT_FRAME::KiwayMailIn(), Load(), PANEL_FP_LIB_TABLE::onMigrateLibraries(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), pcb_parser_main_func(), Save(), and FP_LIB_TABLE_GRID_DATA_MODEL::SetValue().