![]() |
KiCad PCB EDA Suite
|
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files. More...
#include <pcb_plugin.h>
Public Member Functions | |
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... | |
virtual void | Save (const wxString &aFileName, BOARD *aBoard, const PROPERTIES *aProperties=nullptr) override |
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... | |
BOARD * | Load (const wxString &aFileName, BOARD *aAppendToMe, const PROPERTIES *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... | |
BOARD * | DoLoad (LINE_READER &aReader, BOARD *aAppendToMe, const PROPERTIES *aProperties, PROGRESS_REPORTER *aProgressReporter, unsigned aLineCount) |
void | FootprintEnumerate (wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const PROPERTIES *aProperties=nullptr) override |
Return a list of footprint names contained within the library at aLibraryPath. More... | |
const FOOTPRINT * | GetEnumeratedFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=nullptr) override |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management. More... | |
bool | FootprintExists (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=nullptr) override |
Check for the existence of a footprint. More... | |
FOOTPRINT * | FootprintLoad (const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const PROPERTIES *aProperties=nullptr) override |
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PLUGIN knows about. More... | |
void | FootprintSave (const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const PROPERTIES *aProperties=nullptr) override |
Write aFootprint to an existing library located at aLibraryPath. More... | |
void | FootprintDelete (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties=nullptr) override |
Delete aFootprintName from the library at aLibraryPath. More... | |
long long | GetLibraryTimestamp (const wxString &aLibraryPath) const override |
Generate a timestamp representing all the files in the library (including the library directory). More... | |
void | FootprintLibCreate (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) override |
Create a new empty footprint library at aLibraryPath empty. More... | |
bool | FootprintLibDelete (const wxString &aLibraryPath, const PROPERTIES *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... | |
bool | IsFootprintLibWritable (const wxString &aLibraryPath) override |
Return true if the library at aLibraryPath is writable. More... | |
PCB_PLUGIN (int aControlFlags=CTL_FOR_BOARD) | |
virtual | ~PCB_PLUGIN () |
void | Format (const BOARD_ITEM *aItem, int aNestLevel=0) const |
Output aItem to aFormatter in s-expression format. More... | |
std::string | GetStringOutput (bool doClear) |
void | SetOutputFormatter (OUTPUTFORMATTER *aFormatter) |
BOARD_ITEM * | Parse (const wxString &aClipboardSourceInput) |
virtual std::vector< FOOTPRINT * > | GetImportedCachedLibraryFootprints () |
Return a container with the cached library footprints generated in the last call to Load. More... | |
virtual void | PrefetchLib (const wxString &aLibraryPath, const PROPERTIES *aProperties=nullptr) |
If possible, prefetches the specified library (e.g. More... | |
virtual void | FootprintLibOptions (PROPERTIES *aListToAppendTo) const |
Append supported PLUGIN options to aListToAppenTo along with internationalized descriptions. More... | |
Protected Member Functions | |
void | validateCache (const wxString &aLibraryPath, bool checkModified=true) |
const FOOTPRINT * | getFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const PROPERTIES *aProperties, bool checkModified) |
void | init (const PROPERTIES *aProperties) |
void | formatSetup (const BOARD *aBoard, int aNestLevel=0) const |
formats the board setup information More... | |
void | formatGeneral (const BOARD *aBoard, int aNestLevel=0) const |
formats the General section of the file More... | |
void | formatBoardLayers (const BOARD *aBoard, int aNestLevel=0) const |
formats the board layer information More... | |
void | formatNetInformation (const BOARD *aBoard, int aNestLevel=0) const |
formats the Nets and Netclasses More... | |
void | formatProperties (const BOARD *aBoard, int aNestLevel=0) const |
formats the Nets and Netclasses More... | |
void | formatHeader (const BOARD *aBoard, int aNestLevel=0) const |
writes everything that comes before the board_items, like settings and layers etc More... | |
Protected Attributes | |
wxString | m_error |
for throwing exceptions More... | |
BOARD * | m_board |
which BOARD, no ownership here More... | |
const PROPERTIES * | m_props |
passed via Save() or Load(), no ownership, may be NULL. More... | |
FP_CACHE * | m_cache |
Footprint library cache. More... | |
LINE_READER * | m_reader |
no ownership here. More... | |
wxString | m_filename |
for saves only, name is in m_reader for loads More... | |
STRING_FORMATTER | m_sf |
OUTPUTFORMATTER * | m_out |
output any Format()s to this, no ownership More... | |
int | m_ctl |
PCB_PARSER * | m_parser |
NETINFO_MAPPING * | m_mapping |
mapping for net codes, so only not empty net codes are stored with consecutive integers as net codes More... | |
Private Member Functions | |
void | format (const BOARD *aBoard, int aNestLevel=0) const |
void | format (const PCB_DIMENSION_BASE *aDimension, int aNestLevel=0) const |
void | format (const FP_SHAPE *aFPShape, int aNestLevel=0) const |
void | format (const PCB_GROUP *aGroup, int aNestLevel=0) const |
void | format (const PCB_SHAPE *aSegment, int aNestLevel=0) const |
void | format (const PCB_TARGET *aTarget, int aNestLevel=0) const |
void | format (const FOOTPRINT *aFootprint, int aNestLevel=0) const |
void | format (const PAD *aPad, int aNestLevel=0) const |
void | format (const PCB_TEXT *aText, int aNestLevel=0) const |
void | format (const FP_TEXT *aText, int aNestLevel=0) const |
void | format (const PCB_TRACK *aTrack, int aNestLevel=0) const |
void | format (const ZONE *aZone, int aNestLevel=0) const |
void | formatLayer (const BOARD_ITEM *aItem) const |
void | formatLayers (LSET aLayerMask, int aNestLevel=0) const |
Friends | |
class | FP_CACHE |
A PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
Definition at line 141 of file pcb_plugin.h.
PCB_PLUGIN::PCB_PLUGIN | ( | int | aControlFlags = CTL_FOR_BOARD | ) |
Definition at line 2271 of file pcb_plugin.cpp.
|
virtual |
Definition at line 2282 of file pcb_plugin.cpp.
BOARD * PCB_PLUGIN::DoLoad | ( | LINE_READER & | aReader, |
BOARD * | aAppendToMe, | ||
const PROPERTIES * | aProperties, | ||
PROGRESS_REPORTER * | aProgressReporter, | ||
unsigned | aLineCount | ||
) |
Definition at line 2320 of file pcb_plugin.cpp.
References _, PCB_PARSER::GetRequiredVersion(), init(), PCB_PARSER::IsTooRecent(), m_parser, PCB_PARSER::Parse(), PCB_PARSER::SetBoard(), PCB_PARSER::SetLineReader(), PCB_PARSER::SetProgressReporter(), and THROW_PARSE_ERROR.
Referenced by PANEL_PCBNEW_COLOR_SETTINGS::createPreviewItems(), and Load().
|
overridevirtual |
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 from PLUGIN.
Definition at line 2578 of file pcb_plugin.cpp.
References _, Format(), init(), FP_CACHE::IsWritable(), m_cache, FP_CACHE::Remove(), THROW_IO_ERROR, and validateCache().
|
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 2379 of file pcb_plugin.cpp.
References FP_CACHE::GetFootprints(), init(), m_cache, THROW_IO_ERROR, validateCache(), and IO_ERROR::What().
|
overridevirtual |
Check for the existence of a footprint.
Reimplemented from PLUGIN.
Definition at line 2444 of file pcb_plugin.cpp.
References KiCadFootprintFileExtension.
|
overridevirtual |
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 from PLUGIN.
Definition at line 2604 of file pcb_plugin.cpp.
References _, Format(), FP_CACHE, init(), m_cache, FP_CACHE::Save(), and THROW_IO_ERROR.
|
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 2622 of file pcb_plugin.cpp.
References _, Format(), FP_CACHE::IsPath(), KiCadFootprintFileExtension, m_cache, THROW_IO_ERROR, and traceKicadPcbPlugin.
|
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 147 of file plugin.cpp.
References _.
Referenced by EAGLE_PLUGIN::FootprintLibOptions().
|
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 2460 of file pcb_plugin.cpp.
References FOOTPRINT::Clone(), copy, FOOTPRINT::Duplicate(), and getFootprint().
|
overridevirtual |
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 from PLUGIN.
Definition at line 2484 of file pcb_plugin.cpp.
References _, FOOTPRINT::Clone(), CTL_FOR_LIBRARY, FP_CACHE::Exists(), F_Cu, FOOTPRINT::Flip(), Format(), FP_CACHE::GetFootprints(), FOOTPRINT::GetFPID(), BOARD_ITEM::GetLayer(), LIB_ID::GetLibItemName(), FOOTPRINT::GetPosition(), init(), FP_CACHE::IsWritable(), KiCadFootprintFileExtension, Kiface(), m_cache, m_ctl, PCBNEW_SETTINGS::m_FlipLeftRight, WX_FILENAME::ResolvePossibleSymlinks(), FP_CACHE::Save(), FOOTPRINT::SetOrientation(), EDA_ITEM::SetParent(), THROW_IO_ERROR, traceKicadPcbPlugin, and validateCache().
void PCB_PLUGIN::Format | ( | const BOARD_ITEM * | aItem, |
int | aNestLevel = 0 |
||
) | const |
Output aItem to aFormatter in s-expression format.
aItem | A pointer the an BOARD_ITEM object to format. |
aNestLevel | The indentation nest level. |
IO_ERROR | on write error. |
Definition at line 400 of file pcb_plugin.cpp.
References format(), EDA_ITEM::GetClass(), PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_PAD_T, PCB_SHAPE_T, PCB_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, and EDA_ITEM::Type().
Referenced by FOOTPRINT_EDIT_FRAME::ExportFootprint(), format(), CLIPBOARD_IO::Save(), FP_CACHE::Save(), Save(), and CLIPBOARD_IO::SaveSelection().
|
private |
Definition at line 660 of file pcb_plugin.cpp.
References BOARD::Drawings(), BOARD::Footprints(), Format(), formatHeader(), group, BOARD::Groups(), m_out, OUTPUTFORMATTER::Print(), BOARD::Tracks(), and BOARD::Zones().
Referenced by Format().
|
private |
Definition at line 707 of file pcb_plugin.cpp.
References KIID::AsString(), Format(), FormatInternalUnits(), formatLayer(), PCB_DIMENSION_BASE::GetArrowLength(), PCB_DIMENSION_BASE::GetEnd(), PCB_DIM_ALIGNED::GetExtensionHeight(), PCB_DIMENSION_BASE::GetExtensionOffset(), PCB_DIM_ALIGNED::GetHeight(), PCB_DIMENSION_BASE::GetKeepTextAligned(), PCB_DIMENSION_BASE::GetLineThickness(), PCB_DIMENSION_BASE::GetOverrideText(), PCB_DIMENSION_BASE::GetOverrideTextEnabled(), PCB_DIMENSION_BASE::GetPrecision(), PCB_DIMENSION_BASE::GetPrefix(), PCB_DIMENSION_BASE::GetStart(), PCB_DIMENSION_BASE::GetSuffix(), PCB_DIMENSION_BASE::GetSuppressZeroes(), PCB_DIM_LEADER::GetTextFrame(), PCB_DIMENSION_BASE::GetTextPositionMode(), PCB_DIMENSION_BASE::GetUnitsFormat(), PCB_DIMENSION_BASE::GetUnitsMode(), BOARD_ITEM::IsLocked(), m_out, EDA_ITEM::m_Uuid, ortho, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), PCB_DIMENSION_BASE::Text(), TO_UTF8, and EDA_ITEM::Type().
|
private |
Definition at line 939 of file pcb_plugin.cpp.
References ARC, SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcIndex(), KIID::AsString(), BEZIER, CIRCLE, SHAPE_LINE_CHAIN::CPoint(), FormatInternalUnits(), formatLayer(), FP_SHAPE::GetArcMid0(), FP_SHAPE::GetBezierC1_0(), FP_SHAPE::GetBezierC2_0(), ADVANCED_CFG::GetCfg(), FP_SHAPE::GetEnd0(), EDA_SHAPE::GetPolyShape(), EDA_SHAPE::GetShape(), FP_SHAPE::GetStart0(), EDA_SHAPE::GetWidth(), EDA_SHAPE::IsFilled(), BOARD_ITEM::IsLocked(), EDA_SHAPE::IsPolyShapeValid(), locked, ADVANCED_CFG::m_CompactSave, m_out, EDA_ITEM::m_Uuid, SHAPE_POLY_SET::Outline(), SHAPE_LINE_CHAIN::PointCount(), POLY, OUTPUTFORMATTER::Print(), RECT, SEGMENT, EDA_SHAPE::SHAPE_T_asString(), and TO_UTF8.
|
private |
Definition at line 1769 of file pcb_plugin.cpp.
References KIID::AsString(), PCB_GROUP::GetItems(), PCB_GROUP::GetName(), BOARD_ITEM::IsLocked(), m_out, EDA_ITEM::m_Uuid, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and TO_UTF8.
|
private |
Definition at line 806 of file pcb_plugin.cpp.
References ARC, SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcIndex(), KIID::AsString(), BEZIER, CIRCLE, SHAPE_LINE_CHAIN::CPoint(), FormatInternalUnits(), formatLayer(), SHAPE_ARC::GetArcMid(), EDA_SHAPE::GetArcMid(), EDA_SHAPE::GetBezierC1(), EDA_SHAPE::GetBezierC2(), ADVANCED_CFG::GetCfg(), EDA_SHAPE::GetEnd(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), EDA_SHAPE::GetPolyShape(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), EDA_SHAPE::GetWidth(), EDA_SHAPE::IsFilled(), BOARD_ITEM::IsLocked(), EDA_SHAPE::IsPolyShapeValid(), locked, ADVANCED_CFG::m_CompactSave, m_out, EDA_ITEM::m_Uuid, SHAPE_POLY_SET::Outline(), SHAPE_LINE_CHAIN::PointCount(), POLY, OUTPUTFORMATTER::Print(), RECT, SEGMENT, EDA_SHAPE::SHAPE_T_asString(), TO_UTF8, and UNIMPLEMENTED_FOR.
|
private |
Definition at line 1072 of file pcb_plugin.cpp.
References KIID::AsString(), FormatInternalUnits(), formatLayer(), PCB_TARGET::GetPosition(), PCB_TARGET::GetShape(), PCB_TARGET::GetSize(), PCB_TARGET::GetWidth(), m_out, EDA_ITEM::m_Uuid, OUTPUTFORMATTER::Print(), and TO_UTF8.
|
private |
Definition at line 1090 of file pcb_plugin.cpp.
References KIID::AsString(), KIID_PATH::AsString(), CTL_OMIT_AT, CTL_OMIT_FOOTPRINT_VERSION, CTL_OMIT_INITIAL_COMMENTS, CTL_OMIT_LIBNAME, CTL_OMIT_PATH, CTL_OMIT_TSTAMPS, Double2Str(), LIB_ID::Format(), Format(), FormatAngle(), FormatInternalUnits(), formatLayer(), FP_BOARD_ONLY, FP_EXCLUDE_FROM_BOM, FP_EXCLUDE_FROM_POS_FILES, FP_SMD, FP_THROUGH_HOLE, FOOTPRINT::GetAttributes(), FOOTPRINT::GetDescription(), FOOTPRINT::GetFPID(), FOOTPRINT::GetInitialComments(), FOOTPRINT::GetKeywords(), FOOTPRINT::GetLastEditTime(), LIB_ID::GetLibItemName(), FOOTPRINT::GetLocalClearance(), FOOTPRINT::GetLocalSolderMaskMargin(), FOOTPRINT::GetLocalSolderPasteMargin(), FOOTPRINT::GetLocalSolderPasteMarginRatio(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPath(), FOOTPRINT::GetPlacementCost180(), FOOTPRINT::GetPlacementCost90(), FOOTPRINT::GetPosition(), FOOTPRINT::GetProperties(), FOOTPRINT::GetThermalGap(), FOOTPRINT::GetThermalWidth(), FOOTPRINT::GetZoneConnection(), FOOTPRINT::GraphicalItems(), group, FOOTPRINT::Groups(), INHERITED, FOOTPRINT::IsLocked(), FOOTPRINT::IsPlaced(), m_ctl, m_out, EDA_ITEM::m_Uuid, FOOTPRINT::Models(), pad, FOOTPRINT::Pads(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotes(), OUTPUTFORMATTER::Quotew(), FOOTPRINT::Reference(), SEXPR_BOARD_FILE_VERSION, TO_UTF8, FOOTPRINT::Value(), and FOOTPRINT::Zones().
|
private |
Definition at line 1376 of file pcb_plugin.cpp.
References _, ARC, SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcIndex(), KIID::AsString(), BEZIER, BGA, CASTELLATED, CHAMFERED_RECT, CIRCLE, CONN, SHAPE_LINE_CHAIN::CPoint(), CTL_OMIT_PAD_NETS, CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL, CUSTOM, Double2Str(), FIDUCIAL_GLBL, FIDUCIAL_LOCAL, Format(), FormatAngle(), FormatInternalUnits(), formatLayers(), PAD::GetAnchorPadShape(), SHAPE_ARC::GetArcMid(), PAD::GetAttribute(), ADVANCED_CFG::GetCfg(), PAD::GetChamferPositions(), PAD::GetChamferRectRatio(), PAD::GetCustomShapeInZoneOpt(), PAD::GetDelta(), PAD::GetDrillShape(), PAD::GetDrillSize(), PAD::GetKeepTopBottom(), PAD::GetLayerSet(), PAD::GetLocalClearance(), PAD::GetLocalSolderMaskMargin(), PAD::GetLocalSolderPasteMargin(), PAD::GetLocalSolderPasteMarginRatio(), BOARD_CONNECTED_ITEM::GetNetCode(), BOARD_CONNECTED_ITEM::GetNetname(), PAD::GetNumber(), PAD::GetOffset(), PAD::GetOrientation(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), PAD::GetPadToDieLength(), PAD::GetPinFunction(), PAD::GetPinType(), PAD::GetPos0(), PAD::GetPrimitives(), PAD::GetProperty(), PAD::GetRemoveUnconnected(), PAD::GetRoundRectRadiusRatio(), PAD::GetShape(), PAD::GetSize(), PAD::GetThermalGap(), PAD::GetThermalSpokeWidth(), PAD::GetZoneConnection(), HEATSINK, INHERITED, PAD::IsLocked(), ADVANCED_CFG::m_CompactSave, m_ctl, m_mapping, m_out, EDA_ITEM::m_Uuid, NONE, NPTH, SHAPE_POLY_SET::Outline(), OVAL, PAD_DRILL_SHAPE_OBLONG, SHAPE_LINE_CHAIN::PointCount(), POLY, OUTPUTFORMATTER::Print(), PTH, OUTPUTFORMATTER::Quotew(), RECT, RECT_CHAMFER_BOTTOM_LEFT, RECT_CHAMFER_BOTTOM_RIGHT, RECT_CHAMFER_TOP_LEFT, RECT_CHAMFER_TOP_RIGHT, ROUNDRECT, SEGMENT, SMD, StrPrintf(), TESTPOINT, THROW_IO_ERROR, TO_UTF8, NETINFO_MAPPING::Translate(), TRAPEZOID, and NETINFO_LIST::UNCONNECTED.
|
private |
Definition at line 1745 of file pcb_plugin.cpp.
References KIID::AsString(), CTL_OMIT_HIDE, FormatAngle(), FormatInternalUnits(), formatLayer(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngle(), EDA_TEXT::GetTextPos(), m_ctl, m_out, EDA_ITEM::m_Uuid, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and TO_UTF8.
|
private |
Definition at line 1797 of file pcb_plugin.cpp.
References KIID::AsString(), CTL_OMIT_HIDE, FormatAngle(), FormatInternalUnits(), formatLayer(), FOOTPRINT::GetOrientation(), BOARD_ITEM::GetParent(), FP_TEXT::GetPos0(), EDA_TEXT::GetText(), EDA_TEXT::GetTextAngle(), FP_TEXT::GetType(), FP_TEXT::IsKeepUpright(), BOARD_ITEM::IsLocked(), EDA_TEXT::IsVisible(), locked, m_ctl, m_out, EDA_ITEM::m_Uuid, NormalizeAngle360Min(), NormalizeAnglePos(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), FP_TEXT::TEXT_is_DIVERS, FP_TEXT::TEXT_is_REFERENCE, FP_TEXT::TEXT_is_VALUE, and TO_UTF8.
|
private |
Definition at line 1862 of file pcb_plugin.cpp.
References _, KIID::AsString(), BLIND_BURIED, Format(), FormatInternalUnits(), PCB_TRACK::GetEnd(), BOARD_ITEM::GetLayer(), PCB_ARC::GetMid(), BOARD_CONNECTED_ITEM::GetNetCode(), PCB_TRACK::GetStart(), PCB_TRACK::GetWidth(), BOARD_ITEM::IsLocked(), locked, m_mapping, m_out, EDA_ITEM::m_Uuid, MICROVIA, MILLIMETRES, LSET::Name(), PCB_ARC_T, PCB_VIA_T, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), THROUGH, THROW_IO_ERROR, TO_UTF8, NETINFO_MAPPING::Translate(), EDA_ITEM::Type(), UNDEFINED_DRILL_DIAMETER, and via.
|
private |
Definition at line 1962 of file pcb_plugin.cpp.
References _, ALWAYS, SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcIndex(), KIID::AsString(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), DIAGONAL_EDGE, DIAGONAL_FULL, Double2Str(), ZONE::FillSegments(), Format(), FormatInternalUnits(), formatLayer(), formatLayers(), FULL, ZONE::GetBorderHatchPitch(), ADVANCED_CFG::GetCfg(), ZONE::GetCornerRadius(), ZONE::GetCornerSmoothingType(), ZONE::GetDoNotAllowCopperPour(), ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), ZONE::GetFilledPolysList(), ZONE::GetFilledPolysUseThickness(), ZONE::GetFillMode(), ZONE::GetHatchBorderAlgorithm(), ZONE::GetHatchGap(), ZONE::GetHatchHoleMinArea(), ZONE::GetHatchOrientation(), ZONE::GetHatchSmoothingLevel(), ZONE::GetHatchSmoothingValue(), ZONE::GetHatchStyle(), ZONE::GetHatchThickness(), ZONE::GetIslandRemovalMode(), ZONE::GetIsRuleArea(), ZONE::GetLayerSet(), ZONE::GetLocalClearance(), ZONE::GetMinIslandArea(), ZONE::GetMinThickness(), BOARD_CONNECTED_ITEM::GetNetCode(), BOARD_CONNECTED_ITEM::GetNetname(), ZONE::GetNumCorners(), ZONE::GetPadConnection(), ZONE::GetPriority(), BOARD::GetStandardLayerName(), ZONE::GetThermalReliefGap(), ZONE::GetThermalReliefSpokeWidth(), ZONE::GetZoneName(), HATCH_PATTERN, ZONE::IsFilled(), ZONE::IsIsland(), BOARD_ITEM::IsLocked(), IU_PER_MM, locked, ADVANCED_CFG::m_CompactSave, m_mapping, m_out, EDA_ITEM::m_Uuid, LSET::Name(), NO_HATCH, NONE, ZONE::Outline(), SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_POLY_SET::Polygon(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), LSET::Seq(), ZONE_SETTINGS::SMOOTHING_CHAMFER, ZONE_SETTINGS::SMOOTHING_FILLET, ZONE_SETTINGS::SMOOTHING_NONE, THERMAL, THROW_IO_ERROR, THT_THERMAL, TO_UTF8, and NETINFO_MAPPING::Translate().
|
protected |
formats the board layer information
Definition at line 542 of file pcb_plugin.cpp.
References arrayDim(), B_Adhes, B_CrtYd, B_Fab, B_Mask, B_Paste, B_SilkS, Cmts_User, LSET::CuStack(), Dwgs_User, Eco1_User, Eco2_User, Edge_Cuts, F_Adhes, F_CrtYd, F_Fab, F_Mask, F_Paste, F_SilkS, BOARD::GetEnabledLayers(), BOARD::GetLayerName(), BOARD::GetLayerType(), m_board, m_out, Margin, LSET::Name(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), LSET::Seq(), LAYER::ShowType(), User_1, User_2, User_3, User_4, User_5, User_6, User_7, User_8, and User_9.
Referenced by formatHeader(), and CLIPBOARD_IO::SaveSelection().
|
protected |
formats the General section of the file
Definition at line 526 of file pcb_plugin.cpp.
References TITLE_BLOCK::Format(), PAGE_INFO::Format(), FormatInternalUnits(), BOARD_DESIGN_SETTINGS::GetBoardThickness(), BOARD::GetDesignSettings(), BOARD::GetPageSettings(), BOARD::GetTitleBlock(), m_ctl, m_out, and OUTPUTFORMATTER::Print().
Referenced by formatHeader().
|
protected |
writes everything that comes before the board_items, like settings and layers etc
Definition at line 642 of file pcb_plugin.cpp.
References formatBoardLayers(), formatGeneral(), formatNetInformation(), formatProperties(), and formatSetup().
Referenced by format().
|
private |
Definition at line 466 of file pcb_plugin.cpp.
References BOARD_ITEM::GetLayer(), m_out, LSET::Name(), OUTPUTFORMATTER::Print(), and OUTPUTFORMATTER::Quotew().
Referenced by format().
|
private |
Definition at line 1290 of file pcb_plugin.cpp.
References LSET::AllCuMask(), B_Adhes, B_CrtYd, B_Cu, B_Fab, B_Mask, B_Paste, B_SilkS, F_Adhes, F_CrtYd, F_Cu, F_Fab, F_Mask, F_Paste, F_SilkS, m_out, LSET::Name(), paste, PCB_LAYER_ID_COUNT, OUTPUTFORMATTER::Print(), and OUTPUTFORMATTER::Quotew().
Referenced by format().
|
protected |
formats the Nets and Netclasses
Definition at line 612 of file pcb_plugin.cpp.
References m_mapping, m_out, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), and NETINFO_MAPPING::Translate().
Referenced by formatHeader(), and CLIPBOARD_IO::SaveSelection().
|
protected |
formats the Nets and Netclasses
Definition at line 628 of file pcb_plugin.cpp.
References BOARD::GetProperties(), m_out, OUTPUTFORMATTER::Print(), and OUTPUTFORMATTER::Quotew().
Referenced by formatHeader().
|
protected |
formats the board setup information
Definition at line 474 of file pcb_plugin.cpp.
References Double2Str(), PCB_PLOT_PARAMS::Format(), BOARD_STACKUP::FormatBoardStackup(), FormatInternalUnits(), BOARD_DESIGN_SETTINGS::GetAuxOrigin(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetGridOrigin(), BOARD::GetPlotOptions(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), BOARD_DESIGN_SETTINGS::m_HasStackup, m_out, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, BOARD_DESIGN_SETTINGS::m_SolderPasteMargin, BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio, and OUTPUTFORMATTER::Print().
Referenced by formatHeader().
|
overridevirtual |
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
Reimplemented from PLUGIN.
Definition at line 2436 of file pcb_plugin.cpp.
References getFootprint().
|
inlineoverridevirtual |
Returns the file extension for the PLUGIN.
Implements PLUGIN.
Definition at line 149 of file pcb_plugin.h.
|
protected |
Definition at line 2408 of file pcb_plugin.cpp.
References FP_CACHE::GetFootprints(), init(), m_cache, and validateCache().
Referenced by FootprintLoad(), and GetEnumeratedFootprint().
|
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 EAGLE_PLUGIN, and CADSTAR_PCB_ARCHIVE_PLUGIN.
Definition at line 54 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 2598 of file pcb_plugin.cpp.
References FP_CACHE::GetTimestamp().
|
inline |
Definition at line 211 of file pcb_plugin.h.
References STRING_FORMATTER::Clear(), STRING_FORMATTER::GetString(), and m_sf.
Referenced by FOOTPRINT_EDIT_FRAME::ExportFootprint().
|
protected |
Definition at line 2359 of file pcb_plugin.cpp.
References m_board, m_props, and m_reader.
Referenced by DoLoad(), FootprintDelete(), FootprintEnumerate(), FootprintLibCreate(), FootprintSave(), getFootprint(), IsFootprintLibWritable(), CLIPBOARD_IO::Load(), PCB_PLUGIN(), CLIPBOARD_IO::Save(), and Save().
|
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 2699 of file pcb_plugin.cpp.
References init(), FP_CACHE::IsWritable(), m_cache, and validateCache().
|
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 2290 of file pcb_plugin.cpp.
References _, DoLoad(), Format(), PROGRESS_REPORTER::KeepRefreshing(), FILE_LINE_READER::ReadLine(), PROGRESS_REPORTER::Report(), FILE_LINE_READER::Rewind(), BOARD::SetFileName(), and THROW_IO_ERROR.
Referenced by PNS_LOG_FILE::Load().
BOARD_ITEM * PCB_PLUGIN::Parse | ( | const wxString & | aClipboardSourceInput | ) |
Definition at line 378 of file pcb_plugin.cpp.
References PCB_PARSER::GetRequiredVersion(), PCB_PARSER::IsTooRecent(), m_parser, PCB_PARSER::Parse(), PCB_PARSER::SetLineReader(), and TO_UTF8.
Referenced by CLIPBOARD_IO::Parse(), and parse_footprint_kicad().
|
inlineoverridevirtual |
Return a brief hard coded name for this PLUGIN.
Implements PLUGIN.
Definition at line 144 of file pcb_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 75 of file plugin.cpp.
|
overridevirtual |
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. |
IO_ERROR | if there is a problem saving or exporting. |
Reimplemented from PLUGIN.
Reimplemented in CLIPBOARD_IO.
Definition at line 338 of file pcb_plugin.cpp.
References _, Format(), Format(), BOARD::GroupsSanityCheck(), init(), m_board, m_mapping, m_out, OUTPUTFORMATTER::Print(), NETINFO_MAPPING::SetBoard(), SEXPR_BOARD_FILE_VERSION, and KIDIALOG::ShowModal().
Referenced by KI_TEST::DumpBoardToFile(), and ROUTER_TOOL::saveRouterDebugLog().
|
inline |
Definition at line 221 of file pcb_plugin.h.
References m_out.
Referenced by FP_CACHE::Save().
|
protected |
Definition at line 2367 of file pcb_plugin.cpp.
References FP_CACHE, FP_CACHE::IsModified(), FP_CACHE::IsPath(), FP_CACHE::Load(), and m_cache.
Referenced by FootprintDelete(), FootprintEnumerate(), FootprintSave(), getFootprint(), and IsFootprintLibWritable().
|
friend |
Definition at line 280 of file pcb_plugin.h.
Referenced by FootprintLibCreate(), and validateCache().
|
protected |
which BOARD, no ownership here
Definition at line 284 of file pcb_plugin.h.
Referenced by formatBoardLayers(), init(), CLIPBOARD_IO::Save(), Save(), CLIPBOARD_IO::SaveSelection(), and CLIPBOARD_IO::SetBoard().
|
protected |
Footprint library cache.
Definition at line 288 of file pcb_plugin.h.
Referenced by FootprintDelete(), FootprintEnumerate(), FootprintLibCreate(), FootprintLibDelete(), FootprintSave(), getFootprint(), IsFootprintLibWritable(), validateCache(), and ~PCB_PLUGIN().
|
protected |
Definition at line 295 of file pcb_plugin.h.
Referenced by FootprintSave(), format(), and formatGeneral().
|
protected |
for throwing exceptions
Definition at line 283 of file pcb_plugin.h.
|
protected |
for saves only, name is in m_reader for loads
Definition at line 291 of file pcb_plugin.h.
|
protected |
mapping for net codes, so only not empty net codes are stored with consecutive integers as net codes
Definition at line 297 of file pcb_plugin.h.
Referenced by format(), formatNetInformation(), CLIPBOARD_IO::Save(), Save(), CLIPBOARD_IO::SaveSelection(), and ~PCB_PLUGIN().
|
protected |
output any Format()s to this, no ownership
Definition at line 294 of file pcb_plugin.h.
Referenced by CLIPBOARD_IO::CLIPBOARD_IO(), format(), formatBoardLayers(), formatGeneral(), formatLayer(), formatLayers(), formatNetInformation(), formatProperties(), formatSetup(), PCB_PLUGIN(), CLIPBOARD_IO::Save(), Save(), and SetOutputFormatter().
|
protected |
Definition at line 296 of file pcb_plugin.h.
Referenced by DoLoad(), CLIPBOARD_IO::Load(), FP_CACHE::Load(), Parse(), and ~PCB_PLUGIN().
|
protected |
passed via Save() or Load(), no ownership, may be NULL.
Definition at line 287 of file pcb_plugin.h.
Referenced by init().
|
protected |
|
protected |
Definition at line 293 of file pcb_plugin.h.
Referenced by GetStringOutput(), and PCB_PLUGIN().