KiCad PCB EDA Suite
|
A PLUGIN derivation which could possibly be put into a DLL/DSO. More...
#include <legacy_plugin.h>
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... | |
PLUGIN_FILE_DESC | GetBoardFileDesc () const override |
Returns board file description for the PLUGIN. More... | |
PLUGIN_FILE_DESC | GetFootprintLibDesc () const override |
Returns footprint library description for the PLUGIN. More... | |
PLUGIN_FILE_DESC | GetFootprintFileDesc () const override |
Returns footprint file description for the PLUGIN. More... | |
bool | CanReadBoard (const wxString &aFileName) const override |
Checks if this PLUGIN can read the specified board file. More... | |
bool | CanReadFootprint (const wxString &aFileName) const override |
Checks if this PLUGIN can read a footprint from specified file or directory. More... | |
BOARD * | LoadBoard (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... | |
FOOTPRINT * | FootprintLoad (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 bool | CanReadFootprintLib (const wxString &aFileName) const |
Checks if this PLUGIN can read footprint library from specified file or directory. More... | |
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 | SaveBoard (const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *aProperties=nullptr, PROGRESS_REPORTER *aProgressReporter=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 FOOTPRINT * | ImportFootprint (const wxString &aFootprintPath, wxString &aFootprintNameOut, const STRING_UTF8_MAP *aProperties=nullptr) |
Load a single footprint from aFootprintPath and put its name in aFootprintNameOut. More... | |
virtual const FOOTPRINT * | GetEnumeratedFootprint (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 | 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... | |
Static Protected Member Functions | |
static int | getVersion (LINE_READER *aReader) |
Protected Attributes | |
int | m_cu_count |
wxString | m_error |
for throwing exceptions More... | |
BOARD * | m_board |
which BOARD, no ownership here More... | |
const STRING_UTF8_MAP * | m_props |
passed via Save() or Load(), no ownership, More... | |
PROGRESS_REPORTER * | m_progressReporter |
may be NULL, no ownership More... | |
unsigned | m_lastProgressLine |
unsigned | m_lineCount |
for progress reporting More... | |
LINE_READER * | m_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_CACHE * | m_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 More... | |
Friends | |
struct | LP_CACHE |
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 59 of file legacy_plugin.h.
typedef int LEGACY_PLUGIN::BIU |
Definition at line 106 of file legacy_plugin.h.
LEGACY_PLUGIN::LEGACY_PLUGIN | ( | ) |
Definition at line 3290 of file legacy_plugin.cpp.
References init().
LEGACY_PLUGIN::~LEGACY_PLUGIN | ( | ) |
Definition at line 3305 of file legacy_plugin.cpp.
References m_cache.
|
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.
aValue | is the ASCII value in C locale form with possible leading whitespace |
nptrptr | may 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 2836 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().
|
protected |
we only cache one footprint library for now, this determines which one.
Definition at line 3183 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().
|
overridevirtual |
Checks if this PLUGIN can read the specified board file.
If not overriden, extension check is used.
Reimplemented from PLUGIN.
Definition at line 413 of file legacy_plugin.cpp.
References PLUGIN::CanReadBoard(), and getVersion().
|
overridevirtual |
Checks if this PLUGIN can read a footprint from specified file or directory.
If not overriden, extension check is used.
Reimplemented from PLUGIN.
Definition at line 432 of file legacy_plugin.cpp.
References PLUGIN::CanReadFootprint(), FOOTPRINT_LIBRARY_HEADER, FOOTPRINT_LIBRARY_HEADER_CNT, LINE_READER::Line(), and WHITESPACE_FILTER_READER::ReadLine().
|
virtualinherited |
Checks if this PLUGIN can read footprint library from specified file or directory.
If not overriden, extension check is used.
Reimplemented in ALTIUM_DESIGNER_PLUGIN, CADSTAR_PCB_ARCHIVE_PLUGIN, EAGLE_PLUGIN, EASYEDA_PLUGIN, and IPC2581_PLUGIN.
Definition at line 93 of file plugin.cpp.
References PLUGIN::GetFootprintLibDesc(), PLUGIN_FILE_DESC::m_ExtensionsInDir, PLUGIN_FILE_DESC::m_FileExtensions, and PLUGIN_FILE_DESC::m_IsFile.
Referenced by ALTIUM_DESIGNER_PLUGIN::CanReadFootprintLib(), CADSTAR_PCB_ARCHIVE_PLUGIN::CanReadFootprintLib(), EAGLE_PLUGIN::CanReadFootprintLib(), and IO_MGR::GuessPluginTypeFromLibPath().
|
protected |
Converts net code using the mapping table if available, otherwise returns unchanged net code.
Definition at line 207 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().
|
protected |
Parse an ASCII decimal floating point value which is certainly an angle in tenths of a degree.
aValue | is the ASCII value in C locale form with possible leading whitespace. |
nptrptr | may 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 2875 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().
|
virtualinherited |
Delete aFootprintName from the library at aLibraryPath.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprintName | is the name of a footprint to delete from the specified library. |
aProperties | is 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. |
IO_ERROR | if there is a problem finding the footprint or the library, or deleting it. |
Reimplemented in GPCB_PLUGIN, and PCB_PLUGIN.
Definition at line 234 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by FP_LIB_TABLE::FootprintDelete().
|
overridevirtual |
Return a list of footprint names contained within the library at aLibraryPath.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aProperties | is 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. |
aFootprintNames | is the array of available footprint names inside a library. |
aBestEfforts | if true, don't throw on errors, just return an empty list. |
IO_ERROR | if the library cannot be found, or footprint cannot be loaded. |
Reimplemented from PLUGIN.
Definition at line 3195 of file legacy_plugin.cpp.
References cacheLib(), From_UTF8(), init(), m_cache, LP_CACHE::m_footprints, THROW_IO_ERROR, and IO_ERROR::What().
|
virtualinherited |
Check for the existence of a footprint.
Reimplemented in CADSTAR_PCB_ARCHIVE_PLUGIN, and PCB_PLUGIN.
Definition at line 210 of file plugin.cpp.
References PLUGIN::FootprintLoad().
Referenced by FP_LIB_TABLE::FootprintExists().
|
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.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
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 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 finding the library, or creating it. |
Reimplemented in PCB_PLUGIN.
Definition at line 242 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by PCB_BASE_EDIT_FRAME::createNewLibrary(), and FP_LIB_TABLE::FootprintLibCreate().
|
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.
aLibraryPath | is a locator for the "library", usually a directory or file which will contain footprints. |
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 from PLUGIN.
Definition at line 3248 of file legacy_plugin.cpp.
References _, m_cache, LP_CACHE::m_lib_path, and THROW_IO_ERROR.
|
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.
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 PLUGIN, which has been avoided to date. |
Reimplemented in EAGLE_PLUGIN.
Definition at line 263 of file plugin.cpp.
References _.
Referenced by EAGLE_PLUGIN::FootprintLibOptions(), and FP_GRID_TRICKS::optionsEditor().
|
overridevirtual |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN knows about.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprintName | is the name of the footprint to load. |
aProperties | is 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 |
IO_ERROR | if 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 3223 of file legacy_plugin.cpp.
References cacheLib(), copy, init(), m_cache, LP_CACHE::m_footprints, and TO_UTF8.
|
virtualinherited |
Write aFootprint to an existing library located at aLibraryPath.
If a footprint by the same name already exists, it is replaced.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aFootprint | is what to store in the library. The caller continues to own the footprint after this call. |
aProperties | is 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. |
IO_ERROR | if there is a problem saving. |
Reimplemented in PCB_PLUGIN.
Definition at line 226 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by PANEL_FP_LIB_TABLE::convertLibrary(), PCB_EDIT_FRAME::ExportFootprintsToLibrary(), FP_LIB_TABLE::FootprintSave(), PCB_EDIT_FRAME::OpenProjectFiles(), and FOOTPRINT_EDIT_FRAME::SaveLibraryAs().
|
inlineoverridevirtual |
Returns board file description for the PLUGIN.
Reimplemented from PLUGIN.
Definition at line 72 of file legacy_plugin.h.
References _HKI.
|
virtualinherited |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
Reimplemented in GPCB_PLUGIN, and PCB_PLUGIN.
Definition at line 201 of file plugin.cpp.
References PLUGIN::FootprintLoad().
Referenced by PANEL_FP_LIB_TABLE::convertLibrary(), FP_LIB_TABLE::GetEnumeratedFootprint(), and FOOTPRINT_EDIT_FRAME::SaveLibraryAs().
|
inlineoverridevirtual |
Returns footprint file description for the PLUGIN.
Reimplemented from PLUGIN.
Definition at line 82 of file legacy_plugin.h.
References GetFootprintLibDesc().
|
inlineoverridevirtual |
Returns footprint library description for the PLUGIN.
Reimplemented from PLUGIN.
Definition at line 77 of file legacy_plugin.h.
References _HKI.
Referenced by GetFootprintFileDesc().
|
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.
Reimplemented in CADSTAR_PCB_ARCHIVE_PLUGIN, EAGLE_PLUGIN, EASYEDA_PLUGIN, EASYEDAPRO_PLUGIN, and IPC2581_PLUGIN.
Definition at line 152 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by PCB_EDIT_FRAME::OpenProjectFiles().
|
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 3177 of file legacy_plugin.cpp.
References LP_CACHE::GetTimestamp().
|
inlineprotected |
Definition at line 123 of file legacy_plugin.h.
References m_netCodes.
Referenced by loadPAD(), loadTrackList(), and loadZONE_CONTAINER().
|
staticprotected |
Definition at line 630 of file legacy_plugin.cpp.
References _, LINE_READER::GetSource(), LINE_READER::Line(), LINE_READER::ReadLine(), TESTLINE, and THROW_IO_ERROR.
Referenced by CanReadBoard(), and LoadBoard().
|
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.
aLibraryPath | is a path of the footprint file. |
aFootprintNameOut | is the name output of the loaded footprint. |
aProperties | is 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. |
IO_ERROR | if the footprint cannot be found or read. |
Reimplemented in GPCB_PLUGIN, and PCB_PLUGIN.
Definition at line 179 of file plugin.cpp.
References _, PLUGIN::FootprintEnumerate(), and PLUGIN::FootprintLoad().
Referenced by FOOTPRINT_EDIT_FRAME::ImportFootprint().
|
protected |
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
Definition at line 2910 of file legacy_plugin.cpp.
References biuToDisk, diskToBiu, EDA_IU_SCALE::IU_PER_MILS, EDA_IU_SCALE::IU_PER_MM, m_board, m_cu_count, m_loading_format_version, m_props, m_showLegacySegmentZoneWarning, and pcbIUScale.
Referenced by FootprintEnumerate(), FootprintLoad(), IsFootprintLibWritable(), LEGACY_PLUGIN(), and LoadBoard().
|
overridevirtual |
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 from PLUGIN.
Definition at line 3274 of file legacy_plugin.cpp.
References cacheLib(), init(), m_cache, and LP_CACHE::m_writable.
|
static |
Definition at line 310 of file legacy_plugin.cpp.
References ADHESIVE_N_BACK, ADHESIVE_N_FRONT, B_Adhes, B_Cu, B_Mask, B_Paste, B_SilkS, Cmts_User, COMMENT_N, DRAW_N, Dwgs_User, ECO1_N, Eco1_User, ECO2_N, Eco2_User, Edge_Cuts, EDGE_N, F_Adhes, F_Cu, F_Mask, F_Paste, F_SilkS, LAYER_N_BACK, LAYER_N_FRONT, SILKSCREEN_N_BACK, SILKSCREEN_N_FRONT, SOLDERMASK_N_BACK, SOLDERMASK_N_FRONT, SOLDERPASTE_N_BACK, and SOLDERPASTE_N_FRONT.
Referenced by leg_mask2new(), loadDIMENSION(), loadFOOTPRINT(), loadFP_SHAPE(), loadMODULE_TEXT(), loadPCB_LINE(), loadPCB_TARGET(), loadPCB_TEXT(), loadSETUP(), loadTrackList(), and loadZONE_CONTAINER().
|
static |
Definition at line 366 of file legacy_plugin.cpp.
References ALL_CU_LAYERS, LSET::AllCuMask(), and leg_layer2new().
Referenced by loadGENERAL(), and loadPAD().
|
protected |
Definition at line 1798 of file legacy_plugin.cpp.
References FP_3DMODEL::m_Filename, FP_3DMODEL::m_Offset, m_reader, FP_3DMODEL::m_Rotation, FP_3DMODEL::m_Scale, FOOTPRINT::Models(), ReadDelimitedText(), READLINE, SZ, TESTLINE, THROW_IO_ERROR, VECTOR3< T >::x, VECTOR3< T >::y, and VECTOR3< T >::z.
Referenced by loadFOOTPRINT().
|
protected |
Definition at line 523 of file legacy_plugin.cpp.
References BOARD::Add(), checkpoint(), loadDIMENSION(), loadFOOTPRINT(), loadGENERAL(), loadNETCLASS(), loadNETINFO_ITEM(), loadPCB_LINE(), loadPCB_TARGET(), loadPCB_TEXT(), loadSETUP(), loadSHEET(), loadTrackList(), loadZONE_CONTAINER(), m_board, m_reader, NOT_USED, LIB_ID::Parse(), PCB_TRACE_T, READLINE, ReplaceIllegalFileNameChars(), StrPurge(), SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by LoadBoard().
|
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.
aFileName | is the name of the file to use as input and may be foreign in nature or native in nature. |
aAppendToMe | is an existing BOARD to append to, but if NULL then this means "do not append, rather load anew". |
aProperties | is 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. |
aProject | is the optional PROJECT object primarily used by third party importers. |
aProgressReporter | an optional progress reporter |
aLineCount | a line count (necessary if a progress reporter is supplied) |
IO_ERROR | if 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 468 of file legacy_plugin.cpp.
References _, getVersion(), ignore_unused(), init(), PROGRESS_REPORTER::KeepRefreshing(), loadAllSections(), m_board, m_lineCount, m_loading_format_version, m_progressReporter, m_reader, FILE_LINE_READER::ReadLine(), PROGRESS_REPORTER::Report(), FILE_LINE_READER::Rewind(), BOARD::SetFileFormatVersionAtLoad(), BOARD::SetFileName(), and THROW_IO_ERROR.
|
protected |
Definition at line 2658 of file legacy_plugin.cpp.
References BOARD::Add(), biuParse(), degParse(), delims, From_UTF8(), ignore_unused(), intParse(), leg_layer2new(), m_board, m_cu_count, m_reader, PCB_DIM_ALIGNED_T, ReadDelimitedText(), READLINE, SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by loadAllSections().
|
protected |
Definition at line 1195 of file legacy_plugin.cpp.
References _, FOOTPRINT::Add(), biuParse(), delims, FP_EXCLUDE_FROM_BOM, FP_EXCLUDE_FROM_POS_FILES, FP_SMD, FP_THROUGH_HOLE, From_UTF8(), FOOTPRINT::GetFPID(), LIB_ID::GetLibItemName(), hexParse(), ignore_unused(), intParse(), leg_layer2new(), load3D(), loadFP_SHAPE(), loadMODULE_TEXT(), loadPAD(), m_cu_count, m_reader, EDA_ITEM::m_Uuid, PCB_LEGACY_TEXT_is_REFERENCE, PCB_LEGACY_TEXT_is_VALUE, READLINE, FOOTPRINT::Reference(), FOOTPRINT::SetAttributes(), FOOTPRINT::SetIsPlaced(), FOOTPRINT::SetKeywords(), BOARD_ITEM::SetLayer(), FOOTPRINT::SetLibDescription(), FOOTPRINT::SetLocalClearance(), FOOTPRINT::SetLocalSolderMaskMargin(), FOOTPRINT::SetLocalSolderPasteMargin(), FOOTPRINT::SetLocalSolderPasteMarginRatio(), FOOTPRINT::SetLocked(), FOOTPRINT::SetOrientation(), FOOTPRINT::SetPath(), FOOTPRINT::SetPosition(), FOOTPRINT::SetZoneConnection(), StrPurge(), SZ, TENTHS_OF_A_DEGREE_T, TESTLINE, TESTSUBSTR, text, THROW_IO_ERROR, FOOTPRINT::Value(), and UTF8::wx_str().
Referenced by loadAllSections(), and LP_CACHE::LoadModules().
|
protected |
Definition at line 1591 of file legacy_plugin.cpp.
References _, FOOTPRINT::Add(), biuParse(), degParse(), FIRST_NON_COPPER_LAYER, FOOTPRINT::GetFPID(), LIB_ID::GetLibItemName(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), intParse(), LAST_NON_COPPER_LAYER, leg_layer2new(), LINE_READER::Line(), LINE_READER::LineNumber(), m_cu_count, m_error, m_reader, READLINE, SILKSCREEN_N_FRONT, SZ, TESTLINE, THROW_IO_ERROR, and UTF8::wx_str().
Referenced by loadFOOTPRINT().
|
protected |
Definition at line 664 of file legacy_plugin.cpp.
References ALL_CU_LAYERS, biuParse(), delims, diskToBiu, BOARD::GetDesignSettings(), hexParse(), intParse(), EDA_IU_SCALE::IU_PER_MM, layerMaskCountSet(), leg_mask2new(), m_board, m_cu_count, m_netCodes, m_reader, pcbIUScale, READLINE, BOARD_DESIGN_SETTINGS::SetBoardThickness(), BOARD::SetCopperLayerCount(), BOARD::SetEnabledLayers(), BOARD::SetVisibleLayers(), SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by loadAllSections().
|
protected |
Definition at line 1715 of file legacy_plugin.cpp.
References biuParse(), ConvertToNewOverbarNotation(), degParse(), delims, FIRST_LAYER, horizJustify(), intParse(), LAST_NON_COPPER_LAYER, LAYER_N_BACK, LAYER_N_FRONT, leg_layer2new(), LINE_READER::Line(), m_cu_count, m_field, m_reader, PCB_LEGACY_TEXT_is_DIVERS, PCB_LEGACY_TEXT_is_REFERENCE, PCB_LEGACY_TEXT_is_VALUE, ReadDelimitedText(), BOARD_ITEM::SetFPRelativePosition(), EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetItalic(), BOARD_ITEM::SetLayer(), EDA_TEXT::SetMirrored(), EDA_TEXT::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), EDA_TEXT::SetVertJustify(), EDA_TEXT::SetVisible(), SILKSCREEN_N_BACK, SILKSCREEN_N_FRONT, and vertJustify().
Referenced by loadFOOTPRINT().
|
protected |
Definition at line 2289 of file legacy_plugin.cpp.
References _, biuParse(), ConvertToNewOverbarNotation(), CTX_NETCLASS, From_UTF8(), BOARD::GetDesignSettings(), m_board, m_error, BOARD_DESIGN_SETTINGS::m_NetSettings, m_reader, ReadDelimitedText(), READLINE, SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by loadAllSections().
|
protected |
Definition at line 1958 of file legacy_plugin.cpp.
References BOARD::Add(), ConvertToNewOverbarNotation(), BOARD::FindNet(), From_UTF8(), NETINFO_ITEM::GetNetCode(), intParse(), m_board, m_netCodes, m_reader, ReadDelimitedText(), READLINE, SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by loadAllSections().
|
protected |
Definition at line 1370 of file legacy_plugin.cpp.
References _, FOOTPRINT::Add(), biuParse(), ConvertToNewOverbarNotation(), degParse(), delims, BOARD::FindNet(), From_UTF8(), FOOTPRINT::GetFPID(), LIB_ID::GetLibItemName(), getNetCode(), LINE_READER::GetSource(), hexParse(), intParse(), isSpace(), leg_mask2new(), LINE_READER::LineNumber(), m_board, m_cu_count, m_error, m_loading_format_version, m_reader, pad, PAD_DRILL_SHAPE_CIRCLE, PAD_DRILL_SHAPE_OBLONG, ReadDelimitedText(), READLINE, StrPurge(), SZ, TESTLINE, THROW_IO_ERROR, UTF8::wx_str(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by loadFOOTPRINT().
|
protected |
Definition at line 1838 of file legacy_plugin.cpp.
References BOARD::Add(), biuParse(), degParse(), delims, FIRST_NON_COPPER_LAYER, hexParse(), ignore_unused(), intParse(), LAST_NON_COPPER_LAYER, leg_layer2new(), m_board, m_cu_count, m_reader, READLINE, SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by loadAllSections().
|
protected |
Definition at line 2797 of file legacy_plugin.cpp.
References BOARD::Add(), biuParse(), delims, FIRST_NON_COPPER_LAYER, intParse(), LAST_NON_COPPER_LAYER, leg_layer2new(), m_board, m_cu_count, m_reader, EDA_ITEM::m_Uuid, READLINE, SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by loadAllSections().
|
protected |
Definition at line 2026 of file legacy_plugin.cpp.
References BOARD::Add(), biuParse(), ConvertToNewOverbarNotation(), degParse(), delims, F_Cu, FIRST_COPPER_LAYER, FIRST_NON_COPPER_LAYER, From_UTF8(), EDA_TEXT::GetHorizJustify(), EDA_TEXT::GetText(), GR_TEXT_H_ALIGN_CENTER, horizJustify(), intParse(), is_leg_copperlayer_valid(), LAST_NON_COPPER_LAYER, leg_layer2new(), m_board, m_cu_count, m_reader, EDA_ITEM::m_Uuid, ReadDelimitedText(), READLINE, EDA_TEXT::SetHorizJustify(), EDA_TEXT::SetItalic(), BOARD_ITEM::SetLayer(), EDA_TEXT::SetMirrored(), EDA_TEXT::SetText(), EDA_TEXT::SetTextAngle(), EDA_TEXT::SetTextPos(), EDA_TEXT::SetTextSize(), EDA_TEXT::SetTextThickness(), EDA_TEXT::SetVertJustify(), SZ, TESTLINE, text, THROW_IO_ERROR, vertJustify(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by loadAllSections().
|
protected |
Definition at line 907 of file legacy_plugin.cpp.
References biuParse(), delims, From_UTF8(), BOARD::GetDesignSettings(), LINE_READER::GetSource(), BOARD::GetZoneSettings(), hexParse(), intParse(), LAYER_CLASS_COPPER, LAYER_CLASS_EDGES, LAYER_CLASS_OTHERS, LAYER_CLASS_SILK, leg_layer2new(), m_board, m_cu_count, BOARD::m_LegacyDesignSettingsLoaded, BOARD::m_LegacyNetclassesLoaded, BOARD_DESIGN_SETTINGS::m_LineThickness, BOARD_DESIGN_SETTINGS::m_MicroViasMinDrill, BOARD_DESIGN_SETTINGS::m_MicroViasMinSize, BOARD_DESIGN_SETTINGS::m_MinThroughDrill, BOARD_DESIGN_SETTINGS::m_NetSettings, BOARD_DESIGN_SETTINGS::m_Pad_Master, m_reader, BOARD_DESIGN_SETTINGS::m_SolderMaskExpansion, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, BOARD_DESIGN_SETTINGS::m_SolderPasteMargin, BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio, BOARD_DESIGN_SETTINGS::m_TextSize, BOARD_DESIGN_SETTINGS::m_TextThickness, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, BOARD_DESIGN_SETTINGS::m_TrackWidthList, BOARD_DESIGN_SETTINGS::m_ViasDimensionsList, BOARD_DESIGN_SETTINGS::m_ViasMinSize, ZONE_SETTINGS::m_ZoneClearance, PCB_PLOT_PARAMS::Parse(), LAYER::ParseType(), READLINE, GAL_SET::set(), BOARD_DESIGN_SETTINGS::SetAuxOrigin(), BOARD_DESIGN_SETTINGS::SetGridOrigin(), BOARD::SetLayerName(), BOARD::SetLayerType(), BOARD::SetPlotOptions(), BOARD::SetVisibleElements(), BOARD::SetZoneSettings(), SZ, TESTLINE, and TESTSUBSTR.
Referenced by loadAllSections().
|
protected |
Definition at line 776 of file legacy_plugin.cpp.
References _, PAGE_INFO::Custom, delims, From_UTF8(), intParse(), LINE_READER::LineNumber(), m_board, m_error, m_reader, ReadDelimitedText(), READLINE, TITLE_BLOCK::SetComment(), TITLE_BLOCK::SetCompany(), TITLE_BLOCK::SetDate(), PAGE_INFO::SetHeightMils(), BOARD::SetPageSettings(), PAGE_INFO::SetPortrait(), TITLE_BLOCK::SetRevision(), TITLE_BLOCK::SetTitle(), BOARD::SetTitleBlock(), PAGE_INFO::SetType(), PAGE_INFO::SetWidthMils(), SZ, TESTLINE, and THROW_IO_ERROR.
Referenced by loadAllSections().
|
protected |
Read a list of segments (Tracks and Vias, or Segzones)
aStructType | is either PCB_TRACE_T to indicate tracks and vias, or NOT_USED to indicate oldschool zone segments (which are discarded). |
Definition at line 2136 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(), SZ, TESTLINE, THROW_IO_ERROR, and via.
Referenced by loadAllSections().
|
protected |
Definition at line 2380 of file legacy_plugin.cpp.
References _, BOARD::Add(), SHAPE_POLY_SET::Append(), ARC_HIGH_DEF, biuParse(), delims, ZONE::GetDefaultHatchPitch(), getNetCode(), ignore_unused(), SHAPE_POLY_SET::InflateWithLinkedHoles(), intParse(), leg_layer2new(), m_board, m_cu_count, m_error, m_reader, m_showLegacySegmentZoneWarning, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, ReadDelimitedText(), READLINE, ZONE_SETTINGS::SMOOTHING_LAST, SZ, TESTLINE, THROW_IO_ERROR, and NETINFO_LIST::UNCONNECTED.
Referenced by loadAllSections().
|
inlineoverridevirtual |
Return a brief hard coded name for this PLUGIN.
Implements PLUGIN.
Definition at line 67 of file legacy_plugin.h.
|
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.
aLibraryPath | is a locator for the "library", usually a directory, file, or URL containing several footprints. |
aProperties | is 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. |
IO_ERROR | if there is an error prefetching the library. |
Definition at line 174 of file plugin.cpp.
Referenced by FP_LIB_TABLE::PrefetchLib().
|
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.
aFileName | is the name of a file to save to on disk. |
aBoard | is 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. |
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. |
aProgressReporter | an optional progress reporter |
IO_ERROR | if there is a problem saving or exporting. |
Reimplemented in CLIPBOARD_IO, IPC2581_PLUGIN, and PCB_PLUGIN.
Definition at line 158 of file plugin.cpp.
References NOT_IMPLEMENTED.
Referenced by PCB_EDIT_FRAME::GenIPC2581File(), IO_MGR::Save(), PCB_EDIT_FRAME::SavePcbCopy(), and PCB_EDIT_FRAME::SavePcbFile().
|
inlinevirtualinherited |
Registers a KIDIALOG callback for collecting info from the user.
Definition at line 315 of file io_mgr.h.
Referenced by PCB_CONTROL::AppendBoard(), and PCB_EDIT_FRAME::OpenProjectFiles().
|
inline |
Definition at line 108 of file legacy_plugin.h.
References m_reader.
Referenced by LP_CACHE::LoadModules().
|
friend |
Definition at line 61 of file legacy_plugin.h.
Referenced by cacheLib().
|
protected |
convert from BIUs to disk engineering units with this scale factor
Definition at line 210 of file legacy_plugin.h.
Referenced by init().
|
protected |
convert from disk engineering units to BIUs
with this scale factor
Definition at line 213 of file legacy_plugin.h.
Referenced by biuParse(), init(), loadGENERAL(), and LP_CACHE::ReadAndVerifyHeader().
|
protected |
which BOARD, no ownership here
Definition at line 193 of file legacy_plugin.h.
Referenced by init(), loadAllSections(), LoadBoard(), loadDIMENSION(), loadGENERAL(), LP_CACHE::LoadModules(), loadNETCLASS(), loadNETINFO_ITEM(), loadPAD(), loadPCB_LINE(), loadPCB_TARGET(), loadPCB_TEXT(), loadSETUP(), loadSHEET(), loadTrackList(), and loadZONE_CONTAINER().
|
protected |
Definition at line 205 of file legacy_plugin.h.
Referenced by cacheLib(), FootprintEnumerate(), FootprintLibDelete(), FootprintLoad(), IsFootprintLibWritable(), and ~LEGACY_PLUGIN().
|
protected |
Definition at line 190 of file legacy_plugin.h.
Referenced by init(), loadDIMENSION(), loadFOOTPRINT(), loadFP_SHAPE(), loadGENERAL(), loadMODULE_TEXT(), loadPAD(), loadPCB_LINE(), loadPCB_TARGET(), loadPCB_TEXT(), loadSETUP(), loadTrackList(), and loadZONE_CONTAINER().
|
protected |
for throwing exceptions
Definition at line 192 of file legacy_plugin.h.
Referenced by biuParse(), degParse(), loadFP_SHAPE(), loadNETCLASS(), loadPAD(), loadSHEET(), and loadZONE_CONTAINER().
|
protected |
reused to stuff FOOTPRINT fields.
Definition at line 203 of file legacy_plugin.h.
Referenced by loadMODULE_TEXT().
|
protected |
no ownership here.
Definition at line 201 of file legacy_plugin.h.
|
protected |
Definition at line 197 of file legacy_plugin.h.
Referenced by checkpoint().
|
protected |
for progress reporting
Definition at line 198 of file legacy_plugin.h.
Referenced by checkpoint(), and LoadBoard().
|
protected |
which BOARD_FORMAT_VERSION am I Load()ing?
Definition at line 204 of file legacy_plugin.h.
Referenced by init(), LoadBoard(), and loadPAD().
|
protected |
net codes mapping for boards being loaded
Definition at line 208 of file legacy_plugin.h.
Referenced by getNetCode(), loadGENERAL(), and loadNETINFO_ITEM().
|
protected |
may be NULL, no ownership
Definition at line 196 of file legacy_plugin.h.
Referenced by checkpoint(), and LoadBoard().
|
protected |
passed via Save() or Load(), no ownership,
may be NULL.
Definition at line 194 of file legacy_plugin.h.
Referenced by init().
|
protected |
no ownership here.
Definition at line 200 of file legacy_plugin.h.
Referenced by biuParse(), checkpoint(), degParse(), load3D(), loadAllSections(), LoadBoard(), loadDIMENSION(), loadFOOTPRINT(), loadFP_SHAPE(), loadGENERAL(), loadMODULE_TEXT(), loadNETCLASS(), loadNETINFO_ITEM(), loadPAD(), loadPCB_LINE(), loadPCB_TARGET(), loadPCB_TEXT(), loadSETUP(), loadSHEET(), loadTrackList(), loadZONE_CONTAINER(), and SetReader().
|
protected |
Definition at line 206 of file legacy_plugin.h.
Referenced by init(), and loadZONE_CONTAINER().