|
|
@ -48,8 +48,8 @@ |
|
|
|
#include <pcbnew_settings.h>
|
|
|
|
#include <pgm_base.h>
|
|
|
|
#include <io/kicad/kicad_io_utils.h>
|
|
|
|
#include <pcb_io/kicad/pcb_plugin.h>
|
|
|
|
#include <pcb_io/kicad/pcb_parser.h>
|
|
|
|
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h>
|
|
|
|
#include <pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.h>
|
|
|
|
#include <trace_helpers.h>
|
|
|
|
#include <progress_reporter.h>
|
|
|
|
#include <wildcards_and_files_ext.h>
|
|
|
@ -75,7 +75,7 @@ FP_CACHE_ITEM::FP_CACHE_ITEM( FOOTPRINT* aFootprint, const WX_FILENAME& aFileNam |
|
|
|
{ } |
|
|
|
|
|
|
|
|
|
|
|
FP_CACHE::FP_CACHE( PCB_PLUGIN* aOwner, const wxString& aLibraryPath ) |
|
|
|
FP_CACHE::FP_CACHE( PCB_IO_KICAD_SEXPR* aOwner, const wxString& aLibraryPath ) |
|
|
|
{ |
|
|
|
m_owner = aOwner; |
|
|
|
m_lib_raw_path = aLibraryPath; |
|
|
@ -188,7 +188,7 @@ void FP_CACHE::Load() |
|
|
|
try |
|
|
|
{ |
|
|
|
FILE_LINE_READER reader( fn.GetFullPath() ); |
|
|
|
PCB_PARSER parser( &reader, nullptr, nullptr ); |
|
|
|
PCB_IO_KICAD_SEXPR_PARSER parser( &reader, nullptr, nullptr ); |
|
|
|
|
|
|
|
FOOTPRINT* footprint = dynamic_cast<FOOTPRINT*>( parser.Parse() ); |
|
|
|
wxString fpName = fn.GetName(); |
|
|
@ -273,7 +273,7 @@ long long FP_CACHE::GetTimestamp( const wxString& aLibPath ) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool PCB_PLUGIN::CanReadBoard( const wxString& aFileName ) const |
|
|
|
bool PCB_IO_KICAD_SEXPR::CanReadBoard( const wxString& aFileName ) const |
|
|
|
{ |
|
|
|
if( !PCB_IO::CanReadBoard( aFileName ) ) |
|
|
|
return false; |
|
|
@ -281,7 +281,7 @@ bool PCB_PLUGIN::CanReadBoard( const wxString& aFileName ) const |
|
|
|
try |
|
|
|
{ |
|
|
|
FILE_LINE_READER reader( aFileName ); |
|
|
|
PCB_PARSER parser( &reader, nullptr, m_queryUserCallback ); |
|
|
|
PCB_IO_KICAD_SEXPR_PARSER parser( &reader, nullptr, m_queryUserCallback ); |
|
|
|
|
|
|
|
return parser.IsValidBoardHeader(); |
|
|
|
} |
|
|
@ -293,7 +293,7 @@ bool PCB_PLUGIN::CanReadBoard( const wxString& aFileName ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::SaveBoard( const wxString& aFileName, BOARD* aBoard, |
|
|
|
void PCB_IO_KICAD_SEXPR::SaveBoard( const wxString& aFileName, BOARD* aBoard, |
|
|
|
const STRING_UTF8_MAP* aProperties, |
|
|
|
PROGRESS_REPORTER* aProgressReporter ) |
|
|
|
{ |
|
|
@ -336,12 +336,12 @@ void PCB_PLUGIN::SaveBoard( const wxString& aFileName, BOARD* aBoard, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BOARD_ITEM* PCB_PLUGIN::Parse( const wxString& aClipboardSourceInput ) |
|
|
|
BOARD_ITEM* PCB_IO_KICAD_SEXPR::Parse( const wxString& aClipboardSourceInput ) |
|
|
|
{ |
|
|
|
std::string input = TO_UTF8( aClipboardSourceInput ); |
|
|
|
|
|
|
|
STRING_LINE_READER reader( input, wxT( "clipboard" ) ); |
|
|
|
PCB_PARSER parser( &reader, nullptr, m_queryUserCallback ); |
|
|
|
PCB_IO_KICAD_SEXPR_PARSER parser( &reader, nullptr, m_queryUserCallback ); |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
@ -357,7 +357,7 @@ BOARD_ITEM* PCB_PLUGIN::Parse( const wxString& aClipboardSourceInput ) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::Format( const BOARD_ITEM* aItem, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::Format( const BOARD_ITEM* aItem, int aNestLevel ) const |
|
|
|
{ |
|
|
|
LOCALE_IO toggle; // public API function, perform anything convenient for caller
|
|
|
|
|
|
|
@ -456,7 +456,7 @@ std::string formatInternalUnits( const VECTOR2I& aCoord, const FOOTPRINT* aParen |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatLayer( PCB_LAYER_ID aLayer, bool aIsKnockout ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatLayer( PCB_LAYER_ID aLayer, bool aIsKnockout ) const |
|
|
|
{ |
|
|
|
m_out->Print( 0, " (layer %s%s)", |
|
|
|
m_out->Quotew( LSET::Name( aLayer ) ).c_str(), |
|
|
@ -464,7 +464,7 @@ void PCB_PLUGIN::formatLayer( PCB_LAYER_ID aLayer, bool aIsKnockout ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatPolyPts( const SHAPE_LINE_CHAIN& outline, int aNestLevel, |
|
|
|
void PCB_IO_KICAD_SEXPR::formatPolyPts( const SHAPE_LINE_CHAIN& outline, int aNestLevel, |
|
|
|
bool aCompact, const FOOTPRINT* aParentFP ) const |
|
|
|
{ |
|
|
|
m_out->Print( aNestLevel + 1, "(pts\n" ); |
|
|
@ -517,7 +517,7 @@ void PCB_PLUGIN::formatPolyPts( const SHAPE_LINE_CHAIN& outline, int aNestLevel, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatRenderCache( const EDA_TEXT* aText, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatRenderCache( const EDA_TEXT* aText, int aNestLevel ) const |
|
|
|
{ |
|
|
|
wxString resolvedText( aText->GetShownText( true ) ); |
|
|
|
std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache = aText->GetRenderCache( aText->GetFont(), |
|
|
@ -545,7 +545,7 @@ void PCB_PLUGIN::formatRenderCache( const EDA_TEXT* aText, int aNestLevel ) cons |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatSetup( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatSetup( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
{ |
|
|
|
// Setup
|
|
|
|
m_out->Print( aNestLevel, "(setup\n" ); |
|
|
@ -606,7 +606,7 @@ void PCB_PLUGIN::formatSetup( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatGeneral( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatGeneral( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
{ |
|
|
|
const BOARD_DESIGN_SETTINGS& dsnSettings = aBoard->GetDesignSettings(); |
|
|
|
|
|
|
@ -626,7 +626,7 @@ void PCB_PLUGIN::formatGeneral( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
{ |
|
|
|
m_out->Print( aNestLevel, "(layers\n" ); |
|
|
|
|
|
|
@ -696,7 +696,7 @@ void PCB_PLUGIN::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatNetInformation( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatNetInformation( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
{ |
|
|
|
for( NETINFO_ITEM* net : *m_mapping ) |
|
|
|
{ |
|
|
@ -712,7 +712,7 @@ void PCB_PLUGIN::formatNetInformation( const BOARD* aBoard, int aNestLevel ) con |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatProperties( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatProperties( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
{ |
|
|
|
for( const std::pair<const wxString, wxString>& prop : aBoard->GetProperties() ) |
|
|
|
{ |
|
|
@ -726,7 +726,7 @@ void PCB_PLUGIN::formatProperties( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatHeader( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatHeader( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
{ |
|
|
|
formatGeneral( aBoard, aNestLevel ); |
|
|
|
|
|
|
@ -760,7 +760,7 @@ bool isDefaultTeardropParameters( const TEARDROP_PARAMETERS& tdParams ) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatTeardropParameters( const TEARDROP_PARAMETERS& tdParams, |
|
|
|
void PCB_IO_KICAD_SEXPR::formatTeardropParameters( const TEARDROP_PARAMETERS& tdParams, |
|
|
|
int aNestLevel ) const |
|
|
|
{ |
|
|
|
m_out->Print( aNestLevel, "(teardrops%s%s%s (best_length_ratio %s) (max_length %s) " |
|
|
@ -778,7 +778,7 @@ void PCB_PLUGIN::formatTeardropParameters( const TEARDROP_PARAMETERS& tdParams, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
{ |
|
|
|
std::set<BOARD_ITEM*, BOARD_ITEM::ptr_cmp> sorted_footprints( aBoard->Footprints().begin(), |
|
|
|
aBoard->Footprints().end() ); |
|
|
@ -831,7 +831,7 @@ void PCB_PLUGIN::format( const BOARD* aBoard, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel ) const |
|
|
|
{ |
|
|
|
const PCB_DIM_ALIGNED* aligned = dynamic_cast<const PCB_DIM_ALIGNED*>( aDimension ); |
|
|
|
const PCB_DIM_ORTHOGONAL* ortho = dynamic_cast<const PCB_DIM_ORTHOGONAL*>( aDimension ); |
|
|
@ -935,7 +935,7 @@ void PCB_PLUGIN::format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel ) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_SHAPE* aShape, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_SHAPE* aShape, int aNestLevel ) const |
|
|
|
{ |
|
|
|
FOOTPRINT* parentFP = aShape->GetParentFootprint(); |
|
|
|
std::string prefix = parentFP ? "fp" : "gr"; |
|
|
@ -1026,7 +1026,7 @@ void PCB_PLUGIN::format( const PCB_SHAPE* aShape, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_REFERENCE_IMAGE* aBitmap, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_REFERENCE_IMAGE* aBitmap, int aNestLevel ) const |
|
|
|
{ |
|
|
|
wxCHECK_RET( aBitmap != nullptr && m_out != nullptr, "" ); |
|
|
|
|
|
|
@ -1072,7 +1072,7 @@ void PCB_PLUGIN::format( const PCB_REFERENCE_IMAGE* aBitmap, int aNestLevel ) co |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_TARGET* aTarget, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_TARGET* aTarget, int aNestLevel ) const |
|
|
|
{ |
|
|
|
m_out->Print( aNestLevel, "(target %s (at %s) (size %s)", |
|
|
|
( aTarget->GetShape() ) ? "x" : "plus", |
|
|
@ -1090,7 +1090,7 @@ void PCB_PLUGIN::format( const PCB_TARGET* aTarget, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const FOOTPRINT* aFootprint, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const FOOTPRINT* aFootprint, int aNestLevel ) const |
|
|
|
{ |
|
|
|
if( !( m_ctl & CTL_OMIT_INITIAL_COMMENTS ) ) |
|
|
|
{ |
|
|
@ -1351,7 +1351,7 @@ void PCB_PLUGIN::format( const FOOTPRINT* aFootprint, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::formatLayers( LSET aLayerMask, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::formatLayers( LSET aLayerMask, int aNestLevel ) const |
|
|
|
{ |
|
|
|
std::string output; |
|
|
|
|
|
|
@ -1437,7 +1437,7 @@ void PCB_PLUGIN::formatLayers( LSET aLayerMask, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PAD* aPad, int aNestLevel ) const |
|
|
|
{ |
|
|
|
const BOARD* board = aPad->GetBoard(); |
|
|
|
const char* shape; |
|
|
@ -1817,7 +1817,7 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_TEXT* aText, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_TEXT* aText, int aNestLevel ) const |
|
|
|
{ |
|
|
|
FOOTPRINT* parentFP = aText->GetParentFootprint(); |
|
|
|
std::string prefix; |
|
|
@ -1879,7 +1879,7 @@ void PCB_PLUGIN::format( const PCB_TEXT* aText, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_TEXTBOX* aTextBox, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_TEXTBOX* aTextBox, int aNestLevel ) const |
|
|
|
{ |
|
|
|
FOOTPRINT* parentFP = aTextBox->GetParentFootprint(); |
|
|
|
|
|
|
@ -1938,7 +1938,7 @@ void PCB_PLUGIN::format( const PCB_TEXTBOX* aTextBox, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_GROUP* aGroup, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_GROUP* aGroup, int aNestLevel ) const |
|
|
|
{ |
|
|
|
// Don't write empty groups
|
|
|
|
if( aGroup->GetItems().empty() ) |
|
|
@ -1968,7 +1968,7 @@ void PCB_PLUGIN::format( const PCB_GROUP* aGroup, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_GENERATOR* aGenerator, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_GENERATOR* aGenerator, int aNestLevel ) const |
|
|
|
{ |
|
|
|
m_out->Print( aNestLevel, "(generated (id %s)\n", TO_UTF8( aGenerator->m_Uuid.AsString() ) ); |
|
|
|
|
|
|
@ -2063,7 +2063,7 @@ void PCB_PLUGIN::format( const PCB_GENERATOR* aGenerator, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const PCB_TRACK* aTrack, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const PCB_TRACK* aTrack, int aNestLevel ) const |
|
|
|
{ |
|
|
|
if( aTrack->Type() == PCB_VIA_T ) |
|
|
|
{ |
|
|
@ -2182,7 +2182,7 @@ void PCB_PLUGIN::format( const PCB_TRACK* aTrack, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::format( const ZONE* aZone, int aNestLevel ) const |
|
|
|
void PCB_IO_KICAD_SEXPR::format( const ZONE* aZone, int aNestLevel ) const |
|
|
|
{ |
|
|
|
// Save the NET info.
|
|
|
|
// For keepout and non copper zones, net code and net name are irrelevant
|
|
|
@ -2397,7 +2397,7 @@ void PCB_PLUGIN::format( const ZONE* aZone, int aNestLevel ) const |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PCB_PLUGIN::PCB_PLUGIN( int aControlFlags ) : |
|
|
|
PCB_IO_KICAD_SEXPR::PCB_IO_KICAD_SEXPR( int aControlFlags ) : |
|
|
|
m_cache( nullptr ), |
|
|
|
m_ctl( aControlFlags ), |
|
|
|
m_mapping( new NETINFO_MAPPING() ) |
|
|
@ -2407,14 +2407,14 @@ PCB_PLUGIN::PCB_PLUGIN( int aControlFlags ) : |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PCB_PLUGIN::~PCB_PLUGIN() |
|
|
|
PCB_IO_KICAD_SEXPR::~PCB_IO_KICAD_SEXPR() |
|
|
|
{ |
|
|
|
delete m_cache; |
|
|
|
delete m_mapping; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BOARD* PCB_PLUGIN::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe, |
|
|
|
BOARD* PCB_IO_KICAD_SEXPR::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe, |
|
|
|
const STRING_UTF8_MAP* aProperties, PROJECT* aProject, |
|
|
|
PROGRESS_REPORTER* aProgressReporter ) |
|
|
|
{ |
|
|
@ -2445,12 +2445,12 @@ BOARD* PCB_PLUGIN::LoadBoard( const wxString& aFileName, BOARD* aAppendToMe, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BOARD* PCB_PLUGIN::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties, |
|
|
|
BOARD* PCB_IO_KICAD_SEXPR::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const STRING_UTF8_MAP* aProperties, |
|
|
|
PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount) |
|
|
|
{ |
|
|
|
init( aProperties ); |
|
|
|
|
|
|
|
PCB_PARSER parser( &aReader, aAppendToMe, m_queryUserCallback, aProgressReporter, aLineCount ); |
|
|
|
PCB_IO_KICAD_SEXPR_PARSER parser( &aReader, aAppendToMe, m_queryUserCallback, aProgressReporter, aLineCount ); |
|
|
|
BOARD* board; |
|
|
|
|
|
|
|
try |
|
|
@ -2481,7 +2481,7 @@ BOARD* PCB_PLUGIN::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const STRIN |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::init( const STRING_UTF8_MAP* aProperties ) |
|
|
|
void PCB_IO_KICAD_SEXPR::init( const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
m_board = nullptr; |
|
|
|
m_reader = nullptr; |
|
|
@ -2489,7 +2489,7 @@ void PCB_PLUGIN::init( const STRING_UTF8_MAP* aProperties ) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::validateCache( const wxString& aLibraryPath, bool checkModified ) |
|
|
|
void PCB_IO_KICAD_SEXPR::validateCache( const wxString& aLibraryPath, bool checkModified ) |
|
|
|
{ |
|
|
|
if( !m_cache || !m_cache->IsPath( aLibraryPath ) || ( checkModified && m_cache->IsModified() ) ) |
|
|
|
{ |
|
|
@ -2501,7 +2501,7 @@ void PCB_PLUGIN::validateCache( const wxString& aLibraryPath, bool checkModified |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath, |
|
|
|
void PCB_IO_KICAD_SEXPR::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath, |
|
|
|
bool aBestEfforts, const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
|
|
@ -2530,7 +2530,7 @@ void PCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxStr |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const FOOTPRINT* PCB_PLUGIN::getFootprint( const wxString& aLibraryPath, |
|
|
|
const FOOTPRINT* PCB_IO_KICAD_SEXPR::getFootprint( const wxString& aLibraryPath, |
|
|
|
const wxString& aFootprintName, |
|
|
|
const STRING_UTF8_MAP* aProperties, |
|
|
|
bool checkModified ) |
|
|
@ -2558,7 +2558,7 @@ const FOOTPRINT* PCB_PLUGIN::getFootprint( const wxString& aLibraryPath, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const FOOTPRINT* PCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath, |
|
|
|
const FOOTPRINT* PCB_IO_KICAD_SEXPR::GetEnumeratedFootprint( const wxString& aLibraryPath, |
|
|
|
const wxString& aFootprintName, |
|
|
|
const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
@ -2566,7 +2566,7 @@ const FOOTPRINT* PCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPat |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool PCB_PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, |
|
|
|
bool PCB_IO_KICAD_SEXPR::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, |
|
|
|
const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
// Note: checking the cache sounds like a good idea, but won't catch files which differ
|
|
|
@ -2582,7 +2582,7 @@ bool PCB_PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FOOTPRINT* PCB_PLUGIN::ImportFootprint( const wxString& aFootprintPath, wxString& aFootprintNameOut, |
|
|
|
FOOTPRINT* PCB_IO_KICAD_SEXPR::ImportFootprint( const wxString& aFootprintPath, wxString& aFootprintNameOut, |
|
|
|
const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
wxString fcontents; |
|
|
@ -2599,7 +2599,7 @@ FOOTPRINT* PCB_PLUGIN::ImportFootprint( const wxString& aFootprintPath, wxString |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FOOTPRINT* PCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath, |
|
|
|
FOOTPRINT* PCB_IO_KICAD_SEXPR::FootprintLoad( const wxString& aLibraryPath, |
|
|
|
const wxString& aFootprintName, |
|
|
|
bool aKeepUUID, |
|
|
|
const STRING_UTF8_MAP* aProperties ) |
|
|
@ -2623,7 +2623,7 @@ FOOTPRINT* PCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, |
|
|
|
void PCB_IO_KICAD_SEXPR::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, |
|
|
|
const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
|
|
@ -2720,7 +2720,7 @@ void PCB_PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* a |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, |
|
|
|
void PCB_IO_KICAD_SEXPR::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, |
|
|
|
const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
LOCALE_IO toggle; // toggles on, then off, the C locale.
|
|
|
@ -2740,13 +2740,13 @@ void PCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long long PCB_PLUGIN::GetLibraryTimestamp( const wxString& aLibraryPath ) const |
|
|
|
long long PCB_IO_KICAD_SEXPR::GetLibraryTimestamp( const wxString& aLibraryPath ) const |
|
|
|
{ |
|
|
|
return FP_CACHE::GetTimestamp( aLibraryPath ); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PCB_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties ) |
|
|
|
void PCB_IO_KICAD_SEXPR::FootprintLibCreate( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
if( wxDir::Exists( aLibraryPath ) ) |
|
|
|
{ |
|
|
@ -2764,7 +2764,7 @@ void PCB_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const STRING_ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool PCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties ) |
|
|
|
bool PCB_IO_KICAD_SEXPR::FootprintLibDelete( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties ) |
|
|
|
{ |
|
|
|
wxFileName fn; |
|
|
|
fn.SetPath( aLibraryPath ); |
|
|
@ -2841,7 +2841,7 @@ bool PCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const STRING_ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool PCB_PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath ) |
|
|
|
bool PCB_IO_KICAD_SEXPR::IsFootprintLibWritable( const wxString& aLibraryPath ) |
|
|
|
{ |
|
|
|
LOCALE_IO toggle; |
|
|
|
|