|
KiCad PCB EDA Suite
|
#include <io_base.h>
Classes | |
| struct | IO_FILE_DESC |
| Container that describes file type info. More... | |
Public Member Functions | |
| virtual | ~IO_BASE ()=default |
| const wxString & | GetName () const |
| Return a brief hard coded name for this IO interface. | |
| virtual bool | IsPCB_IO () const |
| Work-around for lack of dynamic_cast across compile units on Mac. | |
| virtual void | SetReporter (REPORTER *aReporter) |
| Set an optional reporter for warnings/errors. | |
| virtual void | SetProgressReporter (PROGRESS_REPORTER *aReporter) |
| Set an optional progress reporter. | |
| virtual const IO_FILE_DESC | GetLibraryDesc () const =0 |
| Get the descriptor for the library container that this IO plugin operates on. | |
| virtual const IO_FILE_DESC | GetLibraryFileDesc () const |
| Get the descriptor for the individual library elements that this IO plugin operates on. | |
| virtual bool | CanReadLibrary (const wxString &aFileName) const |
| Checks if this IO object can read the specified library file/directory. | |
| virtual void | CreateLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Create a new empty library at aLibraryPath empty. | |
| virtual bool | DeleteLibrary (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) |
| Delete an existing library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason. | |
| virtual void | CancelLoad () |
| Ask a library load running on this plugin to end early. | |
| virtual void | ResumeLoad () noexcept |
| Called after the loads that were cancelled have ended, to clear what CancelLoad() left behind. | |
| virtual void | LeakCacheAtExit () |
| Have the destructor leave the library cache unfreed. | |
| virtual void | StopBackgroundRefresh () |
| Stop and join any thread that reads other libraries through the library adapter. | |
| virtual bool | IsLibraryWritable (const wxString &aLibraryPath) |
| Return true if the library at aLibraryPath is writable. | |
| virtual void | GetLibraryOptions (std::map< std::string, UTF8 > *aListToAppendTo) const |
| Append supported IO options to aListToAppenTo along with internationalized descriptions. | |
| virtual bool | SupportsConfigurationDialog () const |
| virtual DIALOG_SHIM * | CreateConfigurationDialog (wxWindow *aParent, const wxString &aLibraryPath) |
| virtual void | Report (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) const |
| virtual void | AdvanceProgressPhase () |
| IO_BASE ()=delete | |
Protected Member Functions | |
| IO_BASE (const wxString &aName) | |
Protected Attributes | |
| wxString | m_name |
| Name of the IO loader. | |
| REPORTER * | m_reporter |
| Reporter to log errors/warnings to, may be nullptr. | |
| PROGRESS_REPORTER * | m_progressReporter |
| Progress reporter to track the progress of the operation, may be nullptr. | |
|
virtualdefault |
|
delete |
Referenced by DESIGN_BLOCK_IO::DESIGN_BLOCK_IO(), PCB_IO::PCB_IO(), and SCH_IO::SCH_IO().
|
inlineprotected |
| aName | is the user-visible name for the IO loader |
Definition at line 253 of file io_base.h.
References m_name, m_progressReporter, and m_reporter.
|
virtual |
Definition at line 133 of file io_base.cpp.
References m_progressReporter, and THROW_IO_CANCELLED.
|
inlinevirtual |
Ask a library load running on this plugin to end early.
Called from another thread while an asynchronous load is in flight, so it must return at once. Plugins with no wait worth cutting short ignore it.
Reimplemented in SCH_IO_DATABASE.
Definition at line 168 of file io_base.h.
Referenced by LIBRARY_MANAGER_ADAPTER::cancelLoadingPlugins().
|
virtual |
Checks if this IO object can read the specified library file/directory.
If not overridden, extension check is used.
Reimplemented in PCB_IO_ALLEGRO, PCB_IO_ALTIUM_DESIGNER, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO_V3, PCB_IO_EASYPC, PCB_IO_IPC2581, PCB_IO_ODBPP, PCB_IO_PADS_BINARY, SCH_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO_V3, SCH_IO_EASYPC, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, SCH_IO_ORCAD, SCH_IO_PADS, and SCH_IO_PCAD.
Definition at line 71 of file io_base.cpp.
References GetLibraryDesc(), IO_BASE::IO_FILE_DESC::m_ExtensionsInDir, IO_BASE::IO_FILE_DESC::m_FileExtensions, and IO_BASE::IO_FILE_DESC::m_IsFile.
Referenced by PCB_IO_ALLEGRO::CanReadLibrary(), PCB_IO_ALTIUM_DESIGNER::CanReadLibrary(), PCB_IO_CADSTAR_ARCHIVE::CanReadLibrary(), PCB_IO_EAGLE::CanReadLibrary(), PCB_IO_EASYEDAPRO_V3::CanReadLibrary(), PCB_IO_EASYPC::CanReadLibrary(), PCB_IO_PADS_BINARY::CanReadLibrary(), SCH_IO_ALTIUM::CanReadLibrary(), SCH_IO_CADSTAR_ARCHIVE::CanReadLibrary(), SCH_IO_EAGLE::CanReadLibrary(), SCH_IO_EASYEDAPRO_V3::CanReadLibrary(), SCH_IO_EASYPC::CanReadLibrary(), SCH_IO_KICAD_LEGACY::CanReadLibrary(), SCH_IO_KICAD_SEXPR::CanReadLibrary(), SCH_IO_ORCAD::CanReadLibrary(), and SCH_IO_PADS::CanReadLibrary().
|
inlinevirtual |
| aLibraryPath | is the fully expanded path of the library to configure |
Reimplemented in SCH_IO_DATABASE.
|
virtual |
Create a new empty library at aLibraryPath empty.
It is an error to attempt to create an existing library or to attempt to create on a "read only" location.
| aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several elements. |
| aProperties | is an associative array that can be used to tell the library create function anything special, because it can take any number of additional named tuning arguments that the IO is known to support. The caller continues to own this object (IO may not delete it), and IOs should expect it to be optionally NULL. |
| IO_ERROR | if there is a problem finding the library, or creating it. |
Reimplemented in DESIGN_BLOCK_IO, PCB_IO_KICAD_SEXPR, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 46 of file io_base.cpp.
References NOT_IMPLEMENTED.
Referenced by LIBRARY_MANAGER_ADAPTER::CreateLibrary().
|
virtual |
Delete an existing library and returns true, or if library does not exist returns false, or throws an exception if library exists but is read only or cannot be deleted for some other reason.
| aLibraryPath | is a locator for the "library", usually a directory or file which will contain several elements. |
| aProperties | is an associative array that can be used to tell the library delete implementation function anything special, 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 deleting an existing library. |
Reimplemented in DESIGN_BLOCK_IO, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, PCB_IO_KICAD_SEXPR, SCH_IO_KICAD_LEGACY, and SCH_IO_KICAD_SEXPR.
Definition at line 53 of file io_base.cpp.
References NOT_IMPLEMENTED.
Referenced by LIBRARY_MANAGER_ADAPTER::DeleteLibrary().
|
pure virtual |
Get the descriptor for the library container that this IO plugin operates on.
Implemented in DESIGN_BLOCK_IO, PCB_IO_ALLEGRO, PCB_IO_ALTIUM_CIRCUIT_MAKER, PCB_IO_ALTIUM_CIRCUIT_STUDIO, PCB_IO_ALTIUM_DESIGNER, PCB_IO_AUTOTRAX, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_DIPTRACE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_EASYEDAPRO_V3, PCB_IO_EASYPC, PCB_IO_FABMASTER, PCB_IO_GEDA, PCB_IO_IPC2581, PCB_IO_KICAD_LEGACY, PCB_IO_KICAD_SEXPR, PCB_IO_ODBPP, PCB_IO_PADS, PCB_IO_PADS_BINARY, PCB_IO_PCAD, PCB_IO_SOLIDWORKS, PCB_IO_SPRINT_LAYOUT, PCB_IO_TARGET3001, SCH_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_DATABASE, SCH_IO_DIPTRACE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO, SCH_IO_EASYEDAPRO_V3, SCH_IO_EASYPC, SCH_IO_GEDA, SCH_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, SCH_IO_LTSPICE, SCH_IO_ORCAD, SCH_IO_PADS, SCH_IO_PCAD, and SCH_IO_TARGET3001.
Referenced by CanReadLibrary(), and GetLibraryFileDesc().
|
inlinevirtual |
Get the descriptor for the individual library elements that this IO plugin operates on.
For libraries where all the elements are in a single container (e.g. all elements in a single file), then this will return the descriptor from IO_BASE::GetLibraryDesc().
Reimplemented in PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_GEDA, PCB_IO_KICAD_SEXPR, and PCB_IO_SPRINT_LAYOUT.
Definition at line 117 of file io_base.h.
References GetLibraryDesc().
Referenced by PCB_IO::CanReadFootprint().
|
virtual |
Append supported IO options to aListToAppenTo along with internationalized descriptions.
Options are typically appended so that a derived IO_BASE can call its base class function by the same name first, thus inheriting options declared there. (Some base class options could pertain to all functions in all derived IOs.) Note that since aListToAppendTo is a PROPERTIES object, all options will be unique and last guy wins.
| aListToAppendTo | holds a tuple of
In the future perhaps aListToAppendTo evolves to something capable of also holding a wxValidator for the cells in said dialog: http://forums.wxwidgets.org/viewtopic.php?t=23277&p=104180. This would require a 3 column list, and introducing wx GUI knowledge to SCH_IO, which has been avoided to date. |
Reimplemented in PCB_IO, SCH_IO, and SCH_IO_CADSTAR_ARCHIVE.
Definition at line 65 of file io_base.cpp.
Referenced by PCB_IO::GetLibraryOptions(), and SCH_IO::GetLibraryOptions().
|
inline |
Return a brief hard coded name for this IO interface.
Definition at line 79 of file io_base.h.
References m_name.
Referenced by SCH_IO_EASYPC::convertComponent(), SCH_IO_EASYEDAPRO_V3::EnumerateSymbolLib(), PCB_IO_EASYPC::GetEnumeratedFootprint(), SCH_IO_EASYPC::LoadSchematicFile(), SCH_IO_EASYEDAPRO_V3::LoadSymbol(), SCH_IO_EASYPC::LoadSymbol(), SCH_IO_ALTIUM::ParseAltiumSch(), and SCH_IO_ALTIUM::ParseLibFile().
|
virtual |
Return true if the library at aLibraryPath is writable.
The system libraries are typically read only because of where they are installed..
| aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
| IO_ERROR | if no library at aLibraryPath exists. |
Reimplemented in DESIGN_BLOCK_IO, PCB_IO_ALLEGRO, PCB_IO_ALTIUM_DESIGNER, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_EASYEDAPRO_V3, PCB_IO_EASYPC, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, PCB_IO_KICAD_SEXPR, PCB_IO_SPRINT_LAYOUT, SCH_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_DATABASE, SCH_IO_DIPTRACE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO, SCH_IO_EASYEDAPRO_V3, SCH_IO_EASYPC, SCH_IO_GEDA, SCH_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, SCH_IO_ORCAD, SCH_IO_PADS, SCH_IO_PCAD, and SCH_IO_TARGET3001.
Definition at line 60 of file io_base.cpp.
References NOT_IMPLEMENTED.
Referenced by DESIGN_BLOCK_LIBRARY_ADAPTER::IsDesignBlockLibWritable(), and LIBRARY_MANAGER_ADAPTER::IsWritable().
|
inlinevirtual |
Work-around for lack of dynamic_cast across compile units on Mac.
Reimplemented in PCB_IO.
Definition at line 84 of file io_base.h.
Referenced by FOOTPRINT_LIBRARY_ADAPTER::pcbplugin().
|
inlinevirtual |
Have the destructor leave the library cache unfreed.
Only for use as the process exits, since freeing the caches of thousands of libraries one item at a time holds it up for seconds. The cache stays usable until the plugin is destroyed, so threads still reading it are safe. Plugins without a large cache ignore it.
Reimplemented in PCB_IO_KICAD_SEXPR, and SCH_IO_KICAD_SEXPR.
|
virtual |
Definition at line 124 of file io_base.cpp.
References m_reporter.
Referenced by PCB_IO_IPC2581::addShape(), PCB_IO_ODBPP::ConfigureExport(), SCH_IO_EASYEDAPRO_V3::EnumerateSymbolLib(), PCB_IO_ODBPP::ExportODB(), PCB_IO_IPC2581::generateBOMSection(), PCB_IO_IPC2581::generateComponents(), PCB_IO_IPC2581::generateLayerSetDrill(), PCB_IO_IPC2581::generateLayerSetNet(), PCB_IO_IPC2581::generateProfile(), PCB_IO::ImportFootprint(), PCB_IO_DIPTRACE::loadBoard(), PCB_IO_EASYEDAPRO_V3::loadBoard(), SCH_IO_EAGLE::loadInstance(), SCH_IO_EAGLE::loadLibrary(), PCB_IO_KICAD_LEGACY::loadPAD(), PCB_IO_EAGLE::loadPolygon(), SCH_IO_EASYEDAPRO_V3::LoadSchematicFile(), SCH_IO_EAGLE::loadSegments(), PCB_IO_KICAD_LEGACY::loadZONE_CONTAINER(), PCB_IO_EAGLE::packageCircle(), PCB_IO_EAGLE::packagePad(), PCB_IO_EAGLE::packagePolygon(), PCB_IO_EAGLE::packageRectangle(), PCB_IO_EAGLE::packageText(), PCB_IO_EAGLE::packageWire(), PCB_IO_GEDA::parseElement(), and SCH_IO_DATABASE::reportIssue().
|
inlinevirtualnoexcept |
Called after the loads that were cancelled have ended, to clear what CancelLoad() left behind.
Reimplemented in SCH_IO_DATABASE.
Definition at line 171 of file io_base.h.
Referenced by LIBRARY_MANAGER_ADAPTER::resumeLoadingPlugins().
|
inlinevirtual |
Set an optional progress reporter.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 94 of file io_base.h.
References m_progressReporter.
Referenced by PCB_CONTROL::AppendBoard(), GenerateIpc2581File(), and generateOneODBPackage().
|
inlinevirtual |
Set an optional reporter for warnings/errors.
Reimplemented in SCH_IO_CADSTAR_ARCHIVE.
Definition at line 89 of file io_base.h.
References m_reporter.
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(), ExportOdb(), GenerateIpc2581File(), generateOneODBPackage(), KI_TEST::LoadBoardWithCapture(), SCH_IO_GEDA::loadDeferredSheets(), and SCH_IO_GEDA::LoadSchematicFile().
|
inlinevirtual |
Stop and join any thread that reads other libraries through the library adapter.
Called before the plugin is retired, while every library such a thread could reach is still alive. The plugin is not used again.
Reimplemented in SCH_IO_DATABASE, and SCH_IO_HTTP_LIB.
|
inlinevirtual |
Reimplemented in SCH_IO_DATABASE.
|
protected |
Name of the IO loader.
Definition at line 261 of file io_base.h.
Referenced by PCB_IO_IPC2581::generateBOMSection(), GetName(), IO_BASE(), and PCB_IO_IPC2581::pinName().
|
protected |
Progress reporter to track the progress of the operation, may be nullptr.
Definition at line 267 of file io_base.h.
Referenced by AdvanceProgressPhase(), SCH_IO_KICAD_LEGACY::checkpoint(), SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), SCH_IO_EAGLE::ensureLoadedLibrary(), PCB_IO_ODBPP::ExportODB(), PCB_IO_IPC2581::generateComponents(), PCB_IO_IPC2581::generateLayerFeatures(), PCB_IO_IPC2581::generatePhyNetGroup(), IO_BASE(), PCB_IO_ALTIUM_CIRCUIT_MAKER::loadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::loadBoard(), PCB_IO_ALTIUM_DESIGNER::loadBoard(), PCB_IO_CADSTAR_ARCHIVE::loadBoard(), PCB_IO_DIPTRACE::loadBoard(), PCB_IO_EASYEDA::loadBoard(), PCB_IO_EASYEDAPRO::loadBoard(), PCB_IO_EASYEDAPRO_V3::loadBoard(), PCB_IO_EASYPC::loadBoard(), PCB_IO_FABMASTER::loadBoard(), PCB_IO_KICAD_SEXPR::loadBoard(), PCB_IO_PADS::loadBoard(), PCB_IO_PADS_BINARY::loadBoard(), PCB_IO_SOLIDWORKS::loadBoard(), PCB_IO_TARGET3001::loadBoard(), PCB_IO_ALLEGRO::LoadBoardFromData(), SCH_IO_KICAD_LEGACY::loadFile(), SCH_IO_KICAD_SEXPR::loadFile(), SCH_IO_ORCAD::loadOlbSymbols(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_EAGLE::LoadSchematicFile(), SCH_IO_EASYPC::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_ORCAD::LoadSchematicFile(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_TARGET3001::LoadSchematicFile(), SCH_IO_ALTIUM::ParseAltiumSch(), PCB_IO_IPC2581::reportPhase(), PCB_IO_IPC2581::SaveBoard(), SetProgressReporter(), SCH_IO_CADSTAR_ARCHIVE::SetProgressReporter(), and PCB_IO_IPC2581::tickProgress().
|
protected |
Reporter to log errors/warnings to, may be nullptr.
Definition at line 264 of file io_base.h.
Referenced by SCH_IO_EASYPC::convertComponent(), PCB_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), SCH_IO_EASYEDA::EnumerateSymbolLib(), SCH_IO_GEDA::flushPendingComponent(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), SCH_IO_GEDA::getOrLoadSymbol(), SCH_IO_GEDA::importHierarchicalSheet(), IO_BASE(), PCB_IO_EASYPC::library(), SCH_IO_EASYPC::library(), SCH_IO_PADS::loadBinarySchematicFile(), PCB_IO_ALTIUM_CIRCUIT_MAKER::loadBoard(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::loadBoard(), PCB_IO_ALTIUM_DESIGNER::loadBoard(), PCB_IO_CADSTAR_ARCHIVE::loadBoard(), PCB_IO_EASYPC::loadBoard(), PCB_IO_FABMASTER::loadBoard(), PCB_IO_PADS::loadBoard(), PCB_IO_PADS_BINARY::loadBoard(), PCB_IO_PCAD::loadBoard(), PCB_IO_SOLIDWORKS::loadBoard(), PCB_IO_TARGET3001::loadBoard(), PCB_IO_ALLEGRO::LoadBoardFromData(), PCB_IO_PADS::loadCopperShapes(), PCB_IO_PADS_BINARY::loadCopperShapes(), SCH_IO_GEDA::loadDeferredSheets(), PCB_IO_PADS::loadFootprints(), PCB_IO_PADS_BINARY::loadFootprints(), SCH_IO_ORCAD::loadOlbSymbols(), SCH_IO_ALTIUM::LoadSchematicFile(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_DIPTRACE::LoadSchematicFile(), SCH_IO_EASYEDA::LoadSchematicFile(), SCH_IO_EASYPC::LoadSchematicFile(), SCH_IO_GEDA::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_ORCAD::LoadSchematicFile(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_TARGET3001::LoadSchematicFile(), SCH_IO_EASYEDA::LoadSymbol(), PCB_IO_PADS::loadTracksAndVias(), PCB_IO_PADS_BINARY::loadTracksAndVias(), PCB_IO_PADS::loadZones(), PCB_IO_PADS_BINARY::loadZones(), SCH_IO_ALTIUM::NameNetsAfterNetLabels(), SCH_IO_ALTIUM::ParseLibFile(), SCH_IO_ALTIUM::ParsePowerPort(), SCH_IO_PCAD::populateScreen(), Report(), PCB_IO_AUTOTRAX::reporter(), SCH_IO_ALTIUM::SCH_IO_ALTIUM(), SCH_IO_CADSTAR_ARCHIVE::SCH_IO_CADSTAR_ARCHIVE(), SCH_IO_DIPTRACE::SCH_IO_DIPTRACE(), SCH_IO_EASYEDA::SCH_IO_EASYEDA(), SCH_IO_EASYPC::SCH_IO_EASYPC(), SCH_IO_LTSPICE::SCH_IO_LTSPICE(), SCH_IO_ORCAD::SCH_IO_ORCAD(), SCH_IO_TARGET3001::SCH_IO_TARGET3001(), SetReporter(), and SCH_IO_CADSTAR_ARCHIVE::SetReporter().