1#ifndef LEGACY_PLUGIN_H_
2#define LEGACY_PLUGIN_H_
40#define FOOTPRINT_LIBRARY_HEADER "PCBNEW-LibModule-V1"
41#define FOOTPRINT_LIBRARY_HEADER_CNT 18
69 return wxT(
"KiCad-Legacy" );
84 bool CanReadBoard(
const wxString& aFileName )
const override;
96 bool aKeepUUID =
false,
125 if( (
unsigned int) aNetCode <
m_netCodes.size() )
142 BIU biuParse(
const char* aValue,
const char** nptrptr =
nullptr );
187 void cacheLib(
const wxString& aLibraryPath );
Information pertinent to a Pcbnew printed circuit board.
A PLUGIN derivation which could possibly be put into a DLL/DSO.
unsigned m_lastProgressLine
int m_loading_format_version
which BOARD_FORMAT_VERSION am I Load()ing?
int getNetCode(int aNetCode)
bool CanReadFootprint(const wxString &aFileName) const override
Checks if this PLUGIN can read a footprint from specified file or directory.
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 o...
static LSET leg_mask2new(int cu_count, unsigned aMask)
void loadFP_SHAPE(FOOTPRINT *aFootprint)
void init(const STRING_UTF8_MAP *aProperties)
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
double diskToBiu
convert from disk engineering units to BIUs
PLUGIN_FILE_DESC GetFootprintLibDesc() const override
Returns footprint library description for the PLUGIN.
void loadTrackList(int aStructType)
Read a list of segments (Tracks and Vias, or Segzones)
bool m_showLegacySegmentZoneWarning
wxString m_field
reused to stuff FOOTPRINT fields.
static int getVersion(LINE_READER *aReader)
const wxString PluginName() const override
Return a brief hard coded name for this PLUGIN.
static PCB_LAYER_ID leg_layer2new(int cu_count, int aLayerNum)
PROGRESS_REPORTER * m_progressReporter
may be NULL, no ownership
double biuToDisk
convert from BIUs to disk engineering units with this scale factor
unsigned m_lineCount
for progress reporting
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.
void loadFOOTPRINT(FOOTPRINT *aFootprint)
PLUGIN_FILE_DESC GetFootprintFileDesc() const override
Returns footprint file description for the PLUGIN.
void loadPAD(FOOTPRINT *aFootprint)
void checkpoint()
Converts net code using the mapping table if available, otherwise returns unchanged net code.
FILE * m_fp
no ownership here.
PLUGIN_FILE_DESC GetBoardFileDesc() const override
Returns board file description for the PLUGIN.
void loadAllSections(bool doAppend)
bool IsFootprintLibWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
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,...
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 ...
void load3D(FOOTPRINT *aFootprint)
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.
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
void loadZONE_CONTAINER()
wxString m_error
for throwing exceptions
std::vector< int > m_netCodes
net codes mapping for boards being loaded
const STRING_UTF8_MAP * m_props
passed via Save() or Load(), no ownership,
bool CanReadBoard(const wxString &aFileName) const override
Checks if this PLUGIN can read the specified board file.
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 PL...
LINE_READER * m_reader
no ownership here.
void SetReader(LINE_READER *aReader)
void loadMODULE_TEXT(PCB_TEXT *aText)
void cacheLib(const wxString &aLibraryPath)
we only cache one footprint library for now, this determines which one.
BOARD * m_board
which BOARD, no ownership here
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
LSET is a set of PCB_LAYER_IDs.
A collection of nets and the parameters used to route or test these nets.
Handle the data for a net.
A base class that BOARD loading and saving plugins should derive from.
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
A name/value tuple with unique names and optional values.
Handle a list of polygons defining a copper zone.
PCB_LAYER_ID
A quick note on layer IDs:
The footprint portion of the PLUGIN API, and only for the LEGACY_PLUGIN, so therefore is private to t...
Container that describes file type info.