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

A PLUGIN derivation which could possibly be put into a DLL/DSO. More...

#include <legacy_plugin.h>

Inheritance diagram for LEGACY_PLUGIN:
PLUGIN

Public Types

typedef int BIU
 

Public Member Functions

 LEGACY_PLUGIN ()
 
 ~LEGACY_PLUGIN ()
 
const wxString PluginName () const override
 Return a brief hard coded name for this PLUGIN. More...
 
const wxString GetFileExtension () const override
 Returns the file extension for the PLUGIN. More...
 
BOARDLoad (const wxString &aFileName, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override
 Load information from some input file format that this PLUGIN implementation knows about into either a new BOARD or an existing one. More...
 
void FootprintEnumerate (wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const STRING_UTF8_MAP *aProperties=nullptr) override
 Return a list of footprint names contained within the library at aLibraryPath. More...
 
FOOTPRINTFootprintLoad (const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const STRING_UTF8_MAP *aProperties=nullptr) override
 Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN knows about. More...
 
bool FootprintLibDelete (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr) override
 Delete an existing footprint 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. More...
 
long long GetLibraryTimestamp (const wxString &aLibraryPath) const override
 Generate a timestamp representing all the files in the library (including the library directory). More...
 
bool IsFootprintLibWritable (const wxString &aLibraryPath) override
 Return true if the library at aLibraryPath is writable. More...
 
void SetReader (LINE_READER *aReader)
 
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. More...
 
virtual std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints ()
 Return a container with the cached library footprints generated in the last call to Load. More...
 
virtual void Save (const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *aProperties=nullptr)
 Write aBoard to a storage file in a format that this PLUGIN implementation knows about or it can be used to write a portion of aBoard to a special kind of export file. More...
 
virtual void PrefetchLib (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
 If possible, prefetches the specified library (e.g. More...
 
virtual const FOOTPRINTGetEnumeratedFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *aProperties=nullptr)
 A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management. More...
 
virtual bool FootprintExists (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *aProperties=nullptr)
 Check for the existence of a footprint. More...
 
virtual void FootprintSave (const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const STRING_UTF8_MAP *aProperties=nullptr)
 Write aFootprint to an existing library located at aLibraryPath. More...
 
virtual void FootprintDelete (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *aProperties=nullptr)
 Delete aFootprintName from the library at aLibraryPath. More...
 
virtual void FootprintLibCreate (const wxString &aLibraryPath, const STRING_UTF8_MAP *aProperties=nullptr)
 Create a new empty footprint library at aLibraryPath empty. More...
 
virtual void FootprintLibOptions (STRING_UTF8_MAP *aListToAppendTo) const
 Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions. More...
 

Static Public Member Functions

static PCB_LAYER_ID leg_layer2new (int cu_count, int aLayerNum)
 
static LSET leg_mask2new (int cu_count, unsigned aMask)
 

Protected Member Functions

void init (const STRING_UTF8_MAP *aProperties)
 initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed. More...
 
void checkpoint ()
 Converts net code using the mapping table if available, otherwise returns unchanged net code. More...
 
int getNetCode (int aNetCode)
 
BIU biuParse (const char *aValue, const char **nptrptr=nullptr)
 Parse an ASCII decimal floating point value and scales it into a BIU according to the current value of diskToBui. More...
 
EDA_ANGLE degParse (const char *aValue, const char **nptrptr=nullptr)
 Parse an ASCII decimal floating point value which is certainly an angle in tenths of a degree. More...
 
void checkVersion ()
 
void loadAllSections (bool doAppend)
 
void loadGENERAL ()
 
void loadSETUP ()
 
void loadSHEET ()
 
void load3D (FOOTPRINT *aFootprint)
 
void loadPAD (FOOTPRINT *aFootprint)
 
void loadMODULE_TEXT (PCB_TEXT *aText)
 
void loadFP_SHAPE (FOOTPRINT *aFootprint)
 
void loadPCB_LINE ()
 
void loadNETINFO_ITEM ()
 
void loadPCB_TEXT ()
 
void loadNETCLASS ()
 
void loadFOOTPRINT (FOOTPRINT *aFootprint)
 
void loadTrackList (int aStructType)
 Read a list of segments (Tracks and Vias, or Segzones) More...
 
void loadZONE_CONTAINER ()
 
void loadDIMENSION ()
 
void loadPCB_TARGET ()
 
void cacheLib (const wxString &aLibraryPath)
 we only cache one footprint library for now, this determines which one. More...
 

Protected Attributes

int m_cu_count
 
wxString m_error
 for throwing exceptions More...
 
BOARDm_board
 which BOARD, no ownership here More...
 
const STRING_UTF8_MAPm_props
 passed via Save() or Load(), no ownership, More...
 
PROGRESS_REPORTERm_progressReporter
 may be NULL, no ownership More...
 
unsigned m_lastProgressLine
 
unsigned m_lineCount
 for progress reporting More...
 
LINE_READERm_reader
 no ownership here. More...
 
FILE * m_fp
 no ownership here. More...
 
wxString m_field
 reused to stuff FOOTPRINT fields. More...
 
int m_loading_format_version
 which BOARD_FORMAT_VERSION am I Load()ing? More...
 
LP_CACHEm_cache
 
bool m_showLegacySegmentZoneWarning
 
std::vector< int > m_netCodes
 net codes mapping for boards being loaded More...
 
double biuToDisk
 convert from BIUs to disk engineering units with this scale factor More...
 
double diskToBiu
 convert from disk engineering units to BIUs with this scale factor More...
 

Friends

struct LP_CACHE
 

Detailed Description

A PLUGIN derivation which could possibly be put into a DLL/DSO.

As with any PLUGIN, there is no UI, i.e. windowing calls allowed.

Definition at line 58 of file legacy_plugin.h.

Member Typedef Documentation

◆ BIU

typedef int LEGACY_PLUGIN::BIU

Definition at line 95 of file legacy_plugin.h.

Constructor & Destructor Documentation

◆ LEGACY_PLUGIN()

LEGACY_PLUGIN::LEGACY_PLUGIN ( )

Definition at line 3231 of file legacy_plugin.cpp.

References init().

◆ ~LEGACY_PLUGIN()

LEGACY_PLUGIN::~LEGACY_PLUGIN ( )

Definition at line 3246 of file legacy_plugin.cpp.

References m_cache.

Member Function Documentation

◆ biuParse()

BIU LEGACY_PLUGIN::biuParse ( const char *  aValue,
const char **  nptrptr = nullptr 
)
protected

Parse an ASCII decimal floating point value and scales it into a BIU according to the current value of diskToBui.

This function is the complement of #fmtBIU(). One has to know what the other is doing.

Parameters
aValueis the ASCII value in C locale form with possible leading whitespace
nptrptrmay be NULL, but if not, then it tells where to put a pointer to the next unconsumed input text. See "man strtod" for more information.
Returns
the converted Board Internal Unit.

Definition at line 2774 of file legacy_plugin.cpp.

References _, diskToBiu, LINE_READER::GetSource(), KiROUND(), LINE_READER::Line(), LINE_READER::LineNumber(), m_error, m_reader, and THROW_IO_ERROR.

Referenced by loadDIMENSION(), loadFOOTPRINT(), loadFP_SHAPE(), loadGENERAL(), loadMODULE_TEXT(), loadNETCLASS(), loadPAD(), loadPCB_LINE(), loadPCB_TARGET(), loadPCB_TEXT(), loadSETUP(), loadTrackList(), and loadZONE_CONTAINER().

◆ cacheLib()

void LEGACY_PLUGIN::cacheLib ( const wxString &  aLibraryPath)
protected

we only cache one footprint library for now, this determines which one.

Definition at line 3124 of file legacy_plugin.cpp.

References LP_CACHE::IsModified(), LP_CACHE::Load(), LP_CACHE, m_cache, and LP_CACHE::m_lib_path.

Referenced by FootprintEnumerate(), FootprintLoad(), and IsFootprintLibWritable().

◆ checkpoint()

void LEGACY_PLUGIN::checkpoint ( )
protected

Converts net code using the mapping table if available, otherwise returns unchanged net code.

Definition at line 199 of file legacy_plugin.cpp.

References _, PROGRESS_REPORTER::KeepRefreshing(), LINE_READER::LineNumber(), m_lastProgressLine, m_lineCount, m_progressReporter, m_reader, PROGRESS_REPORTER::SetCurrentProgress(), and THROW_IO_ERROR.

Referenced by loadAllSections(), and loadTrackList().

◆ checkVersion()

void LEGACY_PLUGIN::checkVersion ( )
protected

◆ degParse()

EDA_ANGLE LEGACY_PLUGIN::degParse ( const char *  aValue,
const char **  nptrptr = nullptr 
)
protected

Parse an ASCII decimal floating point value which is certainly an angle in tenths of a degree.

Parameters
aValueis the ASCII value in C locale form with possible leading whitespace.
nptrptrmay be NULL, but if not, then it tells where to put a pointer to the next unconsumed input text. See "man strtod" for more information.

Definition at line 2813 of file legacy_plugin.cpp.

References _, LINE_READER::GetSource(), LINE_READER::Line(), LINE_READER::LineNumber(), m_error, m_reader, TENTHS_OF_A_DEGREE_T, and THROW_IO_ERROR.

Referenced by loadDIMENSION(), loadFP_SHAPE(), loadMODULE_TEXT(), loadPAD(), loadPCB_LINE(), and loadPCB_TEXT().

◆ FootprintDelete()

void PLUGIN::FootprintDelete ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const STRING_UTF8_MAP 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 GPCB_PLUGIN, and PCB_PLUGIN.

Definition at line 103 of file plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by FP_LIB_TABLE::FootprintDelete().

◆ FootprintEnumerate()

void LEGACY_PLUGIN::FootprintEnumerate ( wxArrayString &  aFootprintNames,
const wxString &  aLibraryPath,
bool  aBestEfforts,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtual

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 from PLUGIN.

Definition at line 3136 of file legacy_plugin.cpp.

References cacheLib(), FROM_UTF8(), init(), m_cache, LP_CACHE::m_footprints, THROW_IO_ERROR, and IO_ERROR::What().

◆ FootprintExists()

bool PLUGIN::FootprintExists ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

Check for the existence of a footprint.

Reimplemented in CADSTAR_PCB_ARCHIVE_PLUGIN, and PCB_PLUGIN.

Definition at line 79 of file plugin.cpp.

References PLUGIN::FootprintLoad().

Referenced by FP_LIB_TABLE::FootprintExists().

◆ FootprintLibCreate()

void PLUGIN::FootprintLibCreate ( const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

Create a new empty footprint 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 footprints.
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 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 library, or creating it.

Reimplemented in PCB_PLUGIN.

Definition at line 111 of file plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by PCB_BASE_EDIT_FRAME::createNewLibrary(), and FP_LIB_TABLE::FootprintLibCreate().

◆ FootprintLibDelete()

bool LEGACY_PLUGIN::FootprintLibDelete ( const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtual

Delete an existing footprint 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 footprints.
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 from PLUGIN.

Definition at line 3189 of file legacy_plugin.cpp.

References _, m_cache, LP_CACHE::m_lib_path, and THROW_IO_ERROR.

◆ FootprintLibOptions()

void PLUGIN::FootprintLibOptions ( STRING_UTF8_MAP aListToAppendTo) const
virtualinherited

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 in EAGLE_PLUGIN.

Definition at line 132 of file plugin.cpp.

References _.

Referenced by EAGLE_PLUGIN::FootprintLibOptions(), and FP_GRID_TRICKS::optionsEditor().

◆ FootprintLoad()

FOOTPRINT * LEGACY_PLUGIN::FootprintLoad ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
bool  aKeepUUID = false,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtual

Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN 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 from PLUGIN.

Definition at line 3164 of file legacy_plugin.cpp.

References cacheLib(), copy, init(), m_cache, LP_CACHE::m_footprints, and TO_UTF8.

◆ FootprintSave()

void PLUGIN::FootprintSave ( const wxString &  aLibraryPath,
const FOOTPRINT aFootprint,
const STRING_UTF8_MAP 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_PLUGIN.

Definition at line 95 of file plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by PCB_EDIT_FRAME::ExportFootprintsToLibrary(), FP_LIB_TABLE::FootprintSave(), PCB_EDIT_FRAME::OpenProjectFiles(), and FOOTPRINT_EDIT_FRAME::SaveLibraryAs().

◆ GetEnumeratedFootprint()

const FOOTPRINT * PLUGIN::GetEnumeratedFootprint ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

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

Reimplemented in CADSTAR_PCB_ARCHIVE_PLUGIN, GPCB_PLUGIN, and PCB_PLUGIN.

Definition at line 70 of file plugin.cpp.

References PLUGIN::FootprintLoad().

Referenced by FP_LIB_TABLE::GetEnumeratedFootprint(), and FOOTPRINT_EDIT_FRAME::SaveLibraryAs().

◆ GetFileExtension()

const wxString LEGACY_PLUGIN::GetFileExtension ( ) const
inlineoverridevirtual

Returns the file extension for the PLUGIN.

Implements PLUGIN.

Definition at line 71 of file legacy_plugin.h.

◆ GetImportedCachedLibraryFootprints()

std::vector< FOOTPRINT * > PLUGIN::GetImportedCachedLibraryFootprints ( )
virtualinherited

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 in CADSTAR_PCB_ARCHIVE_PLUGIN, and EAGLE_PLUGIN.

Definition at line 45 of file plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ GetLibraryTimestamp()

long long LEGACY_PLUGIN::GetLibraryTimestamp ( const wxString &  aLibraryPath) const
overridevirtual

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 PLUGIN.

Definition at line 3118 of file legacy_plugin.cpp.

References LP_CACHE::GetTimestamp().

◆ getNetCode()

int LEGACY_PLUGIN::getNetCode ( int  aNetCode)
inlineprotected

Definition at line 112 of file legacy_plugin.h.

References m_netCodes.

Referenced by loadPAD(), loadTrackList(), and loadZONE_CONTAINER().

◆ init()

void LEGACY_PLUGIN::init ( const STRING_UTF8_MAP aProperties)
protected

◆ IsFootprintLibWritable()

bool LEGACY_PLUGIN::IsFootprintLibWritable ( const wxString &  aLibraryPath)
overridevirtual

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 from PLUGIN.

Definition at line 3215 of file legacy_plugin.cpp.

References cacheLib(), init(), m_cache, and LP_CACHE::m_writable.

◆ leg_layer2new()

◆ leg_mask2new()

LSET LEGACY_PLUGIN::leg_mask2new ( int  cu_count,
unsigned  aMask 
)
static

Definition at line 358 of file legacy_plugin.cpp.

References ALL_CU_LAYERS, LSET::AllCuMask(), and leg_layer2new().

Referenced by loadGENERAL(), and loadPAD().

◆ Load()

BOARD * LEGACY_PLUGIN::Load ( const wxString &  aFileName,
BOARD aAppendToMe,
const STRING_UTF8_MAP aProperties = nullptr,
PROJECT aProject = nullptr,
PROGRESS_REPORTER aProgressReporter = nullptr 
)
overridevirtual

Load information from some input file format that this PLUGIN 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.
aProgressReporteran optional progress reporter
aLineCounta line count (necessary if a progress reporter is supplied)
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 from PLUGIN.

Definition at line 405 of file legacy_plugin.cpp.

References _, checkVersion(), ignore_unused(), init(), PROGRESS_REPORTER::KeepRefreshing(), loadAllSections(), m_board, m_lineCount, m_progressReporter, m_reader, FILE_LINE_READER::ReadLine(), PROGRESS_REPORTER::Report(), FILE_LINE_READER::Rewind(), BOARD::SetFileName(), and THROW_IO_ERROR.

◆ load3D()

◆ loadAllSections()

◆ loadDIMENSION()

◆ loadFOOTPRINT()

◆ loadFP_SHAPE()

◆ loadGENERAL()

◆ loadMODULE_TEXT()

◆ loadNETCLASS()

◆ loadNETINFO_ITEM()

◆ loadPAD()

◆ loadPCB_LINE()

◆ loadPCB_TARGET()

◆ loadPCB_TEXT()

◆ loadSETUP()

◆ loadSHEET()

◆ loadTrackList()

void LEGACY_PLUGIN::loadTrackList ( int  aStructType)
protected

Read a list of segments (Tracks and Vias, or Segzones)

Parameters
aStructTypeis either PCB_TRACE_T to indicate tracks and vias, or NOT_USED to indicate oldschool zone segments (which are discarded).

Definition at line 2071 of file legacy_plugin.cpp.

References BOARD::Add(), B_Cu, biuParse(), checkpoint(), delims, F_Cu, getNetCode(), intParse(), is_leg_copperlayer_valid(), leg_layer2new(), LINE_READER::Line(), m_board, m_cu_count, m_reader, EDA_ITEM::m_Uuid, NOT_USED, PCB_TRACE_T, PCB_VIA_T, READLINE, PCB_TRACK::SetEnd(), BOARD_ITEM::SetLayer(), BOARD_CONNECTED_ITEM::SetNetCode(), PCB_TRACK::SetPosition(), PCB_TRACK::SetWidth(), strtok_r(), SZ, TESTLINE, THROW_IO_ERROR, and via.

Referenced by loadAllSections().

◆ loadZONE_CONTAINER()

◆ PluginName()

const wxString LEGACY_PLUGIN::PluginName ( ) const
inlineoverridevirtual

Return a brief hard coded name for this PLUGIN.

Implements PLUGIN.

Definition at line 66 of file legacy_plugin.h.

◆ PrefetchLib()

void PLUGIN::PrefetchLib ( const wxString &  aLibraryPath,
const STRING_UTF8_MAP 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 65 of file plugin.cpp.

Referenced by FP_LIB_TABLE::PrefetchLib().

◆ Save()

void PLUGIN::Save ( const wxString &  aFileName,
BOARD aBoard,
const STRING_UTF8_MAP aProperties = nullptr 
)
virtualinherited

Write aBoard to a storage file in a format that this PLUGIN 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 in CLIPBOARD_IO, and PCB_PLUGIN.

Definition at line 50 of file plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by IO_MGR::Save(), PCB_EDIT_FRAME::SavePcbCopy(), and PCB_EDIT_FRAME::SavePcbFile().

◆ SetQueryUserCallback()

virtual void PLUGIN::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 285 of file io_mgr.h.

Referenced by PCB_CONTROL::AppendBoard(), and PCB_EDIT_FRAME::OpenProjectFiles().

◆ SetReader()

void LEGACY_PLUGIN::SetReader ( LINE_READER aReader)
inline

Definition at line 97 of file legacy_plugin.h.

References m_reader.

Referenced by LP_CACHE::LoadModules().

Friends And Related Function Documentation

◆ LP_CACHE

friend struct LP_CACHE
friend

Definition at line 60 of file legacy_plugin.h.

Referenced by cacheLib().

Member Data Documentation

◆ biuToDisk

double LEGACY_PLUGIN::biuToDisk
protected

convert from BIUs to disk engineering units with this scale factor

Definition at line 199 of file legacy_plugin.h.

Referenced by init().

◆ diskToBiu

double LEGACY_PLUGIN::diskToBiu
protected

convert from disk engineering units to BIUs with this scale factor

Definition at line 202 of file legacy_plugin.h.

Referenced by biuParse(), init(), loadGENERAL(), and LP_CACHE::ReadAndVerifyHeader().

◆ m_board

◆ m_cache

LP_CACHE* LEGACY_PLUGIN::m_cache
protected

◆ m_cu_count

◆ m_error

wxString LEGACY_PLUGIN::m_error
protected

for throwing exceptions

Definition at line 181 of file legacy_plugin.h.

Referenced by biuParse(), checkVersion(), degParse(), loadFP_SHAPE(), loadNETCLASS(), loadPAD(), loadSHEET(), and loadZONE_CONTAINER().

◆ m_field

wxString LEGACY_PLUGIN::m_field
protected

reused to stuff FOOTPRINT fields.

Definition at line 192 of file legacy_plugin.h.

Referenced by loadMODULE_TEXT().

◆ m_fp

FILE* LEGACY_PLUGIN::m_fp
protected

no ownership here.

Definition at line 190 of file legacy_plugin.h.

◆ m_lastProgressLine

unsigned LEGACY_PLUGIN::m_lastProgressLine
protected

Definition at line 186 of file legacy_plugin.h.

Referenced by checkpoint().

◆ m_lineCount

unsigned LEGACY_PLUGIN::m_lineCount
protected

for progress reporting

Definition at line 187 of file legacy_plugin.h.

Referenced by checkpoint(), and Load().

◆ m_loading_format_version

int LEGACY_PLUGIN::m_loading_format_version
protected

which BOARD_FORMAT_VERSION am I Load()ing?

Definition at line 193 of file legacy_plugin.h.

Referenced by checkVersion(), init(), and loadPAD().

◆ m_netCodes

std::vector<int> LEGACY_PLUGIN::m_netCodes
protected

net codes mapping for boards being loaded

Definition at line 197 of file legacy_plugin.h.

Referenced by getNetCode(), loadGENERAL(), and loadNETINFO_ITEM().

◆ m_progressReporter

PROGRESS_REPORTER* LEGACY_PLUGIN::m_progressReporter
protected

may be NULL, no ownership

Definition at line 185 of file legacy_plugin.h.

Referenced by checkpoint(), and Load().

◆ m_props

const STRING_UTF8_MAP* LEGACY_PLUGIN::m_props
protected

passed via Save() or Load(), no ownership,

may be NULL.

Definition at line 183 of file legacy_plugin.h.

Referenced by init().

◆ m_reader

◆ m_showLegacySegmentZoneWarning

bool LEGACY_PLUGIN::m_showLegacySegmentZoneWarning
protected

Definition at line 195 of file legacy_plugin.h.

Referenced by init(), and loadZONE_CONTAINER().


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