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

#include <pcb_io_odbpp.h>

Inheritance diagram for PCB_IO_ODBPP:
PCB_IO IO_BASE

Public Member Functions

 PCB_IO_ODBPP ()
 
 ~PCB_IO_ODBPP () override
 
void SaveBoard (const wxString &aFileName, BOARD *aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
 Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be used to write a portion of aBoard to a special kind of export file.
 
const IO_BASE::IO_FILE_DESC GetBoardFileDesc () const override
 Returns board file description for the PCB_IO.
 
const IO_BASE::IO_FILE_DESC GetLibraryDesc () const override
 Get the descriptor for the library container that this IO plugin operates on.
 
std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints () override
 Return a container with the cached library footprints generated in the last call to Load.
 
long long GetLibraryTimestamp (const wxString &aLibraryPath) const override
 Generate a timestamp representing all the files in the library (including the library directory).
 
bool CanReadBoard (const wxString &aFileName) const override
 Checks if this PCB_IO can read the specified board file.
 
bool CanReadFootprint (const wxString &aFileName) const override
 Checks if this PCB_IO can read a footprint from specified file or directory.
 
bool CanReadLibrary (const wxString &aFileName) const override
 Checks if this IO object can read the specified library file/directory.
 
std::vector< std::pair< PCB_LAYER_ID, wxString > > & GetLayerNameList ()
 
std::map< PCB_LAYER_ID, std::map< int, std::vector< BOARD_ITEM * > > > & GetLayerElementsMap ()
 
std::vector< std::shared_ptr< FOOTPRINT > > & GetLoadedFootprintList ()
 
std::map< std::pair< PCB_LAYER_ID, PCB_LAYER_ID >, std::vector< BOARD_ITEM * > > & GetDrillLayerItemsMap ()
 
std::map< std::pair< PCB_LAYER_ID, PCB_LAYER_ID >, std::vector< BOARD_ITEM * > > & GetSlotHolesMap ()
 
std::map< const PAD *, EDA_DATA::SUB_NET_TOEPRINT * > & GetPadSubnetMap ()
 
std::map< std::pair< PCB_LAYER_ID, ZONE * >, EDA_DATA::SUB_NET_PLANE * > & GetPlaneSubnetMap ()
 
std::map< PCB_TRACK *, EDA_DATA::SUB_NET * > & GetViaTraceSubnetMap ()
 
bool GenerateFiles (ODB_TREE_WRITER &writer)
 
bool ExportODB (const wxString &aFileName)
 
void CreateEntity ()
 
bool CreateDirectories (ODB_TREE_WRITER &writer)
 
void ClearLoadedFootprints ()
 
virtual void SetQueryUserCallback (std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aAction)> aCallback)
 Registers a KIDIALOG callback for collecting info from the user.
 
virtual BOARDLoadBoard (const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr)
 Load information from some input file format that this PCB_IO implementation knows about into either a new BOARD or an existing one.
 
virtual void FootprintEnumerate (wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr)
 Return a list of footprint names contained within the library at aLibraryPath.
 
virtual void PrefetchLib (const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr)
 If possible, prefetches the specified library (e.g.
 
virtual FOOTPRINTImportFootprint (const wxString &aFootprintPath, wxString &aFootprintNameOut, const std::map< std::string, UTF8 > *aProperties=nullptr)
 Load a single footprint from aFootprintPath and put its name in aFootprintNameOut.
 
virtual FOOTPRINTFootprintLoad (const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr)
 Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PCB_IO knows about.
 
virtual const FOOTPRINTGetEnumeratedFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr)
 A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
 
virtual bool FootprintExists (const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr)
 Check for the existence of a footprint.
 
virtual void FootprintSave (const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const std::map< std::string, UTF8 > *aProperties=nullptr)
 Write aFootprint to an existing library located at aLibraryPath.
 
virtual void FootprintDelete (const wxString &aLibraryPath, const wxString &aFootprintName, const std::map< std::string, UTF8 > *aProperties=nullptr)
 Delete aFootprintName from the library at aLibraryPath.
 
virtual void GetLibraryOptions (std::map< std::string, UTF8 > *aListToAppendTo) const override
 Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions.
 
const wxString & GetName () const
 Return a brief hard coded name for this IO interface.
 
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 GetLibraryFileDesc () const
 Get the descriptor for the individual library elements that this IO plugin operates on.
 
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 bool IsLibraryWritable (const wxString &aLibraryPath)
 Return true if the library at aLibraryPath is writable.
 
virtual void Report (const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
 
virtual void AdvanceProgressPhase ()
 

Public Attributes

std::shared_ptr< ODB_TREE_WRITERm_writer
 

Static Public Attributes

static double m_scale = 1.0 / PCB_IU_PER_MM
 
static double m_symbolScale = 1.0 / PL_IU_PER_MM
 
static int m_sigfig = 4
 
static std::string m_unitsStr = "MM"
 

Protected Attributes

const std::map< std::string, UTF8 > * m_props
 Properties passed via Save() or Load(), no ownership, may be NULL.
 
wxString m_name
 Name of the IO loader.
 
REPORTERm_reporter
 Reporter to log errors/warnings to, may be nullptr.
 
PROGRESS_REPORTERm_progressReporter
 Progress reporter to track the progress of the operation, may be nullptr.
 

Private Member Functions

template<typename T , typename... Args>
void Make (Args &&... args)
 

Private Attributes

BOARDm_board
 
std::vector< std::shared_ptr< FOOTPRINT > > m_loaded_footprints
 
std::vector< std::pair< PCB_LAYER_ID, wxString > > m_layer_name_list
 
std::map< std::pair< PCB_LAYER_ID, PCB_LAYER_ID >, std::vector< BOARD_ITEM * > > m_drill_layers
 
std::map< std::pair< PCB_LAYER_ID, PCB_LAYER_ID >, std::vector< BOARD_ITEM * > > m_slot_holes
 
std::map< PCB_LAYER_ID, std::map< int, std::vector< BOARD_ITEM * > > > m_layer_elements
 
std::map< const PAD *, EDA_DATA::SUB_NET_TOEPRINT * > m_topeprint_subnets
 
std::map< std::pair< PCB_LAYER_ID, ZONE * >, EDA_DATA::SUB_NET_PLANE * > m_plane_subnets
 
std::map< PCB_TRACK *, EDA_DATA::SUB_NET * > m_via_trace_subnets
 
std::vector< std::shared_ptr< ODB_ENTITY_BASE > > m_entities
 

Detailed Description

Definition at line 52 of file pcb_io_odbpp.h.

Constructor & Destructor Documentation

◆ PCB_IO_ODBPP()

PCB_IO_ODBPP::PCB_IO_ODBPP ( )
inline

Definition at line 55 of file pcb_io_odbpp.h.

References m_board.

◆ ~PCB_IO_ODBPP()

PCB_IO_ODBPP::~PCB_IO_ODBPP ( )
override

Definition at line 37 of file pcb_io_odbpp.cpp.

References ClearLoadedFootprints().

Member Function Documentation

◆ AdvanceProgressPhase()

void IO_BASE::AdvanceProgressPhase ( )
virtualinherited

◆ CanReadBoard()

bool PCB_IO_ODBPP::CanReadBoard ( const wxString &  aFileName) const
inlineoverridevirtual

Checks if this PCB_IO can read the specified board file.

If not overriden, extension check is used.

Reimplemented from PCB_IO.

Definition at line 78 of file pcb_io_odbpp.h.

◆ CanReadFootprint()

bool PCB_IO_ODBPP::CanReadFootprint ( const wxString &  aFileName) const
inlineoverridevirtual

Checks if this PCB_IO can read a footprint from specified file or directory.

If not overriden, extension check is used.

Reimplemented from PCB_IO.

Definition at line 81 of file pcb_io_odbpp.h.

◆ CanReadLibrary()

bool PCB_IO_ODBPP::CanReadLibrary ( const wxString &  aFileName) const
inlineoverridevirtual

Checks if this IO object can read the specified library file/directory.

If not overriden, extension check is used.

Note
This is not a check that the file system object is readable by the user, but a check that this IO object can parse the given library.

Reimplemented from IO_BASE.

Definition at line 84 of file pcb_io_odbpp.h.

◆ ClearLoadedFootprints()

void PCB_IO_ODBPP::ClearLoadedFootprints ( )

Definition at line 43 of file pcb_io_odbpp.cpp.

References m_loaded_footprints.

Referenced by ~PCB_IO_ODBPP().

◆ CreateDirectories()

bool PCB_IO_ODBPP::CreateDirectories ( ODB_TREE_WRITER writer)

◆ CreateEntity()

void PCB_IO_ODBPP::CreateEntity ( )

Definition at line 49 of file pcb_io_odbpp.cpp.

References m_board.

Referenced by ExportODB().

◆ CreateLibrary()

void IO_BASE::CreateLibrary ( const wxString &  aLibraryPath,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

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.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several elements.
aPropertiesis 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.
Exceptions
IO_ERRORif there is a problem finding the library, or creating it.

Reimplemented in DESIGN_BLOCK_IO, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, and PCB_IO_KICAD_SEXPR.

Definition at line 46 of file io_base.cpp.

References NOT_IMPLEMENTED.

◆ DeleteLibrary()

bool IO_BASE::DeleteLibrary ( const wxString &  aLibraryPath,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

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.

Parameters
aLibraryPathis a locator for the "library", usually a directory or file which will contain several elements.
aPropertiesis 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.
Returns
true if library deleted, false if library did not exist.
Exceptions
IO_ERRORif there is a problem deleting an existing library.

Reimplemented in DESIGN_BLOCK_IO, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, and PCB_IO_KICAD_SEXPR.

Definition at line 52 of file io_base.cpp.

References NOT_IMPLEMENTED.

◆ ExportODB()

◆ FootprintDelete()

void PCB_IO::FootprintDelete ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

Delete aFootprintName from the library at aLibraryPath.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several footprints.
aFootprintNameis the name of a footprint to delete from the specified library.
aPropertiesis an associative array that can be used to tell the library delete 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.
Exceptions
IO_ERRORif there is a problem finding the footprint or the library, or deleting it.

Reimplemented in PCB_IO_GEDA, and PCB_IO_KICAD_SEXPR.

Definition at line 165 of file pcb_io.cpp.

References NOT_IMPLEMENTED.

◆ FootprintEnumerate()

void PCB_IO::FootprintEnumerate ( wxArrayString &  aFootprintNames,
const wxString &  aLibraryPath,
bool  aBestEfforts,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

Return a list of footprint names contained within the library at aLibraryPath.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several footprints.
aPropertiesis an associative array that can be used to tell the plugin anything needed about how to perform with respect to aLibraryPath. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL.
aFootprintNamesis the array of available footprint names inside a library.
aBestEffortsif true, don't throw on errors, just return an empty list.
Exceptions
IO_ERRORif the library cannot be found, or footprint cannot be loaded.

Reimplemented in PCB_IO_ALTIUM_DESIGNER, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, and PCB_IO_KICAD_SEXPR.

Definition at line 95 of file pcb_io.cpp.

References NOT_IMPLEMENTED.

Referenced by PCB_IO::ImportFootprint().

◆ FootprintExists()

bool PCB_IO::FootprintExists ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

Check for the existence of a footprint.

Reimplemented in PCB_IO_CADSTAR_ARCHIVE, and PCB_IO_KICAD_SEXPR.

Definition at line 141 of file pcb_io.cpp.

References PCB_IO::FootprintLoad().

◆ FootprintLoad()

FOOTPRINT * PCB_IO::FootprintLoad ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
bool  aKeepUUID = false,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PCB_IO knows about.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several footprints.
aFootprintNameis the name of the footprint to load.
aPropertiesis an associative array that can be used to tell the loader implementation to do something 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.
aKeepUUID= true to keep initial items UUID, false to set new UUID normally true if loaded in the footprint editor, false if loaded in the board editor. Make sense only in kicad_plugin
Returns
the FOOTPRINT object if found, caller owns it, else NULL if not found.
Exceptions
IO_ERRORif the library cannot be found or read. No exception is thrown in the case where aFootprintName cannot be found.

Reimplemented in PCB_IO_ALTIUM_DESIGNER, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, and PCB_IO_KICAD_SEXPR.

Definition at line 149 of file pcb_io.cpp.

References NOT_IMPLEMENTED.

Referenced by PCB_IO::FootprintExists(), PCB_IO::GetEnumeratedFootprint(), and PCB_IO::ImportFootprint().

◆ FootprintSave()

void PCB_IO::FootprintSave ( const wxString &  aLibraryPath,
const FOOTPRINT aFootprint,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

Write aFootprint to an existing library located at aLibraryPath.

If a footprint by the same name already exists, it is replaced.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several footprints.
aFootprintis what to store in the library. The caller continues to own the footprint after this call.
aPropertiesis an associative array that can be used to tell the saver how to save the footprint, 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.
Exceptions
IO_ERRORif there is a problem saving.

Reimplemented in PCB_IO_KICAD_SEXPR.

Definition at line 157 of file pcb_io.cpp.

References NOT_IMPLEMENTED.

◆ GenerateFiles()

bool PCB_IO_ODBPP::GenerateFiles ( ODB_TREE_WRITER writer)

Definition at line 62 of file pcb_io_odbpp.cpp.

References m_entities.

Referenced by ExportODB().

◆ GetBoardFileDesc()

const IO_BASE::IO_FILE_DESC PCB_IO_ODBPP::GetBoardFileDesc ( ) const
inlineoverridevirtual

Returns board file description for the PCB_IO.

Reimplemented from PCB_IO.

Definition at line 61 of file pcb_io_odbpp.h.

References _HKI.

◆ GetDrillLayerItemsMap()

std::map< std::pair< PCB_LAYER_ID, PCB_LAYER_ID >, std::vector< BOARD_ITEM * > > & PCB_IO_ODBPP::GetDrillLayerItemsMap ( )
inline

◆ GetEnumeratedFootprint()

const FOOTPRINT * PCB_IO::GetEnumeratedFootprint ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.

Reimplemented in PCB_IO_KICAD_SEXPR.

Definition at line 132 of file pcb_io.cpp.

References PCB_IO::FootprintLoad().

◆ GetImportedCachedLibraryFootprints()

std::vector< FOOTPRINT * > PCB_IO_ODBPP::GetImportedCachedLibraryFootprints ( )
overridevirtual

Return a container with the cached library footprints generated in the last call to Load.

This function is intended to be used ONLY by the non-KiCad board importers for the purpose of obtaining the footprint library of the design and creating a project-specific library.

Returns
Footprints (caller owns the objects)

Reimplemented from PCB_IO.

Definition at line 135 of file pcb_io_odbpp.cpp.

References m_loaded_footprints.

◆ GetLayerElementsMap()

std::map< PCB_LAYER_ID, std::map< int, std::vector< BOARD_ITEM * > > > & PCB_IO_ODBPP::GetLayerElementsMap ( )
inline

Definition at line 92 of file pcb_io_odbpp.h.

References m_layer_elements.

Referenced by ODB_STEP_ENTITY::MakeLayerEntity().

◆ GetLayerNameList()

std::vector< std::pair< PCB_LAYER_ID, wxString > > & PCB_IO_ODBPP::GetLayerNameList ( )
inline

◆ GetLibraryDesc()

const IO_BASE::IO_FILE_DESC PCB_IO_ODBPP::GetLibraryDesc ( ) const
inlineoverridevirtual

Get the descriptor for the library container that this IO plugin operates on.

Returns
File descriptor for the container of the library elements

Implements IO_BASE.

Definition at line 66 of file pcb_io_odbpp.h.

◆ GetLibraryFileDesc()

virtual const IO_FILE_DESC IO_BASE::GetLibraryFileDesc ( ) const
inlinevirtualinherited

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().

Returns
File descriptor for the library elements

Reimplemented in PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_GEDA, and PCB_IO_KICAD_SEXPR.

Definition at line 106 of file io_base.h.

Referenced by PCB_IO::CanReadFootprint().

◆ GetLibraryOptions()

void PCB_IO::GetLibraryOptions ( std::map< std::string, UTF8 > *  aListToAppendTo) const
overridevirtualinherited

Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions.

Options are typically appended so that a derived #PLUGIN can call its base class function by the same name first, thus inheriting options declared there. Some base class options could pertain to all Footprint*() functions in all derived PLUGINs.

Note
Since aListToAppendTo is a #PROPERTIES object, all options will be unique and last guy wins.
Parameters
aListToAppendToholds a tuple of
option
This eventually is what shows up into the fp-lib-table "options" field, possibly combined with others.
internationalized description
The internationalized description is displayed in DIALOG_PLUGIN_OPTIONS. It may be multi-line and be quite explanatory of the option.

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 PLUGIN, which has been avoided to date.

Reimplemented from IO_BASE.

Definition at line 173 of file pcb_io.cpp.

References _, and IO_BASE::GetLibraryOptions().

◆ GetLibraryTimestamp()

long long PCB_IO_ODBPP::GetLibraryTimestamp ( const wxString &  aLibraryPath) const
inlineoverridevirtual

Generate a timestamp representing all the files in the library (including the library directory).

Timestamps should not be considered ordered, they either match or they don't.

Implements PCB_IO.

Definition at line 75 of file pcb_io_odbpp.h.

◆ GetLoadedFootprintList()

std::vector< std::shared_ptr< FOOTPRINT > > & PCB_IO_ODBPP::GetLoadedFootprintList ( )
inline

Definition at line 97 of file pcb_io_odbpp.h.

References m_loaded_footprints.

◆ GetName()

const wxString & IO_BASE::GetName ( ) const
inlineinherited

Return a brief hard coded name for this IO interface.

Definition at line 75 of file io_base.h.

Referenced by SCH_IO_ALTIUM::ParseLibFile().

◆ GetPadSubnetMap()

std::map< const PAD *, EDA_DATA::SUB_NET_TOEPRINT * > & PCB_IO_ODBPP::GetPadSubnetMap ( )
inline

Definition at line 114 of file pcb_io_odbpp.h.

References m_topeprint_subnets.

Referenced by ODB_STEP_ENTITY::InitEdaData().

◆ GetPlaneSubnetMap()

std::map< std::pair< PCB_LAYER_ID, ZONE * >, EDA_DATA::SUB_NET_PLANE * > & PCB_IO_ODBPP::GetPlaneSubnetMap ( )
inline

Definition at line 119 of file pcb_io_odbpp.h.

References m_plane_subnets.

Referenced by ODB_STEP_ENTITY::InitEdaData(), and FEATURES_MANAGER::InitFeatureList().

◆ GetSlotHolesMap()

std::map< std::pair< PCB_LAYER_ID, PCB_LAYER_ID >, std::vector< BOARD_ITEM * > > & PCB_IO_ODBPP::GetSlotHolesMap ( )
inline

◆ GetViaTraceSubnetMap()

std::map< PCB_TRACK *, EDA_DATA::SUB_NET * > & PCB_IO_ODBPP::GetViaTraceSubnetMap ( )
inline

◆ ImportFootprint()

FOOTPRINT * PCB_IO::ImportFootprint ( const wxString &  aFootprintPath,
wxString &  aFootprintNameOut,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

Load a single footprint from aFootprintPath and put its name in aFootprintNameOut.

If this is a footprint library, the first footprint should be loaded. The default implementation uses FootprintEnumerate and FootprintLoad to load first footprint.

Parameters
aLibraryPathis a path of the footprint file.
aFootprintNameOutis the name output of the loaded footprint.
aPropertiesis an associative array that can be used to tell the loader implementation to do something 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.
Returns
the FOOTPRINT object if found, caller owns it, else NULL if not found.
Exceptions
IO_ERRORif the footprint cannot be found or read.

Reimplemented in PCB_IO_GEDA, and PCB_IO_KICAD_SEXPR.

Definition at line 108 of file pcb_io.cpp.

References _, PCB_IO::FootprintEnumerate(), and PCB_IO::FootprintLoad().

◆ IsLibraryWritable()

bool IO_BASE::IsLibraryWritable ( const wxString &  aLibraryPath)
virtualinherited

Return true if the library at aLibraryPath is writable.

The system libraries are typically read only because of where they are installed..

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several footprints.
Exceptions
IO_ERRORif no library at aLibraryPath exists.

Reimplemented in DESIGN_BLOCK_IO, SCH_IO_ALTIUM, SCH_IO_CADSTAR_ARCHIVE, SCH_IO_DATABASE, SCH_IO_EAGLE, SCH_IO_EASYEDA, SCH_IO_EASYEDAPRO, SCH_IO_HTTP_LIB, SCH_IO_KICAD_LEGACY, SCH_IO_KICAD_SEXPR, PCB_IO_ALTIUM_DESIGNER, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_GEDA, PCB_IO_KICAD_LEGACY, and PCB_IO_KICAD_SEXPR.

Definition at line 58 of file io_base.cpp.

References NOT_IMPLEMENTED.

◆ LoadBoard()

BOARD * PCB_IO::LoadBoard ( const wxString &  aFileName,
BOARD aAppendToMe,
const std::map< std::string, UTF8 > *  aProperties = nullptr,
PROJECT aProject = nullptr 
)
virtualinherited

Load information from some input file format that this PCB_IO implementation knows about into either a new BOARD or an existing one.

This may be used to load an entire new BOARD, or to augment an existing one if aAppendToMe is not NULL.

Parameters
aFileNameis the name of the file to use as input and may be foreign in nature or native in nature.
aAppendToMeis an existing BOARD to append to, but if NULL then this means "do not append, rather load anew".
aPropertiesis an associative array that can be used to tell the loader how to load the file, because it can take any number of additional named arguments that the plugin is known to support. These are tuning parameters for the import or load. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL.
aProjectis the optional PROJECT object primarily used by third party importers.
Returns
the successfully loaded board, or the same one as aAppendToMe if aAppendToMe was not NULL, and caller owns it.
Exceptions
IO_ERRORif there is a problem loading, and its contents should say what went wrong, using line number and character offsets of the input file if possible.

Reimplemented in PCB_IO_ALTIUM_CIRCUIT_STUDIO, PCB_IO_ALTIUM_CIRCUIT_MAKER, PCB_IO_ALTIUM_DESIGNER, PCB_IO_SOLIDWORKS, CLIPBOARD_IO, PCB_IO_CADSTAR_ARCHIVE, PCB_IO_EAGLE, PCB_IO_EASYEDA, PCB_IO_EASYEDAPRO, PCB_IO_FABMASTER, PCB_IO_KICAD_LEGACY, PCB_IO_KICAD_SEXPR, and PCB_IO_PCAD.

Definition at line 74 of file pcb_io.cpp.

References NOT_IMPLEMENTED.

Referenced by PCB_CONTROL::AppendBoard().

◆ Make()

template<typename T , typename... Args>
void PCB_IO_ODBPP::Make ( Args &&...  args)
inlineprivate

Definition at line 148 of file pcb_io_odbpp.h.

References m_entities.

◆ PrefetchLib()

void PCB_IO::PrefetchLib ( const wxString &  aLibraryPath,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
virtualinherited

If possible, prefetches the specified library (e.g.

performing downloads). Does not parse. Threadsafe.

This is a no-op for libraries that cannot be prefetched. Plugins that cannot prefetch need not override this; a default no-op is provided.

Parameters
aLibraryPathis a locator for the "library", usually a directory, file, or URL containing several footprints.
aPropertiesis an associative array that can be used to tell the plugin anything needed about how to perform with respect to aLibraryPath. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL.
Exceptions
IO_ERRORif there is an error prefetching the library.

Definition at line 103 of file pcb_io.cpp.

◆ Report()

void IO_BASE::Report ( const wxString &  aText,
SEVERITY  aSeverity = RPT_SEVERITY_UNDEFINED 
)
virtualinherited

◆ SaveBoard()

void PCB_IO_ODBPP::SaveBoard ( const wxString &  aFileName,
BOARD aBoard,
const std::map< std::string, UTF8 > *  aProperties = nullptr 
)
overridevirtual

Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be used to write a portion of aBoard to a special kind of export file.

Parameters
aFileNameis the name of a file to save to on disk.
aBoardis the class BOARD 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.
aPropertiesis 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.
Exceptions
IO_ERRORif there is a problem saving or exporting.

Reimplemented from PCB_IO.

Definition at line 149 of file pcb_io_odbpp.cpp.

References ExportODB(), m_board, m_scale, m_sigfig, m_symbolScale, m_unitsStr, PCB_IU_PER_MM, and PL_IU_PER_MM.

◆ SetProgressReporter()

virtual void IO_BASE::SetProgressReporter ( PROGRESS_REPORTER aReporter)
inlinevirtualinherited

Set an optional progress reporter.

Reimplemented in SCH_IO_CADSTAR_ARCHIVE.

Definition at line 85 of file io_base.h.

Referenced by PCB_CONTROL::AppendBoard().

◆ SetQueryUserCallback()

virtual void PCB_IO::SetQueryUserCallback ( std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aAction)>  aCallback)
inlinevirtualinherited

Registers a KIDIALOG callback for collecting info from the user.

Definition at line 97 of file pcb_io.h.

Referenced by PCB_CONTROL::AppendBoard().

◆ SetReporter()

virtual void IO_BASE::SetReporter ( REPORTER aReporter)
inlinevirtualinherited

Set an optional reporter for warnings/errors.

Reimplemented in SCH_IO_CADSTAR_ARCHIVE.

Definition at line 80 of file io_base.h.

Member Data Documentation

◆ m_board

BOARD* PCB_IO_ODBPP::m_board
private

Definition at line 157 of file pcb_io_odbpp.h.

Referenced by CreateEntity(), PCB_IO_ODBPP(), and SaveBoard().

◆ m_drill_layers

std::map<std::pair<PCB_LAYER_ID, PCB_LAYER_ID>, std::vector<BOARD_ITEM*> > PCB_IO_ODBPP::m_drill_layers
private

Definition at line 165 of file pcb_io_odbpp.h.

Referenced by GetDrillLayerItemsMap().

◆ m_entities

std::vector<std::shared_ptr<ODB_ENTITY_BASE> > PCB_IO_ODBPP::m_entities
private

Definition at line 179 of file pcb_io_odbpp.h.

Referenced by ExportODB(), GenerateFiles(), and Make().

◆ m_layer_elements

std::map<PCB_LAYER_ID, std::map<int, std::vector<BOARD_ITEM*> > > PCB_IO_ODBPP::m_layer_elements
private

Definition at line 171 of file pcb_io_odbpp.h.

Referenced by GetLayerElementsMap().

◆ m_layer_name_list

std::vector<std::pair<PCB_LAYER_ID, wxString> > PCB_IO_ODBPP::m_layer_name_list
private

Definition at line 162 of file pcb_io_odbpp.h.

Referenced by GetLayerNameList().

◆ m_loaded_footprints

std::vector<std::shared_ptr<FOOTPRINT> > PCB_IO_ODBPP::m_loaded_footprints
private

◆ m_name

wxString IO_BASE::m_name
protectedinherited

Name of the IO loader.

Definition at line 215 of file io_base.h.

◆ m_plane_subnets

std::map<std::pair<PCB_LAYER_ID, ZONE*>, EDA_DATA::SUB_NET_PLANE*> PCB_IO_ODBPP::m_plane_subnets
private

Definition at line 175 of file pcb_io_odbpp.h.

Referenced by GetPlaneSubnetMap().

◆ m_progressReporter

◆ m_props

◆ m_reporter

REPORTER* IO_BASE::m_reporter
protectedinherited

Reporter to log errors/warnings to, may be nullptr.

Definition at line 218 of file io_base.h.

Referenced by SCH_IO_ALTIUM::AddLibTextBox(), SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary(), PCB_IO_ALTIUM_DESIGNER::FootprintLoad(), PCB_IO_ALTIUM_CIRCUIT_STUDIO::LoadBoard(), PCB_IO_ALTIUM_CIRCUIT_MAKER::LoadBoard(), PCB_IO_ALTIUM_DESIGNER::LoadBoard(), PCB_IO_SOLIDWORKS::LoadBoard(), SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile(), SCH_IO_LTSPICE::LoadSchematicFile(), SCH_IO_ALTIUM::ParseAltiumSch(), SCH_IO_ALTIUM::ParseArc(), SCH_IO_ALTIUM::ParseBezier(), SCH_IO_ALTIUM::ParseCircle(), SCH_IO_ALTIUM::ParseComponent(), SCH_IO_ALTIUM::ParseDesignator(), SCH_IO_ALTIUM::ParseEllipse(), SCH_IO_ALTIUM::ParseEllipticalArc(), SCH_IO_ALTIUM::ParseFileName(), SCH_IO_ALTIUM::ParseHarnessConnector(), SCH_IO_ALTIUM::ParseHarnessEntry(), SCH_IO_ALTIUM::ParseHarnessPort(), SCH_IO_ALTIUM::ParseHarnessType(), SCH_IO_ALTIUM::ParseImage(), SCH_IO_ALTIUM::ParseImplementation(), SCH_IO_ALTIUM::ParseLabel(), SCH_IO_ALTIUM::ParseLibFile(), SCH_IO_ALTIUM::ParseLine(), SCH_IO_ALTIUM::ParsePieChart(), SCH_IO_ALTIUM::ParsePin(), SCH_IO_ALTIUM::ParsePolygon(), SCH_IO_ALTIUM::ParsePolyline(), SCH_IO_ALTIUM::ParsePort(), SCH_IO_ALTIUM::ParsePowerPort(), SCH_IO_ALTIUM::ParseRecord(), SCH_IO_ALTIUM::ParseRectangle(), SCH_IO_ALTIUM::ParseRoundRectangle(), SCH_IO_ALTIUM::ParseSheetEntry(), SCH_IO_ALTIUM::ParseSheetName(), SCH_IO_ALTIUM::ParseSignalHarness(), SCH_IO_ALTIUM::ParseStorage(), PCB_IO_ALTIUM_DESIGNER::PCB_IO_ALTIUM_DESIGNER(), PCB_IO_SOLIDWORKS::PCB_IO_SOLIDWORKS(), IO_BASE::Report(), SCH_IO_ALTIUM::SCH_IO_ALTIUM(), SCH_IO_CADSTAR_ARCHIVE::SCH_IO_CADSTAR_ARCHIVE(), SCH_IO_EAGLE::SCH_IO_EAGLE(), SCH_IO_EASYEDA::SCH_IO_EASYEDA(), SCH_IO_EASYEDAPRO::SCH_IO_EASYEDAPRO(), SCH_IO_LTSPICE::SCH_IO_LTSPICE(), and SCH_IO_CADSTAR_ARCHIVE::SetReporter().

◆ m_scale

double PCB_IO_ODBPP::m_scale = 1.0 / PCB_IU_PER_MM
static

Definition at line 141 of file pcb_io_odbpp.h.

Referenced by ODB::AddXY(), ODB::Data2String(), and SaveBoard().

◆ m_sigfig

int PCB_IO_ODBPP::m_sigfig = 4
static

Definition at line 143 of file pcb_io_odbpp.h.

Referenced by ODB::Double2String(), and SaveBoard().

◆ m_slot_holes

std::map<std::pair<PCB_LAYER_ID, PCB_LAYER_ID>, std::vector<BOARD_ITEM*> > PCB_IO_ODBPP::m_slot_holes
private

Definition at line 168 of file pcb_io_odbpp.h.

Referenced by GetSlotHolesMap().

◆ m_symbolScale

double PCB_IO_ODBPP::m_symbolScale = 1.0 / PL_IU_PER_MM
static

Definition at line 142 of file pcb_io_odbpp.h.

Referenced by SaveBoard(), and ODB::SymDouble2String().

◆ m_topeprint_subnets

std::map<const PAD*, EDA_DATA::SUB_NET_TOEPRINT*> PCB_IO_ODBPP::m_topeprint_subnets
private

Definition at line 173 of file pcb_io_odbpp.h.

Referenced by GetPadSubnetMap().

◆ m_unitsStr

◆ m_via_trace_subnets

std::map<PCB_TRACK*, EDA_DATA::SUB_NET*> PCB_IO_ODBPP::m_via_trace_subnets
private

Definition at line 177 of file pcb_io_odbpp.h.

Referenced by GetViaTraceSubnetMap().

◆ m_writer

std::shared_ptr<ODB_TREE_WRITER> PCB_IO_ODBPP::m_writer

Definition at line 130 of file pcb_io_odbpp.h.


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