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

#include <kicad_clipboard.h>

Inheritance diagram for CLIPBOARD_IO:
PCB_PLUGIN PLUGIN

Public Member Functions

 CLIPBOARD_IO ()
 
 ~CLIPBOARD_IO ()
 
void SaveBoard (const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *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...
 
void SaveSelection (const PCB_SELECTION &selected, bool isFootprintEditor)
 
BOARD_ITEMParse ()
 
BOARDLoadBoard (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 SetBoard (BOARD *aBoard)
 
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 GetFootprintFileDesc () const override
 Returns footprint file description for the PLUGIN. More...
 
PLUGIN_FILE_DESC GetFootprintLibDesc () const override
 Returns footprint library description for the PLUGIN. More...
 
void SetQueryUserCallback (std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aOKButtonTitle)> aCallback) override
 
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...
 
bool CanReadBoard (const wxString &aFileName) const override
 Checks if this PLUGIN can read the specified board file. More...
 
BOARDDoLoad (LINE_READER &aReader, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties, PROGRESS_REPORTER *aProgressReporter, unsigned aLineCount)
 
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...
 
const FOOTPRINTGetEnumeratedFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *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 STRING_UTF8_MAP *aProperties=nullptr) override
 Check for the existence of a footprint. More...
 
FOOTPRINTImportFootprint (const wxString &aFootprintPath, wxString &aFootprintNameOut, const STRING_UTF8_MAP *aProperties=nullptr) override
 Load a single footprint from aFootprintPath and put its name in aFootprintNameOut. 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...
 
void FootprintSave (const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const STRING_UTF8_MAP *aProperties=nullptr) override
 Write aFootprint to an existing library located at aLibraryPath. More...
 
void FootprintDelete (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *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 STRING_UTF8_MAP *aProperties=nullptr) override
 Create a new empty footprint library at aLibraryPath empty. 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...
 
bool IsFootprintLibWritable (const wxString &aLibraryPath) override
 Return true if the library at aLibraryPath is writable. More...
 
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_ITEMParse (const wxString &aClipboardSourceInput)
 
virtual bool CanReadFootprint (const wxString &aFileName) const
 Checks if this PLUGIN can read a footprint from specified file or directory. More...
 
virtual bool CanReadFootprintLib (const wxString &aFileName) const
 Checks if this PLUGIN can read footprint library from specified file or directory. More...
 
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 STRING_UTF8_MAP *aProperties=nullptr)
 If possible, prefetches the specified library (e.g. More...
 
virtual void FootprintLibOptions (STRING_UTF8_MAP *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 FOOTPRINTgetFootprint (const wxString &aLibraryPath, const wxString &aFootprintName, const STRING_UTF8_MAP *aProperties, bool checkModified)
 
void init (const STRING_UTF8_MAP *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...
 
void formatTeardropParameters (const TEARDROP_PARAMETERS &tdParams, int aNestLevel=0) const
 

Protected Attributes

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, may be NULL More...
 
FP_CACHEm_cache
 Footprint library cache. More...
 
LINE_READERm_reader
 no ownership More...
 
wxString m_filename
 for saves only, name is in m_reader for loads More...
 
STRING_FORMATTER m_sf
 
OUTPUTFORMATTERm_out
 output any Format()s to this, no ownership More...
 
int m_ctl
 
NETINFO_MAPPINGm_mapping
 mapping for net codes, so only not empty net codes are stored with consecutive integers as net codes More...
 
std::function< bool(wxString aTitle, int aIcon, wxString aMsg, wxString aAction)> m_queryUserCallback
 

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 PCB_BITMAP *aBitmap, 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 PCB_TEXTBOX *aTextBox, int aNestLevel=0) const
 
void format (const PCB_TRACK *aTrack, int aNestLevel=0) const
 
void format (const ZONE *aZone, int aNestLevel=0) const
 
void formatPolyPts (const SHAPE_LINE_CHAIN &outline, int aNestLevel, bool aCompact, const FOOTPRINT *aParentFP=nullptr) const
 
void formatRenderCache (const EDA_TEXT *aText, int aNestLevel) const
 
void formatLayer (PCB_LAYER_ID aLayer, bool aIsKnockout=false) const
 
void formatLayers (LSET aLayerMask, int aNestLevel=0) const
 

Private Attributes

STRING_FORMATTER m_formatter
 

Detailed Description

Definition at line 41 of file kicad_clipboard.h.

Constructor & Destructor Documentation

◆ CLIPBOARD_IO()

CLIPBOARD_IO::CLIPBOARD_IO ( )

Definition at line 45 of file kicad_clipboard.cpp.

References m_formatter, and PCB_PLUGIN::m_out.

◆ ~CLIPBOARD_IO()

CLIPBOARD_IO::~CLIPBOARD_IO ( )

Definition at line 53 of file kicad_clipboard.cpp.

Member Function Documentation

◆ CanReadBoard()

bool PCB_PLUGIN::CanReadBoard ( const wxString &  aFileName) const
overridevirtualinherited

Checks if this PLUGIN can read the specified board file.

If not overriden, extension check is used.

Reimplemented from PLUGIN.

Definition at line 272 of file pcb_plugin.cpp.

References PLUGIN::CanReadBoard(), PCB_PARSER::IsValidBoardHeader(), and PCB_PLUGIN::m_queryUserCallback.

◆ CanReadFootprint()

bool PLUGIN::CanReadFootprint ( const wxString &  aFileName) const
virtualinherited

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

If not overriden, extension check is used.

Reimplemented in CADSTAR_PCB_ARCHIVE_PLUGIN, EAGLE_PLUGIN, EASYEDA_PLUGIN, and LEGACY_PLUGIN.

Definition at line 77 of file plugin.cpp.

References PLUGIN::GetFootprintFileDesc(), and PLUGIN_FILE_DESC::m_FileExtensions.

Referenced by CADSTAR_PCB_ARCHIVE_PLUGIN::CanReadFootprint(), LEGACY_PLUGIN::CanReadFootprint(), and FOOTPRINT_EDIT_FRAME::ImportFootprint().

◆ CanReadFootprintLib()

bool PLUGIN::CanReadFootprintLib ( const wxString &  aFileName) const
virtualinherited

◆ DoLoad()

BOARD * PCB_PLUGIN::DoLoad ( LINE_READER aReader,
BOARD aAppendToMe,
const STRING_UTF8_MAP aProperties,
PROGRESS_REPORTER aProgressReporter,
unsigned  aLineCount 
)
inherited

◆ FootprintDelete()

void PCB_PLUGIN::FootprintDelete ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtualinherited

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

Definition at line 2612 of file pcb_plugin.cpp.

References _, PCB_PLUGIN::init(), FP_CACHE::IsWritable(), PCB_PLUGIN::m_cache, FP_CACHE::Remove(), THROW_IO_ERROR, and PCB_PLUGIN::validateCache().

◆ FootprintEnumerate()

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

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 2393 of file pcb_plugin.cpp.

References FP_CACHE::GetFootprints(), PCB_PLUGIN::init(), PCB_PLUGIN::m_cache, THROW_IO_ERROR, PCB_PLUGIN::validateCache(), and IO_ERROR::What().

◆ FootprintExists()

bool PCB_PLUGIN::FootprintExists ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtualinherited

Check for the existence of a footprint.

Reimplemented from PLUGIN.

Definition at line 2458 of file pcb_plugin.cpp.

References KiCadFootprintFileExtension.

◆ FootprintLibCreate()

void PCB_PLUGIN::FootprintLibCreate ( const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtualinherited

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

Definition at line 2638 of file pcb_plugin.cpp.

References _, PCB_PLUGIN::FP_CACHE, PCB_PLUGIN::init(), PCB_PLUGIN::m_cache, FP_CACHE::Save(), and THROW_IO_ERROR.

◆ FootprintLibDelete()

bool PCB_PLUGIN::FootprintLibDelete ( const wxString &  aLibraryPath,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtualinherited

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 2656 of file pcb_plugin.cpp.

References _, FP_CACHE::IsPath(), KiCadFootprintFileExtension, PCB_PLUGIN::m_cache, THROW_IO_ERROR, and traceKicadPcbPlugin.

◆ 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 262 of file plugin.cpp.

References _.

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

◆ FootprintLoad()

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

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 2491 of file pcb_plugin.cpp.

References FOOTPRINT::Clone(), copy, FOOTPRINT::Duplicate(), and PCB_PLUGIN::getFootprint().

◆ FootprintSave()

void PCB_PLUGIN::FootprintSave ( const wxString &  aLibraryPath,
const FOOTPRINT aFootprint,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtualinherited

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

Definition at line 2515 of file pcb_plugin.cpp.

References _, ANGLE_0, FOOTPRINT::Clone(), CTL_FOR_LIBRARY, FP_CACHE::Exists(), F_Cu, FOOTPRINT::Flip(), FP_CACHE::GetFootprints(), FOOTPRINT::GetFPID(), FOOTPRINT::GetLayer(), LIB_ID::GetLibItemName(), FOOTPRINT::GetPosition(), PCB_PLUGIN::init(), FP_CACHE::IsWritable(), KiCadFootprintFileExtension, Kiface(), KIFACE_BASE::KifaceSettings(), PCB_PLUGIN::m_cache, PCB_PLUGIN::m_ctl, PCBNEW_SETTINGS::m_FlipLeftRight, Pgm(), WX_FILENAME::ResolvePossibleSymlinks(), FP_CACHE::Save(), FOOTPRINT::SetOrientation(), EDA_ITEM::SetParent(), BOARD_ITEM::SetParentGroup(), THROW_IO_ERROR, traceKicadPcbPlugin, and PCB_PLUGIN::validateCache().

◆ format() [1/12]

void PCB_PLUGIN::format ( const BOARD aBoard,
int  aNestLevel = 0 
) const
privateinherited

◆ Format()

void PCB_PLUGIN::Format ( const BOARD_ITEM aItem,
int  aNestLevel = 0 
) const
inherited

◆ format() [2/12]

void PCB_PLUGIN::format ( const FOOTPRINT aFootprint,
int  aNestLevel = 0 
) const
privateinherited

Definition at line 1082 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, CTX_QUOTED_STR, EscapeString(), LIB_ID::Format(), PCB_PLUGIN::format(), PCB_PLUGIN::Format(), EDA_UNIT_UTILS::FormatAngle(), FormatDouble2Str(), formatInternalUnits(), PCB_PLUGIN::formatLayer(), FP_ALLOW_MISSING_COURTYARD, FP_ALLOW_SOLDERMASK_BRIDGES, FP_BOARD_ONLY, FP_DNP, FP_EXCLUDE_FROM_BOM, FP_EXCLUDE_FROM_POS_FILES, FP_SMD, FP_THROUGH_HOLE, FOOTPRINT::GetAttributes(), FOOTPRINT::GetFields(), FOOTPRINT::GetFilters(), FOOTPRINT::GetFPID(), FOOTPRINT::GetInitialComments(), FOOTPRINT::GetKeywords(), FOOTPRINT::GetLayer(), FOOTPRINT::GetLibDescription(), LIB_ID::GetLibItemName(), FOOTPRINT::GetLocalClearance(), FOOTPRINT::GetLocalSolderMaskMargin(), FOOTPRINT::GetLocalSolderPasteMargin(), FOOTPRINT::GetLocalSolderPasteMarginRatio(), FOOTPRINT::GetNetTiePadGroups(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPath(), FOOTPRINT::GetPosition(), FOOTPRINT::GetPrivateLayers(), FOOTPRINT::GetSheetfile(), FOOTPRINT::GetSheetname(), FOOTPRINT::GetZoneConnection(), FOOTPRINT::GraphicalItems(), group, FOOTPRINT::Groups(), FOOTPRINT::IsLocked(), FOOTPRINT::IsNetTie(), FOOTPRINT::IsPlaced(), EDA_ANGLE::IsZero(), PCB_PLUGIN::m_ctl, PCB_PLUGIN::m_out, EDA_ITEM::m_Uuid, FOOTPRINT::Models(), LSET::Name(), pad, FOOTPRINT::Pads(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotes(), OUTPUTFORMATTER::Quotew(), FOOTPRINT::Reference(), LSET::Seq(), SEXPR_BOARD_FILE_VERSION, TO_UTF8, FOOTPRINT::Value(), and FOOTPRINT::Zones().

◆ format() [3/12]

void PCB_PLUGIN::format ( const PAD aPad,
int  aNestLevel = 0 
) const
privateinherited

Definition at line 1422 of file pcb_plugin.cpp.

References _, ANGLE_45, ANGLE_90, KIID::AsString(), CTL_OMIT_PAD_NETS, CUST_PAD_SHAPE_IN_ZONE_CONVEXHULL, LSET::CuStack(), EDA_UNIT_UTILS::FormatAngle(), FormatDouble2Str(), formatInternalUnits(), PCB_PLUGIN::formatLayers(), PCB_PLUGIN::formatPolyPts(), PCB_PLUGIN::formatTeardropParameters(), PAD::GetAnchorPadShape(), PAD::GetAttribute(), BOARD_ITEM::GetBoard(), ADVANCED_CFG::GetCfg(), PAD::GetChamferPositions(), PAD::GetChamferRectRatio(), PAD::GetCustomShapeInZoneOpt(), PAD::GetDelta(), PAD::GetDrillShape(), PAD::GetDrillSize(), BOARD::GetEnabledLayers(), BOARD_ITEM::GetFPRelativePosition(), 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(), PAD::GetPadToDieLength(), PAD::GetPinFunction(), PAD::GetPinType(), PAD::GetPrimitives(), PAD::GetProperty(), PAD::GetRemoveUnconnected(), PAD::GetRoundRectRadiusRatio(), PAD::GetShape(), PAD::GetSize(), BOARD_CONNECTED_ITEM::GetTeardropParams(), PAD::GetThermalGap(), PAD::GetThermalSpokeAngle(), PAD::GetThermalSpokeWidth(), PAD::GetZoneConnection(), PAD::GetZoneLayerOverride(), isDefaultTeardropParameters(), PAD::IsLocked(), EDA_ANGLE::IsZero(), PCB_PLUGIN::m_ctl, PCB_PLUGIN::m_mapping, PCB_PLUGIN::m_out, EDA_ITEM::m_Uuid, LSET::Name(), SHAPE_POLY_SET::Outline(), PAD_DRILL_SHAPE_OBLONG, OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), RECT_CHAMFER_BOTTOM_LEFT, RECT_CHAMFER_BOTTOM_RIGHT, RECT_CHAMFER_TOP_LEFT, RECT_CHAMFER_TOP_RIGHT, StrPrintf(), THROW_IO_ERROR, TO_UTF8, NETINFO_MAPPING::Translate(), NETINFO_LIST::UNCONNECTED, VECTOR2< T >::x, VECTOR2< T >::y, and ZLO_FORCE_FLASHED.

◆ format() [4/12]

◆ format() [5/12]

◆ format() [6/12]

void PCB_PLUGIN::format ( const PCB_GROUP aGroup,
int  aNestLevel = 0 
) const
privateinherited

◆ format() [7/12]

◆ format() [8/12]

◆ format() [9/12]

◆ format() [10/12]

◆ format() [11/12]

◆ format() [12/12]

void PCB_PLUGIN::format ( const ZONE aZone,
int  aNestLevel = 0 
) const
privateinherited

Definition at line 2076 of file pcb_plugin.cpp.

References _, EDA_ANGLE::AsDegrees(), KIID::AsString(), FormatDouble2Str(), formatInternalUnits(), PCB_PLUGIN::formatLayer(), PCB_PLUGIN::formatLayers(), PCB_PLUGIN::formatPolyPts(), ZONE::GetAssignedPriority(), ZONE::GetBorderHatchPitch(), ADVANCED_CFG::GetCfg(), ZONE::GetCornerRadius(), ZONE::GetCornerSmoothingType(), ZONE::GetDoNotAllowCopperPour(), ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), ZONE::GetFilledPolysList(), ZONE::GetFillMode(), ZONE::GetFirstLayer(), 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::GetTeardropAreaType(), ZONE::GetThermalReliefGap(), ZONE::GetThermalReliefSpokeWidth(), ZONE::GetZoneName(), ZONE::IsFilled(), ZONE::IsIsland(), BOARD_ITEM::IsLocked(), ZONE::IsOnCopperLayer(), ZONE::IsTeardropArea(), EDA_IU_SCALE::IU_PER_MM, PCB_PLUGIN::m_mapping, PCB_PLUGIN::m_out, EDA_ITEM::m_Uuid, LSET::Name(), ZONE::Outline(), pcbIUScale, SHAPE_POLY_SET::Polygon(), OUTPUTFORMATTER::Print(), OUTPUTFORMATTER::Quotew(), LSET::Seq(), ZONE_SETTINGS::SMOOTHING_CHAMFER, ZONE_SETTINGS::SMOOTHING_FILLET, ZONE_SETTINGS::SMOOTHING_NONE, THROW_IO_ERROR, TO_UTF8, and NETINFO_MAPPING::Translate().

◆ formatBoardLayers()

◆ formatGeneral()

void PCB_PLUGIN::formatGeneral ( const BOARD aBoard,
int  aNestLevel = 0 
) const
protectedinherited

◆ formatHeader()

void PCB_PLUGIN::formatHeader ( const BOARD aBoard,
int  aNestLevel = 0 
) const
protectedinherited

writes everything that comes before the board_items, like settings and layers etc

Definition at line 721 of file pcb_plugin.cpp.

References PCB_PLUGIN::formatBoardLayers(), PCB_PLUGIN::formatGeneral(), PCB_PLUGIN::formatNetInformation(), PCB_PLUGIN::formatProperties(), and PCB_PLUGIN::formatSetup().

Referenced by PCB_PLUGIN::format().

◆ formatLayer()

void PCB_PLUGIN::formatLayer ( PCB_LAYER_ID  aLayer,
bool  aIsKnockout = false 
) const
privateinherited

◆ formatLayers()

void PCB_PLUGIN::formatLayers ( LSET  aLayerMask,
int  aNestLevel = 0 
) const
privateinherited

◆ formatNetInformation()

void PCB_PLUGIN::formatNetInformation ( const BOARD aBoard,
int  aNestLevel = 0 
) const
protectedinherited

◆ formatPolyPts()

void PCB_PLUGIN::formatPolyPts ( const SHAPE_LINE_CHAIN outline,
int  aNestLevel,
bool  aCompact,
const FOOTPRINT aParentFP = nullptr 
) const
privateinherited

◆ formatProperties()

void PCB_PLUGIN::formatProperties ( const BOARD aBoard,
int  aNestLevel = 0 
) const
protectedinherited

formats the Nets and Netclasses

Definition at line 707 of file pcb_plugin.cpp.

References BOARD::GetProperties(), PCB_PLUGIN::m_out, OUTPUTFORMATTER::Print(), and OUTPUTFORMATTER::Quotew().

Referenced by PCB_PLUGIN::formatHeader().

◆ formatRenderCache()

◆ formatSetup()

◆ formatTeardropParameters()

◆ GetBoardFileDesc()

PLUGIN_FILE_DESC PCB_PLUGIN::GetBoardFileDesc ( ) const
inlineoverridevirtualinherited

Returns board file description for the PLUGIN.

Reimplemented from PLUGIN.

Definition at line 278 of file pcb_plugin.h.

References _HKI.

◆ GetEnumeratedFootprint()

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

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

Reimplemented from PLUGIN.

Definition at line 2450 of file pcb_plugin.cpp.

References PCB_PLUGIN::getFootprint().

◆ getFootprint()

const FOOTPRINT * PCB_PLUGIN::getFootprint ( const wxString &  aLibraryPath,
const wxString &  aFootprintName,
const STRING_UTF8_MAP aProperties,
bool  checkModified 
)
protectedinherited

◆ GetFootprintFileDesc()

PLUGIN_FILE_DESC PCB_PLUGIN::GetFootprintFileDesc ( ) const
inlineoverridevirtualinherited

Returns footprint file description for the PLUGIN.

Reimplemented from PLUGIN.

Definition at line 287 of file pcb_plugin.h.

References _HKI.

◆ GetFootprintLibDesc()

PLUGIN_FILE_DESC PCB_PLUGIN::GetFootprintLibDesc ( ) const
inlineoverridevirtualinherited

Returns footprint library description for the PLUGIN.

Reimplemented from PLUGIN.

Definition at line 292 of file pcb_plugin.h.

References _HKI.

◆ 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, EAGLE_PLUGIN, EASYEDA_PLUGIN, and EASYEDAPRO_PLUGIN.

Definition at line 152 of file plugin.cpp.

References NOT_IMPLEMENTED.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles().

◆ GetLibraryTimestamp()

long long PCB_PLUGIN::GetLibraryTimestamp ( const wxString &  aLibraryPath) const
overridevirtualinherited

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 2632 of file pcb_plugin.cpp.

References FP_CACHE::GetTimestamp().

◆ GetStringOutput()

std::string PCB_PLUGIN::GetStringOutput ( bool  doClear)
inlineinherited

◆ ImportFootprint()

FOOTPRINT * PCB_PLUGIN::ImportFootprint ( const wxString &  aFootprintPath,
wxString &  aFootprintNameOut,
const STRING_UTF8_MAP aProperties = nullptr 
)
overridevirtualinherited

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

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

Parameters
aLibraryPathis a path of the footprint file.
aFootprintNameOutis the name output of the loaded footprint.
aPropertiesis an associative array that can be used to tell the loader implementation to do something special, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it), and plugins should expect it to be optionally NULL.
Returns
the FOOTPRINT object if found, caller owns it, else NULL if not found.
Exceptions
IO_ERRORif the footprint cannot be found or read.

Reimplemented from PLUGIN.

Definition at line 2474 of file pcb_plugin.cpp.

References PCB_PLUGIN::Parse().

◆ init()

◆ IsFootprintLibWritable()

bool PCB_PLUGIN::IsFootprintLibWritable ( const wxString &  aLibraryPath)
overridevirtualinherited

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 2733 of file pcb_plugin.cpp.

References PCB_PLUGIN::init(), FP_CACHE::IsWritable(), PCB_PLUGIN::m_cache, and PCB_PLUGIN::validateCache().

◆ LoadBoard()

BOARD * CLIPBOARD_IO::LoadBoard ( 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 380 of file kicad_clipboard.cpp.

References _, KIDIALOG::DoNotShowCheckbox(), PCB_PARSER::GetRequiredVersion(), PCB_PLUGIN::init(), PCB_PARSER::IsTooRecent(), PCB_PARSER::Parse(), PCB_T, BOARD::SetFileName(), KIDIALOG::ShowModal(), THROW_PARSE_ERROR, and EDA_ITEM::Type().

◆ Parse() [1/2]

BOARD_ITEM * CLIPBOARD_IO::Parse ( )

Definition at line 302 of file kicad_clipboard.cpp.

References PCB_PLUGIN::Parse().

Referenced by PCB_CONTROL::Paste().

◆ Parse() [2/2]

BOARD_ITEM * PCB_PLUGIN::Parse ( const wxString &  aClipboardSourceInput)
inherited

◆ PluginName()

const wxString PCB_PLUGIN::PluginName ( ) const
inlineoverridevirtualinherited

Return a brief hard coded name for this PLUGIN.

Implements PLUGIN.

Definition at line 273 of file pcb_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 173 of file plugin.cpp.

Referenced by FP_LIB_TABLE::PrefetchLib().

◆ SaveBoard()

void CLIPBOARD_IO::SaveBoard ( const wxString &  aFileName,
BOARD aBoard,
const STRING_UTF8_MAP aProperties = nullptr 
)
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.

Parameters
aFileNameis the name of a file to save to on disk.
aBoardis the class BOARD in memory document tree from which to extract information when writing to aFileName. The caller continues to own the BOARD, and the plugin should refrain from modifying the BOARD if possible.
aPropertiesis an associative array that can be used to tell the saver how to save the file, because it can take any number of additional named tuning arguments that the plugin is known to support. The caller continues to own this object (plugin may not delete it) and plugins should expect it to be optionally NULL.
Exceptions
IO_ERRORif there is a problem saving or exporting.

Reimplemented from PLUGIN.

Definition at line 335 of file kicad_clipboard.cpp.

References PCB_PLUGIN::Format(), STRING_FORMATTER::GetString(), ignore_unused(), PCB_PLUGIN::init(), PCB_PLUGIN::m_board, m_formatter, PCB_PLUGIN::m_mapping, PCB_PLUGIN::m_out, OUTPUTFORMATTER::Print(), NETINFO_MAPPING::SetBoard(), and SEXPR_BOARD_FILE_VERSION.

◆ SaveSelection()

◆ SetBoard()

void CLIPBOARD_IO::SetBoard ( BOARD aBoard)

Definition at line 58 of file kicad_clipboard.cpp.

References PCB_PLUGIN::m_board.

◆ SetOutputFormatter()

void PCB_PLUGIN::SetOutputFormatter ( OUTPUTFORMATTER aFormatter)
inlineinherited

Definition at line 371 of file pcb_plugin.h.

References PCB_PLUGIN::m_out.

Referenced by FP_CACHE::Save().

◆ SetQueryUserCallback() [1/2]

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 313 of file io_mgr.h.

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

◆ SetQueryUserCallback() [2/2]

void PCB_PLUGIN::SetQueryUserCallback ( std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aOKButtonTitle)>  aCallback)
inlineoverrideinherited

Definition at line 297 of file pcb_plugin.h.

References PCB_PLUGIN::m_queryUserCallback.

◆ validateCache()

void PCB_PLUGIN::validateCache ( const wxString &  aLibraryPath,
bool  checkModified = true 
)
protectedinherited

Member Data Documentation

◆ m_board

BOARD* PCB_PLUGIN::m_board
protectedinherited

which BOARD, no ownership here

Definition at line 440 of file pcb_plugin.h.

Referenced by PCB_PLUGIN::formatBoardLayers(), PCB_PLUGIN::init(), SaveBoard(), PCB_PLUGIN::SaveBoard(), SaveSelection(), and SetBoard().

◆ m_cache

◆ m_ctl

int PCB_PLUGIN::m_ctl
protectedinherited

◆ m_error

wxString PCB_PLUGIN::m_error
protectedinherited

for throwing exceptions

Definition at line 439 of file pcb_plugin.h.

◆ m_filename

wxString PCB_PLUGIN::m_filename
protectedinherited

for saves only, name is in m_reader for loads

Definition at line 446 of file pcb_plugin.h.

◆ m_formatter

STRING_FORMATTER CLIPBOARD_IO::m_formatter
private

Definition at line 68 of file kicad_clipboard.h.

Referenced by CLIPBOARD_IO(), SaveBoard(), and SaveSelection().

◆ m_mapping

NETINFO_MAPPING* PCB_PLUGIN::m_mapping
protectedinherited

mapping for net codes, so only not empty net codes are stored with consecutive integers as net codes

Definition at line 451 of file pcb_plugin.h.

Referenced by PCB_PLUGIN::format(), PCB_PLUGIN::formatNetInformation(), SaveBoard(), PCB_PLUGIN::SaveBoard(), SaveSelection(), and PCB_PLUGIN::~PCB_PLUGIN().

◆ m_out

◆ m_props

const STRING_UTF8_MAP* PCB_PLUGIN::m_props
protectedinherited

passed via Save() or Load(), no ownership, may be NULL

Definition at line 442 of file pcb_plugin.h.

Referenced by PCB_PLUGIN::init().

◆ m_queryUserCallback

std::function<bool( wxString aTitle, int aIcon, wxString aMsg, wxString aAction )> PCB_PLUGIN::m_queryUserCallback
protectedinherited

◆ m_reader

LINE_READER* PCB_PLUGIN::m_reader
protectedinherited

no ownership

Definition at line 445 of file pcb_plugin.h.

Referenced by PCB_PLUGIN::init().

◆ m_sf

STRING_FORMATTER PCB_PLUGIN::m_sf
protectedinherited

Definition at line 448 of file pcb_plugin.h.

Referenced by PCB_PLUGIN::GetStringOutput(), and PCB_PLUGIN::PCB_PLUGIN().


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