Rename all schematic IO plugins

This commit is contained in:
Ian McInerney 2023-12-24 00:31:24 +00:00
parent d8b47d18d3
commit 85f62c1fde
58 changed files with 671 additions and 686 deletions

View File

@ -42,52 +42,52 @@ include_directories(
)
set( EESCHEMA_SCH_IO
sch_io/sch_lib_plugin_cache.cpp
sch_io/sch_io_lib_cache.cpp
sch_io/sch_io.cpp
sch_io/sch_io_mgr.cpp
# KiCad IO plugin
sch_io/kicad/sch_sexpr_lib_plugin_cache.cpp
sch_io/kicad/sch_sexpr_plugin_common.cpp
sch_io/kicad/sch_sexpr_parser.cpp
sch_io/kicad/sch_sexpr_plugin.cpp
sch_io/kicad_sexpr/sch_io_kicad_sexpr.cpp
sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.cpp
sch_io/kicad_sexpr/sch_io_kicad_sexpr_common.cpp
sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp
# Legacy IO plugin
sch_io/legacy/sch_legacy_lib_plugin_cache.cpp
sch_io/legacy/sch_legacy_plugin.cpp
sch_io/legacy/sch_legacy_plugin_helpers.cpp
sch_io/kicad_legacy/sch_io_kicad_legacy_lib_cache.cpp
sch_io/kicad_legacy/sch_io_kicad_legacy.cpp
sch_io/kicad_legacy/sch_io_kicad_legacy_helpers.cpp
# HTTP IO plugin
sch_io/http_lib/sch_http_lib_plugin.cpp
sch_io/http_lib/sch_io_http_lib.cpp
# Database IO plugin
sch_io/database/sch_database_plugin.cpp
sch_io/database/sch_io_database.cpp
# Eagle IO plugin
sch_io/eagle/sch_eagle_plugin.cpp
sch_io/eagle/sch_io_eagle.cpp
# Altium IO plugin
sch_io/altium/altium_parser_sch.cpp
sch_io/altium/sch_altium_plugin.cpp
sch_io/altium/sch_io_altium.cpp
# Cadstar IO plugin
sch_io/cadstar/cadstar_sch_archive_loader.cpp
sch_io/cadstar/cadstar_sch_archive_parser.cpp
sch_io/cadstar/cadstar_sch_archive_plugin.cpp
sch_io/cadstar/sch_io_cadstar_archive.cpp
# LTSpice IO plugin
sch_io/ltspice/ltspice_schematic.cpp
sch_io/ltspice/ltspice_sch_parser.cpp
sch_io/ltspice/ltspice_sch_plugin.cpp
sch_io/ltspice/sch_io_ltspice.cpp
sch_io/ltspice/sch_io_ltspice_parser.cpp
# EasyEDA IO plugin
sch_io/easyeda/sch_easyeda_parser.cpp
sch_io/easyeda/sch_easyeda_plugin.cpp
sch_io/easyeda/sch_io_easyeda.cpp
# EasyEDA Pro IO plugin
sch_io/easyedapro/sch_easyedapro_parser.cpp
sch_io/easyedapro/sch_easyedapro_plugin.cpp
sch_io/easyedapro/sch_io_easyedapro.cpp
)
set( EESCHEMA_DLGS

View File

@ -19,12 +19,12 @@
*/
#include <dialogs/dialog_database_lib_settings.h>
#include <sch_io/database/sch_database_plugin.h>
#include <sch_io/database/sch_io_database.h>
#include <database/database_lib_settings.h>
DIALOG_DATABASE_LIB_SETTINGS::DIALOG_DATABASE_LIB_SETTINGS( wxWindow* aParent,
SCH_DATABASE_PLUGIN* aPlugin ) :
SCH_IO_DATABASE* aPlugin ) :
DIALOG_DATABASE_LIB_SETTINGS_BASE( aParent ),
m_plugin( aPlugin )
{

View File

@ -23,12 +23,12 @@
#include "dialog_database_lib_settings_base.h"
class SCH_DATABASE_PLUGIN;
class SCH_IO_DATABASE;
class DIALOG_DATABASE_LIB_SETTINGS : public DIALOG_DATABASE_LIB_SETTINGS_BASE
{
public:
DIALOG_DATABASE_LIB_SETTINGS( wxWindow* aParent, SCH_DATABASE_PLUGIN* aPlugin );
DIALOG_DATABASE_LIB_SETTINGS( wxWindow* aParent, SCH_IO_DATABASE* aPlugin );
virtual ~DIALOG_DATABASE_LIB_SETTINGS() {}
@ -44,7 +44,7 @@ protected:
private:
bool hasPotentiallyValidConfig();
SCH_DATABASE_PLUGIN* m_plugin;
SCH_IO_DATABASE* m_plugin;
};
#endif //KICAD_DIALOG_DATABASE_LIB_SETTINGS_H

View File

@ -50,7 +50,7 @@
#include <settings/settings_manager.h>
#include <sch_file_versions.h>
#include <sch_io/kicad/sch_sexpr_lib_plugin_cache.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.h>
#include <netlist.h>
#include <netlist_exporter_base.h>
@ -802,7 +802,7 @@ int EESCHEMA_JOBS_HANDLER::JobSymExportSvg( JOB* aJob )
wxFileName fn( svgJob->m_libraryPath );
fn.MakeAbsolute();
SCH_SEXPR_PLUGIN_CACHE schLibrary( fn.GetFullPath() );
SCH_IO_KICAD_SEXPR_LIB_CACHE schLibrary( fn.GetFullPath() );
try
{
@ -872,7 +872,7 @@ int EESCHEMA_JOBS_HANDLER::JobSymUpgrade( JOB* aJob )
wxFileName fn( upgradeJob->m_libraryPath );
fn.MakeAbsolute();
SCH_SEXPR_PLUGIN_CACHE schLibrary( fn.GetFullPath() );
SCH_IO_KICAD_SEXPR_LIB_CACHE schLibrary( fn.GetFullPath() );
try
{

View File

@ -48,7 +48,7 @@
#include <sch_bus_entry.h>
#include <sch_commit.h>
#include <sch_edit_frame.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <sch_file_versions.h>
#include <sch_line.h>
#include <sch_sheet.h>
@ -535,7 +535,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// cache library or missing installed libraries, this can cause connectivity errors
// unless junctions are added.
//
// TODO: (RFB) This really needs to be put inside the Load() function of the SCH_LEGACY_PLUGIN
// TODO: (RFB) This really needs to be put inside the Load() function of the SCH_IO_KICAD_LEGACY
// I can't put it right now because of the extra code that is above to convert legacy bus-bus
// entries to bus wires
if( schFileType == SCH_IO_MGR::SCH_LEGACY )

View File

@ -34,7 +34,7 @@
#include <lib_item.h>
class SCH_LEGACY_PLUGIN_CACHE;
class SCH_IO_KICAD_LEGACY_LIB_CACHE;
/**
@ -234,7 +234,7 @@ private:
*/
void CalcEdit( const VECTOR2I& aPosition ) override;
friend class SCH_LEGACY_PLUGIN_CACHE; // Required to access m_name.
friend class SCH_IO_KICAD_LEGACY_LIB_CACHE; // Required to access m_name.
int m_id; ///< @see enum MANDATORY_FIELD_T
wxString m_name; ///< Name (not the field text value itself, that is #EDA_TEXT::m_Text)

View File

@ -822,7 +822,7 @@ void SYMBOL_LIB_TABLE_RESCUER::InvokeDialog( wxWindow* aParent, bool aAskShowAga
void SYMBOL_LIB_TABLE_RESCUER::OpenRescueLibrary()
{
(*m_properties)[ SCH_LEGACY_PLUGIN::PropBuffering ] = "";
(*m_properties)[ SCH_IO_KICAD_LEGACY::PropBuffering ] = "";
wxFileName fn = GetRescueLibraryFileName( m_schematic );

View File

@ -41,7 +41,7 @@
#include <string_utf8_map.h>
#include <lib_symbol.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <class_draw_panel_gal.h>
@ -49,7 +49,7 @@ class LIB_SYMBOL;
class SCH_SYMBOL;
class RESCUER;
class SCH_EDIT_FRAME;
class SCH_LEGACY_PLUGIN;
class SCH_IO_KICAD_LEGACY;
class SCH_SHEET_PATH;
class SCHEMATIC;

View File

@ -501,7 +501,7 @@ ASCH_HARNESS_ENTRY::ASCH_HARNESS_ENTRY( const std::map<wxString, wxString>& aPro
{
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::HARNESS_ENTRY );
// use SCH_ALTIUM_PLUGIN::m_harnessEntryParent instead, because this property sometimes
// use SCH_IO_ALTIUM::m_harnessEntryParent instead, because this property sometimes
// does not exist in altium file!
// ownerindex = ReadOwnerIndex( aProps );
@ -527,7 +527,7 @@ ASCH_HARNESS_TYPE::ASCH_HARNESS_TYPE( const std::map<wxString, wxString>& aProps
{
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::HARNESS_TYPE );
//ownerindex = ReadOwnerIndex( aProps ); // use SCH_ALTIUM_PLUGIN::m_harnessEntryParent instead!
//ownerindex = ReadOwnerIndex( aProps ); // use SCH_IO_ALTIUM::m_harnessEntryParent instead!
Text = ALTIUM_PARSER::ReadString( aProps, "TEXT", "" );

View File

@ -29,7 +29,7 @@
#include <io/io_utils.h>
#include <io/altium/altium_parser.h>
#include <io/altium/altium_parser_utils.h>
#include <sch_io/altium/sch_altium_plugin.h>
#include <sch_io/altium/sch_io_altium.h>
#include <schematic.h>
#include <project_sch.h>
@ -223,7 +223,7 @@ static void SetLibShapeFillAndColor( const ASCH_FILL_INTERFACE& elem, LIB_SHAPE*
}
SCH_ALTIUM_PLUGIN::SCH_ALTIUM_PLUGIN()
SCH_IO_ALTIUM::SCH_IO_ALTIUM()
{
m_isIntLib = false;
m_rootSheet = nullptr;
@ -235,7 +235,7 @@ SCH_ALTIUM_PLUGIN::SCH_ALTIUM_PLUGIN()
}
SCH_ALTIUM_PLUGIN::~SCH_ALTIUM_PLUGIN()
SCH_IO_ALTIUM::~SCH_IO_ALTIUM()
{
for( auto& [libName, lib] : m_libCache )
{
@ -247,26 +247,26 @@ SCH_ALTIUM_PLUGIN::~SCH_ALTIUM_PLUGIN()
}
const wxString SCH_ALTIUM_PLUGIN::GetName() const
const wxString SCH_IO_ALTIUM::GetName() const
{
return "Altium";
}
int SCH_ALTIUM_PLUGIN::GetModifyHash() const
int SCH_IO_ALTIUM::GetModifyHash() const
{
return 0;
}
bool SCH_ALTIUM_PLUGIN::checkFileHeader( const wxString& aFileName )
bool SCH_IO_ALTIUM::checkFileHeader( const wxString& aFileName )
{
// Compound File Binary Format header
return IO_UTILS::fileStartsWithBinaryHeader( aFileName, IO_UTILS::COMPOUND_FILE_HEADER );
}
bool SCH_ALTIUM_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
bool SCH_IO_ALTIUM::CanReadSchematicFile( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
return false;
@ -275,7 +275,7 @@ bool SCH_ALTIUM_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
}
bool SCH_ALTIUM_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
bool SCH_IO_ALTIUM::CanReadLibrary( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadLibrary( aFileName ) )
return false;
@ -284,7 +284,7 @@ bool SCH_ALTIUM_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
}
wxString SCH_ALTIUM_PLUGIN::getLibName()
wxString SCH_IO_ALTIUM::getLibName()
{
if( m_libName.IsEmpty() )
{
@ -308,7 +308,7 @@ wxString SCH_ALTIUM_PLUGIN::getLibName()
}
wxFileName SCH_ALTIUM_PLUGIN::getLibFileName()
wxFileName SCH_IO_ALTIUM::getLibFileName()
{
wxFileName fn( m_schematic->Prj().GetProjectPath(), getLibName(), KiCadSymbolLibFileExtension );
@ -316,7 +316,7 @@ wxFileName SCH_ALTIUM_PLUGIN::getLibFileName()
}
SCH_SHEET* SCH_ALTIUM_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* SCH_IO_ALTIUM::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{
@ -413,19 +413,19 @@ SCH_SHEET* SCH_ALTIUM_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHE
}
SCH_SCREEN* SCH_ALTIUM_PLUGIN::getCurrentScreen()
SCH_SCREEN* SCH_IO_ALTIUM::getCurrentScreen()
{
return m_sheetPath.LastScreen();
}
SCH_SHEET* SCH_ALTIUM_PLUGIN::getCurrentSheet()
SCH_SHEET* SCH_IO_ALTIUM::getCurrentSheet()
{
return m_sheetPath.Last();
}
void SCH_ALTIUM_PLUGIN::ParseAltiumSch( const wxString& aFileName )
void SCH_IO_ALTIUM::ParseAltiumSch( const wxString& aFileName )
{
ALTIUM_COMPOUND_FILE altiumSchFile( aFileName );
@ -507,7 +507,7 @@ void SCH_ALTIUM_PLUGIN::ParseAltiumSch( const wxString& aFileName )
}
void SCH_ALTIUM_PLUGIN::ParseStorage( const ALTIUM_COMPOUND_FILE& aAltiumSchFile )
void SCH_IO_ALTIUM::ParseStorage( const ALTIUM_COMPOUND_FILE& aAltiumSchFile )
{
const CFB::COMPOUND_FILE_ENTRY* file = aAltiumSchFile.FindStream( { "Storage" } );
@ -543,7 +543,7 @@ void SCH_ALTIUM_PLUGIN::ParseStorage( const ALTIUM_COMPOUND_FILE& aAltiumSchFile
}
void SCH_ALTIUM_PLUGIN::ParseAdditional( const ALTIUM_COMPOUND_FILE& aAltiumSchFile )
void SCH_IO_ALTIUM::ParseAdditional( const ALTIUM_COMPOUND_FILE& aAltiumSchFile )
{
const CFB::COMPOUND_FILE_ENTRY* file = aAltiumSchFile.FindStream( { "Additional" } );
@ -619,7 +619,7 @@ void SCH_ALTIUM_PLUGIN::ParseAdditional( const ALTIUM_COMPOUND_FILE& aAltiumSchF
}
void SCH_ALTIUM_PLUGIN::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchFile )
void SCH_IO_ALTIUM::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchFile )
{
const CFB::COMPOUND_FILE_ENTRY* file = aAltiumSchFile.FindStream( { "FileHeader" } );
@ -831,7 +831,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchF
break;
}
SCH_ALTIUM_PLUGIN::m_harnessOwnerIndexOffset = index;
SCH_IO_ALTIUM::m_harnessOwnerIndexOffset = index;
}
if( reader.HasParsingError() )
@ -879,7 +879,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchF
}
bool SCH_ALTIUM_PLUGIN::IsComponentPartVisible( int aOwnerindex, int aOwnerpartdisplaymode ) const
bool SCH_IO_ALTIUM::IsComponentPartVisible( int aOwnerindex, int aOwnerpartdisplaymode ) const
{
const auto& component = m_altiumComponents.find( aOwnerindex );
@ -890,7 +890,7 @@ bool SCH_ALTIUM_PLUGIN::IsComponentPartVisible( int aOwnerindex, int aOwnerpartd
}
const ASCH_STORAGE_FILE* SCH_ALTIUM_PLUGIN::GetFileFromStorage( const wxString& aFilename ) const
const ASCH_STORAGE_FILE* SCH_IO_ALTIUM::GetFileFromStorage( const wxString& aFilename ) const
{
const ASCH_STORAGE_FILE* nonExactMatch = nullptr;
@ -907,7 +907,7 @@ const ASCH_STORAGE_FILE* SCH_ALTIUM_PLUGIN::GetFileFromStorage( const wxString&
}
void SCH_ALTIUM_PLUGIN::ParseComponent( int aIndex,
void SCH_IO_ALTIUM::ParseComponent( int aIndex,
const std::map<wxString, wxString>& aProperties )
{
SCH_SHEET* currentSheet = m_sheetPath.Last();
@ -971,7 +971,7 @@ void SCH_ALTIUM_PLUGIN::ParseComponent( int aIndex,
void SCH_ALTIUM_PLUGIN::ParsePin( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
void SCH_IO_ALTIUM::ParsePin( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_PIN elem( aProperties );
@ -1233,7 +1233,7 @@ void SetTextPositioning( EDA_TEXT* text, ASCH_LABEL_JUSTIFICATION justification,
}
void SCH_ALTIUM_PLUGIN::ParseLabel( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol, std::vector<int>& aFontSizes )
void SCH_IO_ALTIUM::ParseLabel( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol, std::vector<int>& aFontSizes )
{
ASCH_LABEL elem( aProperties );
@ -1331,7 +1331,7 @@ void SCH_ALTIUM_PLUGIN::ParseLabel( const std::map<wxString, wxString>& aPropert
}
void SCH_ALTIUM_PLUGIN::ParseTextFrame( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol, std::vector<int>& aFontSizes )
void SCH_IO_ALTIUM::ParseTextFrame( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol, std::vector<int>& aFontSizes )
{
ASCH_TEXT_FRAME elem( aProperties );
@ -1342,7 +1342,7 @@ void SCH_ALTIUM_PLUGIN::ParseTextFrame( const std::map<wxString, wxString>& aPro
}
void SCH_ALTIUM_PLUGIN::ParseNote( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseNote( const std::map<wxString, wxString>& aProperties )
{
ASCH_NOTE elem( aProperties );
AddTextBox( static_cast<ASCH_TEXT_FRAME*>( &elem ) );
@ -1351,7 +1351,7 @@ void SCH_ALTIUM_PLUGIN::ParseNote( const std::map<wxString, wxString>& aProperti
}
void SCH_ALTIUM_PLUGIN::AddTextBox(const ASCH_TEXT_FRAME *aElem )
void SCH_IO_ALTIUM::AddTextBox(const ASCH_TEXT_FRAME *aElem )
{
SCH_TEXTBOX* textBox = new SCH_TEXTBOX();
@ -1414,7 +1414,7 @@ void SCH_ALTIUM_PLUGIN::AddTextBox(const ASCH_TEXT_FRAME *aElem )
}
void SCH_ALTIUM_PLUGIN::AddLibTextBox(const ASCH_TEXT_FRAME *aElem, std::vector<LIB_SYMBOL*>& aSymbol, std::vector<int>& aFontSizes )
void SCH_IO_ALTIUM::AddLibTextBox(const ASCH_TEXT_FRAME *aElem, std::vector<LIB_SYMBOL*>& aSymbol, std::vector<int>& aFontSizes )
{
LIB_SYMBOL* symbol = static_cast<int>( aSymbol.size() ) <= aElem->ownerpartdisplaymode
? nullptr
@ -1493,7 +1493,7 @@ void SCH_ALTIUM_PLUGIN::AddLibTextBox(const ASCH_TEXT_FRAME *aElem, std::vector<
}
void SCH_ALTIUM_PLUGIN::ParseBezier( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParseBezier( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_BEZIER elem( aProperties );
@ -1657,7 +1657,7 @@ void SCH_ALTIUM_PLUGIN::ParseBezier( const std::map<wxString, wxString>& aProper
}
void SCH_ALTIUM_PLUGIN::ParsePolyline( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParsePolyline( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_POLYLINE elem( aProperties );
@ -1727,7 +1727,7 @@ void SCH_ALTIUM_PLUGIN::ParsePolyline( const std::map<wxString, wxString>& aProp
}
void SCH_ALTIUM_PLUGIN::ParsePolygon( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParsePolygon( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_POLYGON elem( aProperties );
@ -1807,7 +1807,7 @@ void SCH_ALTIUM_PLUGIN::ParsePolygon( const std::map<wxString, wxString>& aPrope
}
void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParseRoundRectangle( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_ROUND_RECTANGLE elem( aProperties );
@ -1900,7 +1900,7 @@ void SCH_ALTIUM_PLUGIN::ParseRoundRectangle( const std::map<wxString, wxString>&
}
void SCH_ALTIUM_PLUGIN::ParseArc( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
void SCH_IO_ALTIUM::ParseArc( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_ARC elem( aProperties );
@ -2013,7 +2013,7 @@ void SCH_ALTIUM_PLUGIN::ParseArc( const std::map<wxString, wxString>& aPropertie
}
void SCH_ALTIUM_PLUGIN::ParseEllipticalArc( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
void SCH_IO_ALTIUM::ParseEllipticalArc( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_ARC elem( aProperties );
@ -2107,7 +2107,7 @@ void SCH_ALTIUM_PLUGIN::ParseEllipticalArc( const std::map<wxString, wxString>&
}
void SCH_ALTIUM_PLUGIN::ParseEllipse( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
void SCH_IO_ALTIUM::ParseEllipse( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_ELLIPSE elem( aProperties );
@ -2235,7 +2235,7 @@ void SCH_ALTIUM_PLUGIN::ParseEllipse( const std::map<wxString, wxString>& aPrope
}
void SCH_ALTIUM_PLUGIN::ParseCircle( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
void SCH_IO_ALTIUM::ParseCircle( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_ELLIPSE elem( aProperties );
@ -2301,7 +2301,7 @@ void SCH_ALTIUM_PLUGIN::ParseCircle( const std::map<wxString, wxString>& aProper
}
void SCH_ALTIUM_PLUGIN::ParseLine( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
void SCH_IO_ALTIUM::ParseLine( const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_LINE elem( aProperties );
@ -2369,7 +2369,7 @@ void SCH_ALTIUM_PLUGIN::ParseLine( const std::map<wxString, wxString>& aProperti
}
void SCH_ALTIUM_PLUGIN::ParseSignalHarness( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseSignalHarness( const std::map<wxString, wxString>& aProperties )
{
ASCH_SIGNAL_HARNESS elem( aProperties );
@ -2398,7 +2398,7 @@ void SCH_ALTIUM_PLUGIN::ParseSignalHarness( const std::map<wxString, wxString>&
}
void SCH_ALTIUM_PLUGIN::ParseHarnessConnector( int aIndex, const std::map<wxString,
void SCH_IO_ALTIUM::ParseHarnessConnector( int aIndex, const std::map<wxString,
wxString>& aProperties )
{
ASCH_HARNESS_CONNECTOR elem( aProperties );
@ -2435,7 +2435,7 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessConnector( int aIndex, const std::map<wxStri
}
void SCH_ALTIUM_PLUGIN::ParseHarnessEntry( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseHarnessEntry( const std::map<wxString, wxString>& aProperties )
{
ASCH_HARNESS_ENTRY elem( aProperties );
@ -2444,7 +2444,7 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessEntry( const std::map<wxString, wxString>& a
if( sheetIt == m_sheets.end() )
{
m_reporter->Report( wxString::Format( wxT( "Harness entry's parent (%d) not found." ),
SCH_ALTIUM_PLUGIN::m_harnessEntryParent ),
SCH_IO_ALTIUM::m_harnessEntryParent ),
RPT_SEVERITY_DEBUG );
return;
}
@ -2485,7 +2485,7 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessEntry( const std::map<wxString, wxString>& a
}
void SCH_ALTIUM_PLUGIN::ParseHarnessType( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseHarnessType( const std::map<wxString, wxString>& aProperties )
{
ASCH_HARNESS_TYPE elem( aProperties );
@ -2531,7 +2531,7 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessType( const std::map<wxString, wxString>& aP
}
void SCH_ALTIUM_PLUGIN::ParseRectangle( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParseRectangle( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_RECTANGLE elem( aProperties );
@ -2603,7 +2603,7 @@ void SCH_ALTIUM_PLUGIN::ParseRectangle( const std::map<wxString, wxString>& aPro
}
void SCH_ALTIUM_PLUGIN::ParseSheetSymbol( int aIndex,
void SCH_IO_ALTIUM::ParseSheetSymbol( int aIndex,
const std::map<wxString, wxString>& aProperties )
{
ASCH_SHEET_SYMBOL elem( aProperties );
@ -2641,7 +2641,7 @@ void SCH_ALTIUM_PLUGIN::ParseSheetSymbol( int aIndex,
}
void SCH_ALTIUM_PLUGIN::ParseSheetEntry( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseSheetEntry( const std::map<wxString, wxString>& aProperties )
{
ASCH_SHEET_ENTRY elem( aProperties );
@ -2922,7 +2922,7 @@ VECTOR2I HelperGeneratePowerPortGraphics( LIB_SYMBOL* aKsymbol, ASCH_POWER_PORT_
}
void SCH_ALTIUM_PLUGIN::ParsePowerPort( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParsePowerPort( const std::map<wxString, wxString>& aProperties )
{
ASCH_POWER_PORT elem( aProperties );
LIB_ID libId = AltiumToKiCadLibID( getLibName(), elem.text );
@ -3020,7 +3020,7 @@ void SCH_ALTIUM_PLUGIN::ParsePowerPort( const std::map<wxString, wxString>& aPro
}
void SCH_ALTIUM_PLUGIN::ParseHarnessPort( const ASCH_PORT& aElem )
void SCH_IO_ALTIUM::ParseHarnessPort( const ASCH_PORT& aElem )
{
SCH_TEXTBOX* textBox = new SCH_TEXTBOX();
@ -3084,7 +3084,7 @@ void SCH_ALTIUM_PLUGIN::ParseHarnessPort( const ASCH_PORT& aElem )
}
void SCH_ALTIUM_PLUGIN::ParsePort( const ASCH_PORT& aElem )
void SCH_IO_ALTIUM::ParsePort( const ASCH_PORT& aElem )
{
if( !aElem.HarnessType.IsEmpty() )
{
@ -3224,7 +3224,7 @@ void SCH_ALTIUM_PLUGIN::ParsePort( const ASCH_PORT& aElem )
}
void SCH_ALTIUM_PLUGIN::ParseNoERC( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseNoERC( const std::map<wxString, wxString>& aProperties )
{
ASCH_NO_ERC elem( aProperties );
@ -3241,7 +3241,7 @@ void SCH_ALTIUM_PLUGIN::ParseNoERC( const std::map<wxString, wxString>& aPropert
}
void SCH_ALTIUM_PLUGIN::ParseNetLabel( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseNetLabel( const std::map<wxString, wxString>& aProperties )
{
ASCH_NET_LABEL elem( aProperties );
@ -3257,7 +3257,7 @@ void SCH_ALTIUM_PLUGIN::ParseNetLabel( const std::map<wxString, wxString>& aProp
}
void SCH_ALTIUM_PLUGIN::ParseBus( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseBus( const std::map<wxString, wxString>& aProperties )
{
ASCH_BUS elem( aProperties );
@ -3277,7 +3277,7 @@ void SCH_ALTIUM_PLUGIN::ParseBus( const std::map<wxString, wxString>& aPropertie
}
void SCH_ALTIUM_PLUGIN::ParseWire( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseWire( const std::map<wxString, wxString>& aProperties )
{
ASCH_WIRE elem( aProperties );
@ -3297,7 +3297,7 @@ void SCH_ALTIUM_PLUGIN::ParseWire( const std::map<wxString, wxString>& aProperti
}
void SCH_ALTIUM_PLUGIN::ParseJunction( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseJunction( const std::map<wxString, wxString>& aProperties )
{
SCH_SCREEN* screen = getCurrentScreen();
wxCHECK( screen, /* void */ );
@ -3311,7 +3311,7 @@ void SCH_ALTIUM_PLUGIN::ParseJunction( const std::map<wxString, wxString>& aProp
}
void SCH_ALTIUM_PLUGIN::ParseImage( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseImage( const std::map<wxString, wxString>& aProperties )
{
ASCH_IMAGE elem( aProperties );
@ -3388,7 +3388,7 @@ void SCH_ALTIUM_PLUGIN::ParseImage( const std::map<wxString, wxString>& aPropert
}
void SCH_ALTIUM_PLUGIN::ParseSheet( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseSheet( const std::map<wxString, wxString>& aProperties )
{
m_altiumSheet = std::make_unique<ASCH_SHEET>( aProperties );
@ -3437,7 +3437,7 @@ void SCH_ALTIUM_PLUGIN::ParseSheet( const std::map<wxString, wxString>& aPropert
}
void SCH_ALTIUM_PLUGIN::ParseSheetName( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseSheetName( const std::map<wxString, wxString>& aProperties )
{
ASCH_SHEET_NAME elem( aProperties );
@ -3460,7 +3460,7 @@ void SCH_ALTIUM_PLUGIN::ParseSheetName( const std::map<wxString, wxString>& aPro
}
void SCH_ALTIUM_PLUGIN::ParseFileName( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseFileName( const std::map<wxString, wxString>& aProperties )
{
ASCH_FILE_NAME elem( aProperties );
@ -3485,7 +3485,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileName( const std::map<wxString, wxString>& aProp
}
void SCH_ALTIUM_PLUGIN::ParseDesignator( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseDesignator( const std::map<wxString, wxString>& aProperties )
{
ASCH_DESIGNATOR elem( aProperties );
@ -3524,7 +3524,7 @@ void SCH_ALTIUM_PLUGIN::ParseDesignator( const std::map<wxString, wxString>& aPr
}
void SCH_ALTIUM_PLUGIN::ParseLibDesignator( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParseLibDesignator( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol,
std::vector<int>& aFontSizes )
{
@ -3552,7 +3552,7 @@ void SCH_ALTIUM_PLUGIN::ParseLibDesignator( const std::map<wxString, wxString>&
}
void SCH_ALTIUM_PLUGIN::ParseBusEntry( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseBusEntry( const std::map<wxString, wxString>& aProperties )
{
ASCH_BUS_ENTRY elem( aProperties );
@ -3569,7 +3569,7 @@ void SCH_ALTIUM_PLUGIN::ParseBusEntry( const std::map<wxString, wxString>& aProp
}
void SCH_ALTIUM_PLUGIN::ParseParameter( const std::map<wxString, wxString>& aProperties )
void SCH_IO_ALTIUM::ParseParameter( const std::map<wxString, wxString>& aProperties )
{
ASCH_PARAMETER elem( aProperties );
@ -3667,7 +3667,7 @@ void SCH_ALTIUM_PLUGIN::ParseParameter( const std::map<wxString, wxString>& aPro
}
void SCH_ALTIUM_PLUGIN::ParseLibParameter( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParseLibParameter( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol,
std::vector<int>& aFontSizes )
{
@ -3741,7 +3741,7 @@ void SCH_ALTIUM_PLUGIN::ParseLibParameter( const std::map<wxString, wxString>& a
}
void SCH_ALTIUM_PLUGIN::ParseImplementationList( int aIndex,
void SCH_IO_ALTIUM::ParseImplementationList( int aIndex,
const std::map<wxString, wxString>& aProperties )
{
ASCH_IMPLEMENTATION_LIST elem( aProperties );
@ -3750,7 +3750,7 @@ void SCH_ALTIUM_PLUGIN::ParseImplementationList( int aIndex,
}
void SCH_ALTIUM_PLUGIN::ParseImplementation( const std::map<wxString, wxString>& aProperties,
void SCH_IO_ALTIUM::ParseImplementation( const std::map<wxString, wxString>& aProperties,
std::vector<LIB_SYMBOL*>& aSymbol )
{
ASCH_IMPLEMENTATION elem( aProperties );
@ -3814,7 +3814,7 @@ void SCH_ALTIUM_PLUGIN::ParseImplementation( const std::map<wxString, wxString>&
std::vector<LIB_SYMBOL*> SCH_ALTIUM_PLUGIN::ParseLibComponent( const std::map<wxString, wxString>& aProperties )
std::vector<LIB_SYMBOL*> SCH_IO_ALTIUM::ParseLibComponent( const std::map<wxString, wxString>& aProperties )
{
ASCH_SYMBOL elem( aProperties );
@ -3842,7 +3842,7 @@ std::vector<LIB_SYMBOL*> SCH_ALTIUM_PLUGIN::ParseLibComponent( const std::map<wx
}
std::map<wxString,LIB_SYMBOL*> SCH_ALTIUM_PLUGIN::ParseLibFile( const ALTIUM_COMPOUND_FILE& aAltiumLibFile )
std::map<wxString,LIB_SYMBOL*> SCH_IO_ALTIUM::ParseLibFile( const ALTIUM_COMPOUND_FILE& aAltiumLibFile )
{
std::map<wxString,LIB_SYMBOL*> ret;
std::vector<int> fontSizes;
@ -4013,7 +4013,7 @@ std::map<wxString,LIB_SYMBOL*> SCH_ALTIUM_PLUGIN::ParseLibFile( const ALTIUM_COM
}
long long SCH_ALTIUM_PLUGIN::getLibraryTimestamp( const wxString& aLibraryPath ) const
long long SCH_IO_ALTIUM::getLibraryTimestamp( const wxString& aLibraryPath ) const
{
wxFileName fn( aLibraryPath );
@ -4024,7 +4024,7 @@ long long SCH_ALTIUM_PLUGIN::getLibraryTimestamp( const wxString& aLibraryPath )
}
void SCH_ALTIUM_PLUGIN::ensureLoadedLibrary( const wxString& aLibraryPath,
void SCH_IO_ALTIUM::ensureLoadedLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
if( m_libCache.count( aLibraryPath ) )
@ -4085,7 +4085,7 @@ void SCH_ALTIUM_PLUGIN::ensureLoadedLibrary( const wxString& aLibraryPath
}
void SCH_ALTIUM_PLUGIN::ParseLibHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchFile, std::vector<int>& aFontSizes )
void SCH_IO_ALTIUM::ParseLibHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchFile, std::vector<int>& aFontSizes )
{
const CFB::COMPOUND_FILE_ENTRY* file = aAltiumSchFile.FindStream( { "FileHeader" } );
@ -4130,7 +4130,7 @@ void SCH_ALTIUM_PLUGIN::ParseLibHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchFi
}
void SCH_ALTIUM_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_ALTIUM::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -4147,7 +4147,7 @@ void SCH_ALTIUM_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameLi
}
void SCH_ALTIUM_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_ALTIUM::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -4162,7 +4162,7 @@ void SCH_ALTIUM_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolLis
}
}
LIB_SYMBOL* SCH_ALTIUM_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
LIB_SYMBOL* SCH_IO_ALTIUM::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
{

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _SCH_ALTIUM_PLUGIN_H_
#define _SCH_ALTIUM_PLUGIN_H_
#ifndef _SCH_IO_ALTIUM_H_
#define _SCH_IO_ALTIUM_H_
#include <memory>
#include <vector>
@ -42,7 +42,7 @@ class TITLE_BLOCK;
class ALTIUM_COMPOUND_FILE;
/**
* SCH_ALTIUM_PLUGIN
* SCH_IO_ALTIUM
* is a #SCH_IO derivation for loading Altium .SchDoc schematic files.
*
* As with all SCH_IO there is no UI dependencies i.e. windowing calls allowed.
@ -52,11 +52,11 @@ static std::vector<LIB_SYMBOL*> nullsym;
static std::vector<int> nullint;
class SCH_ALTIUM_PLUGIN : public SCH_IO
class SCH_IO_ALTIUM : public SCH_IO
{
public:
SCH_ALTIUM_PLUGIN();
~SCH_ALTIUM_PLUGIN();
SCH_IO_ALTIUM();
~SCH_IO_ALTIUM();
const wxString GetName() const override;
@ -235,4 +235,4 @@ private:
std::vector<std::pair<wxString, int>> m_fonts;
};
#endif // _SCH_ALTIUM_PLUGIN_H_
#endif // _SCH_IO_ALTIUM_H_

View File

@ -18,28 +18,28 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ALTIUM_LIB_IO_CACHE_
#define ALTIUM_LIB_IO_CACHE_
#ifndef SCH_IO_ALTIUM_LIB_CACHE_H_
#define SCH_IO_ALTIUM_LIB_CACHE_H_
#include "sch_io/sch_lib_plugin_cache.h"
#include "sch_io/sch_io_lib_cache.h"
class FILE_LINE_READER;
class SCH_SEXPR_IO;
class SCH_IO_KICAD_SEXPR;
/**
* A cache assistant for Altium symbol libraries.
*/
class ALTIUM_LIB_IO_CACHE : public SCH_LIB_IO_CACHE
class SCH_IO_ALTIUM_LIB_CACHE : public SCH_IO_LIB_CACHE
{
public:
ALTIUM_LIB_IO_CACHE( const wxString& aLibraryPath );
virtual ~ALTIUM_LIB_IO_CACHE();
SCH_IO_ALTIUM_LIB_CACHE( const wxString& aLibraryPath );
virtual ~SCH_IO_ALTIUM_LIB_CACHE();
void Load() override;
private:
friend SCH_SEXPR_IO;
friend SCH_IO_KICAD_SEXPR;
};
#endif // ALTIUM_LIB_IO_CACHE_
#endif // SCH_IO_ALTIUM_LIB_CACHE_H_

View File

@ -18,14 +18,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file cadstar_pcb_archive_plugin.cpp
* @brief Pcbnew PLUGIN for CADSTAR PCB Archive (*.cpa) format: an ASCII format
* based on S-expressions.
*/
#include <sch_io/cadstar/cadstar_sch_archive_loader.h>
#include <sch_io/cadstar/cadstar_sch_archive_plugin.h>
#include <sch_io/cadstar/sch_io_cadstar_archive.h>
#include <io/cadstar/cadstar_parts_lib_parser.h>
#include <lib_symbol.h>
@ -35,7 +29,7 @@
#include <sch_screen.h>
#include <sch_sheet.h>
#include <schematic.h>
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <wildcards_and_files_ext.h>
#include <wx_filename.h>
#include <wx/dir.h>
@ -43,13 +37,13 @@
#include <wx/txtstrm.h>
const wxString CADSTAR_SCH_ARCHIVE_PLUGIN::GetName() const
const wxString SCH_IO_CADSTAR_ARCHIVE::GetName() const
{
return wxT( "CADSTAR Schematic Archive" );
}
bool CADSTAR_SCH_ARCHIVE_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
bool SCH_IO_CADSTAR_ARCHIVE::CanReadLibrary( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadLibrary( aFileName ) )
return false;
@ -67,13 +61,13 @@ bool CADSTAR_SCH_ARCHIVE_PLUGIN::CanReadLibrary( const wxString& aFileName ) con
}
int CADSTAR_SCH_ARCHIVE_PLUGIN::GetModifyHash() const
int SCH_IO_CADSTAR_ARCHIVE::GetModifyHash() const
{
return 0;
}
SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::LoadSchematicFile( const wxString& aFileName,
SCH_SHEET* SCH_IO_CADSTAR_ARCHIVE::LoadSchematicFile( const wxString& aFileName,
SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
@ -157,7 +151,7 @@ SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::LoadSchematicFile( const wxString&
// set properties to prevent save file on every symbol save
STRING_UTF8_MAP properties;
properties.emplace( SCH_SEXPR_PLUGIN::PropBuffering, "" );
properties.emplace( SCH_IO_KICAD_SEXPR::PropBuffering, "" );
for( LIB_SYMBOL* const& symbol : csaLoader.GetLoadedSymbols() )
sch_plugin->SaveSymbol( libFileName.GetFullPath(), symbol, &properties );
@ -187,7 +181,7 @@ SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::LoadSchematicFile( const wxString&
}
void CADSTAR_SCH_ARCHIVE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_CADSTAR_ARCHIVE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -198,7 +192,7 @@ void CADSTAR_SCH_ARCHIVE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSym
}
void CADSTAR_SCH_ARCHIVE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_CADSTAR_ARCHIVE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -209,7 +203,7 @@ void CADSTAR_SCH_ARCHIVE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& a
}
LIB_SYMBOL* CADSTAR_SCH_ARCHIVE_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
LIB_SYMBOL* SCH_IO_CADSTAR_ARCHIVE::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
{
@ -222,7 +216,7 @@ LIB_SYMBOL* CADSTAR_SCH_ARCHIVE_PLUGIN::LoadSymbol( const wxString& aLibr
}
void CADSTAR_SCH_ARCHIVE_PLUGIN::GetAvailableSymbolFields( std::vector<wxString>& aNames )
void SCH_IO_CADSTAR_ARCHIVE::GetAvailableSymbolFields( std::vector<wxString>& aNames )
{
std::set<wxString> fieldNames;
@ -244,7 +238,7 @@ void CADSTAR_SCH_ARCHIVE_PLUGIN::GetAvailableSymbolFields( std::vector<wxString>
}
void CADSTAR_SCH_ARCHIVE_PLUGIN::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
void SCH_IO_CADSTAR_ARCHIVE::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
{
( *aListToAppendTo )["csa"] =
UTF8( _( "Path to the CADSTAR schematic archive (*.csa) file related to this CADSTAR "
@ -258,7 +252,7 @@ void CADSTAR_SCH_ARCHIVE_PLUGIN::SymbolLibOptions( STRING_UTF8_MAP* aListToAppen
}
void CADSTAR_SCH_ARCHIVE_PLUGIN::ensureLoadedLibrary( const wxString& aLibraryPath,
void SCH_IO_CADSTAR_ARCHIVE::ensureLoadedLibrary( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
wxFileName csafn;

View File

@ -18,14 +18,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file cadstar_pcb_archive_plugin.h
* @brief Pcbnew PLUGIN for CADSTAR PCB Archive (*.cpa) format: an ASCII format
* based on S-expressions.
*/
#ifndef CADSTAR_SCH_ARCHIVE_PLUGIN_H_
#define CADSTAR_SCH_ARCHIVE_PLUGIN_H_
#ifndef SCH_IO_CADSTAR_ARCHIVE_H_
#define SCH_IO_CADSTAR_ARCHIVE_H_
#include <map>
#include <sch_io/sch_io.h>
@ -38,17 +32,17 @@
class SCH_SHEET;
class SCH_SCREEN;
class CADSTAR_SCH_ARCHIVE_PLUGIN : public SCH_IO
class SCH_IO_CADSTAR_ARCHIVE : public SCH_IO
{
public:
CADSTAR_SCH_ARCHIVE_PLUGIN() :
SCH_IO_CADSTAR_ARCHIVE() :
m_cacheTimestamp( 0 )
{
m_reporter = &WXLOG_REPORTER::GetInstance();
m_progressReporter = nullptr;
}
virtual ~CADSTAR_SCH_ARCHIVE_PLUGIN() {}
virtual ~SCH_IO_CADSTAR_ARCHIVE() {}
const wxString GetName() const override;
@ -117,4 +111,4 @@ private:
PROGRESS_REPORTER* m_progressReporter; // optional; may be nullptr
};
#endif // CADSTAR_SCH_ARCHIVE_PLUGIN_H_
#endif // SCH_IO_CADSTAR_ARCHIVE_H_

View File

@ -30,10 +30,10 @@
#include <lib_symbol.h>
#include <symbol_lib_table.h>
#include "sch_database_plugin.h"
#include "sch_io_database.h"
SCH_DATABASE_PLUGIN::SCH_DATABASE_PLUGIN() :
SCH_IO_DATABASE::SCH_IO_DATABASE() :
m_libTable( nullptr ),
m_settings(),
m_conn()
@ -41,12 +41,12 @@ SCH_DATABASE_PLUGIN::SCH_DATABASE_PLUGIN() :
}
SCH_DATABASE_PLUGIN::~SCH_DATABASE_PLUGIN()
SCH_IO_DATABASE::~SCH_IO_DATABASE()
{
}
void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_DATABASE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -58,7 +58,7 @@ void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
}
void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_DATABASE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -107,7 +107,7 @@ void SCH_DATABASE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolL
}
LIB_SYMBOL* SCH_DATABASE_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
LIB_SYMBOL* SCH_IO_DATABASE::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
{
@ -175,7 +175,7 @@ LIB_SYMBOL* SCH_DATABASE_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
}
void SCH_DATABASE_PLUGIN::GetSubLibraryNames( std::vector<wxString>& aNames )
void SCH_IO_DATABASE::GetSubLibraryNames( std::vector<wxString>& aNames )
{
ensureSettings( wxEmptyString );
@ -194,20 +194,20 @@ void SCH_DATABASE_PLUGIN::GetSubLibraryNames( std::vector<wxString>& aNames )
}
void SCH_DATABASE_PLUGIN::GetAvailableSymbolFields( std::vector<wxString>& aNames )
void SCH_IO_DATABASE::GetAvailableSymbolFields( std::vector<wxString>& aNames )
{
std::copy( m_customFields.begin(), m_customFields.end(), std::back_inserter( aNames ) );
}
void SCH_DATABASE_PLUGIN::GetDefaultSymbolFields( std::vector<wxString>& aNames )
void SCH_IO_DATABASE::GetDefaultSymbolFields( std::vector<wxString>& aNames )
{
std::copy( m_defaultShownFields.begin(), m_defaultShownFields.end(),
std::back_inserter( aNames ) );
}
bool SCH_DATABASE_PLUGIN::TestConnection( wxString* aErrorMsg )
bool SCH_IO_DATABASE::TestConnection( wxString* aErrorMsg )
{
if( m_conn && m_conn->IsConnected() )
return true;
@ -221,7 +221,7 @@ bool SCH_DATABASE_PLUGIN::TestConnection( wxString* aErrorMsg )
}
void SCH_DATABASE_PLUGIN::ensureSettings( const wxString& aSettingsPath )
void SCH_IO_DATABASE::ensureSettings( const wxString& aSettingsPath )
{
auto tryLoad =
[&]()
@ -261,7 +261,7 @@ void SCH_DATABASE_PLUGIN::ensureSettings( const wxString& aSettingsPath )
}
void SCH_DATABASE_PLUGIN::ensureConnection()
void SCH_IO_DATABASE::ensureConnection()
{
wxCHECK_RET( m_settings, "Call ensureSettings before ensureConnection!" );
@ -278,7 +278,7 @@ void SCH_DATABASE_PLUGIN::ensureConnection()
}
void SCH_DATABASE_PLUGIN::connect()
void SCH_IO_DATABASE::connect()
{
wxCHECK_RET( m_settings, "Call ensureSettings before connect()!" );
@ -339,7 +339,7 @@ void SCH_DATABASE_PLUGIN::connect()
}
std::optional<bool> SCH_DATABASE_PLUGIN::boolFromAny( const std::any& aVal )
std::optional<bool> SCH_IO_DATABASE::boolFromAny( const std::any& aVal )
{
try
{
@ -388,7 +388,7 @@ std::optional<bool> SCH_DATABASE_PLUGIN::boolFromAny( const std::any& aVal )
}
LIB_SYMBOL* SCH_DATABASE_PLUGIN::loadSymbolFromRow( const wxString& aSymbolName,
LIB_SYMBOL* SCH_IO_DATABASE::loadSymbolFromRow( const wxString& aSymbolName,
const DATABASE_LIB_TABLE& aTable,
const DATABASE_CONNECTION::ROW& aRow )
{

View File

@ -18,8 +18,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KICAD_SCH_DATABASE_PLUGIN_H
#define KICAD_SCH_DATABASE_PLUGIN_H
#ifndef SCH_IO_DATABASE_H_
#define SCH_IO_DATABASE_H_
#include <database/database_connection.h>
#include <sch_io/sch_io.h>
@ -38,12 +38,12 @@ struct DATABASE_LIB_TABLE;
* plugins because the backing file is just a configuration file rather than something that
* contains symbol or footprint data.
*/
class SCH_DATABASE_PLUGIN : public SCH_IO
class SCH_IO_DATABASE : public SCH_IO
{
public:
SCH_DATABASE_PLUGIN();
virtual ~SCH_DATABASE_PLUGIN();
SCH_IO_DATABASE();
virtual ~SCH_IO_DATABASE();
const wxString GetName() const override
{
@ -119,4 +119,4 @@ private:
wxString m_lastError;
};
#endif //KICAD_SCH_DATABASE_PLUGIN_H
#endif //SCH_IO_DATABASE_H_

View File

@ -22,7 +22,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sch_io/eagle/sch_eagle_plugin.h>
#include <sch_io/eagle/sch_io_eagle.h>
#include <locale_io.h>
#include <string_utf8_map.h>
@ -51,7 +51,7 @@
#include <project/net_settings.h>
#include <sch_edit_frame.h>
#include <sch_junction.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <sch_marker.h>
#include <sch_screen.h>
#include <sch_shape.h>
@ -132,13 +132,13 @@ static inline wxString extractNetName( const wxString& aPinName )
}
SCH_SHEET* SCH_EAGLE_PLUGIN::getCurrentSheet()
SCH_SHEET* SCH_IO_EAGLE::getCurrentSheet()
{
return m_sheetPath.Last();
}
SCH_SCREEN* SCH_EAGLE_PLUGIN::getCurrentScreen()
SCH_SCREEN* SCH_IO_EAGLE::getCurrentScreen()
{
SCH_SHEET* currentSheet = m_sheetPath.Last();
wxCHECK( currentSheet, nullptr );
@ -146,7 +146,7 @@ SCH_SCREEN* SCH_EAGLE_PLUGIN::getCurrentScreen()
}
wxString SCH_EAGLE_PLUGIN::getLibName()
wxString SCH_IO_EAGLE::getLibName()
{
if( m_libName.IsEmpty() )
{
@ -170,7 +170,7 @@ wxString SCH_EAGLE_PLUGIN::getLibName()
}
wxFileName SCH_EAGLE_PLUGIN::getLibFileName()
wxFileName SCH_IO_EAGLE::getLibFileName()
{
wxFileName fn;
@ -182,7 +182,7 @@ wxFileName SCH_EAGLE_PLUGIN::getLibFileName()
}
void SCH_EAGLE_PLUGIN::loadLayerDefs( wxXmlNode* aLayers )
void SCH_IO_EAGLE::loadLayerDefs( wxXmlNode* aLayers )
{
std::vector<ELAYER> eagleLayers;
@ -227,7 +227,7 @@ void SCH_EAGLE_PLUGIN::loadLayerDefs( wxXmlNode* aLayers )
}
SCH_LAYER_ID SCH_EAGLE_PLUGIN::kiCadLayer( int aEagleLayer )
SCH_LAYER_ID SCH_IO_EAGLE::kiCadLayer( int aEagleLayer )
{
auto it = m_layerMap.find( aEagleLayer );
return it == m_layerMap.end() ? LAYER_NOTES : it->second;
@ -356,7 +356,7 @@ static void eagleToKicadAlignment( EDA_TEXT* aText, int aEagleAlignment, int aRe
}
SCH_EAGLE_PLUGIN::SCH_EAGLE_PLUGIN() :
SCH_IO_EAGLE::SCH_IO_EAGLE() :
m_progressReporter( nullptr ),
m_doneCount( 0 ),
m_lastProgressCount( 0 ),
@ -369,24 +369,24 @@ SCH_EAGLE_PLUGIN::SCH_EAGLE_PLUGIN() :
}
SCH_EAGLE_PLUGIN::~SCH_EAGLE_PLUGIN()
SCH_IO_EAGLE::~SCH_IO_EAGLE()
{
}
const wxString SCH_EAGLE_PLUGIN::GetName() const
const wxString SCH_IO_EAGLE::GetName() const
{
return wxT( "EAGLE" );
}
int SCH_EAGLE_PLUGIN::GetModifyHash() const
int SCH_IO_EAGLE::GetModifyHash() const
{
return 0;
}
void SCH_EAGLE_PLUGIN::checkpoint()
void SCH_IO_EAGLE::checkpoint()
{
const unsigned PROGRESS_DELTA = 5;
@ -406,7 +406,7 @@ void SCH_EAGLE_PLUGIN::checkpoint()
}
SCH_SHEET* SCH_EAGLE_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* SCH_IO_EAGLE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{
@ -463,7 +463,7 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEM
m_pi.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
m_properties = std::make_unique<STRING_UTF8_MAP>();
( *m_properties )[SCH_LEGACY_PLUGIN::PropBuffering] = "";
( *m_properties )[SCH_IO_KICAD_LEGACY::PropBuffering] = "";
/// @note No check is being done here to see if the existing symbol library exists so this
/// will overwrite the existing one.
@ -514,7 +514,7 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEM
}
void SCH_EAGLE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_EAGLE::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -533,7 +533,7 @@ void SCH_EAGLE_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameLis
}
void SCH_EAGLE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_EAGLE::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -552,7 +552,7 @@ void SCH_EAGLE_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList
}
LIB_SYMBOL* SCH_EAGLE_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
LIB_SYMBOL* SCH_IO_EAGLE::LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
{
m_filename = aLibraryPath;
@ -574,7 +574,7 @@ LIB_SYMBOL* SCH_EAGLE_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wx
}
long long SCH_EAGLE_PLUGIN::getLibraryTimestamp( const wxString& aLibraryPath ) const
long long SCH_IO_EAGLE::getLibraryTimestamp( const wxString& aLibraryPath ) const
{
wxFileName fn( aLibraryPath );
@ -585,7 +585,7 @@ long long SCH_EAGLE_PLUGIN::getLibraryTimestamp( const wxString& aLibraryPath )
}
void SCH_EAGLE_PLUGIN::ensureLoadedLibrary( const wxString& aLibraryPath )
void SCH_IO_EAGLE::ensureLoadedLibrary( const wxString& aLibraryPath )
{
if( m_eagleLibs.find( m_libName ) != m_eagleLibs.end() )
{
@ -626,7 +626,7 @@ void SCH_EAGLE_PLUGIN::ensureLoadedLibrary( const wxString& aLibraryPath )
}
wxXmlDocument SCH_EAGLE_PLUGIN::loadXmlDocument( const wxString& aFileName )
wxXmlDocument SCH_IO_EAGLE::loadXmlDocument( const wxString& aFileName )
{
wxXmlDocument xmlDocument;
wxFFileInputStream stream( m_filename.GetFullPath() );
@ -652,7 +652,7 @@ wxXmlDocument SCH_EAGLE_PLUGIN::loadXmlDocument( const wxString& aFileName )
}
void SCH_EAGLE_PLUGIN::loadDrawing( wxXmlNode* aDrawingNode )
void SCH_IO_EAGLE::loadDrawing( wxXmlNode* aDrawingNode )
{
// Map all children into a readable dictionary
NODE_MAP drawingChildren = MapChildren( aDrawingNode );
@ -687,7 +687,7 @@ void SCH_EAGLE_PLUGIN::loadDrawing( wxXmlNode* aDrawingNode )
}
void SCH_EAGLE_PLUGIN::countNets( wxXmlNode* aSchematicNode )
void SCH_IO_EAGLE::countNets( wxXmlNode* aSchematicNode )
{
// Map all children into a readable dictionary
NODE_MAP schematicChildren = MapChildren( aSchematicNode );
@ -721,7 +721,7 @@ void SCH_EAGLE_PLUGIN::countNets( wxXmlNode* aSchematicNode )
}
void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
void SCH_IO_EAGLE::loadSchematic( wxXmlNode* aSchematicNode )
{
// Map all children into a readable dictionary
NODE_MAP schematicChildren = MapChildren( aSchematicNode );
@ -939,7 +939,7 @@ void SCH_EAGLE_PLUGIN::loadSchematic( wxXmlNode* aSchematicNode )
}
void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex )
void SCH_IO_EAGLE::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex )
{
// Map all children into a readable dictionary
NODE_MAP sheetChildren = MapChildren( aSheetNode );
@ -1150,7 +1150,7 @@ void SCH_EAGLE_PLUGIN::loadSheet( wxXmlNode* aSheetNode, int aSheetIndex )
}
void SCH_EAGLE_PLUGIN::loadFrame( wxXmlNode* aFrameNode, std::vector<SCH_ITEM*>& aItems )
void SCH_IO_EAGLE::loadFrame( wxXmlNode* aFrameNode, std::vector<SCH_ITEM*>& aItems )
{
EFRAME eframe( aFrameNode );
@ -1347,7 +1347,7 @@ void SCH_EAGLE_PLUGIN::loadFrame( wxXmlNode* aFrameNode, std::vector<SCH_ITEM*>&
}
void SCH_EAGLE_PLUGIN::loadSegments( wxXmlNode* aSegmentsNode, const wxString& netName,
void SCH_IO_EAGLE::loadSegments( wxXmlNode* aSegmentsNode, const wxString& netName,
const wxString& aNetClass )
{
// Loop through all segments
@ -1489,7 +1489,7 @@ void SCH_EAGLE_PLUGIN::loadSegments( wxXmlNode* aSegmentsNode, const wxString& n
}
SCH_SHAPE* SCH_EAGLE_PLUGIN::loadPolyLine( wxXmlNode* aPolygonNode )
SCH_SHAPE* SCH_IO_EAGLE::loadPolyLine( wxXmlNode* aPolygonNode )
{
std::unique_ptr<SCH_SHAPE> poly = std::make_unique<SCH_SHAPE>( SHAPE_T::POLY );
EPOLYGON epoly( aPolygonNode );
@ -1530,7 +1530,7 @@ SCH_SHAPE* SCH_EAGLE_PLUGIN::loadPolyLine( wxXmlNode* aPolygonNode )
}
SCH_ITEM* SCH_EAGLE_PLUGIN::loadWire( wxXmlNode* aWireNode, SEG& endpoints )
SCH_ITEM* SCH_IO_EAGLE::loadWire( wxXmlNode* aWireNode, SEG& endpoints )
{
EWIRE ewire = EWIRE( aWireNode );
@ -1570,7 +1570,7 @@ SCH_ITEM* SCH_EAGLE_PLUGIN::loadWire( wxXmlNode* aWireNode, SEG& endpoints )
}
SCH_SHAPE* SCH_EAGLE_PLUGIN::loadCircle( wxXmlNode* aCircleNode )
SCH_SHAPE* SCH_IO_EAGLE::loadCircle( wxXmlNode* aCircleNode )
{
std::unique_ptr<SCH_SHAPE> circle = std::make_unique<SCH_SHAPE>( SHAPE_T::CIRCLE );
ECIRCLE c( aCircleNode );
@ -1585,7 +1585,7 @@ SCH_SHAPE* SCH_EAGLE_PLUGIN::loadCircle( wxXmlNode* aCircleNode )
}
SCH_SHAPE* SCH_EAGLE_PLUGIN::loadRectangle( wxXmlNode* aRectNode )
SCH_SHAPE* SCH_IO_EAGLE::loadRectangle( wxXmlNode* aRectNode )
{
std::unique_ptr<SCH_SHAPE> rectangle = std::make_unique<SCH_SHAPE>( SHAPE_T::RECTANGLE );
ERECT rect( aRectNode );
@ -1614,7 +1614,7 @@ SCH_SHAPE* SCH_EAGLE_PLUGIN::loadRectangle( wxXmlNode* aRectNode )
}
SCH_JUNCTION* SCH_EAGLE_PLUGIN::loadJunction( wxXmlNode* aJunction )
SCH_JUNCTION* SCH_IO_EAGLE::loadJunction( wxXmlNode* aJunction )
{
std::unique_ptr<SCH_JUNCTION> junction = std::make_unique<SCH_JUNCTION>();
@ -1627,7 +1627,7 @@ SCH_JUNCTION* SCH_EAGLE_PLUGIN::loadJunction( wxXmlNode* aJunction )
}
SCH_TEXT* SCH_EAGLE_PLUGIN::loadLabel( wxXmlNode* aLabelNode, const wxString& aNetName )
SCH_TEXT* SCH_IO_EAGLE::loadLabel( wxXmlNode* aLabelNode, const wxString& aNetName )
{
ELABEL elabel = ELABEL( aLabelNode, aNetName );
VECTOR2I elabelpos( elabel.x.ToSchUnits(), -elabel.y.ToSchUnits() );
@ -1664,7 +1664,7 @@ SCH_TEXT* SCH_EAGLE_PLUGIN::loadLabel( wxXmlNode* aLabelNode, const wxString& aN
std::pair<VECTOR2I, const SEG*>
SCH_EAGLE_PLUGIN::findNearestLinePoint( const VECTOR2I& aPoint,
SCH_IO_EAGLE::findNearestLinePoint( const VECTOR2I& aPoint,
const std::vector<SEG>& aLines ) const
{
VECTOR2I nearestPoint;
@ -1710,7 +1710,7 @@ SCH_EAGLE_PLUGIN::findNearestLinePoint( const VECTOR2I& aPoint,
}
void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
void SCH_IO_EAGLE::loadInstance( wxXmlNode* aInstanceNode )
{
EINSTANCE einstance = EINSTANCE( aInstanceNode );
SCH_SCREEN* screen = getCurrentScreen();
@ -1982,7 +1982,7 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
}
EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
EAGLE_LIBRARY* SCH_IO_EAGLE::loadLibrary( wxXmlNode* aLibraryNode,
EAGLE_LIBRARY* aEagleLibrary )
{
NODE_MAP libraryChildren = MapChildren( aLibraryNode );
@ -2130,7 +2130,7 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLibraryNode,
}
bool SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_SYMBOL>& aSymbol,
bool SCH_IO_EAGLE::loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_SYMBOL>& aSymbol,
EDEVICE* aDevice, int aGateNumber, const wxString& aGateName )
{
wxString symbolName = aSymbolNode->GetAttribute( wxT( "name" ) );
@ -2286,7 +2286,7 @@ bool SCH_EAGLE_PLUGIN::loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_S
}
LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolCircle( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_EAGLE::loadSymbolCircle( std::unique_ptr<LIB_SYMBOL>& aSymbol,
wxXmlNode* aCircleNode, int aGateNumber )
{
// Parse the circle properties
@ -2303,7 +2303,7 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolCircle( std::unique_ptr<LIB_SYMBOL>& aSym
}
LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolRectangle( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_EAGLE::loadSymbolRectangle( std::unique_ptr<LIB_SYMBOL>& aSymbol,
wxXmlNode* aRectNode, int aGateNumber )
{
ERECT rect( aRectNode );
@ -2334,7 +2334,7 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolRectangle( std::unique_ptr<LIB_SYMBOL>& a
}
LIB_ITEM* SCH_EAGLE_PLUGIN::loadSymbolWire( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_ITEM* SCH_IO_EAGLE::loadSymbolWire( std::unique_ptr<LIB_SYMBOL>& aSymbol,
wxXmlNode* aWireNode, int aGateNumber )
{
EWIRE ewire = EWIRE( aWireNode );
@ -2392,7 +2392,7 @@ LIB_ITEM* SCH_EAGLE_PLUGIN::loadSymbolWire( std::unique_ptr<LIB_SYMBOL>& aSymbol
}
LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolPolyLine( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_EAGLE::loadSymbolPolyLine( std::unique_ptr<LIB_SYMBOL>& aSymbol,
wxXmlNode* aPolygonNode, int aGateNumber )
{
LIB_SHAPE* poly = new LIB_SHAPE( aSymbol.get(), SHAPE_T::POLY );
@ -2434,7 +2434,7 @@ LIB_SHAPE* SCH_EAGLE_PLUGIN::loadSymbolPolyLine( std::unique_ptr<LIB_SYMBOL>& aS
}
LIB_PIN* SCH_EAGLE_PLUGIN::loadPin( std::unique_ptr<LIB_SYMBOL>& aSymbol, wxXmlNode* aPin,
LIB_PIN* SCH_IO_EAGLE::loadPin( std::unique_ptr<LIB_SYMBOL>& aSymbol, wxXmlNode* aPin,
EPIN* aEPin, int aGateNumber )
{
std::unique_ptr<LIB_PIN> pin = std::make_unique<LIB_PIN>( aSymbol.get() );
@ -2511,7 +2511,7 @@ LIB_PIN* SCH_EAGLE_PLUGIN::loadPin( std::unique_ptr<LIB_SYMBOL>& aSymbol, wxXmlN
}
LIB_TEXT* SCH_EAGLE_PLUGIN::loadSymbolText( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_TEXT* SCH_IO_EAGLE::loadSymbolText( std::unique_ptr<LIB_SYMBOL>& aSymbol,
wxXmlNode* aLibText, int aGateNumber )
{
std::unique_ptr<LIB_TEXT> libtext = std::make_unique<LIB_TEXT>( aSymbol.get() );
@ -2542,7 +2542,7 @@ LIB_TEXT* SCH_EAGLE_PLUGIN::loadSymbolText( std::unique_ptr<LIB_SYMBOL>& aSymbol
}
void SCH_EAGLE_PLUGIN::loadFrame( wxXmlNode* aFrameNode, std::vector<LIB_ITEM*>& aItems )
void SCH_IO_EAGLE::loadFrame( wxXmlNode* aFrameNode, std::vector<LIB_ITEM*>& aItems )
{
EFRAME eframe( aFrameNode );
@ -2731,7 +2731,7 @@ void SCH_EAGLE_PLUGIN::loadFrame( wxXmlNode* aFrameNode, std::vector<LIB_ITEM*>&
}
SCH_TEXT* SCH_EAGLE_PLUGIN::loadPlainText( wxXmlNode* aSchText )
SCH_TEXT* SCH_IO_EAGLE::loadPlainText( wxXmlNode* aSchText )
{
std::unique_ptr<SCH_TEXT> schtext = std::make_unique<SCH_TEXT>();
ETEXT etext = ETEXT( aSchText );
@ -2760,7 +2760,7 @@ SCH_TEXT* SCH_EAGLE_PLUGIN::loadPlainText( wxXmlNode* aSchText )
}
void SCH_EAGLE_PLUGIN::loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttribs ) const
void SCH_IO_EAGLE::loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttribs ) const
{
aText->SetTextSize( aAttribs.ConvertSize() );
@ -2782,7 +2782,7 @@ void SCH_EAGLE_PLUGIN::loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttrib
}
void SCH_EAGLE_PLUGIN::loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* aText ) const
void SCH_IO_EAGLE::loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* aText ) const
{
aField->SetTextPos( aText->GetPosition() );
aField->SetTextSize( aText->GetTextSize() );
@ -2793,7 +2793,7 @@ void SCH_EAGLE_PLUGIN::loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* a
}
void SCH_EAGLE_PLUGIN::adjustNetLabels()
void SCH_IO_EAGLE::adjustNetLabels()
{
// Eagle supports detached labels, so a label does not need to be placed on a wire
// to be associated with it. KiCad needs to move them, so the labels actually touch the
@ -2868,7 +2868,7 @@ void SCH_EAGLE_PLUGIN::adjustNetLabels()
}
bool SCH_EAGLE_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
bool SCH_IO_EAGLE::CanReadSchematicFile( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
return false;
@ -2877,7 +2877,7 @@ bool SCH_EAGLE_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
}
bool SCH_EAGLE_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
bool SCH_IO_EAGLE::CanReadLibrary( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadLibrary( aFileName ) )
return false;
@ -2886,7 +2886,7 @@ bool SCH_EAGLE_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
}
bool SCH_EAGLE_PLUGIN::checkHeader( const wxString& aFileName ) const
bool SCH_IO_EAGLE::checkHeader( const wxString& aFileName ) const
{
wxFileInputStream input( aFileName );
@ -2908,7 +2908,7 @@ bool SCH_EAGLE_PLUGIN::checkHeader( const wxString& aFileName ) const
}
void SCH_EAGLE_PLUGIN::moveLabels( SCH_LINE* aWire, const VECTOR2I& aNewEndPoint )
void SCH_IO_EAGLE::moveLabels( SCH_LINE* aWire, const VECTOR2I& aNewEndPoint )
{
SCH_SCREEN* screen = getCurrentScreen();
@ -2925,7 +2925,7 @@ void SCH_EAGLE_PLUGIN::moveLabels( SCH_LINE* aWire, const VECTOR2I& aNewEndPoint
}
void SCH_EAGLE_PLUGIN::addBusEntries()
void SCH_IO_EAGLE::addBusEntries()
{
// Add bus entry symbols
// TODO: Cleanup this function and break into pieces
@ -3475,7 +3475,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
}
const SEG* SCH_EAGLE_PLUGIN::SEG_DESC::LabelAttached( const SCH_TEXT* aLabel ) const
const SEG* SCH_IO_EAGLE::SEG_DESC::LabelAttached( const SCH_TEXT* aLabel ) const
{
VECTOR2I labelPos( aLabel->GetPosition() );
@ -3491,7 +3491,7 @@ const SEG* SCH_EAGLE_PLUGIN::SEG_DESC::LabelAttached( const SCH_TEXT* aLabel ) c
// TODO could be used to place junctions, instead of IsJunctionNeeded()
// (see SCH_EDIT_FRAME::importFile())
bool SCH_EAGLE_PLUGIN::checkConnections( const SCH_SYMBOL* aSymbol, const LIB_PIN* aPin ) const
bool SCH_IO_EAGLE::checkConnections( const SCH_SYMBOL* aSymbol, const LIB_PIN* aPin ) const
{
wxCHECK( aSymbol && aPin, false );
@ -3509,7 +3509,7 @@ bool SCH_EAGLE_PLUGIN::checkConnections( const SCH_SYMBOL* aSymbol, const LIB_PI
}
void SCH_EAGLE_PLUGIN::addImplicitConnections( SCH_SYMBOL* aSymbol, SCH_SCREEN* aScreen,
void SCH_IO_EAGLE::addImplicitConnections( SCH_SYMBOL* aSymbol, SCH_SCREEN* aScreen,
bool aUpdateSet )
{
wxCHECK( aSymbol->GetLibSymbolRef(), /*void*/ );
@ -3599,7 +3599,7 @@ void SCH_EAGLE_PLUGIN::addImplicitConnections( SCH_SYMBOL* aSymbol, SCH_SCREEN*
}
wxString SCH_EAGLE_PLUGIN::translateEagleBusName( const wxString& aEagleName ) const
wxString SCH_IO_EAGLE::translateEagleBusName( const wxString& aEagleName ) const
{
if( NET_SETTINGS::ParseBusVector( aEagleName, nullptr, nullptr ) )
return aEagleName;

View File

@ -22,8 +22,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SCH_EAGLE_PLUGIN_H_
#define _SCH_EAGLE_PLUGIN_H_
#ifndef SCH_IO_EAGLE_H_
#define SCH_IO_EAGLE_H_
#include <sch_line.h>
#include <sch_io/sch_io.h>
@ -50,7 +50,6 @@ class SCH_GLOBALLABEL;
class SCH_SYMBOL;
class SCH_FIELD;
class STRING_UTF8_MAP;
class SCH_EAGLE_PLUGIN_CACHE;
class LIB_SYMBOL;
class SYMBOL_LIB;
class LIB_SHAPE;
@ -79,13 +78,13 @@ typedef boost::ptr_map<wxString, EPART> EPART_LIST;
*
* As with all SCH_IO there is no UI dependencies i.e. windowing calls allowed.
*/
class SCH_EAGLE_PLUGIN : public SCH_IO
class SCH_IO_EAGLE : public SCH_IO
{
public:
const double ARC_ACCURACY = SCH_IU_PER_MM * 0.01; // 0.01mm
SCH_EAGLE_PLUGIN();
~SCH_EAGLE_PLUGIN();
SCH_IO_EAGLE();
~SCH_IO_EAGLE();
const wxString GetName() const override;
@ -296,4 +295,4 @@ private:
std::map<VECTOR2I, std::set<const EDA_ITEM*>> m_connPoints;
};
#endif // _SCH_EAGLE_PLUGIN_H_
#endif // SCH_IO_EAGLE_H_

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "sch_easyeda_plugin.h"
#include "sch_easyeda_parser.h"
#include "sch_io_easyeda.h"
#include <schematic.h>
#include <sch_sheet.h>
@ -41,7 +41,7 @@
const wxString SCH_EASYEDA_PLUGIN::GetName() const
const wxString SCH_IO_EASYEDA::GetName() const
{
return wxT( "EasyEDA (JLCEDA) Schematic Importer" );
}
@ -97,7 +97,7 @@ static bool FindSchFileInStream( const wxString& aName, wxInputStream& aStream,
}
bool SCH_EASYEDA_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
bool SCH_IO_EASYEDA::CanReadSchematicFile( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
return false;
@ -122,13 +122,13 @@ bool SCH_EASYEDA_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
}
bool SCH_EASYEDA_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
bool SCH_IO_EASYEDA::CanReadLibrary( const wxString& aFileName ) const
{
return CanReadSchematicFile( aFileName );
}
int SCH_EASYEDA_PLUGIN::GetModifyHash() const
int SCH_IO_EASYEDA::GetModifyHash() const
{
return 0;
}
@ -284,7 +284,7 @@ LIB_SYMBOL* loadSymbol( const wxString& aLibraryPath, nlohmann::json aFileData,
}
void SCH_EASYEDA_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_EASYEDA::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -407,7 +407,7 @@ void SCH_EASYEDA_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameL
}
void SCH_EASYEDA_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_EASYEDA::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -449,7 +449,7 @@ void SCH_EASYEDA_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolLi
}
LIB_SYMBOL* SCH_EASYEDA_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
LIB_SYMBOL* SCH_IO_EASYEDA::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
{
@ -544,7 +544,7 @@ static void LoadSchematic( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet, const w
}
SCH_SHEET* SCH_EASYEDA_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* SCH_IO_EASYEDA::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SCH_EASYEDA_PLUGIN_H_
#define SCH_EASYEDA_PLUGIN_H_
#ifndef SCH_IO_EASYEDA_H_
#define SCH_IO_EASYEDA_H_
#include <sch_io/sch_io.h>
#include <sch_io/sch_io_mgr.h>
@ -35,16 +35,16 @@ class SCH_SHEET;
class SCH_SCREEN;
class SCH_EASYEDA_PLUGIN : public SCH_IO
class SCH_IO_EASYEDA : public SCH_IO
{
public:
SCH_EASYEDA_PLUGIN()
SCH_IO_EASYEDA()
{
m_reporter = &WXLOG_REPORTER::GetInstance();
m_progressReporter = nullptr;
}
~SCH_EASYEDA_PLUGIN() {}
~SCH_IO_EASYEDA() {}
const wxString GetName() const override;
@ -89,4 +89,4 @@ private:
};
#endif // SCH_EASYEDA_PLUGIN_H_
#endif // SCH_IO_EASYEDA_H_

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "sch_easyedapro_plugin.h"
#include "sch_easyedapro_parser.h"
#include "sch_io_easyedapro.h"
#include <schematic.h>
#include <sch_sheet.h>
@ -41,40 +41,40 @@
#include <nlohmann/json.hpp>
#include <string_utils.h>
#include <wildcards_and_files_ext.h>
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <io/easyedapro/easyedapro_import_utils.h>
#include <core/map_helpers.h>
#include <project_sch.h>
struct SCH_EASYEDAPRO_PLUGIN::PRJ_DATA
struct SCH_IO_EASYEDAPRO::PRJ_DATA
{
std::map<wxString, EASYEDAPRO::SYM_INFO> m_Symbols;
std::map<wxString, EASYEDAPRO::BLOB> m_Blobs;
};
SCH_EASYEDAPRO_PLUGIN::SCH_EASYEDAPRO_PLUGIN()
SCH_IO_EASYEDAPRO::SCH_IO_EASYEDAPRO()
{
m_reporter = &WXLOG_REPORTER::GetInstance();
m_progressReporter = nullptr;
}
SCH_EASYEDAPRO_PLUGIN::~SCH_EASYEDAPRO_PLUGIN()
SCH_IO_EASYEDAPRO::~SCH_IO_EASYEDAPRO()
{
if( m_projectData )
delete m_projectData;
}
const wxString SCH_EASYEDAPRO_PLUGIN::GetName() const
const wxString SCH_IO_EASYEDAPRO::GetName() const
{
return wxT( "EasyEDA (JLCEDA) Schematic Importer" );
}
bool SCH_EASYEDAPRO_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
bool SCH_IO_EASYEDAPRO::CanReadSchematicFile( const wxString& aFileName ) const
{
if( aFileName.Lower().EndsWith( wxS( ".epro" ) ) )
{
@ -104,7 +104,7 @@ bool SCH_EASYEDAPRO_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) co
}
int SCH_EASYEDAPRO_PLUGIN::GetModifyHash() const
int SCH_IO_EASYEDAPRO::GetModifyHash() const
{
return 0;
}
@ -219,7 +219,7 @@ static LIB_SYMBOL* loadSymbol( nlohmann::json project, const wxString& aLibraryP
}
void SCH_EASYEDAPRO_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_EASYEDAPRO::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -255,7 +255,7 @@ void SCH_EASYEDAPRO_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNa
}
void SCH_EASYEDAPRO_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_EASYEDAPRO::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -278,7 +278,7 @@ void SCH_EASYEDAPRO_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbo
}
void SCH_EASYEDAPRO_PLUGIN::LoadAllDataFromProject( const wxString& aProjectPath )
void SCH_IO_EASYEDAPRO::LoadAllDataFromProject( const wxString& aProjectPath )
{
if( m_projectData )
delete m_projectData;
@ -357,7 +357,7 @@ void SCH_EASYEDAPRO_PLUGIN::LoadAllDataFromProject( const wxString& aProjectPath
}
LIB_SYMBOL* SCH_EASYEDAPRO_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
LIB_SYMBOL* SCH_IO_EASYEDAPRO::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
{
@ -371,7 +371,7 @@ LIB_SYMBOL* SCH_EASYEDAPRO_PLUGIN::LoadSymbol( const wxString& aLibraryPa
}
SCH_SHEET* SCH_EASYEDAPRO_PLUGIN::LoadSchematicFile( const wxString& aFileName,
SCH_SHEET* SCH_IO_EASYEDAPRO::LoadSchematicFile( const wxString& aFileName,
SCHEMATIC* aSchematic, SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{
@ -560,7 +560,7 @@ SCH_SHEET* SCH_EASYEDAPRO_PLUGIN::LoadSchematicFile( const wxString& aFileName,
// set properties to prevent save file on every symbol save
STRING_UTF8_MAP properties;
properties.emplace( SCH_SEXPR_PLUGIN::PropBuffering, wxEmptyString );
properties.emplace( SCH_IO_KICAD_SEXPR::PropBuffering, wxEmptyString );
for( auto& [symbolUuid, symInfo] : m_projectData->m_Symbols )
sch_plugin->SaveSymbol( libFileName.GetFullPath(), symInfo.libSymbol.release(),

View File

@ -22,8 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SCH_EASYEDAPRO_PLUGIN_H_
#define SCH_EASYEDAPRO_PLUGIN_H_
#ifndef SCH_IO_EASYEDAPRO_H_
#define SCH_IO_EASYEDAPRO_H_
#include <sch_io/sch_io.h>
#include <sch_io/sch_io_mgr.h>
@ -35,11 +35,11 @@ class SCH_SHEET;
class SCH_SCREEN;
class SCH_EASYEDAPRO_PLUGIN : public SCH_IO, public PROJECT_CHOOSER_PLUGIN
class SCH_IO_EASYEDAPRO : public SCH_IO, public PROJECT_CHOOSER_PLUGIN
{
public:
SCH_EASYEDAPRO_PLUGIN();
~SCH_EASYEDAPRO_PLUGIN();
SCH_IO_EASYEDAPRO();
~SCH_IO_EASYEDAPRO();
const wxString GetName() const override;
@ -87,4 +87,4 @@ private:
};
#endif // SCH_EASYEDAPRO_PLUGIN_H_
#endif // SCH_IO_EASYEDAPRO_H_

View File

@ -25,21 +25,21 @@
#include <symbol_lib_table.h>
#include <http_lib/http_lib_connection.h>
#include "sch_http_lib_plugin.h"
#include "sch_io_http_lib.h"
SCH_HTTP_LIB_PLUGIN::SCH_HTTP_LIB_PLUGIN() :
SCH_IO_HTTP_LIB::SCH_IO_HTTP_LIB() :
m_libTable( nullptr )
{
}
SCH_HTTP_LIB_PLUGIN::~SCH_HTTP_LIB_PLUGIN()
SCH_IO_HTTP_LIB::~SCH_IO_HTTP_LIB()
{
}
void SCH_HTTP_LIB_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_HTTP_LIB::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -51,7 +51,7 @@ void SCH_HTTP_LIB_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolName
}
void SCH_HTTP_LIB_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_HTTP_LIB::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -105,7 +105,7 @@ void SCH_HTTP_LIB_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolL
}
LIB_SYMBOL* SCH_HTTP_LIB_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
LIB_SYMBOL* SCH_IO_HTTP_LIB::LoadSymbol( const wxString& aLibraryPath,
const wxString& aAliasName,
const STRING_UTF8_MAP* aProperties )
{
@ -175,7 +175,7 @@ LIB_SYMBOL* SCH_HTTP_LIB_PLUGIN::LoadSymbol( const wxString& aLibraryPath
}
void SCH_HTTP_LIB_PLUGIN::GetSubLibraryNames( std::vector<wxString>& aNames )
void SCH_IO_HTTP_LIB::GetSubLibraryNames( std::vector<wxString>& aNames )
{
ensureSettings( wxEmptyString );
@ -194,21 +194,21 @@ void SCH_HTTP_LIB_PLUGIN::GetSubLibraryNames( std::vector<wxString>& aNames )
}
void SCH_HTTP_LIB_PLUGIN::GetAvailableSymbolFields( std::vector<wxString>& aNames )
void SCH_IO_HTTP_LIB::GetAvailableSymbolFields( std::vector<wxString>& aNames )
{
// TODO: Implement this sometime; This is currently broken...
std::copy( m_customFields.begin(), m_customFields.end(), std::back_inserter( aNames ) );
}
void SCH_HTTP_LIB_PLUGIN::GetDefaultSymbolFields( std::vector<wxString>& aNames )
void SCH_IO_HTTP_LIB::GetDefaultSymbolFields( std::vector<wxString>& aNames )
{
std::copy( m_defaultShownFields.begin(), m_defaultShownFields.end(),
std::back_inserter( aNames ) );
}
void SCH_HTTP_LIB_PLUGIN::ensureSettings( const wxString& aSettingsPath )
void SCH_IO_HTTP_LIB::ensureSettings( const wxString& aSettingsPath )
{
auto tryLoad = [&]()
@ -294,7 +294,7 @@ void SCH_HTTP_LIB_PLUGIN::ensureSettings( const wxString& aSettingsPath )
}
void SCH_HTTP_LIB_PLUGIN::ensureConnection()
void SCH_IO_HTTP_LIB::ensureConnection()
{
wxCHECK_RET( m_settings, "Call ensureSettings before ensureConnection!" );
@ -311,7 +311,7 @@ void SCH_HTTP_LIB_PLUGIN::ensureConnection()
}
void SCH_HTTP_LIB_PLUGIN::connect()
void SCH_IO_HTTP_LIB::connect()
{
wxCHECK_RET( m_settings, "Call ensureSettings before connect()!" );
@ -328,7 +328,7 @@ void SCH_HTTP_LIB_PLUGIN::connect()
}
LIB_SYMBOL* SCH_HTTP_LIB_PLUGIN::loadSymbolFromPart( const wxString& aSymbolName,
LIB_SYMBOL* SCH_IO_HTTP_LIB::loadSymbolFromPart( const wxString& aSymbolName,
const HTTP_LIB_CATEGORY& aCategory,
const HTTP_LIB_PART& aPart )
{
@ -444,7 +444,7 @@ LIB_SYMBOL* SCH_HTTP_LIB_PLUGIN::loadSymbolFromPart( const wxString& aS
return symbol;
}
void SCH_HTTP_LIB_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
void SCH_IO_HTTP_LIB::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
{
// TODO: Implement this sometime;

View File

@ -18,8 +18,8 @@
*/
#ifndef KICAD_SCH_HTTP_LIB_PLUGIN_H
#define KICAD_SCH_HTTP_LIB_PLUGIN_H
#ifndef SCH_IO_HTTP_LIB_H
#define SCH_IO_HTTP_LIB_H
#include "http_lib/http_lib_settings.h"
#include <http_lib/http_lib_connection.h>
@ -35,12 +35,12 @@
* plugins because the backing file is just a configuration file rather than something that
* contains symbol or footprint data.
*/
class SCH_HTTP_LIB_PLUGIN : public SCH_IO
class SCH_IO_HTTP_LIB : public SCH_IO
{
public:
SCH_HTTP_LIB_PLUGIN();
virtual ~SCH_HTTP_LIB_PLUGIN();
SCH_IO_HTTP_LIB();
virtual ~SCH_IO_HTTP_LIB();
const wxString GetName() const override
{
@ -128,4 +128,4 @@ private:
};
#endif //KICAD_SCH_HTTP_LIB_PLUGIN_H
#endif // SCH_IO_HTTP_LIB_H_

View File

@ -54,9 +54,9 @@
#include <sch_sheet_pin.h>
#include <bus_alias.h>
#include <io/io_utils.h>
#include <sch_io/legacy/sch_legacy_lib_plugin_cache.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/legacy/sch_legacy_plugin_helpers.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy_lib_cache.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy_helpers.h>
#include <sch_screen.h>
#include <schematic.h>
#include <symbol_library.h>
@ -72,7 +72,7 @@
#define T_WIDTH "width"
SCH_LEGACY_PLUGIN::SCH_LEGACY_PLUGIN() :
SCH_IO_KICAD_LEGACY::SCH_IO_KICAD_LEGACY() :
m_appending( false ),
m_progressReporter( nullptr ),
m_lineReader( nullptr ),
@ -83,13 +83,13 @@ SCH_LEGACY_PLUGIN::SCH_LEGACY_PLUGIN() :
}
SCH_LEGACY_PLUGIN::~SCH_LEGACY_PLUGIN()
SCH_IO_KICAD_LEGACY::~SCH_IO_KICAD_LEGACY()
{
delete m_cache;
}
void SCH_LEGACY_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_LEGACY::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
{
m_version = 0;
m_rootSheet = nullptr;
@ -100,7 +100,7 @@ void SCH_LEGACY_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aPro
}
void SCH_LEGACY_PLUGIN::checkpoint()
void SCH_IO_KICAD_LEGACY::checkpoint()
{
const unsigned PROGRESS_DELTA = 250;
@ -122,7 +122,7 @@ void SCH_LEGACY_PLUGIN::checkpoint()
}
SCH_SHEET* SCH_LEGACY_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* SCH_IO_KICAD_LEGACY::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{
@ -193,7 +193,7 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHE
// Everything below this comment is recursive. Modify with care.
void SCH_LEGACY_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
void SCH_IO_KICAD_LEGACY::loadHierarchy( SCH_SHEET* aSheet )
{
SCH_SCREEN* screen = nullptr;
@ -277,7 +277,7 @@ void SCH_LEGACY_PLUGIN::loadHierarchy( SCH_SHEET* aSheet )
}
void SCH_LEGACY_PLUGIN::loadFile( const wxString& aFileName, SCH_SCREEN* aScreen )
void SCH_IO_KICAD_LEGACY::loadFile( const wxString& aFileName, SCH_SCREEN* aScreen )
{
FILE_LINE_READER reader( aFileName );
@ -316,13 +316,13 @@ void SCH_LEGACY_PLUGIN::loadFile( const wxString& aFileName, SCH_SCREEN* aScreen
}
void SCH_LEGACY_PLUGIN::LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen, int version )
void SCH_IO_KICAD_LEGACY::LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen, int version )
{
m_version = version;
// We cannot safely load content without a set root level.
wxCHECK_RET( m_rootSheet,
"Cannot call SCH_LEGACY_PLUGIN::LoadContent() without setting root sheet." );
"Cannot call SCH_IO_KICAD_LEGACY::LoadContent() without setting root sheet." );
while( aReader.ReadLine() )
{
@ -365,7 +365,7 @@ void SCH_LEGACY_PLUGIN::LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen,
}
void SCH_LEGACY_PLUGIN::loadHeader( LINE_READER& aReader, SCH_SCREEN* aScreen )
void SCH_IO_KICAD_LEGACY::loadHeader( LINE_READER& aReader, SCH_SCREEN* aScreen )
{
const char* line = aReader.ReadLine();
@ -405,7 +405,7 @@ void SCH_LEGACY_PLUGIN::loadHeader( LINE_READER& aReader, SCH_SCREEN* aScreen )
}
void SCH_LEGACY_PLUGIN::loadPageSettings( LINE_READER& aReader, SCH_SCREEN* aScreen )
void SCH_IO_KICAD_LEGACY::loadPageSettings( LINE_READER& aReader, SCH_SCREEN* aScreen )
{
wxASSERT( aScreen != nullptr );
@ -534,7 +534,7 @@ void SCH_LEGACY_PLUGIN::loadPageSettings( LINE_READER& aReader, SCH_SCREEN* aScr
}
SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader )
SCH_SHEET* SCH_IO_KICAD_LEGACY::loadSheet( LINE_READER& aReader )
{
std::unique_ptr<SCH_SHEET> sheet = std::make_unique<SCH_SHEET>();
@ -644,7 +644,7 @@ SCH_SHEET* SCH_LEGACY_PLUGIN::loadSheet( LINE_READER& aReader )
}
SCH_BITMAP* SCH_LEGACY_PLUGIN::loadBitmap( LINE_READER& aReader )
SCH_BITMAP* SCH_IO_KICAD_LEGACY::loadBitmap( LINE_READER& aReader )
{
std::unique_ptr<SCH_BITMAP> bitmap = std::make_unique<SCH_BITMAP>();
@ -735,7 +735,7 @@ SCH_BITMAP* SCH_LEGACY_PLUGIN::loadBitmap( LINE_READER& aReader )
}
SCH_JUNCTION* SCH_LEGACY_PLUGIN::loadJunction( LINE_READER& aReader )
SCH_JUNCTION* SCH_IO_KICAD_LEGACY::loadJunction( LINE_READER& aReader )
{
std::unique_ptr<SCH_JUNCTION> junction = std::make_unique<SCH_JUNCTION>();
@ -757,7 +757,7 @@ SCH_JUNCTION* SCH_LEGACY_PLUGIN::loadJunction( LINE_READER& aReader )
}
SCH_NO_CONNECT* SCH_LEGACY_PLUGIN::loadNoConnect( LINE_READER& aReader )
SCH_NO_CONNECT* SCH_IO_KICAD_LEGACY::loadNoConnect( LINE_READER& aReader )
{
std::unique_ptr<SCH_NO_CONNECT> no_connect = std::make_unique<SCH_NO_CONNECT>();
@ -779,7 +779,7 @@ SCH_NO_CONNECT* SCH_LEGACY_PLUGIN::loadNoConnect( LINE_READER& aReader )
}
SCH_LINE* SCH_LEGACY_PLUGIN::loadWire( LINE_READER& aReader )
SCH_LINE* SCH_IO_KICAD_LEGACY::loadWire( LINE_READER& aReader )
{
std::unique_ptr<SCH_LINE> wire = std::make_unique<SCH_LINE>();
@ -885,7 +885,7 @@ SCH_LINE* SCH_LEGACY_PLUGIN::loadWire( LINE_READER& aReader )
}
SCH_BUS_ENTRY_BASE* SCH_LEGACY_PLUGIN::loadBusEntry( LINE_READER& aReader )
SCH_BUS_ENTRY_BASE* SCH_IO_KICAD_LEGACY::loadBusEntry( LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -944,7 +944,7 @@ const std::map<LABEL_FLAG_SHAPE, const char*> sheetLabelNames
// clang-format on
SCH_TEXT* SCH_LEGACY_PLUGIN::loadText( LINE_READER& aReader )
SCH_TEXT* SCH_IO_KICAD_LEGACY::loadText( LINE_READER& aReader )
{
const char* line = aReader.Line();
KICAD_T textType = TYPE_NOT_INIT;
@ -1081,7 +1081,7 @@ SCH_TEXT* SCH_LEGACY_PLUGIN::loadText( LINE_READER& aReader )
}
SCH_SYMBOL* SCH_LEGACY_PLUGIN::loadSymbol( LINE_READER& aReader )
SCH_SYMBOL* SCH_IO_KICAD_LEGACY::loadSymbol( LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -1428,7 +1428,7 @@ SCH_SYMBOL* SCH_LEGACY_PLUGIN::loadSymbol( LINE_READER& aReader )
}
std::shared_ptr<BUS_ALIAS> SCH_LEGACY_PLUGIN::loadBusAlias( LINE_READER& aReader,
std::shared_ptr<BUS_ALIAS> SCH_IO_KICAD_LEGACY::loadBusAlias( LINE_READER& aReader,
SCH_SCREEN* aScreen )
{
auto busAlias = std::make_shared<BUS_ALIAS>( aScreen );
@ -1453,7 +1453,7 @@ std::shared_ptr<BUS_ALIAS> SCH_LEGACY_PLUGIN::loadBusAlias( LINE_READER& aReader
}
void SCH_LEGACY_PLUGIN::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
void SCH_IO_KICAD_LEGACY::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties )
{
@ -1480,7 +1480,7 @@ void SCH_LEGACY_PLUGIN::SaveSchematicFile( const wxString& aFileName, SCH_SHEET*
}
void SCH_LEGACY_PLUGIN::Format( SCH_SHEET* aSheet )
void SCH_IO_KICAD_LEGACY::Format( SCH_SHEET* aSheet )
{
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET* object." );
wxCHECK_RET( m_schematic != nullptr, "NULL SCHEMATIC* object." );
@ -1569,7 +1569,7 @@ void SCH_LEGACY_PLUGIN::Format( SCH_SHEET* aSheet )
saveText( static_cast<SCH_TEXT*>( item ) );
break;
default:
wxASSERT( "Unexpected schematic object type in SCH_LEGACY_PLUGIN::Format()" );
wxASSERT( "Unexpected schematic object type in SCH_IO_KICAD_LEGACY::Format()" );
}
}
@ -1577,7 +1577,7 @@ void SCH_LEGACY_PLUGIN::Format( SCH_SHEET* aSheet )
}
void SCH_LEGACY_PLUGIN::Format( SELECTION* aSelection, OUTPUTFORMATTER* aFormatter )
void SCH_IO_KICAD_LEGACY::Format( SELECTION* aSelection, OUTPUTFORMATTER* aFormatter )
{
m_out = aFormatter;
@ -1616,13 +1616,13 @@ void SCH_LEGACY_PLUGIN::Format( SELECTION* aSelection, OUTPUTFORMATTER* aFormatt
saveText( static_cast< SCH_TEXT* >( item ) );
break;
default:
wxASSERT( "Unexpected schematic object type in SCH_LEGACY_PLUGIN::Format()" );
wxASSERT( "Unexpected schematic object type in SCH_IO_KICAD_LEGACY::Format()" );
}
}
}
void SCH_LEGACY_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol )
void SCH_IO_KICAD_LEGACY::saveSymbol( SCH_SYMBOL* aSymbol )
{
std::string name1;
std::string name2;
@ -1728,7 +1728,7 @@ void SCH_LEGACY_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol )
}
void SCH_LEGACY_PLUGIN::saveField( SCH_FIELD* aField )
void SCH_IO_KICAD_LEGACY::saveField( SCH_FIELD* aField )
{
char hjustify = 'C';
@ -1764,7 +1764,7 @@ void SCH_LEGACY_PLUGIN::saveField( SCH_FIELD* aField )
}
void SCH_LEGACY_PLUGIN::saveBitmap( SCH_BITMAP* aBitmap )
void SCH_IO_KICAD_LEGACY::saveBitmap( SCH_BITMAP* aBitmap )
{
wxCHECK_RET( aBitmap != nullptr, "SCH_BITMAP* is NULL" );
@ -1804,7 +1804,7 @@ void SCH_LEGACY_PLUGIN::saveBitmap( SCH_BITMAP* aBitmap )
}
void SCH_LEGACY_PLUGIN::saveSheet( SCH_SHEET* aSheet )
void SCH_IO_KICAD_LEGACY::saveSheet( SCH_SHEET* aSheet )
{
wxCHECK_RET( aSheet != nullptr, "SCH_SHEET* is NULL" );
@ -1872,7 +1872,7 @@ void SCH_LEGACY_PLUGIN::saveSheet( SCH_SHEET* aSheet )
}
void SCH_LEGACY_PLUGIN::saveJunction( SCH_JUNCTION* aJunction )
void SCH_IO_KICAD_LEGACY::saveJunction( SCH_JUNCTION* aJunction )
{
wxCHECK_RET( aJunction != nullptr, "SCH_JUNCTION* is NULL" );
@ -1882,7 +1882,7 @@ void SCH_LEGACY_PLUGIN::saveJunction( SCH_JUNCTION* aJunction )
}
void SCH_LEGACY_PLUGIN::saveNoConnect( SCH_NO_CONNECT* aNoConnect )
void SCH_IO_KICAD_LEGACY::saveNoConnect( SCH_NO_CONNECT* aNoConnect )
{
wxCHECK_RET( aNoConnect != nullptr, "SCH_NOCONNECT* is NULL" );
@ -1892,7 +1892,7 @@ void SCH_LEGACY_PLUGIN::saveNoConnect( SCH_NO_CONNECT* aNoConnect )
}
void SCH_LEGACY_PLUGIN::saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry )
void SCH_IO_KICAD_LEGACY::saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry )
{
wxCHECK_RET( aBusEntry != nullptr, "SCH_BUS_ENTRY_BASE* is NULL" );
@ -1915,7 +1915,7 @@ void SCH_LEGACY_PLUGIN::saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry )
}
void SCH_LEGACY_PLUGIN::saveLine( SCH_LINE* aLine )
void SCH_IO_KICAD_LEGACY::saveLine( SCH_LINE* aLine )
{
wxCHECK_RET( aLine != nullptr, "SCH_LINE* is NULL" );
@ -1957,7 +1957,7 @@ void SCH_LEGACY_PLUGIN::saveLine( SCH_LINE* aLine )
}
void SCH_LEGACY_PLUGIN::saveText( SCH_TEXT* aText )
void SCH_IO_KICAD_LEGACY::saveText( SCH_TEXT* aText )
{
wxCHECK_RET( aText != nullptr, "SCH_TEXT* is NULL" );
@ -2038,7 +2038,7 @@ void SCH_LEGACY_PLUGIN::saveText( SCH_TEXT* aText )
}
void SCH_LEGACY_PLUGIN::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
void SCH_IO_KICAD_LEGACY::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
{
wxCHECK_RET( aAlias != nullptr, "BUS_ALIAS* is NULL" );
@ -2049,13 +2049,13 @@ void SCH_LEGACY_PLUGIN::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias )
}
void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_LEGACY::cacheLib( const wxString& aLibraryFileName, const STRING_UTF8_MAP* aProperties )
{
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
{
// a spectacular episode in memory management:
delete m_cache;
m_cache = new SCH_LEGACY_PLUGIN_CACHE( aLibraryFileName );
m_cache = new SCH_IO_KICAD_LEGACY_LIB_CACHE( aLibraryFileName );
if( !isBuffering( aProperties ) )
m_cache->Load();
@ -2063,9 +2063,9 @@ void SCH_LEGACY_PLUGIN::cacheLib( const wxString& aLibraryFileName, const STRING
}
bool SCH_LEGACY_PLUGIN::writeDocFile( const STRING_UTF8_MAP* aProperties )
bool SCH_IO_KICAD_LEGACY::writeDocFile( const STRING_UTF8_MAP* aProperties )
{
std::string propName( SCH_LEGACY_PLUGIN::PropNoDocFile );
std::string propName( SCH_IO_KICAD_LEGACY::PropNoDocFile );
if( aProperties && aProperties->find( propName ) != aProperties->end() )
return false;
@ -2074,13 +2074,13 @@ bool SCH_LEGACY_PLUGIN::writeDocFile( const STRING_UTF8_MAP* aProperties )
}
bool SCH_LEGACY_PLUGIN::isBuffering( const STRING_UTF8_MAP* aProperties )
bool SCH_IO_KICAD_LEGACY::isBuffering( const STRING_UTF8_MAP* aProperties )
{
return ( aProperties && aProperties->Exists( SCH_LEGACY_PLUGIN::PropBuffering ) );
return ( aProperties && aProperties->Exists( SCH_IO_KICAD_LEGACY::PropBuffering ) );
}
int SCH_LEGACY_PLUGIN::GetModifyHash() const
int SCH_IO_KICAD_LEGACY::GetModifyHash() const
{
if( m_cache )
return m_cache->GetModifyHash();
@ -2090,7 +2090,7 @@ int SCH_LEGACY_PLUGIN::GetModifyHash() const
}
void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -2111,7 +2111,7 @@ void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
}
void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_KICAD_LEGACY::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -2132,7 +2132,7 @@ void SCH_LEGACY_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolLis
}
LIB_SYMBOL* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
LIB_SYMBOL* SCH_IO_KICAD_LEGACY::LoadSymbol( const wxString& aLibraryPath,
const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
{
@ -2149,7 +2149,7 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath,
}
void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
void SCH_IO_KICAD_LEGACY::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2163,7 +2163,7 @@ void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMB
}
void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
void SCH_IO_KICAD_LEGACY::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -2177,7 +2177,7 @@ void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxStri
}
void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
void SCH_IO_KICAD_LEGACY::CreateSymbolLib( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
if( wxFileExists( aLibraryPath ) )
@ -2189,14 +2189,14 @@ void SCH_LEGACY_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
LOCALE_IO toggle;
delete m_cache;
m_cache = new SCH_LEGACY_PLUGIN_CACHE( aLibraryPath );
m_cache = new SCH_IO_KICAD_LEGACY_LIB_CACHE( aLibraryPath );
m_cache->SetModified();
m_cache->Save( writeDocFile( aProperties ) );
m_cache->Load(); // update m_writable and m_mod_time
}
bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
bool SCH_IO_KICAD_LEGACY::DeleteSymbolLib( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
wxFileName fn = aLibraryPath;
@ -2222,10 +2222,10 @@ bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
}
void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_LEGACY::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{
if( !m_cache )
m_cache = new SCH_LEGACY_PLUGIN_CACHE( aLibraryPath );
m_cache = new SCH_IO_KICAD_LEGACY_LIB_CACHE( aLibraryPath );
wxString oldFileName = m_cache->GetFileName();
@ -2241,7 +2241,7 @@ void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_
}
bool SCH_LEGACY_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
bool SCH_IO_KICAD_LEGACY::CanReadSchematicFile( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
return false;
@ -2250,7 +2250,7 @@ bool SCH_LEGACY_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
}
bool SCH_LEGACY_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
bool SCH_IO_KICAD_LEGACY::CanReadLibrary( const wxString& aFileName ) const
{
if( !SCH_IO::CanReadLibrary( aFileName ) )
return false;
@ -2259,26 +2259,26 @@ bool SCH_LEGACY_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
}
bool SCH_LEGACY_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
bool SCH_IO_KICAD_LEGACY::IsSymbolLibWritable( const wxString& aLibraryPath )
{
// Writing legacy symbol libraries is deprecated.
return false;
}
LIB_SYMBOL* SCH_LEGACY_PLUGIN::ParsePart( LINE_READER& reader, int aMajorVersion,
LIB_SYMBOL* SCH_IO_KICAD_LEGACY::ParsePart( LINE_READER& reader, int aMajorVersion,
int aMinorVersion )
{
return SCH_LEGACY_PLUGIN_CACHE::LoadPart( reader, aMajorVersion, aMinorVersion );
return SCH_IO_KICAD_LEGACY_LIB_CACHE::LoadPart( reader, aMajorVersion, aMinorVersion );
}
void SCH_LEGACY_PLUGIN::FormatPart( LIB_SYMBOL* symbol, OUTPUTFORMATTER & formatter )
void SCH_IO_KICAD_LEGACY::FormatPart( LIB_SYMBOL* symbol, OUTPUTFORMATTER & formatter )
{
SCH_LEGACY_PLUGIN_CACHE::SaveSymbol( symbol, formatter );
SCH_IO_KICAD_LEGACY_LIB_CACHE::SaveSymbol( symbol, formatter );
}
const char* SCH_LEGACY_PLUGIN::PropBuffering = "buffering";
const char* SCH_LEGACY_PLUGIN::PropNoDocFile = "no_doc_file";
const char* SCH_IO_KICAD_LEGACY::PropBuffering = "buffering";
const char* SCH_IO_KICAD_LEGACY::PropNoDocFile = "no_doc_file";

View File

@ -20,8 +20,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SCH_LEGACY_PLUGIN_H_
#define _SCH_LEGACY_PLUGIN_H_
#ifndef SCH_IO_KICAD_LEGACY_H_
#define SCH_IO_KICAD_LEGACY_H_
#include <memory>
#include <sch_io/sch_io.h>
@ -45,7 +45,7 @@ class SCH_SYMBOL;
class SCH_FIELD;
class STRING_UTF8_MAP;
class SELECTION;
class SCH_LEGACY_PLUGIN_CACHE;
class SCH_IO_KICAD_LEGACY_LIB_CACHE;
class LIB_SYMBOL;
class SYMBOL_LIB;
class BUS_ALIAS;
@ -63,12 +63,12 @@ class OUTPUTFORMATTER;
*
* As with all SCH_IO there is no UI dependencies i.e. windowing calls allowed.
*/
class SCH_LEGACY_PLUGIN : public SCH_IO
class SCH_IO_KICAD_LEGACY : public SCH_IO
{
public:
SCH_LEGACY_PLUGIN();
virtual ~SCH_LEGACY_PLUGIN();
SCH_IO_KICAD_LEGACY();
virtual ~SCH_IO_KICAD_LEGACY();
const wxString GetName() const override
{
@ -201,11 +201,11 @@ protected:
SCH_SHEET* m_rootSheet; ///< The root sheet of the schematic being loaded.
SCH_SHEET* m_currentSheet; ///< The sheet currently being loaded.
OUTPUTFORMATTER* m_out; ///< The formatter for saving SCH_SCREEN objects.
SCH_LEGACY_PLUGIN_CACHE* m_cache;
SCH_IO_KICAD_LEGACY_LIB_CACHE* m_cache;
SCHEMATIC* m_schematic;
/// initialize PLUGIN like a constructor would.
void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
};
#endif // _SCH_LEGACY_PLUGIN_H_
#endif // SCH_IO_KICAD_LEGACY_H_

View File

@ -26,7 +26,7 @@
#include <richio.h>
#include <config.h> // contains strncasecmp for msvc
#include "sch_legacy_plugin_helpers.h"
#include "sch_io_kicad_legacy_helpers.h"
// Token delimiters.

View File

@ -17,8 +17,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SCH_LEGACY_PLUGIN_HELPERS_H_
#define _SCH_LEGACY_PLUGIN_HELPERS_H_
#ifndef SCH_IO_KICAD_LEGACY_HELPERS_H_
#define SCH_IO_KICAD_LEGACY_HELPERS_H_
#include <cstdint>
@ -142,4 +142,4 @@ extern void parseQuotedString( wxString& aString, LINE_READER& aReader, const ch
#endif // _SCH_LEGACY_PLUGIN_HELPERS_H_
#endif // SCH_IO_KICAD_LEGACY_HELPERS_H_

View File

@ -31,8 +31,8 @@
#include <trace_helpers.h>
#include <wildcards_and_files_ext.h>
#include "sch_legacy_lib_plugin_cache.h"
#include "sch_legacy_plugin_helpers.h"
#include "sch_io_kicad_legacy_lib_cache.h"
#include "sch_io_kicad_legacy_helpers.h"
#define LIB_VERSION_MAJOR 2 ///< Legacy symbol library major version.
@ -56,15 +56,15 @@
( LIB_VERSION( major, minor ) <= LIB_VERSION( 2, 4 ) )
SCH_LEGACY_PLUGIN_CACHE::SCH_LEGACY_PLUGIN_CACHE( const wxString& aFullPathAndFileName ) :
SCH_LIB_PLUGIN_CACHE( aFullPathAndFileName )
SCH_IO_KICAD_LEGACY_LIB_CACHE::SCH_IO_KICAD_LEGACY_LIB_CACHE( const wxString& aFullPathAndFileName ) :
SCH_IO_LIB_CACHE( aFullPathAndFileName )
{
m_versionMajor = -1;
m_versionMinor = -1;
}
void SCH_LEGACY_PLUGIN_CACHE::Load()
void SCH_IO_KICAD_LEGACY_LIB_CACHE::Load()
{
if( !m_libFileName.FileExists() )
{
@ -151,7 +151,7 @@ void SCH_LEGACY_PLUGIN_CACHE::Load()
}
}
SCH_LEGACY_PLUGIN_CACHE::IncrementModifyHash();
SCH_IO_KICAD_LEGACY_LIB_CACHE::IncrementModifyHash();
// Remember the file modification time of library file when the
// cache snapshot was made, so that in a networked environment we will
@ -163,7 +163,7 @@ void SCH_LEGACY_PLUGIN_CACHE::Load()
}
void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadDocs()
{
const char* line;
wxString text;
@ -267,7 +267,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDocs()
}
void SCH_LEGACY_PLUGIN_CACHE::loadHeader( FILE_LINE_READER& aReader )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadHeader( FILE_LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -289,7 +289,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadHeader( FILE_LINE_READER& aReader )
}
LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorVersion,
LIB_SYMBOL* SCH_IO_KICAD_LEGACY_LIB_CACHE::LoadPart( LINE_READER& aReader, int aMajorVersion,
int aMinorVersion, LIB_SYMBOL_MAP* aMap )
{
const char* line = aReader.Line();
@ -474,7 +474,7 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorV
}
void SCH_LEGACY_PLUGIN_CACHE::loadAliases( std::unique_ptr<LIB_SYMBOL>& aSymbol,
void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadAliases( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader,
LIB_SYMBOL_MAP* aMap )
{
@ -524,7 +524,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadAliases( std::unique_ptr<LIB_SYMBOL>& aSymbol,
}
void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSymbol,
void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -675,7 +675,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadField( std::unique_ptr<LIB_SYMBOL>& aSymbol,
}
void SCH_LEGACY_PLUGIN_CACHE::loadDrawEntries( std::unique_ptr<LIB_SYMBOL>& aSymbol,
void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadDrawEntries( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader,
int aMajorVersion,
int aMinorVersion )
@ -742,7 +742,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadDrawEntries( std::unique_ptr<LIB_SYMBOL>& aSym
}
FILL_T SCH_LEGACY_PLUGIN_CACHE::parseFillMode( LINE_READER& aReader, const char* aLine,
FILL_T SCH_IO_KICAD_LEGACY_LIB_CACHE::parseFillMode( LINE_READER& aReader, const char* aLine,
const char** aOutput )
{
switch ( parseChar( aReader, aLine, aOutput ) )
@ -819,7 +819,7 @@ static bool MapAnglesV6( int* aAngle1, int* aAngle2 )
}
LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadArc( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadArc( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -901,7 +901,7 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadArc( std::unique_ptr<LIB_SYMBOL>& aSymbo
}
LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadCircle( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadCircle( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -934,7 +934,7 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadCircle( std::unique_ptr<LIB_SYMBOL>& aSy
}
LIB_TEXT* SCH_LEGACY_PLUGIN_CACHE::loadText( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_TEXT* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadText( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader,
int aMajorVersion,
int aMinorVersion )
@ -1033,7 +1033,7 @@ LIB_TEXT* SCH_LEGACY_PLUGIN_CACHE::loadText( std::unique_ptr<LIB_SYMBOL>& aSymbo
}
LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadRect( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadRect( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -1070,7 +1070,7 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadRect( std::unique_ptr<LIB_SYMBOL>& aSymb
}
LIB_PIN* SCH_LEGACY_PLUGIN_CACHE::loadPin( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_PIN* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPin( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -1292,7 +1292,7 @@ LIB_PIN* SCH_LEGACY_PLUGIN_CACHE::loadPin( std::unique_ptr<LIB_SYMBOL>& aSymbol,
}
LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadPolyLine( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPolyLine( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -1326,7 +1326,7 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadPolyLine( std::unique_ptr<LIB_SYMBOL>& a
}
LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadBezier( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LIB_SHAPE* SCH_IO_KICAD_LEGACY_LIB_CACHE::loadBezier( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -1374,7 +1374,7 @@ LIB_SHAPE* SCH_LEGACY_PLUGIN_CACHE::loadBezier( std::unique_ptr<LIB_SYMBOL>& aSy
}
void SCH_LEGACY_PLUGIN_CACHE::loadFootprintFilters( std::unique_ptr<LIB_SYMBOL>& aSymbol,
void SCH_IO_KICAD_LEGACY_LIB_CACHE::loadFootprintFilters( std::unique_ptr<LIB_SYMBOL>& aSymbol,
LINE_READER& aReader )
{
const char* line = aReader.Line();
@ -1404,7 +1404,7 @@ void SCH_LEGACY_PLUGIN_CACHE::loadFootprintFilters( std::unique_ptr<LIB_SYMBOL>&
}
void SCH_LEGACY_PLUGIN_CACHE::Save( const std::optional<bool>& aOpt )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::Save( const std::optional<bool>& aOpt )
{
wxCHECK( aOpt, /* void */ );
@ -1439,7 +1439,7 @@ void SCH_LEGACY_PLUGIN_CACHE::Save( const std::optional<bool>& aOpt )
}
void SCH_LEGACY_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& aFormatter,
void SCH_IO_KICAD_LEGACY_LIB_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& aFormatter,
LIB_SYMBOL_MAP* aMap )
{
/*
@ -1592,7 +1592,7 @@ void SCH_LEGACY_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER&
}
void SCH_LEGACY_PLUGIN_CACHE::saveArc( LIB_SHAPE* aArc, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveArc( LIB_SHAPE* aArc, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aArc && aArc->GetShape() == SHAPE_T::ARC, "Invalid ARC object." );
@ -1619,7 +1619,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveArc( LIB_SHAPE* aArc, OUTPUTFORMATTER& aFormat
}
void SCH_LEGACY_PLUGIN_CACHE::saveBezier( LIB_SHAPE* aBezier, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveBezier( LIB_SHAPE* aBezier, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aBezier && aBezier->GetShape() == SHAPE_T::BEZIER, "Invalid BEZIER object." );
@ -1642,7 +1642,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveBezier( LIB_SHAPE* aBezier, OUTPUTFORMATTER& a
}
void SCH_LEGACY_PLUGIN_CACHE::saveCircle( LIB_SHAPE* aCircle, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveCircle( LIB_SHAPE* aCircle, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aCircle && aCircle->GetShape() == SHAPE_T::CIRCLE, "Invalid CIRCLE object." );
@ -1657,7 +1657,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveCircle( LIB_SHAPE* aCircle, OUTPUTFORMATTER& a
}
void SCH_LEGACY_PLUGIN_CACHE::saveField( const LIB_FIELD* aField, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveField( const LIB_FIELD* aField, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aField && aField->Type() == LIB_FIELD_T, "Invalid LIB_FIELD object." );
@ -1705,7 +1705,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveField( const LIB_FIELD* aField, OUTPUTFORMATTE
}
void SCH_LEGACY_PLUGIN_CACHE::savePin( const LIB_PIN* aPin, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::savePin( const LIB_PIN* aPin, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aPin && aPin->Type() == LIB_PIN_T, "Invalid LIB_PIN object." );
@ -1770,7 +1770,7 @@ void SCH_LEGACY_PLUGIN_CACHE::savePin( const LIB_PIN* aPin, OUTPUTFORMATTER& aFo
}
void SCH_LEGACY_PLUGIN_CACHE::savePolyLine( LIB_SHAPE* aPolyLine, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::savePolyLine( LIB_SHAPE* aPolyLine, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aPolyLine && aPolyLine->GetShape() == SHAPE_T::POLY, "Invalid POLY object." );
@ -1787,7 +1787,7 @@ void SCH_LEGACY_PLUGIN_CACHE::savePolyLine( LIB_SHAPE* aPolyLine, OUTPUTFORMATTE
}
void SCH_LEGACY_PLUGIN_CACHE::saveRectangle( LIB_SHAPE* aRectangle, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveRectangle( LIB_SHAPE* aRectangle, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aRectangle && aRectangle->GetShape() == SHAPE_T::RECTANGLE, "Invalid RECT object." );
@ -1803,7 +1803,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveRectangle( LIB_SHAPE* aRectangle, OUTPUTFORMAT
}
void SCH_LEGACY_PLUGIN_CACHE::saveText( const LIB_TEXT* aText, OUTPUTFORMATTER& aFormatter )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveText( const LIB_TEXT* aText, OUTPUTFORMATTER& aFormatter )
{
wxCHECK_RET( aText && aText->Type() == LIB_TEXT_T, "Invalid LIB_TEXT object." );
@ -1846,7 +1846,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveText( const LIB_TEXT* aText, OUTPUTFORMATTER&
}
void SCH_LEGACY_PLUGIN_CACHE::saveDocFile()
void SCH_IO_KICAD_LEGACY_LIB_CACHE::saveDocFile()
{
/*
* NB:
@ -1888,7 +1888,7 @@ void SCH_LEGACY_PLUGIN_CACHE::saveDocFile()
}
void SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol( const wxString& aSymbolName )
void SCH_IO_KICAD_LEGACY_LIB_CACHE::DeleteSymbol( const wxString& aSymbolName )
{
LIB_SYMBOL_MAP::iterator it = m_symbols.find( aSymbolName );
@ -1930,6 +1930,6 @@ void SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol( const wxString& aSymbolName )
delete symbol;
}
SCH_LEGACY_PLUGIN_CACHE::IncrementModifyHash();
SCH_IO_KICAD_LEGACY_LIB_CACHE::IncrementModifyHash();
m_isModified = true;
}

View File

@ -26,7 +26,7 @@
#include <eda_shape.h> // FILL_T
#include "sch_io/sch_lib_plugin_cache.h"
#include "sch_io/sch_io_lib_cache.h"
class FILE_LINE_READER;
class LIB_FIELD;
@ -34,17 +34,17 @@ class LIB_PIN;
class LIB_SHAPE;
class LIB_TEXT;
class LINE_READER;
class SCH_LEGACY_PLUGIN;
class SCH_IO_KICAD_LEGACY;
/**
* A cache assistant for KiCad legacy symbol libraries.
*/
class SCH_LEGACY_PLUGIN_CACHE : public SCH_LIB_PLUGIN_CACHE
class SCH_IO_KICAD_LEGACY_LIB_CACHE : public SCH_IO_LIB_CACHE
{
public:
SCH_LEGACY_PLUGIN_CACHE( const wxString& aLibraryPath );
virtual ~SCH_LEGACY_PLUGIN_CACHE() {}
SCH_IO_KICAD_LEGACY_LIB_CACHE( const wxString& aLibraryPath );
virtual ~SCH_IO_KICAD_LEGACY_LIB_CACHE() {}
// Most all functions in this class throw IO_ERROR exceptions. There are no
// error codes nor user interface calls from here, nor in any SCH_IO objects.
@ -63,7 +63,7 @@ public:
LIB_SYMBOL_MAP* aMap = nullptr );
private:
friend SCH_LEGACY_PLUGIN;
friend SCH_IO_KICAD_LEGACY;
void loadHeader( FILE_LINE_READER& aReader );
static void loadAliases( std::unique_ptr<LIB_SYMBOL>& aSymbol, LINE_READER& aReader,

View File

@ -46,7 +46,6 @@
#include <sch_sheet.h>
#include <sch_sheet_pin.h>
#include <schematic.h>
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_screen.h>
#include <lib_shape.h>
#include <lib_pin.h>
@ -56,9 +55,10 @@
#include <io/kicad/kicad_io_utils.h>
#include <sch_file_versions.h>
#include <schematic_lexer.h>
#include <sch_io/kicad/sch_sexpr_parser.h>
#include "sch_sexpr_lib_plugin_cache.h"
#include "sch_sexpr_plugin_common.h"
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr_common.h>
#include <symbol_lib_table.h> // for PropPowerSymsOnly definition.
#include <ee_selection.h>
#include <string_utils.h>
@ -74,20 +74,20 @@ using namespace TSCHEMATIC_T;
reader.LineNumber(), pos - reader.Line() )
SCH_SEXPR_PLUGIN::SCH_SEXPR_PLUGIN() :
SCH_IO_KICAD_SEXPR::SCH_IO_KICAD_SEXPR() :
m_progressReporter( nullptr )
{
init( nullptr );
}
SCH_SEXPR_PLUGIN::~SCH_SEXPR_PLUGIN()
SCH_IO_KICAD_SEXPR::~SCH_IO_KICAD_SEXPR()
{
delete m_cache;
}
void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_SEXPR::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties )
{
m_version = 0;
m_appending = false;
@ -99,7 +99,7 @@ void SCH_SEXPR_PLUGIN::init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProp
}
SCH_SHEET* SCH_SEXPR_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* SCH_IO_KICAD_SEXPR::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{
@ -179,7 +179,7 @@ SCH_SHEET* SCH_SEXPR_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEM
// Everything below this comment is recursive. Modify with care.
void SCH_SEXPR_PLUGIN::loadHierarchy( const SCH_SHEET_PATH& aParentSheetPath, SCH_SHEET* aSheet )
void SCH_IO_KICAD_SEXPR::loadHierarchy( const SCH_SHEET_PATH& aParentSheetPath, SCH_SHEET* aSheet )
{
m_currentSheetPath.push_back( aSheet );
@ -295,7 +295,7 @@ void SCH_SEXPR_PLUGIN::loadHierarchy( const SCH_SHEET_PATH& aParentSheetPath, SC
}
void SCH_SEXPR_PLUGIN::loadFile( const wxString& aFileName, SCH_SHEET* aSheet )
void SCH_IO_KICAD_SEXPR::loadFile( const wxString& aFileName, SCH_SHEET* aSheet )
{
FILE_LINE_READER reader( aFileName );
@ -314,24 +314,24 @@ void SCH_SEXPR_PLUGIN::loadFile( const wxString& aFileName, SCH_SHEET* aSheet )
reader.Rewind();
}
SCH_SEXPR_PARSER parser( &reader, m_progressReporter, lineCount, m_rootSheet, m_appending );
SCH_IO_KICAD_SEXPR_PARSER parser( &reader, m_progressReporter, lineCount, m_rootSheet, m_appending );
parser.ParseSchematic( aSheet );
}
void SCH_SEXPR_PLUGIN::LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet, int aFileVersion )
void SCH_IO_KICAD_SEXPR::LoadContent( LINE_READER& aReader, SCH_SHEET* aSheet, int aFileVersion )
{
wxCHECK( aSheet, /* void */ );
LOCALE_IO toggle;
SCH_SEXPR_PARSER parser( &aReader );
SCH_IO_KICAD_SEXPR_PARSER parser( &aReader );
parser.ParseSchematic( aSheet, true, aFileVersion );
}
void SCH_SEXPR_PLUGIN::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
void SCH_IO_KICAD_SEXPR::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet,
SCHEMATIC* aSchematic,
const STRING_UTF8_MAP* aProperties )
{
@ -359,7 +359,7 @@ void SCH_SEXPR_PLUGIN::SaveSchematicFile( const wxString& aFileName, SCH_SHEET*
}
void SCH_SEXPR_PLUGIN::Format( SCH_SHEET* aSheet )
void SCH_IO_KICAD_SEXPR::Format( SCH_SHEET* aSheet )
{
wxCHECK_RET( aSheet != nullptr, "NULL SCH_SHEET* object." );
wxCHECK_RET( m_schematic != nullptr, "NULL SCHEMATIC* object." );
@ -381,7 +381,7 @@ void SCH_SEXPR_PLUGIN::Format( SCH_SHEET* aSheet )
m_out->Print( 1, "(lib_symbols\n" );
for( const auto& [ libItemName, libSymbol ] : screen->GetLibSymbols() )
SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( libSymbol, *m_out, 2, libItemName );
SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol( libSymbol, *m_out, 2, libItemName );
m_out->Print( 1, ")\n\n" );
@ -487,7 +487,7 @@ void SCH_SEXPR_PLUGIN::Format( SCH_SHEET* aSheet )
break;
default:
wxASSERT( "Unexpected schematic object type in SCH_SEXPR_PLUGIN::Format()" );
wxASSERT( "Unexpected schematic object type in SCH_IO_KICAD_SEXPR::Format()" );
}
}
@ -503,7 +503,7 @@ void SCH_SEXPR_PLUGIN::Format( SCH_SHEET* aSheet )
}
void SCH_SEXPR_PLUGIN::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelectionPath,
void SCH_IO_KICAD_SEXPR::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelectionPath,
SCHEMATIC& aSchematic, OUTPUTFORMATTER* aFormatter,
bool aForClipboard )
{
@ -549,7 +549,7 @@ void SCH_SEXPR_PLUGIN::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelect
m_out->Print( 0, "(lib_symbols\n" );
for( const std::pair<const wxString, LIB_SYMBOL*>& libSymbol : libSymbols )
SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( libSymbol.second, *m_out, 1, libSymbol.first );
SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol( libSymbol.second, *m_out, 1, libSymbol.first );
m_out->Print( 0, ")\n\n" );
}
@ -607,13 +607,13 @@ void SCH_SEXPR_PLUGIN::Format( EE_SELECTION* aSelection, SCH_SHEET_PATH* aSelect
break;
default:
wxASSERT( "Unexpected schematic object type in SCH_SEXPR_PLUGIN::Format()" );
wxASSERT( "Unexpected schematic object type in SCH_IO_KICAD_SEXPR::Format()" );
}
}
}
void SCH_SEXPR_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchematic,
void SCH_IO_KICAD_SEXPR::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchematic,
int aNestLevel, bool aForClipboard,
const SCH_SHEET_PATH* aRelativePath )
{
@ -858,7 +858,7 @@ void SCH_SEXPR_PLUGIN::saveSymbol( SCH_SYMBOL* aSymbol, const SCHEMATIC& aSchema
}
void SCH_SEXPR_PLUGIN::saveField( SCH_FIELD* aField, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveField( SCH_FIELD* aField, int aNestLevel )
{
wxCHECK_RET( aField != nullptr && m_out != nullptr, "" );
@ -910,7 +910,7 @@ void SCH_SEXPR_PLUGIN::saveField( SCH_FIELD* aField, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveBitmap( SCH_BITMAP* aBitmap, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveBitmap( SCH_BITMAP* aBitmap, int aNestLevel )
{
wxCHECK_RET( aBitmap != nullptr && m_out != nullptr, "" );
@ -964,7 +964,7 @@ void SCH_SEXPR_PLUGIN::saveBitmap( SCH_BITMAP* aBitmap, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveSheet( SCH_SHEET* aSheet, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveSheet( SCH_SHEET* aSheet, int aNestLevel )
{
wxCHECK_RET( aSheet != nullptr && m_out != nullptr, "" );
@ -1101,7 +1101,7 @@ void SCH_SEXPR_PLUGIN::saveSheet( SCH_SHEET* aSheet, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveJunction( SCH_JUNCTION* aJunction, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveJunction( SCH_JUNCTION* aJunction, int aNestLevel )
{
wxCHECK_RET( aJunction != nullptr && m_out != nullptr, "" );
@ -1123,7 +1123,7 @@ void SCH_SEXPR_PLUGIN::saveJunction( SCH_JUNCTION* aJunction, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveNoConnect( SCH_NO_CONNECT* aNoConnect, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveNoConnect( SCH_NO_CONNECT* aNoConnect, int aNestLevel )
{
wxCHECK_RET( aNoConnect != nullptr && m_out != nullptr, "" );
@ -1137,7 +1137,7 @@ void SCH_SEXPR_PLUGIN::saveNoConnect( SCH_NO_CONNECT* aNoConnect, int aNestLevel
}
void SCH_SEXPR_PLUGIN::saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry, int aNestLevel )
{
wxCHECK_RET( aBusEntry != nullptr && m_out != nullptr, "" );
@ -1172,7 +1172,7 @@ void SCH_SEXPR_PLUGIN::saveBusEntry( SCH_BUS_ENTRY_BASE* aBusEntry, int aNestLev
}
void SCH_SEXPR_PLUGIN::saveShape( SCH_SHAPE* aShape, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveShape( SCH_SHAPE* aShape, int aNestLevel )
{
wxCHECK_RET( aShape != nullptr && m_out != nullptr, "" );
@ -1209,7 +1209,7 @@ void SCH_SEXPR_PLUGIN::saveShape( SCH_SHAPE* aShape, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveLine( SCH_LINE* aLine, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveLine( SCH_LINE* aLine, int aNestLevel )
{
wxCHECK_RET( aLine != nullptr && m_out != nullptr, "" );
@ -1246,7 +1246,7 @@ void SCH_SEXPR_PLUGIN::saveLine( SCH_LINE* aLine, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveText( SCH_TEXT* aText, int aNestLevel )
{
wxCHECK_RET( aText != nullptr && m_out != nullptr, "" );
@ -1331,7 +1331,7 @@ void SCH_SEXPR_PLUGIN::saveText( SCH_TEXT* aText, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveTextBox( SCH_TEXTBOX* aTextBox, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveTextBox( SCH_TEXTBOX* aTextBox, int aNestLevel )
{
wxCHECK_RET( aTextBox != nullptr && m_out != nullptr, "" );
@ -1363,7 +1363,7 @@ void SCH_SEXPR_PLUGIN::saveTextBox( SCH_TEXTBOX* aTextBox, int aNestLevel )
}
void SCH_SEXPR_PLUGIN::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aNestLevel )
void SCH_IO_KICAD_SEXPR::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aNestLevel )
{
wxCHECK_RET( aAlias != nullptr, "BUS_ALIAS* is NULL" );
@ -1383,7 +1383,7 @@ void SCH_SEXPR_PLUGIN::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aNes
}
void SCH_SEXPR_PLUGIN::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances,
void SCH_IO_KICAD_SEXPR::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances,
int aNestLevel )
{
if( aInstances.size() )
@ -1408,14 +1408,14 @@ void SCH_SEXPR_PLUGIN::saveInstances( const std::vector<SCH_SHEET_INSTANCE>& aIn
}
void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName,
void SCH_IO_KICAD_SEXPR::cacheLib( const wxString& aLibraryFileName,
const STRING_UTF8_MAP* aProperties )
{
if( !m_cache || !m_cache->IsFile( aLibraryFileName ) || m_cache->IsFileChanged() )
{
// a spectacular episode in memory management:
delete m_cache;
m_cache = new SCH_SEXPR_PLUGIN_CACHE( aLibraryFileName );
m_cache = new SCH_IO_KICAD_SEXPR_LIB_CACHE( aLibraryFileName );
if( !isBuffering( aProperties ) )
m_cache->Load();
@ -1423,13 +1423,13 @@ void SCH_SEXPR_PLUGIN::cacheLib( const wxString& aLibraryFileName,
}
bool SCH_SEXPR_PLUGIN::isBuffering( const STRING_UTF8_MAP* aProperties )
bool SCH_IO_KICAD_SEXPR::isBuffering( const STRING_UTF8_MAP* aProperties )
{
return ( aProperties && aProperties->Exists( SCH_SEXPR_PLUGIN::PropBuffering ) );
return ( aProperties && aProperties->Exists( SCH_IO_KICAD_SEXPR::PropBuffering ) );
}
int SCH_SEXPR_PLUGIN::GetModifyHash() const
int SCH_IO_KICAD_SEXPR::GetModifyHash() const
{
if( m_cache )
return m_cache->GetModifyHash();
@ -1439,7 +1439,7 @@ int SCH_SEXPR_PLUGIN::GetModifyHash() const
}
void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -1460,7 +1460,7 @@ void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( wxArrayString& aSymbolNameList,
}
void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
void SCH_IO_KICAD_SEXPR::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
@ -1481,7 +1481,7 @@ void SCH_SEXPR_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList
}
LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
LIB_SYMBOL* SCH_IO_KICAD_SEXPR::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1508,7 +1508,7 @@ LIB_SYMBOL* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wx
}
void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
void SCH_IO_KICAD_SEXPR::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1522,7 +1522,7 @@ void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBO
}
void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
void SCH_IO_KICAD_SEXPR::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
const STRING_UTF8_MAP* aProperties )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
@ -1536,7 +1536,7 @@ void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxStrin
}
void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
void SCH_IO_KICAD_SEXPR::CreateSymbolLib( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
if( wxFileExists( aLibraryPath ) )
@ -1548,14 +1548,14 @@ void SCH_SEXPR_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath,
LOCALE_IO toggle;
delete m_cache;
m_cache = new SCH_SEXPR_PLUGIN_CACHE( aLibraryPath );
m_cache = new SCH_IO_KICAD_SEXPR_LIB_CACHE( aLibraryPath );
m_cache->SetModified();
m_cache->Save();
m_cache->Load(); // update m_writable and m_mod_time
}
bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
bool SCH_IO_KICAD_SEXPR::DeleteSymbolLib( const wxString& aLibraryPath,
const STRING_UTF8_MAP* aProperties )
{
wxFileName fn = aLibraryPath;
@ -1581,10 +1581,10 @@ bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
}
void SCH_SEXPR_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
void SCH_IO_KICAD_SEXPR::SaveLibrary( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
{
if( !m_cache )
m_cache = new SCH_SEXPR_PLUGIN_CACHE( aLibraryPath );
m_cache = new SCH_IO_KICAD_SEXPR_LIB_CACHE( aLibraryPath );
wxString oldFileName = m_cache->GetFileName();
@ -1600,7 +1600,7 @@ void SCH_SEXPR_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_U
}
bool SCH_SEXPR_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
bool SCH_IO_KICAD_SEXPR::IsSymbolLibWritable( const wxString& aLibraryPath )
{
wxFileName fn( aLibraryPath );
@ -1608,7 +1608,7 @@ bool SCH_SEXPR_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
}
void SCH_SEXPR_PLUGIN::GetAvailableSymbolFields( std::vector<wxString>& aNames )
void SCH_IO_KICAD_SEXPR::GetAvailableSymbolFields( std::vector<wxString>& aNames )
{
if( !m_cache )
return;
@ -1637,13 +1637,13 @@ void SCH_SEXPR_PLUGIN::GetAvailableSymbolFields( std::vector<wxString>& aNames )
}
void SCH_SEXPR_PLUGIN::GetDefaultSymbolFields( std::vector<wxString>& aNames )
void SCH_IO_KICAD_SEXPR::GetDefaultSymbolFields( std::vector<wxString>& aNames )
{
GetAvailableSymbolFields( aNames );
}
std::vector<LIB_SYMBOL*> SCH_SEXPR_PLUGIN::ParseLibSymbols( std::string& aSymbolText,
std::vector<LIB_SYMBOL*> SCH_IO_KICAD_SEXPR::ParseLibSymbols( std::string& aSymbolText,
std::string aSource,
int aFileVersion )
{
@ -1656,7 +1656,7 @@ std::vector<LIB_SYMBOL*> SCH_SEXPR_PLUGIN::ParseLibSymbols( std::string& aSymbol
do
{
SCH_SEXPR_PARSER parser( reader.get() );
SCH_IO_KICAD_SEXPR_PARSER parser( reader.get() );
newSymbol = parser.ParseSymbol( map, aFileVersion );
@ -1671,12 +1671,12 @@ std::vector<LIB_SYMBOL*> SCH_SEXPR_PLUGIN::ParseLibSymbols( std::string& aSymbol
}
void SCH_SEXPR_PLUGIN::FormatLibSymbol( LIB_SYMBOL* symbol, OUTPUTFORMATTER & formatter )
void SCH_IO_KICAD_SEXPR::FormatLibSymbol( LIB_SYMBOL* symbol, OUTPUTFORMATTER & formatter )
{
LOCALE_IO toggle; // toggles on, then off, the C locale.
SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( symbol, formatter );
SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol( symbol, formatter );
}
const char* SCH_SEXPR_PLUGIN::PropBuffering = "buffering";
const char* SCH_IO_KICAD_SEXPR::PropBuffering = "buffering";

View File

@ -20,8 +20,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SCH_SEXPR_PLUGIN_H_
#define _SCH_SEXPR_PLUGIN_H_
#ifndef SCH_IO_KICAD_SEXPR_H_
#define SCH_IO_KICAD_SEXPR_H_
#include <memory>
#include <sch_io/sch_io.h>
@ -51,7 +51,7 @@ class SCH_FIELD;
struct SCH_SYMBOL_INSTANCE;
class STRING_UTF8_MAP;
class EE_SELECTION;
class SCH_SEXPR_PLUGIN_CACHE;
class SCH_IO_KICAD_SEXPR_LIB_CACHE;
class LIB_SYMBOL;
class SYMBOL_LIB;
class BUS_ALIAS;
@ -62,12 +62,12 @@ class BUS_ALIAS;
*
* As with all SCH_IOs there is no UI dependencies i.e. windowing calls allowed.
*/
class SCH_SEXPR_PLUGIN : public SCH_IO
class SCH_IO_KICAD_SEXPR : public SCH_IO
{
public:
SCH_SEXPR_PLUGIN();
virtual ~SCH_SEXPR_PLUGIN();
SCH_IO_KICAD_SEXPR();
virtual ~SCH_IO_KICAD_SEXPR();
const wxString GetName() const override
{
@ -182,10 +182,10 @@ protected:
SCH_SHEET_PATH m_currentSheetPath;
SCHEMATIC* m_schematic;
OUTPUTFORMATTER* m_out; ///< The formatter for saving SCH_SCREEN objects.
SCH_SEXPR_PLUGIN_CACHE* m_cache;
SCH_IO_KICAD_SEXPR_LIB_CACHE* m_cache;
/// initialize PLUGIN like a constructor would.
void init( SCHEMATIC* aSchematic, const STRING_UTF8_MAP* aProperties = nullptr );
};
#endif // _SCH_SEXPR_PLUGIN_H_
#endif // SCH_IO_KICAD_SEXPR_H_

View File

@ -21,7 +21,7 @@
#include <base_units.h>
#include <macros.h>
#include <schematic_lexer.h>
#include "sch_sexpr_plugin_common.h"
#include "sch_io_kicad_sexpr_common.h"
#include <string_utils.h>

View File

@ -17,8 +17,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SCH_SEXPR_PLUGIN_COMMON_H_
#define _SCH_SEXPR_PLUGIN_COMMON_H_
#ifndef SCH_IO_KICAD_SEXPR_COMMON_H_
#define SCH_IO_KICAD_SEXPR_COMMON_H_
#include <eda_shape.h>
#include <kiid.h>
@ -71,4 +71,4 @@ extern void formatPoly( OUTPUTFORMATTER* aFormatter, int aNestLevel, EDA_SHAPE*
bool aIsPrivate, const STROKE_PARAMS& aStroke, FILL_T aFillMode,
const COLOR4D& aFillColor, const KIID& aUuid = niluuid );
#endif // _SCH_SEXPR_PLUGIN_COMMON_H_
#endif // SCH_IO_KICAD_SEXPR_COMMON_H_

View File

@ -29,26 +29,26 @@
#include <locale_io.h>
#include <macros.h>
#include <richio.h>
#include "sch_sexpr_lib_plugin_cache.h"
#include "sch_sexpr_plugin_common.h"
#include "sch_sexpr_parser.h"
#include "sch_io_kicad_sexpr_lib_cache.h"
#include "sch_io_kicad_sexpr_common.h"
#include "sch_io_kicad_sexpr_parser.h"
#include <string_utils.h>
#include <trace_helpers.h>
SCH_SEXPR_PLUGIN_CACHE::SCH_SEXPR_PLUGIN_CACHE( const wxString& aFullPathAndFileName ) :
SCH_LIB_PLUGIN_CACHE( aFullPathAndFileName )
SCH_IO_KICAD_SEXPR_LIB_CACHE::SCH_IO_KICAD_SEXPR_LIB_CACHE( const wxString& aFullPathAndFileName ) :
SCH_IO_LIB_CACHE( aFullPathAndFileName )
{
m_fileFormatVersionAtLoad = 0;
}
SCH_SEXPR_PLUGIN_CACHE::~SCH_SEXPR_PLUGIN_CACHE()
SCH_IO_KICAD_SEXPR_LIB_CACHE::~SCH_IO_KICAD_SEXPR_LIB_CACHE()
{
}
void SCH_SEXPR_PLUGIN_CACHE::Load()
void SCH_IO_KICAD_SEXPR_LIB_CACHE::Load()
{
if( !m_libFileName.FileExists() )
{
@ -69,7 +69,7 @@ void SCH_SEXPR_PLUGIN_CACHE::Load()
FILE_LINE_READER reader( m_libFileName.GetFullPath() );
SCH_SEXPR_PARSER parser( &reader );
SCH_IO_KICAD_SEXPR_PARSER parser( &reader );
parser.ParseLib( m_symbols );
++m_modHash;
@ -81,7 +81,7 @@ void SCH_SEXPR_PLUGIN_CACHE::Load()
}
void SCH_SEXPR_PLUGIN_CACHE::Save( const std::optional<bool>& aOpt )
void SCH_IO_KICAD_SEXPR_LIB_CACHE::Save( const std::optional<bool>& aOpt )
{
if( !m_isModified )
return;
@ -129,7 +129,7 @@ void SCH_SEXPR_PLUGIN_CACHE::Save( const std::optional<bool>& aOpt )
}
void SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& aFormatter,
void SCH_IO_KICAD_SEXPR_LIB_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& aFormatter,
int aNestLevel, const wxString& aLibName )
{
wxCHECK_RET( aSymbol, "Invalid LIB_SYMBOL pointer." );
@ -282,7 +282,7 @@ void SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& a
}
void SCH_SEXPR_PLUGIN_CACHE::saveDcmInfoAsFields( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& aFormatter,
void SCH_IO_KICAD_SEXPR_LIB_CACHE::saveDcmInfoAsFields( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& aFormatter,
int& aNextFreeFieldId, int aNestLevel )
{
wxCHECK_RET( aSymbol, "Invalid LIB_SYMBOL pointer." );
@ -322,7 +322,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveDcmInfoAsFields( LIB_SYMBOL* aSymbol, OUTPUTFOR
}
void SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem( LIB_ITEM* aItem, OUTPUTFORMATTER& aFormatter,
void SCH_IO_KICAD_SEXPR_LIB_CACHE::saveSymbolDrawItem( LIB_ITEM* aItem, OUTPUTFORMATTER& aFormatter,
int aNestLevel )
{
wxCHECK_RET( aItem, "Invalid LIB_ITEM pointer." );
@ -384,7 +384,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem( LIB_ITEM* aItem, OUTPUTFORMATTE
}
void SCH_SEXPR_PLUGIN_CACHE::saveField( LIB_FIELD* aField, OUTPUTFORMATTER& aFormatter,
void SCH_IO_KICAD_SEXPR_LIB_CACHE::saveField( LIB_FIELD* aField, OUTPUTFORMATTER& aFormatter,
int aNestLevel )
{
wxCHECK_RET( aField && aField->Type() == LIB_FIELD_T, "Invalid LIB_FIELD object." );
@ -413,7 +413,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveField( LIB_FIELD* aField, OUTPUTFORMATTER& aFor
}
void SCH_SEXPR_PLUGIN_CACHE::savePin( LIB_PIN* aPin, OUTPUTFORMATTER& aFormatter, int aNestLevel )
void SCH_IO_KICAD_SEXPR_LIB_CACHE::savePin( LIB_PIN* aPin, OUTPUTFORMATTER& aFormatter, int aNestLevel )
{
wxCHECK_RET( aPin && aPin->Type() == LIB_PIN_T, "Invalid LIB_PIN object." );
@ -456,7 +456,7 @@ void SCH_SEXPR_PLUGIN_CACHE::savePin( LIB_PIN* aPin, OUTPUTFORMATTER& aFormatter
}
void SCH_SEXPR_PLUGIN_CACHE::saveText( LIB_TEXT* aText, OUTPUTFORMATTER& aFormatter,
void SCH_IO_KICAD_SEXPR_LIB_CACHE::saveText( LIB_TEXT* aText, OUTPUTFORMATTER& aFormatter,
int aNestLevel )
{
wxCHECK_RET( aText && aText->Type() == LIB_TEXT_T, "Invalid LIB_TEXT object." );
@ -473,7 +473,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveText( LIB_TEXT* aText, OUTPUTFORMATTER& aFormat
}
void SCH_SEXPR_PLUGIN_CACHE::saveTextBox( LIB_TEXTBOX* aTextBox, OUTPUTFORMATTER& aFormatter,
void SCH_IO_KICAD_SEXPR_LIB_CACHE::saveTextBox( LIB_TEXTBOX* aTextBox, OUTPUTFORMATTER& aFormatter,
int aNestLevel )
{
wxCHECK_RET( aTextBox && aTextBox->Type() == LIB_TEXTBOX_T, "Invalid LIB_TEXTBOX object." );
@ -503,7 +503,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveTextBox( LIB_TEXTBOX* aTextBox, OUTPUTFORMATTER
}
void SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol( const wxString& aSymbolName )
void SCH_IO_KICAD_SEXPR_LIB_CACHE::DeleteSymbol( const wxString& aSymbolName )
{
LIB_SYMBOL_MAP::iterator it = m_symbols.find( aSymbolName );

View File

@ -19,10 +19,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SCH_SEXPR_LIB_PLUGIN_CACHE_
#define _SCH_SEXPR_LIB_PLUGIN_CACHE_
#ifndef SCH_IO_KICAD_SEXPR_LIB_CACHE_H_
#define SCH_IO_KICAD_SEXPR_LIB_CACHE_H_
#include "sch_io/sch_lib_plugin_cache.h"
#include "sch_io/sch_io_lib_cache.h"
class FILE_LINE_READER;
class LIB_FIELD;
@ -31,16 +31,16 @@ class LIB_PIN;
class LIB_TEXT;
class LIB_TEXTBOX;
class LINE_READER;
class SCH_SEXPR_PLUGIN;
class SCH_IO_KICAD_SEXPR;
/**
* A cache assistant for the KiCad s-expression symbol libraries.
*/
class SCH_SEXPR_PLUGIN_CACHE : public SCH_LIB_PLUGIN_CACHE
class SCH_IO_KICAD_SEXPR_LIB_CACHE : public SCH_IO_LIB_CACHE
{
public:
SCH_SEXPR_PLUGIN_CACHE( const wxString& aLibraryPath );
virtual ~SCH_SEXPR_PLUGIN_CACHE();
SCH_IO_KICAD_SEXPR_LIB_CACHE( const wxString& aLibraryPath );
virtual ~SCH_IO_KICAD_SEXPR_LIB_CACHE();
// Most all functions in this class throw IO_ERROR exceptions. There are no
// error codes nor user interface calls from here, nor in any SCH_IO objects.
@ -60,7 +60,7 @@ public:
int GetFileFormatVersionAtLoad() const { return m_fileFormatVersionAtLoad; }
private:
friend SCH_SEXPR_PLUGIN;
friend SCH_IO_KICAD_SEXPR;
int m_fileFormatVersionAtLoad;
@ -76,4 +76,4 @@ private:
int& aNextFreeFieldId, int aNestLevel );
};
#endif // _SCH_SEXPR_LIB_PLUGIN_CACHE_
#endif // SCH_IO_KICAD_SEXPR_LIB_CACHE_H_

View File

@ -21,7 +21,6 @@
*/
/**
* @file sch_sexpr_parser.cpp
* @brief Schematic and symbol library s-expression file format parser implementations.
*/
@ -56,7 +55,7 @@
#include <sch_no_connect.h>
#include <sch_screen.h>
#include <sch_sheet_pin.h>
#include <sch_io/kicad/sch_sexpr_parser.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.h>
#include <template_fieldnames.h>
#include <trigo.h>
#include <progress_reporter.h>
@ -67,7 +66,7 @@
using namespace TSCHEMATIC_T;
SCH_SEXPR_PARSER::SCH_SEXPR_PARSER( LINE_READER* aLineReader, PROGRESS_REPORTER* aProgressReporter,
SCH_IO_KICAD_SEXPR_PARSER::SCH_IO_KICAD_SEXPR_PARSER( LINE_READER* aLineReader, PROGRESS_REPORTER* aProgressReporter,
unsigned aLineCount, SCH_SHEET* aRootSheet,
bool aIsAppending ) :
SCHEMATIC_LEXER( aLineReader ),
@ -84,7 +83,7 @@ SCH_SEXPR_PARSER::SCH_SEXPR_PARSER( LINE_READER* aLineReader, PROGRESS_REPORTER*
}
void SCH_SEXPR_PARSER::checkpoint()
void SCH_IO_KICAD_SEXPR_PARSER::checkpoint()
{
const unsigned PROGRESS_DELTA = 500;
@ -106,7 +105,7 @@ void SCH_SEXPR_PARSER::checkpoint()
}
KIID SCH_SEXPR_PARSER::parseKIID()
KIID SCH_IO_KICAD_SEXPR_PARSER::parseKIID()
{
KIID id( FromUTF8() );
@ -119,7 +118,7 @@ KIID SCH_SEXPR_PARSER::parseKIID()
}
bool SCH_SEXPR_PARSER::parseBool()
bool SCH_IO_KICAD_SEXPR_PARSER::parseBool()
{
T token = NextTok();
@ -137,7 +136,7 @@ bool SCH_SEXPR_PARSER::parseBool()
/*
* e.g. "hide", "hide)", "(hide yes)"
*/
bool SCH_SEXPR_PARSER::parseMaybeAbsentBool( bool aDefaultValue )
bool SCH_IO_KICAD_SEXPR_PARSER::parseMaybeAbsentBool( bool aDefaultValue )
{
bool ret = aDefaultValue;
@ -168,7 +167,7 @@ bool SCH_SEXPR_PARSER::parseMaybeAbsentBool( bool aDefaultValue )
}
void SCH_SEXPR_PARSER::ParseLib( LIB_SYMBOL_MAP& aSymbolLibMap )
void SCH_IO_KICAD_SEXPR_PARSER::ParseLib( LIB_SYMBOL_MAP& aSymbolLibMap )
{
T token;
@ -249,7 +248,7 @@ void SCH_SEXPR_PARSER::ParseLib( LIB_SYMBOL_MAP& aSymbolLibMap )
}
LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aFileVersion )
LIB_SYMBOL* SCH_IO_KICAD_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aFileVersion )
{
LIB_SYMBOL* newSymbol = nullptr;
@ -277,7 +276,7 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF
}
LIB_SYMBOL* SCH_SEXPR_PARSER::parseLibSymbol( LIB_SYMBOL_MAP& aSymbolLibMap )
LIB_SYMBOL* SCH_IO_KICAD_SEXPR_PARSER::parseLibSymbol( LIB_SYMBOL_MAP& aSymbolLibMap )
{
wxCHECK_MSG( CurTok() == T_symbol, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a symbol." ) );
@ -545,7 +544,7 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::parseLibSymbol( LIB_SYMBOL_MAP& aSymbolLibMap )
}
LIB_ITEM* SCH_SEXPR_PARSER::ParseDrawItem()
LIB_ITEM* SCH_IO_KICAD_SEXPR_PARSER::ParseDrawItem()
{
switch( CurTok() )
{
@ -589,7 +588,7 @@ LIB_ITEM* SCH_SEXPR_PARSER::ParseDrawItem()
}
int SCH_SEXPR_PARSER::parseInternalUnits()
int SCH_IO_KICAD_SEXPR_PARSER::parseInternalUnits()
{
auto retval = parseDouble() * schIUScale.IU_PER_MM;
@ -602,7 +601,7 @@ int SCH_SEXPR_PARSER::parseInternalUnits()
}
int SCH_SEXPR_PARSER::parseInternalUnits( const char* aExpected )
int SCH_IO_KICAD_SEXPR_PARSER::parseInternalUnits( const char* aExpected )
{
auto retval = parseDouble( aExpected ) * schIUScale.IU_PER_MM;
@ -612,7 +611,7 @@ int SCH_SEXPR_PARSER::parseInternalUnits( const char* aExpected )
}
void SCH_SEXPR_PARSER::parseStroke( STROKE_PARAMS& aStroke )
void SCH_IO_KICAD_SEXPR_PARSER::parseStroke( STROKE_PARAMS& aStroke )
{
STROKE_PARAMS_PARSER strokeParser( reader, schIUScale.IU_PER_MM );
strokeParser.SyncLineReaderWith( *this );
@ -622,7 +621,7 @@ void SCH_SEXPR_PARSER::parseStroke( STROKE_PARAMS& aStroke )
}
void SCH_SEXPR_PARSER::parseFill( FILL_PARAMS& aFill )
void SCH_IO_KICAD_SEXPR_PARSER::parseFill( FILL_PARAMS& aFill )
{
wxCHECK_RET( CurTok() == T_fill, "Cannot parse " + GetTokenString( CurTok() ) + " as a fill." );
@ -677,7 +676,7 @@ void SCH_SEXPR_PARSER::parseFill( FILL_PARAMS& aFill )
}
void SCH_SEXPR_PARSER::parseEDA_TEXT( EDA_TEXT* aText, bool aConvertOverbarSyntax )
void SCH_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT( EDA_TEXT* aText, bool aConvertOverbarSyntax )
{
wxCHECK_RET( aText && ( CurTok() == T_effects || CurTok() == T_href ),
"Cannot parse " + GetTokenString( CurTok() ) + " as an EDA_TEXT." );
@ -823,7 +822,7 @@ void SCH_SEXPR_PARSER::parseEDA_TEXT( EDA_TEXT* aText, bool aConvertOverbarSynta
}
void SCH_SEXPR_PARSER::parseHeader( TSCHEMATIC_T::T aHeaderType, int aFileVersion )
void SCH_IO_KICAD_SEXPR_PARSER::parseHeader( TSCHEMATIC_T::T aHeaderType, int aFileVersion )
{
wxCHECK_RET( CurTok() == aHeaderType,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a header." ) );
@ -844,7 +843,7 @@ void SCH_SEXPR_PARSER::parseHeader( TSCHEMATIC_T::T aHeaderType, int aFileVersio
}
void SCH_SEXPR_PARSER::parsePinNames( std::unique_ptr<LIB_SYMBOL>& aSymbol )
void SCH_IO_KICAD_SEXPR_PARSER::parsePinNames( std::unique_ptr<LIB_SYMBOL>& aSymbol )
{
wxCHECK_RET( CurTok() == T_pin_names,
"Cannot parse " + GetTokenString( CurTok() ) + " as a pin_name token." );
@ -876,7 +875,7 @@ void SCH_SEXPR_PARSER::parsePinNames( std::unique_ptr<LIB_SYMBOL>& aSymbol )
}
LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol )
LIB_FIELD* SCH_IO_KICAD_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol )
{
wxCHECK_MSG( CurTok() == T_property, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a property." ) );
@ -1076,7 +1075,7 @@ LIB_FIELD* SCH_SEXPR_PARSER::parseProperty( std::unique_ptr<LIB_SYMBOL>& aSymbol
}
LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
LIB_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseArc()
{
wxCHECK_MSG( CurTok() == T_arc, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as an arc." ) );
@ -1263,7 +1262,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
}
LIB_SHAPE* SCH_SEXPR_PARSER::parseBezier()
LIB_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseBezier()
{
wxCHECK_MSG( CurTok() == T_bezier, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a bezier." ) );
@ -1344,7 +1343,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseBezier()
}
LIB_SHAPE* SCH_SEXPR_PARSER::parseCircle()
LIB_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseCircle()
{
wxCHECK_MSG( CurTok() == T_circle, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a circle." ) );
@ -1410,7 +1409,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseCircle()
}
LIB_PIN* SCH_SEXPR_PARSER::parsePin()
LIB_PIN* SCH_IO_KICAD_SEXPR_PARSER::parsePin()
{
auto parseType = [&]( T token ) -> ELECTRICAL_PINTYPE
{
@ -1620,7 +1619,7 @@ LIB_PIN* SCH_SEXPR_PARSER::parsePin()
}
LIB_SHAPE* SCH_SEXPR_PARSER::parsePolyLine()
LIB_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parsePolyLine()
{
wxCHECK_MSG( CurTok() == T_polyline, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a poly." ) );
@ -1688,7 +1687,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parsePolyLine()
}
LIB_SHAPE* SCH_SEXPR_PARSER::parseRectangle()
LIB_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseRectangle()
{
wxCHECK_MSG( CurTok() == T_rectangle, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a rectangle." ) );
@ -1748,7 +1747,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseRectangle()
}
LIB_TEXT* SCH_SEXPR_PARSER::parseText()
LIB_TEXT* SCH_IO_KICAD_SEXPR_PARSER::parseText()
{
wxCHECK_MSG( CurTok() == T_text, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a text token." ) );
@ -1803,7 +1802,7 @@ LIB_TEXT* SCH_SEXPR_PARSER::parseText()
}
LIB_TEXTBOX* SCH_SEXPR_PARSER::parseTextBox()
LIB_TEXTBOX* SCH_IO_KICAD_SEXPR_PARSER::parseTextBox()
{
wxCHECK_MSG( CurTok() == T_text_box, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a text box." ) );
@ -1901,7 +1900,7 @@ LIB_TEXTBOX* SCH_SEXPR_PARSER::parseTextBox()
}
void SCH_SEXPR_PARSER::parsePAGE_INFO( PAGE_INFO& aPageInfo )
void SCH_IO_KICAD_SEXPR_PARSER::parsePAGE_INFO( PAGE_INFO& aPageInfo )
{
wxCHECK_RET( ( CurTok() == T_page && m_requiredVersion <= 20200506 ) || CurTok() == T_paper,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a PAGE_INFO." ) );
@ -1953,7 +1952,7 @@ void SCH_SEXPR_PARSER::parsePAGE_INFO( PAGE_INFO& aPageInfo )
}
void SCH_SEXPR_PARSER::parseTITLE_BLOCK( TITLE_BLOCK& aTitleBlock )
void SCH_IO_KICAD_SEXPR_PARSER::parseTITLE_BLOCK( TITLE_BLOCK& aTitleBlock )
{
wxCHECK_RET( CurTok() == T_title_block,
"Cannot parse " + GetTokenString( CurTok() ) + " as a TITLE_BLOCK." );
@ -2057,7 +2056,7 @@ void SCH_SEXPR_PARSER::parseTITLE_BLOCK( TITLE_BLOCK& aTitleBlock )
}
SCH_FIELD* SCH_SEXPR_PARSER::parseSchField( SCH_ITEM* aParent )
SCH_FIELD* SCH_IO_KICAD_SEXPR_PARSER::parseSchField( SCH_ITEM* aParent )
{
wxCHECK_MSG( CurTok() == T_property, nullptr,
"Cannot parse " + GetTokenString( CurTok() ) + " as a property token." );
@ -2190,7 +2189,7 @@ SCH_FIELD* SCH_SEXPR_PARSER::parseSchField( SCH_ITEM* aParent )
}
SCH_SHEET_PIN* SCH_SEXPR_PARSER::parseSchSheetPin( SCH_SHEET* aSheet )
SCH_SHEET_PIN* SCH_IO_KICAD_SEXPR_PARSER::parseSchSheetPin( SCH_SHEET* aSheet )
{
wxCHECK_MSG( aSheet != nullptr, nullptr, "" );
wxCHECK_MSG( CurTok() == T_pin, nullptr,
@ -2276,7 +2275,7 @@ SCH_SHEET_PIN* SCH_SEXPR_PARSER::parseSchSheetPin( SCH_SHEET* aSheet )
}
void SCH_SEXPR_PARSER::parseSchSheetInstances( SCH_SHEET* aRootSheet, SCH_SCREEN* aScreen )
void SCH_IO_KICAD_SEXPR_PARSER::parseSchSheetInstances( SCH_SHEET* aRootSheet, SCH_SCREEN* aScreen )
{
wxCHECK_RET( CurTok() == T_sheet_instances,
"Cannot parse " + GetTokenString( CurTok() ) + " as an instances token." );
@ -2373,7 +2372,7 @@ void SCH_SEXPR_PARSER::parseSchSheetInstances( SCH_SHEET* aRootSheet, SCH_SCREEN
}
void SCH_SEXPR_PARSER::parseSchSymbolInstances( SCH_SCREEN* aScreen )
void SCH_IO_KICAD_SEXPR_PARSER::parseSchSymbolInstances( SCH_SCREEN* aScreen )
{
wxCHECK_RET( CurTok() == T_symbol_instances,
"Cannot parse " + GetTokenString( CurTok() ) + " as an instances token." );
@ -2450,7 +2449,7 @@ void SCH_SEXPR_PARSER::parseSchSymbolInstances( SCH_SCREEN* aScreen )
}
void SCH_SEXPR_PARSER::ParseSchematic( SCH_SHEET* aSheet, bool aIsCopyableOnly, int aFileVersion )
void SCH_IO_KICAD_SEXPR_PARSER::ParseSchematic( SCH_SHEET* aSheet, bool aIsCopyableOnly, int aFileVersion )
{
wxCHECK( aSheet != nullptr, /* void */ );
@ -2763,7 +2762,7 @@ void SCH_SEXPR_PARSER::ParseSchematic( SCH_SHEET* aSheet, bool aIsCopyableOnly,
}
SCH_SYMBOL* SCH_SEXPR_PARSER::parseSchematicSymbol()
SCH_SYMBOL* SCH_IO_KICAD_SEXPR_PARSER::parseSchematicSymbol()
{
wxCHECK_MSG( CurTok() == T_symbol, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a symbol." ) );
@ -3152,7 +3151,7 @@ SCH_SYMBOL* SCH_SEXPR_PARSER::parseSchematicSymbol()
}
SCH_BITMAP* SCH_SEXPR_PARSER::parseImage()
SCH_BITMAP* SCH_IO_KICAD_SEXPR_PARSER::parseImage()
{
wxCHECK_MSG( CurTok() == T_image, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as an image." ) );
@ -3236,7 +3235,7 @@ SCH_BITMAP* SCH_SEXPR_PARSER::parseImage()
}
SCH_SHEET* SCH_SEXPR_PARSER::parseSheet()
SCH_SHEET* SCH_IO_KICAD_SEXPR_PARSER::parseSheet()
{
wxCHECK_MSG( CurTok() == T_sheet, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a sheet." ) );
@ -3428,7 +3427,7 @@ SCH_SHEET* SCH_SEXPR_PARSER::parseSheet()
}
SCH_JUNCTION* SCH_SEXPR_PARSER::parseJunction()
SCH_JUNCTION* SCH_IO_KICAD_SEXPR_PARSER::parseJunction()
{
wxCHECK_MSG( CurTok() == T_junction, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a junction." ) );
@ -3484,7 +3483,7 @@ SCH_JUNCTION* SCH_SEXPR_PARSER::parseJunction()
}
SCH_NO_CONNECT* SCH_SEXPR_PARSER::parseNoConnect()
SCH_NO_CONNECT* SCH_IO_KICAD_SEXPR_PARSER::parseNoConnect()
{
wxCHECK_MSG( CurTok() == T_no_connect, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a no connect." ) );
@ -3521,7 +3520,7 @@ SCH_NO_CONNECT* SCH_SEXPR_PARSER::parseNoConnect()
}
SCH_BUS_WIRE_ENTRY* SCH_SEXPR_PARSER::parseBusEntry()
SCH_BUS_WIRE_ENTRY* SCH_IO_KICAD_SEXPR_PARSER::parseBusEntry()
{
wxCHECK_MSG( CurTok() == T_bus_entry, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a bus entry." ) );
@ -3575,7 +3574,7 @@ SCH_BUS_WIRE_ENTRY* SCH_SEXPR_PARSER::parseBusEntry()
}
SCH_SHAPE* SCH_SEXPR_PARSER::parseSchPolyLine()
SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchPolyLine()
{
T token;
STROKE_PARAMS stroke( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), LINE_STYLE::DEFAULT );
@ -3636,7 +3635,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchPolyLine()
}
SCH_LINE* SCH_SEXPR_PARSER::parseLine()
SCH_LINE* SCH_IO_KICAD_SEXPR_PARSER::parseLine()
{
// Note: T_polyline is deprecated in this code: it is now handled by
// parseSchPolyLine() that can handle true polygons, and not only one segment.
@ -3705,7 +3704,7 @@ SCH_LINE* SCH_SEXPR_PARSER::parseLine()
}
SCH_SHAPE* SCH_SEXPR_PARSER::parseSchArc()
SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchArc()
{
wxCHECK_MSG( CurTok() == T_arc, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as an arc." ) );
@ -3770,7 +3769,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchArc()
}
SCH_SHAPE* SCH_SEXPR_PARSER::parseSchCircle()
SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchCircle()
{
wxCHECK_MSG( CurTok() == T_circle, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a circle." ) );
@ -3830,7 +3829,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchCircle()
}
SCH_SHAPE* SCH_SEXPR_PARSER::parseSchRectangle()
SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchRectangle()
{
wxCHECK_MSG( CurTok() == T_rectangle, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a rectangle." ) );
@ -3885,7 +3884,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchRectangle()
}
SCH_SHAPE* SCH_SEXPR_PARSER::parseSchBezier()
SCH_SHAPE* SCH_IO_KICAD_SEXPR_PARSER::parseSchBezier()
{
wxCHECK_MSG( CurTok() == T_bezier, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a bezier." ) );
@ -3948,7 +3947,7 @@ SCH_SHAPE* SCH_SEXPR_PARSER::parseSchBezier()
}
SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
SCH_TEXT* SCH_IO_KICAD_SEXPR_PARSER::parseSchText()
{
T token;
std::unique_ptr<SCH_TEXT> text;
@ -4118,7 +4117,7 @@ SCH_TEXT* SCH_SEXPR_PARSER::parseSchText()
}
SCH_TEXTBOX* SCH_SEXPR_PARSER::parseSchTextBox()
SCH_TEXTBOX* SCH_IO_KICAD_SEXPR_PARSER::parseSchTextBox()
{
wxCHECK_MSG( CurTok() == T_text_box, nullptr,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a text box." ) );
@ -4213,7 +4212,7 @@ SCH_TEXTBOX* SCH_SEXPR_PARSER::parseSchTextBox()
}
void SCH_SEXPR_PARSER::parseBusAlias( SCH_SCREEN* aScreen )
void SCH_IO_KICAD_SEXPR_PARSER::parseBusAlias( SCH_SCREEN* aScreen )
{
wxCHECK_RET( CurTok() == T_bus_alias,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as a bus alias." ) );

View File

@ -25,12 +25,11 @@
*/
/**
* @file sch_sexpr_parser.h
* @brief Schematic and symbol library s-expression file format parser definitions.
*/
#ifndef __SCH_SEXPR_PARSER_H__
#define __SCH_SEXPR_PARSER_H__
#ifndef SCH_IO_KICAD_SEXPR_PARSER_H_
#define SCH_IO_KICAD_SEXPR_PARSER_H_
#include <symbol_library.h>
#include <schematic_lexer.h>
@ -74,10 +73,10 @@ public:
/**
* Object to parser s-expression symbol library and schematic file formats.
*/
class SCH_SEXPR_PARSER : public SCHEMATIC_LEXER
class SCH_IO_KICAD_SEXPR_PARSER : public SCHEMATIC_LEXER
{
public:
SCH_SEXPR_PARSER( LINE_READER* aLineReader = nullptr,
SCH_IO_KICAD_SEXPR_PARSER( LINE_READER* aLineReader = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr, unsigned aLineCount = 0,
SCH_SHEET* aRootSheet = nullptr, bool aIsAppending = false );
@ -241,4 +240,4 @@ private:
SCH_SHEET* m_rootSheet;
};
#endif // __SCH_SEXPR_PARSER_H__
#endif // SCH_IO_KICAD_SEXPR_PARSER_H_

View File

@ -24,7 +24,7 @@
*/
#include <sch_io/ltspice/ltspice_schematic.h>
#include <sch_io/ltspice/ltspice_sch_parser.h>
#include <sch_io/ltspice/sch_io_ltspice_parser.h>
#include <sch_screen.h>
#include <wx/log.h>
#include <wx/dir.h>
@ -130,7 +130,7 @@ void LTSPICE_SCHEMATIC::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet,
}
SCH_SHEET_PATH curSheetPath;
LTSPICE_SCH_PARSER parser( this );
SCH_IO_LTSPICE_PARSER parser( this );
if( i > 0 )
{

View File

@ -20,8 +20,8 @@
*/
#include <sch_io/ltspice/ltspice_schematic.h>
#include <sch_io/ltspice/ltspice_sch_plugin.h>
#include <sch_io/ltspice/ltspice_sch_parser.h>
#include <sch_io/ltspice/sch_io_ltspice.h>
#include <sch_io/ltspice/sch_io_ltspice_parser.h>
#include <project_sch.h>
#include <schematic.h>
@ -33,19 +33,19 @@
* @brief schematic PLUGIN for LTspice (*.asc) and (.asy) format.
*/
const wxString SCH_LTSPICE_PLUGIN::GetName() const
const wxString SCH_IO_LTSPICE::GetName() const
{
return wxT( "LTspice Schematic Importer" );
}
int SCH_LTSPICE_PLUGIN::GetModifyHash() const
int SCH_IO_LTSPICE::GetModifyHash() const
{
return 0;
}
SCH_SHEET* SCH_LTSPICE_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* SCH_IO_LTSPICE::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
SCH_SHEET* aAppendToMe,
const STRING_UTF8_MAP* aProperties )
{

View File

@ -19,8 +19,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SCH_LTSPICE_PLUGIN_H_
#define SCH_LTSPICE_PLUGIN_H_
#ifndef SCH_IO_LTSPICE_H_
#define SCH_IO_LTSPICE_H_
#include <sch_io/sch_io.h>
#include <sch_io/sch_io_mgr.h>
@ -32,16 +32,16 @@ class SCH_SHEET;
class SCH_SCREEN;
class SCH_LTSPICE_PLUGIN : public SCH_IO
class SCH_IO_LTSPICE : public SCH_IO
{
public:
SCH_LTSPICE_PLUGIN()
SCH_IO_LTSPICE()
{
m_reporter = &WXLOG_REPORTER::GetInstance();
m_progressReporter = nullptr;
}
~SCH_LTSPICE_PLUGIN()
~SCH_IO_LTSPICE()
{
}
@ -74,4 +74,4 @@ private:
REPORTER* m_reporter; // current reporter for warnings/errors
PROGRESS_REPORTER* m_progressReporter; // optional; may be nullptr
};
#endif // SCH_LTSPICE_PLUGIN_H_
#endif // SCH_IO_LTSPICE_H_

View File

@ -24,7 +24,7 @@
* schematic file.
*/
#include <sch_io/ltspice/ltspice_sch_parser.h>
#include <sch_io/ltspice/sch_io_ltspice_parser.h>
#include <sch_io/ltspice/ltspice_schematic.h>
#include <sch_io/sch_io_mgr.h>
#include <schematic.h>
@ -38,7 +38,7 @@
#include <sch_bus_entry.h>
void LTSPICE_SCH_PARSER::Parse( SCH_SHEET_PATH* aSheet,
void SCH_IO_LTSPICE_PARSER::Parse( SCH_SHEET_PATH* aSheet,
std::vector<LTSPICE_SCHEMATIC::LT_ASC>& outLT_ASCs,
const std::vector<wxString>& aAsyFileNames )
{
@ -72,7 +72,7 @@ void LTSPICE_SCH_PARSER::Parse( SCH_SHEET_PATH* aSheet,
}
void LTSPICE_SCH_PARSER::readIncludes( std::vector<LTSPICE_SCHEMATIC::LT_ASC>& outLT_ASCs )
void SCH_IO_LTSPICE_PARSER::readIncludes( std::vector<LTSPICE_SCHEMATIC::LT_ASC>& outLT_ASCs )
{
wxFileName ltSubDir( m_lt_schematic->GetLTspiceDataDir().GetFullPath(), wxEmptyString );
ltSubDir.AppendDir( wxS( "sub" ) );
@ -107,7 +107,7 @@ void LTSPICE_SCH_PARSER::readIncludes( std::vector<LTSPICE_SCHEMATIC::LT_ASC>& o
}
void LTSPICE_SCH_PARSER::CreateLines( LIB_SYMBOL* aSymbol, LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
void SCH_IO_LTSPICE_PARSER::CreateLines( LIB_SYMBOL* aSymbol, LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
int aIndex, LIB_SHAPE* shape )
{
LTSPICE_SCHEMATIC::LINE& lt_line = aLTSymbol.Lines[aIndex];
@ -118,7 +118,7 @@ void LTSPICE_SCH_PARSER::CreateLines( LIB_SYMBOL* aSymbol, LTSPICE_SCHEMATIC::LT
}
void LTSPICE_SCH_PARSER::CreateLines( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateLines( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::LINE& lt_line = aLTSymbol.Lines[aIndex];
@ -135,7 +135,7 @@ void LTSPICE_SCH_PARSER::CreateLines( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, i
}
void LTSPICE_SCH_PARSER::CreateKicadSYMBOLs( SCH_SHEET_PATH* aSheet,
void SCH_IO_LTSPICE_PARSER::CreateKicadSYMBOLs( SCH_SHEET_PATH* aSheet,
std::vector<LTSPICE_SCHEMATIC::LT_ASC>& outLT_ASCs,
const std::vector<wxString>& aAsyFiles )
{
@ -274,7 +274,7 @@ void LTSPICE_SCH_PARSER::CreateKicadSYMBOLs( SCH_SHEET_PATH* aSheet,
}
void LTSPICE_SCH_PARSER::CreateSymbol( LTSPICE_SCHEMATIC::LT_SYMBOL& aLtSymbol,
void SCH_IO_LTSPICE_PARSER::CreateSymbol( LTSPICE_SCHEMATIC::LT_SYMBOL& aLtSymbol,
LIB_SYMBOL* aLibSymbol )
{
for( int j = 0; j < (int) aLtSymbol.Lines.size(); j++ )
@ -321,25 +321,25 @@ void LTSPICE_SCH_PARSER::CreateSymbol( LTSPICE_SCHEMATIC::LT_SYMBOL& aLtSymbol,
}
int LTSPICE_SCH_PARSER::ToKicadCoords( int aCoordinate )
int SCH_IO_LTSPICE_PARSER::ToKicadCoords( int aCoordinate )
{
return schIUScale.MilsToIU( rescale( 50, aCoordinate, 16 ) );
}
VECTOR2I LTSPICE_SCH_PARSER::ToKicadCoords( const VECTOR2I& aPos )
VECTOR2I SCH_IO_LTSPICE_PARSER::ToKicadCoords( const VECTOR2I& aPos )
{
return VECTOR2I( ToKicadCoords( aPos.x ), ToKicadCoords( aPos.y ) );
}
VECTOR2I LTSPICE_SCH_PARSER::ToInvertedKicadCoords( const VECTOR2I& aPos )
VECTOR2I SCH_IO_LTSPICE_PARSER::ToInvertedKicadCoords( const VECTOR2I& aPos )
{
return VECTOR2I( ToKicadCoords( aPos.x ), -ToKicadCoords( aPos.y ) );
}
VECTOR2I LTSPICE_SCH_PARSER::ToKicadFontSize( int aLTFontSize )
VECTOR2I SCH_IO_LTSPICE_PARSER::ToKicadFontSize( int aLTFontSize )
{
auto MILS_SIZE =
[]( int mils )
@ -358,13 +358,13 @@ VECTOR2I LTSPICE_SCH_PARSER::ToKicadFontSize( int aLTFontSize )
}
int LTSPICE_SCH_PARSER::ToLtSpiceCoords( int aCoordinate )
int SCH_IO_LTSPICE_PARSER::ToLtSpiceCoords( int aCoordinate )
{
return schIUScale.IUToMils( rescale( 16, aCoordinate, 50 ) );
}
void LTSPICE_SCH_PARSER::RotateMirrorShape( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
void SCH_IO_LTSPICE_PARSER::RotateMirrorShape( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
SCH_SHAPE* aShape )
{
if( aLTSymbol.SymbolOrientation == LTSPICE_SCHEMATIC::ORIENTATION::R90 )
@ -405,7 +405,7 @@ void LTSPICE_SCH_PARSER::RotateMirrorShape( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSym
}
void LTSPICE_SCH_PARSER::RotateMirror( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
void SCH_IO_LTSPICE_PARSER::RotateMirror( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
SCH_SYMBOL* aSchSymbol )
{
if( aLTSymbol.SymbolOrientation == LTSPICE_SCHEMATIC::ORIENTATION::R0 )
@ -446,7 +446,7 @@ void LTSPICE_SCH_PARSER::RotateMirror( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
}
void LTSPICE_SCH_PARSER::CreateWires( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateWires( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
SCH_SHEET_PATH* aSheet )
{
SCH_LINE* segment = new SCH_LINE();
@ -461,7 +461,7 @@ void LTSPICE_SCH_PARSER::CreateWires( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, i
}
void LTSPICE_SCH_PARSER::CreateKicadSCH_ITEMs( SCH_SHEET_PATH* aSheet,
void SCH_IO_LTSPICE_PARSER::CreateKicadSCH_ITEMs( SCH_SHEET_PATH* aSheet,
std::vector<LTSPICE_SCHEMATIC::LT_ASC>& outLT_ASCs )
{
SCH_SCREEN* screen = aSheet->LastScreen();
@ -546,7 +546,7 @@ void LTSPICE_SCH_PARSER::CreateKicadSCH_ITEMs( SCH_SHEET_PATH* aSheet,
}
void LTSPICE_SCH_PARSER::CreateBusEntry( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateBusEntry( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::BUSTAP& bustap = aAscfile.Bustap[aIndex];
@ -581,7 +581,7 @@ LABEL_FLAG_SHAPE getLabelShape( LTSPICE_SCHEMATIC::POLARITY aPolarity )
}
void LTSPICE_SCH_PARSER::CreatePin( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreatePin( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::IOPIN& iopin = aAscfile.Iopins[aIndex];
@ -607,7 +607,7 @@ void LTSPICE_SCH_PARSER::CreatePin( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIn
}
void LTSPICE_SCH_PARSER::CreateLine( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateLine( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::LINE& lt_line = aAscfile.Lines[aIndex];
@ -621,7 +621,7 @@ void LTSPICE_SCH_PARSER::CreateLine( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aI
}
void LTSPICE_SCH_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::CIRCLE& lt_circle = aAscfile.Circles[aIndex];
@ -639,7 +639,7 @@ void LTSPICE_SCH_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int
}
void LTSPICE_SCH_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::ARC& lt_arc = aAscfile.Arcs[aIndex];
@ -655,7 +655,7 @@ void LTSPICE_SCH_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIn
}
void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::RECTANGLE& lt_rect = aAscfile.Rectangles[aIndex];
@ -670,7 +670,7 @@ void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aI
}
int LTSPICE_SCH_PARSER::getLineWidth( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineWidth )
int SCH_IO_LTSPICE_PARSER::getLineWidth( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineWidth )
{
if( aLineWidth == LTSPICE_SCHEMATIC::LINEWIDTH::Normal )
return schIUScale.MilsToIU( 6 );
@ -681,7 +681,7 @@ int LTSPICE_SCH_PARSER::getLineWidth( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineW
}
LINE_STYLE LTSPICE_SCH_PARSER::getLineStyle( const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle )
LINE_STYLE SCH_IO_LTSPICE_PARSER::getLineStyle( const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle )
{
switch( aLineStyle )
{
@ -695,14 +695,14 @@ LINE_STYLE LTSPICE_SCH_PARSER::getLineStyle( const LTSPICE_SCHEMATIC::LINESTYLE&
}
STROKE_PARAMS LTSPICE_SCH_PARSER::getStroke( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineWidth,
STROKE_PARAMS SCH_IO_LTSPICE_PARSER::getStroke( const LTSPICE_SCHEMATIC::LINEWIDTH& aLineWidth,
const LTSPICE_SCHEMATIC::LINESTYLE& aLineStyle )
{
return STROKE_PARAMS( getLineWidth( aLineWidth ), getLineStyle( aLineStyle ) );
}
void LTSPICE_SCH_PARSER::setTextJustification( EDA_TEXT* aText,
void SCH_IO_LTSPICE_PARSER::setTextJustification( EDA_TEXT* aText,
LTSPICE_SCHEMATIC::JUSTIFICATION aJustification )
{
switch( aJustification )
@ -786,7 +786,7 @@ void LTSPICE_SCH_PARSER::setTextJustification( EDA_TEXT*
}
SCH_TEXT* LTSPICE_SCH_PARSER::CreateSCH_TEXT( VECTOR2I aOffset, const wxString& aText,
SCH_TEXT* SCH_IO_LTSPICE_PARSER::CreateSCH_TEXT( VECTOR2I aOffset, const wxString& aText,
int aFontSize,
LTSPICE_SCHEMATIC::JUSTIFICATION aJustification )
{
@ -803,7 +803,7 @@ SCH_TEXT* LTSPICE_SCH_PARSER::CreateSCH_TEXT( VECTOR2I aOffset, const wxString&
}
void LTSPICE_SCH_PARSER::CreateWire( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateWire( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aIndex,
SCH_SHEET_PATH* aSheet, SCH_LAYER_ID aLayer )
{
SCH_LINE* segment = new SCH_LINE();
@ -819,7 +819,7 @@ void LTSPICE_SCH_PARSER::CreateWire( LTSPICE_SCHEMATIC::LT_ASC& aAscfile, int aI
}
SCH_SYMBOL* LTSPICE_SCH_PARSER::CreatePowerSymbol( const VECTOR2I& aOffset, const wxString& aValue,
SCH_SYMBOL* SCH_IO_LTSPICE_PARSER::CreatePowerSymbol( const VECTOR2I& aOffset, const wxString& aValue,
int aFontSize, SCH_SHEET_PATH* aSheet,
std::vector<LTSPICE_SCHEMATIC::WIRE>& aWires )
{
@ -902,7 +902,7 @@ SCH_SYMBOL* LTSPICE_SCH_PARSER::CreatePowerSymbol( const VECTOR2I& aOffset, cons
}
SCH_LABEL_BASE* LTSPICE_SCH_PARSER::CreateSCH_LABEL( KICAD_T aType, const VECTOR2I& aOffset,
SCH_LABEL_BASE* SCH_IO_LTSPICE_PARSER::CreateSCH_LABEL( KICAD_T aType, const VECTOR2I& aOffset,
const wxString& aValue, int aFontSize )
{
SCH_LABEL_BASE* label = nullptr;
@ -944,7 +944,7 @@ SCH_LABEL_BASE* LTSPICE_SCH_PARSER::CreateSCH_LABEL( KICAD_T aType, const VECTOR
}
void LTSPICE_SCH_PARSER::CreateFields( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
void SCH_IO_LTSPICE_PARSER::CreateFields( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
SCH_SYMBOL* aSymbol, SCH_SHEET_PATH* aSheet )
{
wxString libPath = m_lt_schematic->GetLTspiceDataDir().GetFullPath();
@ -1246,7 +1246,7 @@ void LTSPICE_SCH_PARSER::CreateFields( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
}
void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
LIB_SHAPE* aRectangle )
{
LTSPICE_SCHEMATIC::RECTANGLE& lt_rect = aLTSymbol.Rectangles[aIndex];
@ -1260,7 +1260,7 @@ void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, in
}
void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::RECTANGLE& lt_rect = aLTSymbol.Rectangles[aIndex];
@ -1277,7 +1277,7 @@ void LTSPICE_SCH_PARSER::CreateRect( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, in
}
void LTSPICE_SCH_PARSER::CreatePin( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreatePin( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
LIB_PIN* aPin )
{
LTSPICE_SCHEMATIC::LT_PIN& lt_pin = aLTSymbol.Pins[aIndex];
@ -1331,7 +1331,7 @@ void LTSPICE_SCH_PARSER::CreatePin( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int
}
void LTSPICE_SCH_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
LIB_SHAPE* aArc )
{
LTSPICE_SCHEMATIC::ARC& lt_arc = aLTSymbol.Arcs[aIndex];
@ -1343,7 +1343,7 @@ void LTSPICE_SCH_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int
}
void LTSPICE_SCH_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::ARC& lt_arc = aLTSymbol.Arcs[aIndex];
@ -1361,7 +1361,7 @@ void LTSPICE_SCH_PARSER::CreateArc( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int
}
void LTSPICE_SCH_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
SCH_SHEET_PATH* aSheet )
{
LTSPICE_SCHEMATIC::CIRCLE& lt_circle = aLTSymbol.Circles[aIndex];
@ -1381,7 +1381,7 @@ void LTSPICE_SCH_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol,
}
void LTSPICE_SCH_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
void SCH_IO_LTSPICE_PARSER::CreateCircle( LTSPICE_SCHEMATIC::LT_SYMBOL& aLTSymbol, int aIndex,
LIB_SHAPE* aCircle )
{
LTSPICE_SCHEMATIC::CIRCLE& lt_circle = aLTSymbol.Circles[aIndex];

View File

@ -64,15 +64,15 @@ class SCH_SHAPE;
* Enum Conversion Methods - The individual comments for functions under this section is
* given. In general these methods are used to convert the string into enum.
*/
class LTSPICE_SCH_PARSER
class SCH_IO_LTSPICE_PARSER
{
public:
explicit LTSPICE_SCH_PARSER( LTSPICE_SCHEMATIC* aLTSchematic ) :
explicit SCH_IO_LTSPICE_PARSER( LTSPICE_SCHEMATIC* aLTSchematic ) :
m_lt_schematic( aLTSchematic ),
m_powerSymbolIndex( 0 )
{ }
~LTSPICE_SCH_PARSER() {}
~SCH_IO_LTSPICE_PARSER() {}
/**
* Method converts ltspice coordinate(i.e scale) to kicad coordinates

View File

@ -19,13 +19,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "sch_lib_plugin_cache.h"
#include "sch_io_lib_cache.h"
#include <lib_symbol.h>
#include <wx_filename.h>
SCH_LIB_PLUGIN_CACHE::SCH_LIB_PLUGIN_CACHE( const wxString& aFullPathAndFileName ) :
SCH_IO_LIB_CACHE::SCH_IO_LIB_CACHE( const wxString& aFullPathAndFileName ) :
m_modHash( 1 ),
m_fileName( aFullPathAndFileName ),
m_libFileName( aFullPathAndFileName ),
@ -36,7 +36,7 @@ SCH_LIB_PLUGIN_CACHE::SCH_LIB_PLUGIN_CACHE( const wxString& aFullPathAndFileName
}
SCH_LIB_PLUGIN_CACHE::~SCH_LIB_PLUGIN_CACHE()
SCH_IO_LIB_CACHE::~SCH_IO_LIB_CACHE()
{
// When the cache is destroyed, all of the alias objects on the heap should be deleted.
for( auto& symbol : m_symbols )
@ -46,13 +46,13 @@ SCH_LIB_PLUGIN_CACHE::~SCH_LIB_PLUGIN_CACHE()
}
void SCH_LIB_PLUGIN_CACHE::Save( const std::optional<bool>& aOpt )
void SCH_IO_LIB_CACHE::Save( const std::optional<bool>& aOpt )
{
wxCHECK( false, /* void */ );
}
wxFileName SCH_LIB_PLUGIN_CACHE::GetRealFile() const
wxFileName SCH_IO_LIB_CACHE::GetRealFile() const
{
wxFileName fn( m_libFileName );
@ -62,7 +62,7 @@ wxFileName SCH_LIB_PLUGIN_CACHE::GetRealFile() const
}
wxDateTime SCH_LIB_PLUGIN_CACHE::GetLibModificationTime()
wxDateTime SCH_IO_LIB_CACHE::GetLibModificationTime()
{
wxFileName fn = GetRealFile();
@ -74,13 +74,13 @@ wxDateTime SCH_LIB_PLUGIN_CACHE::GetLibModificationTime()
}
bool SCH_LIB_PLUGIN_CACHE::IsFile( const wxString& aFullPathAndFileName ) const
bool SCH_IO_LIB_CACHE::IsFile( const wxString& aFullPathAndFileName ) const
{
return m_fileName == aFullPathAndFileName;
}
bool SCH_LIB_PLUGIN_CACHE::IsFileChanged() const
bool SCH_IO_LIB_CACHE::IsFileChanged() const
{
wxFileName fn = GetRealFile();
@ -91,7 +91,7 @@ bool SCH_LIB_PLUGIN_CACHE::IsFileChanged() const
}
LIB_SYMBOL* SCH_LIB_PLUGIN_CACHE::removeSymbol( LIB_SYMBOL* aSymbol )
LIB_SYMBOL* SCH_IO_LIB_CACHE::removeSymbol( LIB_SYMBOL* aSymbol )
{
wxCHECK_MSG( aSymbol != nullptr, nullptr, "NULL pointer cannot be removed from library." );
@ -158,7 +158,7 @@ LIB_SYMBOL* SCH_LIB_PLUGIN_CACHE::removeSymbol( LIB_SYMBOL* aSymbol )
}
void SCH_LIB_PLUGIN_CACHE::AddSymbol( const LIB_SYMBOL* aSymbol )
void SCH_IO_LIB_CACHE::AddSymbol( const LIB_SYMBOL* aSymbol )
{
// aSymbol is cloned in SYMBOL_LIB::AddSymbol(). The cache takes ownership of aSymbol.
wxString name = aSymbol->GetName();
@ -175,7 +175,7 @@ void SCH_LIB_PLUGIN_CACHE::AddSymbol( const LIB_SYMBOL* aSymbol )
}
LIB_SYMBOL* SCH_LIB_PLUGIN_CACHE::GetSymbol( const wxString& aName )
LIB_SYMBOL* SCH_IO_LIB_CACHE::GetSymbol( const wxString& aName )
{
LIB_SYMBOL_MAP::iterator it = m_symbols.find( aName );

View File

@ -19,8 +19,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SCH_LIB_PLUGIN_CACHE_H_
#define _SCH_LIB_PLUGIN_CACHE_H_
#ifndef _SCH_IO_LIB_CACHE_H_
#define _SCH_IO_LIB_CACHE_H_
#include <mutex>
#include <optional>
@ -37,11 +37,11 @@ class OUTPUTFORMATTER;
/**
* A base cache assistant implementation for the symbol library portion of the #SCH_IO API.
*/
class SCH_LIB_PLUGIN_CACHE
class SCH_IO_LIB_CACHE
{
public:
SCH_LIB_PLUGIN_CACHE( const wxString& aLibraryPath );
virtual ~SCH_LIB_PLUGIN_CACHE();
SCH_IO_LIB_CACHE( const wxString& aLibraryPath );
virtual ~SCH_IO_LIB_CACHE();
void IncrementModifyHash()
{
@ -104,4 +104,4 @@ protected:
SCH_LIB_TYPE m_libType; // Is this cache a symbol or symbol library.
};
#endif // _SCH_LIB_PLUGIN_CACHE_H_
#endif // _SCH_IO_LIB_CACHE_H_

View File

@ -24,17 +24,17 @@
#include <wx/uri.h>
#include <sch_io/sch_io_mgr.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/eagle/sch_eagle_plugin.h>
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_io/eagle/sch_io_eagle.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <sch_io/altium/sch_altium_plugin.h>
#include <sch_io/cadstar/cadstar_sch_archive_plugin.h>
#include <sch_io/easyeda/sch_easyeda_plugin.h>
#include <sch_io/easyedapro/sch_easyedapro_plugin.h>
#include <sch_io/database/sch_database_plugin.h>
#include <sch_io/ltspice/ltspice_sch_plugin.h>
#include <sch_io/http_lib/sch_http_lib_plugin.h>
#include <sch_io/altium/sch_io_altium.h>
#include <sch_io/cadstar/sch_io_cadstar_archive.h>
#include <sch_io/easyeda/sch_io_easyeda.h>
#include <sch_io/easyedapro/sch_io_easyedapro.h>
#include <sch_io/database/sch_io_database.h>
#include <sch_io/ltspice/sch_io_ltspice.h>
#include <sch_io/http_lib/sch_io_http_lib.h>
#include <common.h> // for ExpandEnvVarSubstitutions
#include <wildcards_and_files_ext.h>
@ -64,16 +64,16 @@ SCH_IO* SCH_IO_MGR::FindPlugin( SCH_FILE_T aFileType )
switch( aFileType )
{
case SCH_KICAD: return new SCH_SEXPR_PLUGIN();
case SCH_LEGACY: return new SCH_LEGACY_PLUGIN();
case SCH_ALTIUM: return new SCH_ALTIUM_PLUGIN();
case SCH_CADSTAR_ARCHIVE: return new CADSTAR_SCH_ARCHIVE_PLUGIN();
case SCH_DATABASE: return new SCH_DATABASE_PLUGIN();
case SCH_EAGLE: return new SCH_EAGLE_PLUGIN();
case SCH_EASYEDA: return new SCH_EASYEDA_PLUGIN();
case SCH_EASYEDAPRO: return new SCH_EASYEDAPRO_PLUGIN();
case SCH_LTSPICE: return new SCH_LTSPICE_PLUGIN();
case SCH_HTTP: return new SCH_HTTP_LIB_PLUGIN();
case SCH_KICAD: return new SCH_IO_KICAD_SEXPR();
case SCH_LEGACY: return new SCH_IO_KICAD_LEGACY();
case SCH_ALTIUM: return new SCH_IO_ALTIUM();
case SCH_CADSTAR_ARCHIVE: return new SCH_IO_CADSTAR_ARCHIVE();
case SCH_DATABASE: return new SCH_IO_DATABASE();
case SCH_EAGLE: return new SCH_IO_EAGLE();
case SCH_EASYEDA: return new SCH_IO_EASYEDA();
case SCH_EASYEDAPRO: return new SCH_IO_EASYEDAPRO();
case SCH_LTSPICE: return new SCH_IO_LTSPICE();
case SCH_HTTP: return new SCH_IO_HTTP_LIB();
default: return nullptr;
}
}

View File

@ -269,7 +269,7 @@ public:
* element in the %EE_RTREE
* N.B. The iteration order of the RTree is not readily apparent and will change
* if/when you add or move items and the RTree is re-balanced. Any exposure of the
* RTree contents to the user MUST be sorted before being presented. See SCH_SEXPR_PLUGIN::Format
* RTree contents to the user MUST be sorted before being presented. See SCH_IO_KICAD_SEXPR::Format
* or SCH_EDITOR_CONTROL::nextMatch for examples.
* @return Complete RTree of the screen's items
*/

View File

@ -61,11 +61,11 @@ class SCH_LINE;
class SCH_LABEL_BASE;
class PLOTTER;
class REPORTER;
class SCH_ALTIUM_PLUGIN;
class SCH_IO_ALTIUM;
class SCH_EDIT_FRAME;
class SCH_SHEET_LIST;
class SCH_SEXPR_PARSER;
class SCH_SEXPR_PLUGIN;
class SCH_IO_KICAD_SEXPR_PARSER;
class SCH_IO_KICAD_SEXPR;
enum SCH_LINE_TEST_T
{
@ -102,7 +102,7 @@ public:
* N.B. The iteration order of the RTree is not readily apparent and will change
* if/when you add or move items and the RTree is re-balanced. Any exposure of the
* RTree contents to the user MUST be sorted before being presented. See
* SCH_SEXPR_PLUGIN::Format() or SCH_EDITOR_CONTROL::nextMatch() for examples.
* SCH_IO_KICAD_SEXPR::Format() or SCH_EDITOR_CONTROL::nextMatch() for examples.
*
* @return Complete RTree of the screen's items
*/
@ -568,9 +568,9 @@ public:
private:
friend SCH_EDIT_FRAME; // Only to populate m_symbolInstances.
friend SCH_SEXPR_PARSER; // Only to load instance information from schematic file.
friend SCH_SEXPR_PLUGIN; // Only to save the loaded instance information to schematic file.
friend SCH_ALTIUM_PLUGIN;
friend SCH_IO_KICAD_SEXPR_PARSER; // Only to load instance information from schematic file.
friend SCH_IO_KICAD_SEXPR; // Only to save the loaded instance information to schematic file.
friend SCH_IO_ALTIUM;
bool doIsJunction( const VECTOR2I& aPosition, bool aBreakCrossings,
bool* aHasExplicitJunctionDot, bool* aHasBusEntry ) const;

View File

@ -29,7 +29,7 @@
class KIID_PATH;
class SCH_SCREEN;
class SCH_SEXPR_PARSER;
class SCH_IO_KICAD_SEXPR_PARSER;
class SCH_SHEET_LIST;
class SCH_SHEET_PIN;
class SCH_SHEET_PATH;
@ -431,7 +431,7 @@ public:
protected:
friend SCH_SHEET_PATH;
friend SCH_SEXPR_PARSER;
friend SCH_IO_KICAD_SEXPR_PARSER;
void setInstances( const std::vector<SCH_SHEET_INSTANCE>& aInstances )
{

View File

@ -31,7 +31,7 @@
#include <tool/tool_manager.h>
#include <project_sch.h>
#include <sch_edit_frame.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <sch_view.h>

View File

@ -38,8 +38,8 @@
#include <symbol_tree_pane.h>
#include <project/project_file.h>
#include <widgets/lib_tree.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <dialogs/dialog_lib_new_symbol.h>
#include <eda_list_dialog.h>
#include <wx/clipbrd.h>
@ -853,7 +853,7 @@ void SYMBOL_EDIT_FRAME::CopySymbolToClipboard()
continue;
std::unique_ptr<LIB_SYMBOL> tmp = symbol->Flatten();
SCH_SEXPR_PLUGIN::FormatLibSymbol( tmp.get(), formatter );
SCH_IO_KICAD_SEXPR::FormatLibSymbol( tmp.get(), formatter );
}
wxLogNull doNotLog; // disable logging of failed clipboard actions
@ -887,7 +887,7 @@ void SYMBOL_EDIT_FRAME::DuplicateSymbol( bool aFromClipboard )
try
{
newSymbols = SCH_SEXPR_PLUGIN::ParseLibSymbols( clipboardData, "Clipboard" );
newSymbols = SCH_IO_KICAD_SEXPR::ParseLibSymbols( clipboardData, "Clipboard" );
}
catch( IO_ERROR& e )
{

View File

@ -34,7 +34,7 @@
#include <systemdirsappend.h>
#include <symbol_lib_table.h>
#include <lib_symbol.h>
#include <sch_io/database/sch_database_plugin.h>
#include <sch_io/database/sch_io_database.h>
#include <dialogs/dialog_database_lib_settings.h>
#include <wx/dir.h>
@ -111,7 +111,7 @@ void SYMBOL_LIB_TABLE_ROW::ShowSettingsDialog( wxWindow* aParent ) const
return;
DIALOG_DATABASE_LIB_SETTINGS dlg( aParent,
static_cast<SCH_DATABASE_PLUGIN*>( ( SCH_IO* )plugin ) );
static_cast<SCH_IO_DATABASE*>( ( SCH_IO* )plugin ) );
dlg.ShowModal();
}

View File

@ -38,7 +38,7 @@
#include <widgets/app_progress_dialog.h>
#include <symbol_library.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <wx/log.h>
#include <wx/progdlg.h>
@ -81,7 +81,7 @@ void SYMBOL_LIB::Save( bool aSaveDocFile )
STRING_UTF8_MAP props;
if( !aSaveDocFile )
props[ SCH_LEGACY_PLUGIN::PropNoDocFile ] = "";
props[ SCH_IO_KICAD_LEGACY::PropNoDocFile ] = "";
m_plugin->SaveLibrary( fileName.GetFullPath(), &props );
isModified = false;
@ -111,28 +111,28 @@ void SYMBOL_LIB::SetPluginType( SCH_IO_MGR::SCH_FILE_T aPluginType )
bool SYMBOL_LIB::IsCache() const
{
return m_properties->Exists( SCH_LEGACY_PLUGIN::PropNoDocFile );
return m_properties->Exists( SCH_IO_KICAD_LEGACY::PropNoDocFile );
}
void SYMBOL_LIB::SetCache()
{
(*m_properties)[ SCH_LEGACY_PLUGIN::PropNoDocFile ] = "";
(*m_properties)[ SCH_IO_KICAD_LEGACY::PropNoDocFile ] = "";
}
bool SYMBOL_LIB::IsBuffering() const
{
return m_properties->Exists( SCH_LEGACY_PLUGIN::PropBuffering );
return m_properties->Exists( SCH_IO_KICAD_LEGACY::PropBuffering );
}
void SYMBOL_LIB::EnableBuffering( bool aEnable )
{
if( aEnable )
(*m_properties)[ SCH_LEGACY_PLUGIN::PropBuffering ] = "";
(*m_properties)[ SCH_IO_KICAD_LEGACY::PropBuffering ] = "";
else
m_properties->Clear( SCH_LEGACY_PLUGIN::PropBuffering );
m_properties->Clear( SCH_IO_KICAD_LEGACY::PropBuffering );
}

View File

@ -34,7 +34,7 @@
#include <core/profile.h>
#include <wx_filename.h>
#include <sch_io/sch_io_mgr.h>
#include <sch_io/legacy/sch_legacy_plugin.h>
#include <sch_io/kicad_legacy/sch_io_kicad_legacy.h>
#include <symbol_lib_table.h>
#include <symbol_async_loader.h>
#include <progress_reporter.h>
@ -177,7 +177,7 @@ bool SYMBOL_LIBRARY_MANAGER::SaveLibrary( const wxString& aLibrary, const wxStri
bool res = true; // assume all libraries are successfully saved
STRING_UTF8_MAP properties;
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
properties.emplace( SCH_IO_KICAD_LEGACY::PropBuffering, "" );
auto it = m_libs.find( aLibrary );
@ -993,7 +993,7 @@ bool LIB_BUFFER::SaveBuffer( std::shared_ptr<SYMBOL_BUFFER> aSymbolBuf,
// Set properties to prevent saving the file on every symbol save.
STRING_UTF8_MAP properties;
properties.emplace( SCH_LEGACY_PLUGIN::PropBuffering, "" );
properties.emplace( SCH_IO_KICAD_LEGACY::PropBuffering, "" );
std::shared_ptr<SYMBOL_BUFFER>& symbolBuf = aSymbolBuf;
LIB_SYMBOL* libSymbol = symbolBuf->GetSymbol();

View File

@ -113,7 +113,7 @@ public:
void ClearDeletedBuffer() { m_deleted.clear(); }
///< Save stored modifications using a plugin. aBuffer decides whether the changes
///< should be cached or stored directly to the disk (for SCH_LEGACY_PLUGIN).
///< should be cached or stored directly to the disk (for SCH_IO_KICAD_LEGACY).
bool SaveBuffer( std::shared_ptr<SYMBOL_BUFFER> aSymbolBuf, const wxString& aFileName,
SCH_IO* aPlugin, bool aBuffer );

View File

@ -45,7 +45,7 @@
#include <project/net_settings.h>
#include <project_sch.h>
#include <sch_edit_frame.h>
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <sch_line.h>
#include <sch_junction.h>
#include <sch_bus_entry.h>
@ -1313,7 +1313,7 @@ bool SCH_EDITOR_CONTROL::doCopy( bool aUseDuplicateClipboard )
}
STRING_FORMATTER formatter;
SCH_SEXPR_PLUGIN plugin;
SCH_IO_KICAD_SEXPR plugin;
SCH_SHEET_LIST hierarchy = schematic.GetSheets();
SCH_SHEET_PATH selPath = m_frame->GetCurrentSheet();
@ -1583,7 +1583,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
eventPos = getViewControls()->GetCursorPosition( false );
STRING_LINE_READER reader( content, "Clipboard" );
SCH_SEXPR_PLUGIN plugin;
SCH_IO_KICAD_SEXPR plugin;
SCH_SHEET tempSheet;
SCH_SCREEN* tempScreen = new SCH_SCREEN( &m_frame->Schematic() );

View File

@ -38,7 +38,7 @@
#include <dialogs/dialog_lib_symbol_properties.h>
#include <dialogs/dialog_lib_edit_pin_table.h>
#include <dialogs/dialog_update_symbol_fields.h>
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <lib_text.h>
#include <lib_textbox.h>
#include "symbol_editor_edit_tool.h"
@ -783,7 +783,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent )
LIB_SYMBOL* partCopy = new LIB_SYMBOL( *symbol );
STRING_FORMATTER formatter;
SCH_SEXPR_PLUGIN::FormatLibSymbol( partCopy, formatter );
SCH_IO_KICAD_SEXPR::FormatLibSymbol( partCopy, formatter );
delete partCopy;
@ -809,7 +809,7 @@ int SYMBOL_EDITOR_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent )
try
{
std::vector<LIB_SYMBOL*> newParts = SCH_SEXPR_PLUGIN::ParseLibSymbols( clipboardData, "Clipboard" );
std::vector<LIB_SYMBOL*> newParts = SCH_IO_KICAD_SEXPR::ParseLibSymbols( clipboardData, "Clipboard" );
if( newParts.empty() || !newParts[0] )
return -1;

View File

@ -29,8 +29,8 @@
#include <sch_screen.h>
// For SCH parsing
#include <sch_io/kicad/sch_sexpr_plugin.h>
#include <sch_io/kicad/sch_sexpr_parser.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr.h>
#include <sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.h>
#include <richio.h>
#include <qa_utils/stdstream_line_reader.h>
@ -40,7 +40,7 @@ namespace KI_TEST
void DumpSchematicToFile( SCHEMATIC& aSchematic, SCH_SHEET& aSheet, const std::string& aFilename )
{
SCH_SEXPR_PLUGIN io;
SCH_IO_KICAD_SEXPR io;
io.SaveSchematicFile( aFilename, &aSheet, &aSchematic );
}
@ -51,7 +51,7 @@ void LoadSheetSchematicContents( const std::string& fileName, SCH_SHEET* sheet )
wxASSERT( fileStream.is_open() );
STDISTREAM_LINE_READER reader;
reader.SetStream( fileStream );
SCH_SEXPR_PARSER parser( &reader );
SCH_IO_KICAD_SEXPR_PARSER parser( &reader );
parser.ParseSchematic( sheet );
}