Initial rename of file plugin infrastructure components to IO
This commit is contained in:
parent
3a90b729ea
commit
d8b47d18d3
|
@ -117,7 +117,7 @@ set( KICOMMON_SRCS
|
||||||
trace_helpers.cpp
|
trace_helpers.cpp
|
||||||
wx_filename.cpp
|
wx_filename.cpp
|
||||||
|
|
||||||
plugins/kicad/kicad_plugin_utils.cpp # needed by richio
|
io/kicad/kicad_io_utils.cpp # needed by richio
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library( kicommon SHARED
|
add_library( kicommon SHARED
|
||||||
|
@ -376,28 +376,28 @@ set( PLOTTERS_CONTROL_SRCS
|
||||||
plotters/common_plot_functions.cpp
|
plotters/common_plot_functions.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set( PLUGINS_ALTIUM_SRCS
|
set( COMMON_IO_SRCS
|
||||||
plugins/altium/altium_parser.cpp
|
io/plugin_file_desc.cpp
|
||||||
plugins/altium/altium_parser_utils.cpp
|
io/io_utils.cpp
|
||||||
)
|
|
||||||
|
|
||||||
set( PLUGINS_CADSTAR_SRCS
|
# Altium
|
||||||
plugins/cadstar/cadstar_archive_parser.cpp
|
io/altium/altium_parser.cpp
|
||||||
plugins/cadstar/cadstar_parts_lib_parser.cpp
|
io/altium/altium_parser_utils.cpp
|
||||||
)
|
|
||||||
|
|
||||||
set( PLUGINS_EAGLE_SRCS
|
# Cadstar
|
||||||
plugins/eagle/eagle_parser.cpp
|
io/cadstar/cadstar_archive_parser.cpp
|
||||||
)
|
io/cadstar/cadstar_parts_lib_parser.cpp
|
||||||
|
|
||||||
set( PLUGINS_EASYEDA_SRCS
|
# Eagle
|
||||||
plugins/easyeda/easyeda_parser_base.cpp
|
io/eagle/eagle_parser.cpp
|
||||||
plugins/easyeda/easyeda_parser_structs.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set( PLUGINS_EASYEDAPRO_SRCS
|
# EasyEDA
|
||||||
plugins/easyedapro/easyedapro_parser.cpp
|
io/easyeda/easyeda_parser_base.cpp
|
||||||
plugins/easyedapro/easyedapro_import_utils.cpp
|
io/easyeda/easyeda_parser_structs.cpp
|
||||||
|
|
||||||
|
# EasyEDA pro
|
||||||
|
io/easyedapro/easyedapro_parser.cpp
|
||||||
|
io/easyedapro/easyedapro_import_utils.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set( COMMON_IMPORT_GFX_SRCS
|
set( COMMON_IMPORT_GFX_SRCS
|
||||||
|
@ -430,11 +430,7 @@ set( COMMON_SRCS
|
||||||
${COMMON_DRAWING_SHEET_SRCS}
|
${COMMON_DRAWING_SHEET_SRCS}
|
||||||
${COMMON_PREVIEW_ITEMS_SRCS}
|
${COMMON_PREVIEW_ITEMS_SRCS}
|
||||||
${PLOTTERS_CONTROL_SRCS}
|
${PLOTTERS_CONTROL_SRCS}
|
||||||
${PLUGINS_ALTIUM_SRCS}
|
${COMMON_IO_SRCS}
|
||||||
${PLUGINS_CADSTAR_SRCS}
|
|
||||||
${PLUGINS_EAGLE_SRCS}
|
|
||||||
${PLUGINS_EASYEDA_SRCS}
|
|
||||||
${PLUGINS_EASYEDAPRO_SRCS}
|
|
||||||
${FONT_SRCS}
|
${FONT_SRCS}
|
||||||
${COMMON_IMPORT_GFX_SRCS}
|
${COMMON_IMPORT_GFX_SRCS}
|
||||||
${COMMON_GIT_SRCS}
|
${COMMON_GIT_SRCS}
|
||||||
|
@ -493,8 +489,6 @@ set( COMMON_SRCS
|
||||||
notifications_manager.cpp
|
notifications_manager.cpp
|
||||||
origin_transforms.cpp
|
origin_transforms.cpp
|
||||||
page_info.cpp
|
page_info.cpp
|
||||||
plugin_file_desc.cpp
|
|
||||||
plugins/plugin_utils.cpp
|
|
||||||
printout.cpp
|
printout.cpp
|
||||||
project.cpp
|
project.cpp
|
||||||
ptree.cpp
|
ptree.cpp
|
||||||
|
@ -702,28 +696,21 @@ set( PCB_COMMON_SRCS
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_condition.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_condition.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_parser.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_rule_parser.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_test_provider.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/drc/drc_test_provider.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/plugins/eagle/eagle_plugin.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/footprint_editor_settings.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/footprint_editor_settings.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/plugins/geda/gpcb_plugin.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/io_mgr.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/generators_mgr.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/generators_mgr.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/kicad_clipboard.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/kicad_clipboard.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/kicad_netlist_reader.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/kicad_netlist_reader.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/plugins/kicad/pcb_plugin.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/legacy_netlist_reader.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/legacy_netlist_reader.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/plugins/legacy/legacy_plugin.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pad_custom_shape_functions.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pad_custom_shape_functions.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_draw_panel_gal.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_draw_panel_gal.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/pcb_netlist.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/pcb_netlist.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_origin_transforms.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_origin_transforms.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_painter.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_painter.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/plugins/kicad/pcb_parser.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_params.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_plot_params.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_screen.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_screen.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pcb_view.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_view.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/pcbnew_settings.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/pcbnew_settings.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/plugin.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_data.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_data.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_view_item.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/ratsnest/ratsnest_view_item.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/sel_layer.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/sel_layer.cpp
|
||||||
|
@ -732,6 +719,15 @@ set( PCB_COMMON_SRCS
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_utils.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/teardrop/teardrop_utils.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/zone_settings.cpp
|
||||||
|
|
||||||
|
# IO files
|
||||||
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/pcb_io_mgr.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/legacy/legacy_plugin.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad/pcb_plugin.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/kicad/pcb_parser.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/eagle/eagle_plugin.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/pcbnew/pcb_io/geda/gpcb_plugin.cpp
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_grid_helper.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_grid_helper.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_actions.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_actions.cpp
|
||||||
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_editor_conditions.cpp
|
${CMAKE_SOURCE_DIR}/pcbnew/tools/pcb_editor_conditions.cpp
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define DIALOG_IMPORT_CHOOSE_PROJECT_H
|
#define DIALOG_IMPORT_CHOOSE_PROJECT_H
|
||||||
|
|
||||||
#include "dialog_import_choose_project_base.h"
|
#include "dialog_import_choose_project_base.h"
|
||||||
#include <plugins/common/plugin_common_choose_project.h>
|
#include <io/common/plugin_common_choose_project.h>
|
||||||
|
|
||||||
|
|
||||||
class DIALOG_IMPORT_CHOOSE_PROJECT : public DIALOG_IMPORT_CHOOSE_PROJECT_BASE
|
class DIALOG_IMPORT_CHOOSE_PROJECT : public DIALOG_IMPORT_CHOOSE_PROJECT_BASE
|
||||||
|
|
|
@ -56,10 +56,10 @@ bool FP_LIB_TABLE_ROW::operator==( const FP_LIB_TABLE_ROW& aRow ) const
|
||||||
|
|
||||||
void FP_LIB_TABLE_ROW::SetType( const wxString& aType )
|
void FP_LIB_TABLE_ROW::SetType( const wxString& aType )
|
||||||
{
|
{
|
||||||
type = IO_MGR::EnumFromStr( aType );
|
type = PCB_IO_MGR::EnumFromStr( aType );
|
||||||
|
|
||||||
if( IO_MGR::PCB_FILE_T( -1 ) == type )
|
if( PCB_IO_MGR::PCB_FILE_T( -1 ) == type )
|
||||||
type = IO_MGR::KICAD_SEXP;
|
type = PCB_IO_MGR::KICAD_SEXP;
|
||||||
|
|
||||||
plugin.release();
|
plugin.release();
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ void FP_LIB_TABLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxS
|
||||||
bool aBestEfforts )
|
bool aBestEfforts )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
row->plugin->FootprintEnumerate( aFootprintNames, row->GetFullURI( true ), aBestEfforts,
|
row->plugin->FootprintEnumerate( aFootprintNames, row->GetFullURI( true ), aBestEfforts,
|
||||||
row->GetProperties() );
|
row->GetProperties() );
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ void FP_LIB_TABLE::FootprintEnumerate( wxArrayString& aFootprintNames, const wxS
|
||||||
void FP_LIB_TABLE::PrefetchLib( const wxString& aNickname )
|
void FP_LIB_TABLE::PrefetchLib( const wxString& aNickname )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
row->plugin->PrefetchLib( row->GetFullURI( true ), row->GetProperties() );
|
row->plugin->PrefetchLib( row->GetFullURI( true ), row->GetProperties() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,10 +332,10 @@ const FP_LIB_TABLE_ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname, bool a
|
||||||
}
|
}
|
||||||
|
|
||||||
// We've been 'lazy' up until now, but it cannot be deferred any longer,
|
// We've been 'lazy' up until now, but it cannot be deferred any longer,
|
||||||
// instantiate a PLUGIN of the proper kind if it is not already in this
|
// instantiate a PCB_IO of the proper kind if it is not already in this
|
||||||
// FP_LIB_TABLE_ROW.
|
// FP_LIB_TABLE_ROW.
|
||||||
if( !row->plugin )
|
if( !row->plugin )
|
||||||
row->setPlugin( IO_MGR::PluginFind( row->type ) );
|
row->setPlugin( PCB_IO_MGR::PluginFind( row->type ) );
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ const FOOTPRINT* FP_LIB_TABLE::GetEnumeratedFootprint( const wxString& aNickname
|
||||||
const wxString& aFootprintName )
|
const wxString& aFootprintName )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
|
|
||||||
return row->plugin->GetEnumeratedFootprint( row->GetFullURI( true ), aFootprintName,
|
return row->plugin->GetEnumeratedFootprint( row->GetFullURI( true ), aFootprintName,
|
||||||
row->GetProperties() );
|
row->GetProperties() );
|
||||||
|
@ -381,7 +381,7 @@ bool FP_LIB_TABLE::FootprintExists( const wxString& aNickname, const wxString& a
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
|
|
||||||
return row->plugin->FootprintExists( row->GetFullURI( true ), aFootprintName,
|
return row->plugin->FootprintExists( row->GetFullURI( true ), aFootprintName,
|
||||||
row->GetProperties() );
|
row->GetProperties() );
|
||||||
|
@ -397,7 +397,7 @@ FOOTPRINT* FP_LIB_TABLE::FootprintLoad( const wxString& aNickname,
|
||||||
const wxString& aFootprintName, bool aKeepUUID )
|
const wxString& aFootprintName, bool aKeepUUID )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
|
|
||||||
FOOTPRINT* ret = row->plugin->FootprintLoad( row->GetFullURI( true ), aFootprintName,
|
FOOTPRINT* ret = row->plugin->FootprintLoad( row->GetFullURI( true ), aFootprintName,
|
||||||
aKeepUUID, row->GetProperties() );
|
aKeepUUID, row->GetProperties() );
|
||||||
|
@ -412,7 +412,7 @@ FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave( const wxString& aNickname,
|
||||||
const FOOTPRINT* aFootprint, bool aOverwrite )
|
const FOOTPRINT* aFootprint, bool aOverwrite )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
|
|
||||||
if( !aOverwrite )
|
if( !aOverwrite )
|
||||||
{
|
{
|
||||||
|
@ -438,7 +438,7 @@ FP_LIB_TABLE::SAVE_T FP_LIB_TABLE::FootprintSave( const wxString& aNickname,
|
||||||
void FP_LIB_TABLE::FootprintDelete( const wxString& aNickname, const wxString& aFootprintName )
|
void FP_LIB_TABLE::FootprintDelete( const wxString& aNickname, const wxString& aFootprintName )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
return row->plugin->FootprintDelete( row->GetFullURI( true ), aFootprintName,
|
return row->plugin->FootprintDelete( row->GetFullURI( true ), aFootprintName,
|
||||||
row->GetProperties() );
|
row->GetProperties() );
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ void FP_LIB_TABLE::FootprintDelete( const wxString& aNickname, const wxString& a
|
||||||
bool FP_LIB_TABLE::IsFootprintLibWritable( const wxString& aNickname )
|
bool FP_LIB_TABLE::IsFootprintLibWritable( const wxString& aNickname )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
return row->plugin->IsFootprintLibWritable( row->GetFullURI( true ) );
|
return row->plugin->IsFootprintLibWritable( row->GetFullURI( true ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,7 +455,7 @@ bool FP_LIB_TABLE::IsFootprintLibWritable( const wxString& aNickname )
|
||||||
void FP_LIB_TABLE::FootprintLibDelete( const wxString& aNickname )
|
void FP_LIB_TABLE::FootprintLibDelete( const wxString& aNickname )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
row->plugin->FootprintLibDelete( row->GetFullURI( true ), row->GetProperties() );
|
row->plugin->FootprintLibDelete( row->GetFullURI( true ), row->GetProperties() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +463,7 @@ void FP_LIB_TABLE::FootprintLibDelete( const wxString& aNickname )
|
||||||
void FP_LIB_TABLE::FootprintLibCreate( const wxString& aNickname )
|
void FP_LIB_TABLE::FootprintLibCreate( const wxString& aNickname )
|
||||||
{
|
{
|
||||||
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
const FP_LIB_TABLE_ROW* row = FindRow( aNickname, true );
|
||||||
wxASSERT( (PLUGIN*) row->plugin );
|
wxASSERT( (PCB_IO*) row->plugin );
|
||||||
row->plugin->FootprintLibCreate( row->GetFullURI( true ), row->GetProperties() );
|
row->plugin->FootprintLibCreate( row->GetFullURI( true ), row->GetProperties() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
#include <dsnlexer.h>
|
#include <dsnlexer.h>
|
||||||
#include <geometry/shape_poly_set.h>
|
#include <geometry/shape_poly_set.h>
|
||||||
#include <plugins/cadstar/cadstar_archive_parser.h>
|
#include <io/cadstar/cadstar_archive_parser.h>
|
||||||
#include <eda_item.h>
|
#include <eda_item.h>
|
||||||
#include <eda_text.h>
|
#include <eda_text.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
|
@ -35,7 +35,7 @@
|
||||||
#include <xnode.h>
|
#include <xnode.h>
|
||||||
|
|
||||||
#include <math/vector2d.h>
|
#include <math/vector2d.h>
|
||||||
#include <plugins/cadstar/cadstar_archive_objects.h>
|
#include <io/cadstar/cadstar_archive_objects.h>
|
||||||
|
|
||||||
// THROW_IO_ERROR definitions to ensure consistent wording is used in the error messages
|
// THROW_IO_ERROR definitions to ensure consistent wording is used in the error messages
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <plugins/cadstar/cadstar_archive_objects.h>
|
#include <io/cadstar/cadstar_archive_objects.h>
|
||||||
|
|
||||||
struct CADSTAR_PART_ENTRY;
|
struct CADSTAR_PART_ENTRY;
|
||||||
struct CADSTAR_SWAP_GROUP;
|
struct CADSTAR_SWAP_GROUP;
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <wx/string.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Describes how non-KiCad boards and schematics should be imported as KiCad projects
|
* @brief Describes how non-KiCad boards and schematics should be imported as KiCad projects
|
|
@ -25,7 +25,7 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <plugins/eagle/eagle_parser.h>
|
#include <io/eagle/eagle_parser.h>
|
||||||
|
|
||||||
#include <string_utils.h>
|
#include <string_utils.h>
|
||||||
#include <richio.h>
|
#include <richio.h>
|
|
@ -25,7 +25,7 @@
|
||||||
#include "easyedapro_import_utils.h"
|
#include "easyedapro_import_utils.h"
|
||||||
#include "easyedapro_parser.h"
|
#include "easyedapro_parser.h"
|
||||||
|
|
||||||
#include <plugins/common/plugin_common_choose_project.h>
|
#include <io/common/plugin_common_choose_project.h>
|
||||||
|
|
||||||
#include <ki_exception.h>
|
#include <ki_exception.h>
|
||||||
#include <string_utils.h>
|
#include <string_utils.h>
|
|
@ -21,12 +21,12 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "plugin_utils.h"
|
#include "io_utils.h"
|
||||||
|
|
||||||
#include <wx/wfstream.h>
|
#include <wx/wfstream.h>
|
||||||
#include <wx/txtstrm.h>
|
#include <wx/txtstrm.h>
|
||||||
|
|
||||||
namespace PLUGIN_UTILS
|
namespace IO_UTILS
|
||||||
{
|
{
|
||||||
|
|
||||||
bool fileStartsWithPrefix( const wxString& aFilePath, const wxString& aPrefix,
|
bool fileStartsWithPrefix( const wxString& aFilePath, const wxString& aPrefix,
|
|
@ -21,15 +21,15 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PLUGIN_UTILS_H
|
#ifndef IO_UTILS_H
|
||||||
#define PLUGIN_UTILS_H
|
#define IO_UTILS_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
|
||||||
namespace PLUGIN_UTILS
|
namespace IO_UTILS
|
||||||
{
|
{
|
||||||
|
|
||||||
static const std::vector<uint8_t> COMPOUND_FILE_HEADER{ 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1};
|
static const std::vector<uint8_t> COMPOUND_FILE_HEADER{ 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1};
|
||||||
|
@ -52,4 +52,4 @@ bool fileStartsWithBinaryHeader( const wxString& aFilePath, const std::vector<ui
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // PLUGIN_UTILS_H
|
#endif // IO_UTILS_H
|
|
@ -20,7 +20,7 @@
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include <kiid.h>
|
#include <kiid.h>
|
||||||
#include <plugins/kicad/kicad_plugin_utils.h>
|
#include <io/kicad/kicad_io_utils.h>
|
||||||
#include <richio.h>
|
#include <richio.h>
|
||||||
#include <string_utils.h>
|
#include <string_utils.h>
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <core/ignore.h>
|
#include <core/ignore.h>
|
||||||
#include <richio.h>
|
#include <richio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <plugins/kicad/kicad_plugin_utils.h>
|
#include <io/kicad/kicad_io_utils.h>
|
||||||
|
|
||||||
#include <wx/file.h>
|
#include <wx/file.h>
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
|
|
|
@ -41,33 +41,53 @@ include_directories(
|
||||||
./widgets
|
./widgets
|
||||||
)
|
)
|
||||||
|
|
||||||
set( EESCHEMA_SCH_PLUGINS_ALTIUM
|
set( EESCHEMA_SCH_IO
|
||||||
sch_plugins/altium/altium_parser_sch.cpp
|
sch_io/sch_lib_plugin_cache.cpp
|
||||||
sch_plugins/altium/sch_altium_plugin.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
sch_io/sch_io.cpp
|
||||||
|
sch_io/sch_io_mgr.cpp
|
||||||
|
|
||||||
set( EESCHEMA_SCH_PLUGINS_CADSTAR
|
# KiCad IO plugin
|
||||||
sch_plugins/cadstar/cadstar_sch_archive_loader.cpp
|
sch_io/kicad/sch_sexpr_lib_plugin_cache.cpp
|
||||||
sch_plugins/cadstar/cadstar_sch_archive_parser.cpp
|
sch_io/kicad/sch_sexpr_plugin_common.cpp
|
||||||
sch_plugins/cadstar/cadstar_sch_archive_plugin.cpp
|
sch_io/kicad/sch_sexpr_parser.cpp
|
||||||
)
|
sch_io/kicad/sch_sexpr_plugin.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
|
||||||
|
|
||||||
set( EESCHEMA_SCH_PLUGINS_LTSPICE
|
# HTTP IO plugin
|
||||||
sch_plugins/ltspice/ltspice_schematic.cpp
|
sch_io/http_lib/sch_http_lib_plugin.cpp
|
||||||
sch_plugins/ltspice/ltspice_sch_parser.cpp
|
|
||||||
sch_plugins/ltspice/ltspice_sch_plugin.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set( EESCHEMA_SCH_PLUGINS_EASYEDA
|
# Database IO plugin
|
||||||
sch_plugins/easyeda/sch_easyeda_parser.cpp
|
sch_io/database/sch_database_plugin.cpp
|
||||||
sch_plugins/easyeda/sch_easyeda_plugin.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set( EESCHEMA_SCH_PLUGINS_EASYEDAPRO
|
# Eagle IO plugin
|
||||||
sch_plugins/easyedapro/sch_easyedapro_parser.cpp
|
sch_io/eagle/sch_eagle_plugin.cpp
|
||||||
sch_plugins/easyedapro/sch_easyedapro_plugin.cpp
|
|
||||||
|
# Altium IO plugin
|
||||||
|
sch_io/altium/altium_parser_sch.cpp
|
||||||
|
sch_io/altium/sch_altium_plugin.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
|
||||||
|
|
||||||
|
# LTSpice IO plugin
|
||||||
|
sch_io/ltspice/ltspice_schematic.cpp
|
||||||
|
sch_io/ltspice/ltspice_sch_parser.cpp
|
||||||
|
sch_io/ltspice/ltspice_sch_plugin.cpp
|
||||||
|
|
||||||
|
# EasyEDA IO plugin
|
||||||
|
sch_io/easyeda/sch_easyeda_parser.cpp
|
||||||
|
sch_io/easyeda/sch_easyeda_plugin.cpp
|
||||||
|
|
||||||
|
# EasyEDA Pro IO plugin
|
||||||
|
sch_io/easyedapro/sch_easyedapro_parser.cpp
|
||||||
|
sch_io/easyedapro/sch_easyedapro_plugin.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set( EESCHEMA_DLGS
|
set( EESCHEMA_DLGS
|
||||||
|
@ -295,11 +315,7 @@ set( EESCHEMA_PRINTING
|
||||||
set( EESCHEMA_SRCS
|
set( EESCHEMA_SRCS
|
||||||
${EESCHEMA_DLGS}
|
${EESCHEMA_DLGS}
|
||||||
${EESCHEMA_LIBEDIT_SRCS}
|
${EESCHEMA_LIBEDIT_SRCS}
|
||||||
${EESCHEMA_SCH_PLUGINS_ALTIUM}
|
${EESCHEMA_SCH_IO}
|
||||||
${EESCHEMA_SCH_PLUGINS_CADSTAR}
|
|
||||||
${EESCHEMA_SCH_PLUGINS_LTSPICE}
|
|
||||||
${EESCHEMA_SCH_PLUGINS_EASYEDA}
|
|
||||||
${EESCHEMA_SCH_PLUGINS_EASYEDAPRO}
|
|
||||||
${EESCHEMA_SIM_SRCS}
|
${EESCHEMA_SIM_SRCS}
|
||||||
${EESCHEMA_WIDGETS}
|
${EESCHEMA_WIDGETS}
|
||||||
${EESCHEMA_IMPORT_GFX}
|
${EESCHEMA_IMPORT_GFX}
|
||||||
|
@ -347,7 +363,6 @@ set( EESCHEMA_SRCS
|
||||||
sch_draw_panel.cpp
|
sch_draw_panel.cpp
|
||||||
sch_edit_frame.cpp
|
sch_edit_frame.cpp
|
||||||
sch_field.cpp
|
sch_field.cpp
|
||||||
sch_io_mgr.cpp
|
|
||||||
sch_item.cpp
|
sch_item.cpp
|
||||||
sch_junction.cpp
|
sch_junction.cpp
|
||||||
sch_label.cpp
|
sch_label.cpp
|
||||||
|
@ -357,7 +372,6 @@ set( EESCHEMA_SRCS
|
||||||
sch_painter.cpp
|
sch_painter.cpp
|
||||||
sch_pin.cpp
|
sch_pin.cpp
|
||||||
sch_plotter.cpp
|
sch_plotter.cpp
|
||||||
sch_plugin.cpp
|
|
||||||
sch_preview_panel.cpp
|
sch_preview_panel.cpp
|
||||||
sch_reference_list.cpp
|
sch_reference_list.cpp
|
||||||
sch_screen.cpp
|
sch_screen.cpp
|
||||||
|
@ -396,18 +410,6 @@ set( EESCHEMA_SRCS
|
||||||
netlist_exporters/netlist_exporter_xml.cpp
|
netlist_exporters/netlist_exporter_xml.cpp
|
||||||
netlist_exporters/netlist_generator.cpp
|
netlist_exporters/netlist_generator.cpp
|
||||||
|
|
||||||
sch_plugins/sch_lib_plugin_cache.cpp
|
|
||||||
sch_plugins/eagle/sch_eagle_plugin.cpp
|
|
||||||
sch_plugins/kicad/sch_sexpr_lib_plugin_cache.cpp
|
|
||||||
sch_plugins/kicad/sch_sexpr_plugin_common.cpp
|
|
||||||
sch_plugins/kicad/sch_sexpr_parser.cpp
|
|
||||||
sch_plugins/kicad/sch_sexpr_plugin.cpp
|
|
||||||
sch_plugins/legacy/sch_legacy_lib_plugin_cache.cpp
|
|
||||||
sch_plugins/legacy/sch_legacy_plugin.cpp
|
|
||||||
sch_plugins/legacy/sch_legacy_plugin_helpers.cpp
|
|
||||||
sch_plugins/database/sch_database_plugin.cpp
|
|
||||||
sch_plugins/http_lib/sch_http_lib_plugin.cpp
|
|
||||||
|
|
||||||
tools/assign_footprints.cpp
|
tools/assign_footprints.cpp
|
||||||
tools/backannotate.cpp
|
tools/backannotate.cpp
|
||||||
tools/ee_actions.cpp
|
tools/ee_actions.cpp
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <dialogs/dialog_database_lib_settings.h>
|
#include <dialogs/dialog_database_lib_settings.h>
|
||||||
#include <sch_plugins/database/sch_database_plugin.h>
|
#include <sch_io/database/sch_database_plugin.h>
|
||||||
#include <database/database_lib_settings.h>
|
#include <database/database_lib_settings.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -560,7 +560,7 @@ bool DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged( const wxString& aNewFilena
|
||||||
|
|
||||||
if( renameFile )
|
if( renameFile )
|
||||||
{
|
{
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
||||||
|
|
||||||
// If the associated screen is shared by more than one sheet, do not
|
// If the associated screen is shared by more than one sheet, do not
|
||||||
// change the filename of the corresponding screen here.
|
// change the filename of the corresponding screen here.
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include <core/kicad_algo.h>
|
#include <core/kicad_algo.h>
|
||||||
#include <symbol_viewer_frame.h>
|
#include <symbol_viewer_frame.h>
|
||||||
#include <project_rescue.h>
|
#include <project_rescue.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <sch_symbol.h>
|
#include <sch_symbol.h>
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
|
|
|
@ -172,7 +172,7 @@ protected:
|
||||||
STRING_UTF8_MAP choices;
|
STRING_UTF8_MAP choices;
|
||||||
|
|
||||||
SCH_IO_MGR::SCH_FILE_T pi_type = SCH_IO_MGR::EnumFromStr( row->GetType() );
|
SCH_IO_MGR::SCH_FILE_T pi_type = SCH_IO_MGR::EnumFromStr( row->GetType() );
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( pi_type ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( pi_type ) );
|
||||||
pi->SymbolLibOptions( &choices );
|
pi->SymbolLibOptions( &choices );
|
||||||
|
|
||||||
DIALOG_PLUGIN_OPTIONS dlg( m_dialog, row->GetNickName(), choices, options, &result );
|
DIALOG_PLUGIN_OPTIONS dlg( m_dialog, row->GetNickName(), choices, options, &result );
|
||||||
|
@ -256,7 +256,7 @@ PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, P
|
||||||
|
|
||||||
for( const SCH_IO_MGR::SCH_FILE_T& type : SCH_IO_MGR::SCH_FILE_T_vector )
|
for( const SCH_IO_MGR::SCH_FILE_T& type : SCH_IO_MGR::SCH_FILE_T_vector )
|
||||||
{
|
{
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( type ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( type ) );
|
||||||
|
|
||||||
if( !pi )
|
if( !pi )
|
||||||
continue;
|
continue;
|
||||||
|
@ -308,7 +308,7 @@ PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE( DIALOG_EDIT_LIBRARY_TABLES* aParent, P
|
||||||
auto* libTable = static_cast<SYMBOL_LIB_TABLE_GRID*>( grid->GetTable() );
|
auto* libTable = static_cast<SYMBOL_LIB_TABLE_GRID*>( grid->GetTable() );
|
||||||
auto* tableRow = static_cast<SYMBOL_LIB_TABLE_ROW*>( libTable->at( row ) );
|
auto* tableRow = static_cast<SYMBOL_LIB_TABLE_ROW*>( libTable->at( row ) );
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( tableRow->GetFileType() ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( tableRow->GetFileType() ) );
|
||||||
|
|
||||||
if( pi )
|
if( pi )
|
||||||
{
|
{
|
||||||
|
@ -585,7 +585,7 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event )
|
||||||
|
|
||||||
for( const SCH_IO_MGR::SCH_FILE_T& fileType : SCH_IO_MGR::SCH_FILE_T_vector )
|
for( const SCH_IO_MGR::SCH_FILE_T& fileType : SCH_IO_MGR::SCH_FILE_T_vector )
|
||||||
{
|
{
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
||||||
|
|
||||||
if( !pi )
|
if( !pi )
|
||||||
continue;
|
continue;
|
||||||
|
@ -936,8 +936,8 @@ bool PANEL_SYM_LIB_TABLE::convertLibrary( STRING_UTF8_MAP* aOldFileProps, const
|
||||||
if( oldFileType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
if( oldFileType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER oldFilePI( SCH_IO_MGR::FindPlugin( oldFileType ) );
|
SCH_IO::SCH_IO_RELEASER oldFilePI( SCH_IO_MGR::FindPlugin( oldFileType ) );
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER kicadPI( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
SCH_IO::SCH_IO_RELEASER kicadPI( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
||||||
std::vector<LIB_SYMBOL*> symbols;
|
std::vector<LIB_SYMBOL*> symbols;
|
||||||
std::vector<LIB_SYMBOL*> newSymbols;
|
std::vector<LIB_SYMBOL*> newSymbols;
|
||||||
std::map<LIB_SYMBOL*, LIB_SYMBOL*> symbolMap;
|
std::map<LIB_SYMBOL*, LIB_SYMBOL*> symbolMap;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <settings/settings_manager.h>
|
#include <settings/settings_manager.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <locale_io.h>
|
#include <locale_io.h>
|
||||||
#include <wx/app.h>
|
#include <wx/app.h>
|
||||||
#include <sch_label.h>
|
#include <sch_label.h>
|
||||||
|
@ -121,8 +121,8 @@ SCHEMATIC* EESCHEMA_HELPERS::LoadSchematic( wxString& aFileName, SCH_IO_MGR::SCH
|
||||||
if( !project )
|
if( !project )
|
||||||
project = GetDefaultProject();
|
project = GetDefaultProject();
|
||||||
|
|
||||||
SCH_PLUGIN* plugin = SCH_IO_MGR::FindPlugin( aFormat );
|
SCH_IO* plugin = SCH_IO_MGR::FindPlugin( aFormat );
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( plugin );
|
SCH_IO::SCH_IO_RELEASER pi( plugin );
|
||||||
|
|
||||||
SCHEMATIC* schematic = new SCHEMATIC( project );
|
SCHEMATIC* schematic = new SCHEMATIC( project );
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#define EESCHEMA_HELPERS_H_
|
#define EESCHEMA_HELPERS_H_
|
||||||
|
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
|
|
||||||
class SCHEMATIC;
|
class SCHEMATIC;
|
||||||
class SCH_EDIT_FRAME;
|
class SCH_EDIT_FRAME;
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include <settings/settings_manager.h>
|
#include <settings/settings_manager.h>
|
||||||
|
|
||||||
#include <sch_file_versions.h>
|
#include <sch_file_versions.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_lib_plugin_cache.h>
|
#include <sch_io/kicad/sch_sexpr_lib_plugin_cache.h>
|
||||||
|
|
||||||
#include <netlist.h>
|
#include <netlist.h>
|
||||||
#include <netlist_exporter_base.h>
|
#include <netlist_exporter_base.h>
|
||||||
|
|
|
@ -42,13 +42,13 @@
|
||||||
#include <project_rescue.h>
|
#include <project_rescue.h>
|
||||||
#include <project_sch.h>
|
#include <project_sch.h>
|
||||||
#include <dialog_HTML_reporter_base.h>
|
#include <dialog_HTML_reporter_base.h>
|
||||||
#include <plugins/common/plugin_common_choose_project.h>
|
#include <io/common/plugin_common_choose_project.h>
|
||||||
#include <reporter.h>
|
#include <reporter.h>
|
||||||
#include <richio.h>
|
#include <richio.h>
|
||||||
#include <sch_bus_entry.h>
|
#include <sch_bus_entry.h>
|
||||||
#include <sch_commit.h>
|
#include <sch_commit.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
#include <sch_file_versions.h>
|
#include <sch_file_versions.h>
|
||||||
#include <sch_line.h>
|
#include <sch_line.h>
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
|
@ -248,8 +248,8 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
|
|
||||||
SetScreen( nullptr );
|
SetScreen( nullptr );
|
||||||
|
|
||||||
SCH_PLUGIN* plugin = SCH_IO_MGR::FindPlugin( schFileType );
|
SCH_IO* plugin = SCH_IO_MGR::FindPlugin( schFileType );
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( plugin );
|
SCH_IO::SCH_IO_RELEASER pi( plugin );
|
||||||
|
|
||||||
pi->SetProgressReporter( &progressReporter );
|
pi->SetProgressReporter( &progressReporter );
|
||||||
|
|
||||||
|
@ -669,7 +669,7 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
|
||||||
if( fileType == SCH_IO_MGR::SCH_KICAD || fileType == SCH_IO_MGR::SCH_LEGACY )
|
if( fileType == SCH_IO_MGR::SCH_KICAD || fileType == SCH_IO_MGR::SCH_LEGACY )
|
||||||
continue; // this is "Import non-KiCad schematic"
|
continue; // this is "Import non-KiCad schematic"
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
||||||
|
|
||||||
if( !pi )
|
if( !pi )
|
||||||
continue;
|
continue;
|
||||||
|
@ -724,7 +724,7 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
|
||||||
|
|
||||||
for( const SCH_IO_MGR::SCH_FILE_T& fileType : SCH_IO_MGR::SCH_FILE_T_vector )
|
for( const SCH_IO_MGR::SCH_FILE_T& fileType : SCH_IO_MGR::SCH_FILE_T_vector )
|
||||||
{
|
{
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
||||||
|
|
||||||
if( !pi )
|
if( !pi )
|
||||||
continue;
|
continue;
|
||||||
|
@ -797,7 +797,7 @@ bool SCH_EDIT_FRAME::saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSave
|
||||||
if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
||||||
pluginType = SCH_IO_MGR::SCH_KICAD;
|
pluginType = SCH_IO_MGR::SCH_KICAD;
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( pluginType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( pluginType ) );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1329,12 +1329,12 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType,
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
||||||
DIALOG_HTML_REPORTER errorReporter( this );
|
DIALOG_HTML_REPORTER errorReporter( this );
|
||||||
WX_PROGRESS_REPORTER progressReporter( this, _( "Importing Schematic" ), 1 );
|
WX_PROGRESS_REPORTER progressReporter( this, _( "Importing Schematic" ), 1 );
|
||||||
|
|
||||||
PROJECT_CHOOSER_PLUGIN* projectChooserPlugin =
|
PROJECT_CHOOSER_PLUGIN* projectChooserPlugin =
|
||||||
dynamic_cast<PROJECT_CHOOSER_PLUGIN*>( (SCH_PLUGIN*) pi );
|
dynamic_cast<PROJECT_CHOOSER_PLUGIN*>( (SCH_IO*) pi );
|
||||||
|
|
||||||
if( projectChooserPlugin )
|
if( projectChooserPlugin )
|
||||||
{
|
{
|
||||||
|
|
|
@ -862,7 +862,7 @@ bool SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary( wxWindow *aParent )
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
||||||
|
|
||||||
for( const std::unique_ptr<LIB_SYMBOL>& symbol : m_rescueLibSymbols )
|
for( const std::unique_ptr<LIB_SYMBOL>& symbol : m_rescueLibSymbols )
|
||||||
pi->SaveSymbol( fn.GetFullPath(), new LIB_SYMBOL( *symbol.get() ), m_properties.get() );
|
pi->SaveSymbol( fn.GetFullPath(), new LIB_SYMBOL( *symbol.get() ), m_properties.get() );
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
#include <string_utf8_map.h>
|
#include <string_utf8_map.h>
|
||||||
#include <lib_symbol.h>
|
#include <lib_symbol.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
#include <class_draw_panel_gal.h>
|
#include <class_draw_panel_gal.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,28 +18,28 @@
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _ALTIUM_LIB_PLUGIN_CACHE_
|
#ifndef ALTIUM_LIB_IO_CACHE_
|
||||||
#define _ALTIUM_LIB_PLUGIN_CACHE_
|
#define ALTIUM_LIB_IO_CACHE_
|
||||||
|
|
||||||
#include "../sch_lib_plugin_cache.h"
|
#include "sch_io/sch_lib_plugin_cache.h"
|
||||||
|
|
||||||
class FILE_LINE_READER;
|
class FILE_LINE_READER;
|
||||||
class SCH_SEXPR_PLUGIN;
|
class SCH_SEXPR_IO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A cache assistant for Altium symbol libraries.
|
* A cache assistant for Altium symbol libraries.
|
||||||
*/
|
*/
|
||||||
class ALTIUM_LIB_PLUGIN_CACHE : public SCH_LIB_PLUGIN_CACHE
|
class ALTIUM_LIB_IO_CACHE : public SCH_LIB_IO_CACHE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ALTIUM_LIB_PLUGIN_CACHE( const wxString& aLibraryPath );
|
ALTIUM_LIB_IO_CACHE( const wxString& aLibraryPath );
|
||||||
virtual ~ALTIUM_LIB_PLUGIN_CACHE();
|
virtual ~ALTIUM_LIB_IO_CACHE();
|
||||||
|
|
||||||
void Load() override;
|
void Load() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend SCH_SEXPR_PLUGIN;
|
friend SCH_SEXPR_IO;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _ALTIUM_LIB_PLUGIN_CACHE_
|
#endif // ALTIUM_LIB_IO_CACHE_
|
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
|
||||||
#include "plugins/altium/altium_parser.h"
|
#include "io/altium/altium_parser.h"
|
||||||
#include "sch_plugins/altium/altium_parser_sch.h"
|
#include "sch_io/altium/altium_parser_sch.h"
|
||||||
|
|
||||||
|
|
||||||
ALTIUM_SCH_RECORD ReadRecord( const std::map<wxString, wxString>& aProps )
|
ALTIUM_SCH_RECORD ReadRecord( const std::map<wxString, wxString>& aProps )
|
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
#include "altium_parser_sch.h"
|
#include "altium_parser_sch.h"
|
||||||
#include "sch_shape.h"
|
#include "sch_shape.h"
|
||||||
#include <plugins/plugin_utils.h>
|
#include <io/io_utils.h>
|
||||||
#include <plugins/altium/altium_parser.h>
|
#include <io/altium/altium_parser.h>
|
||||||
#include <plugins/altium/altium_parser_utils.h>
|
#include <io/altium/altium_parser_utils.h>
|
||||||
#include <sch_plugins/altium/sch_altium_plugin.h>
|
#include <sch_io/altium/sch_altium_plugin.h>
|
||||||
|
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <project_sch.h>
|
#include <project_sch.h>
|
||||||
|
@ -262,13 +262,13 @@ int SCH_ALTIUM_PLUGIN::GetModifyHash() const
|
||||||
bool SCH_ALTIUM_PLUGIN::checkFileHeader( const wxString& aFileName )
|
bool SCH_ALTIUM_PLUGIN::checkFileHeader( const wxString& aFileName )
|
||||||
{
|
{
|
||||||
// Compound File Binary Format header
|
// Compound File Binary Format header
|
||||||
return PLUGIN_UTILS::fileStartsWithBinaryHeader( aFileName, PLUGIN_UTILS::COMPOUND_FILE_HEADER );
|
return IO_UTILS::fileStartsWithBinaryHeader( aFileName, IO_UTILS::COMPOUND_FILE_HEADER );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_ALTIUM_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
bool SCH_ALTIUM_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadSchematicFile( aFileName ) )
|
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return checkFileHeader( aFileName );
|
return checkFileHeader( aFileName );
|
||||||
|
@ -277,7 +277,7 @@ bool SCH_ALTIUM_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
|
|
||||||
bool SCH_ALTIUM_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
bool SCH_ALTIUM_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadLibrary( aFileName ) )
|
if( !SCH_IO::CanReadLibrary( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return checkFileHeader( aFileName );
|
return checkFileHeader( aFileName );
|
|
@ -27,7 +27,8 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
|
||||||
|
@ -42,14 +43,16 @@ class ALTIUM_COMPOUND_FILE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SCH_ALTIUM_PLUGIN
|
* SCH_ALTIUM_PLUGIN
|
||||||
* is a #SCH_PLUGIN derivation for loading Altium .SchDoc schematic files.
|
* is a #SCH_IO derivation for loading Altium .SchDoc schematic files.
|
||||||
*
|
*
|
||||||
* As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed.
|
* As with all SCH_IO there is no UI dependencies i.e. windowing calls allowed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static std::vector<LIB_SYMBOL*> nullsym;
|
static std::vector<LIB_SYMBOL*> nullsym;
|
||||||
static std::vector<int> nullint;
|
static std::vector<int> nullint;
|
||||||
class SCH_ALTIUM_PLUGIN : public SCH_PLUGIN
|
|
||||||
|
|
||||||
|
class SCH_ALTIUM_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SCH_ALTIUM_PLUGIN();
|
SCH_ALTIUM_PLUGIN();
|
||||||
|
@ -192,7 +195,7 @@ private:
|
||||||
wxString m_libName; // Library name to save symbols
|
wxString m_libName; // Library name to save symbols
|
||||||
bool m_isIntLib; // Flag to indicate Integrated Library
|
bool m_isIntLib; // Flag to indicate Integrated Library
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; // Plugin to create KiCad symbol library.
|
SCH_IO::SCH_IO_RELEASER m_pi; // Plugin to create KiCad symbol library.
|
||||||
std::unique_ptr<STRING_UTF8_MAP> m_properties; // Library plugin properties.
|
std::unique_ptr<STRING_UTF8_MAP> m_properties; // Library plugin properties.
|
||||||
|
|
||||||
std::unique_ptr<TITLE_BLOCK> m_currentTitleBlock; // Will be assigned at the end of parsing
|
std::unique_ptr<TITLE_BLOCK> m_currentTitleBlock; // Will be assigned at the end of parsing
|
|
@ -23,8 +23,8 @@
|
||||||
* @brief Loads a csa file into a KiCad SCHEMATIC object
|
* @brief Loads a csa file into a KiCad SCHEMATIC object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sch_plugins/cadstar/cadstar_sch_archive_loader.h>
|
#include <sch_io/cadstar/cadstar_sch_archive_loader.h>
|
||||||
#include <plugins/cadstar/cadstar_parts_lib_parser.h>
|
#include <io/cadstar/cadstar_parts_lib_parser.h>
|
||||||
|
|
||||||
#include <bus_alias.h>
|
#include <bus_alias.h>
|
||||||
#include <core/mirror.h>
|
#include <core/mirror.h>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#include <string_utils.h>
|
#include <string_utils.h>
|
||||||
#include <sch_bus_entry.h>
|
#include <sch_bus_entry.h>
|
||||||
#include <sch_edit_frame.h> //SYMBOL_ORIENTATION_T
|
#include <sch_edit_frame.h> //SYMBOL_ORIENTATION_T
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <sch_junction.h>
|
#include <sch_junction.h>
|
||||||
#include <sch_line.h>
|
#include <sch_line.h>
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
|
@ -26,7 +26,7 @@
|
||||||
#ifndef CADSTAR_SCH_ARCHIVE_LOADER_H_
|
#ifndef CADSTAR_SCH_ARCHIVE_LOADER_H_
|
||||||
#define CADSTAR_SCH_ARCHIVE_LOADER_H_
|
#define CADSTAR_SCH_ARCHIVE_LOADER_H_
|
||||||
|
|
||||||
#include <sch_plugins/cadstar/cadstar_sch_archive_parser.h>
|
#include <sch_io/cadstar/cadstar_sch_archive_parser.h>
|
||||||
|
|
||||||
#include <layer_ids.h> // SCH_LAYER_ID
|
#include <layer_ids.h> // SCH_LAYER_ID
|
||||||
#include <plotters/plotter.h> // LINE_STYLE
|
#include <plotters/plotter.h> // LINE_STYLE
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
#include <base_units.h>
|
#include <base_units.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <sch_plugins/cadstar/cadstar_sch_archive_parser.h>
|
#include <sch_io/cadstar/cadstar_sch_archive_parser.h>
|
||||||
#include <progress_reporter.h>
|
#include <progress_reporter.h>
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#ifndef CADSTAR_SCH_ARCHIVE_PARSER_H_
|
#ifndef CADSTAR_SCH_ARCHIVE_PARSER_H_
|
||||||
#define CADSTAR_SCH_ARCHIVE_PARSER_H_
|
#define CADSTAR_SCH_ARCHIVE_PARSER_H_
|
||||||
|
|
||||||
#include <plugins/cadstar/cadstar_archive_parser.h>
|
#include <io/cadstar/cadstar_archive_parser.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -24,9 +24,9 @@
|
||||||
* based on S-expressions.
|
* based on S-expressions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sch_plugins/cadstar/cadstar_sch_archive_loader.h>
|
#include <sch_io/cadstar/cadstar_sch_archive_loader.h>
|
||||||
#include <sch_plugins/cadstar/cadstar_sch_archive_plugin.h>
|
#include <sch_io/cadstar/cadstar_sch_archive_plugin.h>
|
||||||
#include <plugins/cadstar/cadstar_parts_lib_parser.h>
|
#include <io/cadstar/cadstar_parts_lib_parser.h>
|
||||||
|
|
||||||
#include <lib_symbol.h>
|
#include <lib_symbol.h>
|
||||||
#include <progress_reporter.h>
|
#include <progress_reporter.h>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_plugin.h>
|
#include <sch_io/kicad/sch_sexpr_plugin.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
#include <wx_filename.h>
|
#include <wx_filename.h>
|
||||||
#include <wx/dir.h>
|
#include <wx/dir.h>
|
||||||
|
@ -51,7 +51,7 @@ const wxString CADSTAR_SCH_ARCHIVE_PLUGIN::GetName() const
|
||||||
|
|
||||||
bool CADSTAR_SCH_ARCHIVE_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
bool CADSTAR_SCH_ARCHIVE_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadLibrary( aFileName ) )
|
if( !SCH_IO::CanReadLibrary( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -127,7 +127,7 @@ SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::LoadSchematicFile( const wxString&
|
||||||
wxFileName libFileName( aSchematic->Prj().GetProjectPath(), libName,
|
wxFileName libFileName( aSchematic->Prj().GetProjectPath(), libName,
|
||||||
KiCadSymbolLibFileExtension );
|
KiCadSymbolLibFileExtension );
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER sch_plugin;
|
SCH_IO::SCH_IO_RELEASER sch_plugin;
|
||||||
sch_plugin.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
sch_plugin.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
||||||
|
|
||||||
if( !libTable->HasLibrary( libName ) )
|
if( !libTable->HasLibrary( libName ) )
|
|
@ -28,7 +28,8 @@
|
||||||
#define CADSTAR_SCH_ARCHIVE_PLUGIN_H_
|
#define CADSTAR_SCH_ARCHIVE_PLUGIN_H_
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <reporter.h>
|
#include <reporter.h>
|
||||||
#include <lib_symbol.h>
|
#include <lib_symbol.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
|
@ -37,7 +38,7 @@
|
||||||
class SCH_SHEET;
|
class SCH_SHEET;
|
||||||
class SCH_SCREEN;
|
class SCH_SCREEN;
|
||||||
|
|
||||||
class CADSTAR_SCH_ARCHIVE_PLUGIN : public SCH_PLUGIN
|
class CADSTAR_SCH_ARCHIVE_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CADSTAR_SCH_ARCHIVE_PLUGIN() :
|
CADSTAR_SCH_ARCHIVE_PLUGIN() :
|
|
@ -22,7 +22,8 @@
|
||||||
#define KICAD_SCH_DATABASE_PLUGIN_H
|
#define KICAD_SCH_DATABASE_PLUGIN_H
|
||||||
|
|
||||||
#include <database/database_connection.h>
|
#include <database/database_connection.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ struct DATABASE_LIB_TABLE;
|
||||||
* plugins because the backing file is just a configuration file rather than something that
|
* plugins because the backing file is just a configuration file rather than something that
|
||||||
* contains symbol or footprint data.
|
* contains symbol or footprint data.
|
||||||
*/
|
*/
|
||||||
class SCH_DATABASE_PLUGIN : public SCH_PLUGIN
|
class SCH_DATABASE_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sch_plugins/eagle/sch_eagle_plugin.h>
|
#include <sch_io/eagle/sch_eagle_plugin.h>
|
||||||
|
|
||||||
#include <locale_io.h>
|
#include <locale_io.h>
|
||||||
#include <string_utf8_map.h>
|
#include <string_utf8_map.h>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#include <wx/xml/xml.h>
|
#include <wx/xml/xml.h>
|
||||||
|
|
||||||
#include <symbol_library.h>
|
#include <symbol_library.h>
|
||||||
#include <plugins/eagle/eagle_parser.h>
|
#include <io/eagle/eagle_parser.h>
|
||||||
#include <string_utils.h>
|
#include <string_utils.h>
|
||||||
#include <gr_text.h>
|
#include <gr_text.h>
|
||||||
#include <lib_shape.h>
|
#include <lib_shape.h>
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
#include <project/net_settings.h>
|
#include <project/net_settings.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <sch_junction.h>
|
#include <sch_junction.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
#include <sch_marker.h>
|
#include <sch_marker.h>
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
||||||
#include <sch_shape.h>
|
#include <sch_shape.h>
|
||||||
|
@ -2870,7 +2870,7 @@ void SCH_EAGLE_PLUGIN::adjustNetLabels()
|
||||||
|
|
||||||
bool SCH_EAGLE_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
bool SCH_EAGLE_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadSchematicFile( aFileName ) )
|
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return checkHeader( aFileName );
|
return checkHeader( aFileName );
|
||||||
|
@ -2879,7 +2879,7 @@ bool SCH_EAGLE_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
|
|
||||||
bool SCH_EAGLE_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
bool SCH_EAGLE_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadLibrary( aFileName ) )
|
if( !SCH_IO::CanReadLibrary( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return checkHeader( aFileName );
|
return checkHeader( aFileName );
|
|
@ -26,8 +26,9 @@
|
||||||
#define _SCH_EAGLE_PLUGIN_H_
|
#define _SCH_EAGLE_PLUGIN_H_
|
||||||
|
|
||||||
#include <sch_line.h>
|
#include <sch_line.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
#include <plugins/eagle/eagle_parser.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
|
#include <io/eagle/eagle_parser.h>
|
||||||
#include <lib_item.h>
|
#include <lib_item.h>
|
||||||
#include <geometry/seg.h>
|
#include <geometry/seg.h>
|
||||||
|
|
||||||
|
@ -74,11 +75,11 @@ typedef boost::ptr_map<wxString, EPART> EPART_LIST;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A #SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files.
|
* A #SCH_IO derivation for loading 6.x+ Eagle schematic files.
|
||||||
*
|
*
|
||||||
* As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed.
|
* As with all SCH_IO there is no UI dependencies i.e. windowing calls allowed.
|
||||||
*/
|
*/
|
||||||
class SCH_EAGLE_PLUGIN : public SCH_PLUGIN
|
class SCH_EAGLE_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const double ARC_ACCURACY = SCH_IU_PER_MM * 0.01; // 0.01mm
|
const double ARC_ACCURACY = SCH_IU_PER_MM * 0.01; // 0.01mm
|
||||||
|
@ -258,7 +259,7 @@ private:
|
||||||
std::map<wxString, EAGLE_LIBRARY> m_eagleLibs;
|
std::map<wxString, EAGLE_LIBRARY> m_eagleLibs;
|
||||||
std::unordered_map<wxString, bool> m_userValue; ///< deviceset/@uservalue for device.
|
std::unordered_map<wxString, bool> m_userValue; ///< deviceset/@uservalue for device.
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER m_pi; ///< PI to create KiCad symbol library.
|
SCH_IO::SCH_IO_RELEASER m_pi; ///< PI to create KiCad symbol library.
|
||||||
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
|
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library plugin properties.
|
||||||
|
|
||||||
PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr
|
PROGRESS_REPORTER* m_progressReporter; ///< optional; may be nullptr
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "sch_easyeda_parser.h"
|
#include "sch_easyeda_parser.h"
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
#include <sch_sheet_pin.h>
|
#include <sch_sheet_pin.h>
|
|
@ -25,10 +25,10 @@
|
||||||
#ifndef SCH_EASYEDA_PARSER_H_
|
#ifndef SCH_EASYEDA_PARSER_H_
|
||||||
#define SCH_EASYEDA_PARSER_H_
|
#define SCH_EASYEDA_PARSER_H_
|
||||||
|
|
||||||
#include <plugins/easyeda/easyeda_parser_base.h>
|
#include <io/easyeda/easyeda_parser_base.h>
|
||||||
#include <plugins/easyeda/easyeda_parser_structs.h>
|
#include <io/easyeda/easyeda_parser_structs.h>
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <pin_type.h>
|
#include <pin_type.h>
|
||||||
#include <layer_ids.h>
|
#include <layer_ids.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
|
@ -99,7 +99,7 @@ static bool FindSchFileInStream( const wxString& aName, wxInputStream& aStream,
|
||||||
|
|
||||||
bool SCH_EASYEDA_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
bool SCH_EASYEDA_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadSchematicFile( aFileName ) )
|
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
try
|
try
|
|
@ -25,7 +25,8 @@
|
||||||
#ifndef SCH_EASYEDA_PLUGIN_H_
|
#ifndef SCH_EASYEDA_PLUGIN_H_
|
||||||
#define SCH_EASYEDA_PLUGIN_H_
|
#define SCH_EASYEDA_PLUGIN_H_
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <reporter.h>
|
#include <reporter.h>
|
||||||
#include <wx/arrstr.h>
|
#include <wx/arrstr.h>
|
||||||
|
|
||||||
|
@ -34,7 +35,7 @@ class SCH_SHEET;
|
||||||
class SCH_SCREEN;
|
class SCH_SCREEN;
|
||||||
|
|
||||||
|
|
||||||
class SCH_EASYEDA_PLUGIN : public SCH_PLUGIN
|
class SCH_EASYEDA_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SCH_EASYEDA_PLUGIN()
|
SCH_EASYEDA_PLUGIN()
|
|
@ -23,11 +23,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sch_easyedapro_parser.h"
|
#include "sch_easyedapro_parser.h"
|
||||||
#include <plugins/easyedapro/easyedapro_import_utils.h>
|
#include <io/easyedapro/easyedapro_import_utils.h>
|
||||||
|
|
||||||
#include <core/map_helpers.h>
|
#include <core/map_helpers.h>
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
#include <sch_sheet_pin.h>
|
#include <sch_sheet_pin.h>
|
|
@ -25,9 +25,9 @@
|
||||||
#ifndef SCH_EASYEDAPRO_PARSER_H_
|
#ifndef SCH_EASYEDAPRO_PARSER_H_
|
||||||
#define SCH_EASYEDAPRO_PARSER_H_
|
#define SCH_EASYEDAPRO_PARSER_H_
|
||||||
|
|
||||||
#include <plugins/easyedapro/easyedapro_parser.h>
|
#include <io/easyedapro/easyedapro_parser.h>
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <pin_type.h>
|
#include <pin_type.h>
|
||||||
#include <layer_ids.h>
|
#include <layer_ids.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
|
@ -41,8 +41,8 @@
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include <string_utils.h>
|
#include <string_utils.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_plugin.h>
|
#include <sch_io/kicad/sch_sexpr_plugin.h>
|
||||||
#include <plugins/easyedapro/easyedapro_import_utils.h>
|
#include <io/easyedapro/easyedapro_import_utils.h>
|
||||||
#include <core/map_helpers.h>
|
#include <core/map_helpers.h>
|
||||||
#include <project_sch.h>
|
#include <project_sch.h>
|
||||||
|
|
||||||
|
@ -531,7 +531,7 @@ SCH_SHEET* SCH_EASYEDAPRO_PLUGIN::LoadSchematicFile( const wxString& aFileName,
|
||||||
};
|
};
|
||||||
EASYEDAPRO::IterateZipFiles( aFileName, cbs );
|
EASYEDAPRO::IterateZipFiles( aFileName, cbs );
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER sch_plugin;
|
SCH_IO::SCH_IO_RELEASER sch_plugin;
|
||||||
sch_plugin.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
sch_plugin.set( SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD ) );
|
||||||
|
|
||||||
if( !libTable->HasLibrary( libName ) )
|
if( !libTable->HasLibrary( libName ) )
|
|
@ -25,16 +25,17 @@
|
||||||
#ifndef SCH_EASYEDAPRO_PLUGIN_H_
|
#ifndef SCH_EASYEDAPRO_PLUGIN_H_
|
||||||
#define SCH_EASYEDAPRO_PLUGIN_H_
|
#define SCH_EASYEDAPRO_PLUGIN_H_
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <reporter.h>
|
#include <reporter.h>
|
||||||
#include <plugins/common/plugin_common_choose_project.h>
|
#include <io/common/plugin_common_choose_project.h>
|
||||||
|
|
||||||
|
|
||||||
class SCH_SHEET;
|
class SCH_SHEET;
|
||||||
class SCH_SCREEN;
|
class SCH_SCREEN;
|
||||||
|
|
||||||
|
|
||||||
class SCH_EASYEDAPRO_PLUGIN : public SCH_PLUGIN, public PROJECT_CHOOSER_PLUGIN
|
class SCH_EASYEDAPRO_PLUGIN : public SCH_IO, public PROJECT_CHOOSER_PLUGIN
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SCH_EASYEDAPRO_PLUGIN();
|
SCH_EASYEDAPRO_PLUGIN();
|
|
@ -24,7 +24,8 @@
|
||||||
#include "http_lib/http_lib_settings.h"
|
#include "http_lib/http_lib_settings.h"
|
||||||
#include <http_lib/http_lib_connection.h>
|
#include <http_lib/http_lib_connection.h>
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +35,7 @@
|
||||||
* plugins because the backing file is just a configuration file rather than something that
|
* plugins because the backing file is just a configuration file rather than something that
|
||||||
* contains symbol or footprint data.
|
* contains symbol or footprint data.
|
||||||
*/
|
*/
|
||||||
class SCH_HTTP_LIB_PLUGIN : public SCH_PLUGIN
|
class SCH_HTTP_LIB_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#ifndef _SCH_SEXPR_LIB_PLUGIN_CACHE_
|
#ifndef _SCH_SEXPR_LIB_PLUGIN_CACHE_
|
||||||
#define _SCH_SEXPR_LIB_PLUGIN_CACHE_
|
#define _SCH_SEXPR_LIB_PLUGIN_CACHE_
|
||||||
|
|
||||||
#include "../sch_lib_plugin_cache.h"
|
#include "sch_io/sch_lib_plugin_cache.h"
|
||||||
|
|
||||||
class FILE_LINE_READER;
|
class FILE_LINE_READER;
|
||||||
class LIB_FIELD;
|
class LIB_FIELD;
|
||||||
|
@ -43,7 +43,7 @@ public:
|
||||||
virtual ~SCH_SEXPR_PLUGIN_CACHE();
|
virtual ~SCH_SEXPR_PLUGIN_CACHE();
|
||||||
|
|
||||||
// Most all functions in this class throw IO_ERROR exceptions. There are no
|
// 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_PLUGIN objects.
|
// error codes nor user interface calls from here, nor in any SCH_IO objects.
|
||||||
// Catch these exceptions higher up please.
|
// Catch these exceptions higher up please.
|
||||||
|
|
||||||
/// Save the entire library to file m_libFileName;
|
/// Save the entire library to file m_libFileName;
|
|
@ -56,7 +56,7 @@
|
||||||
#include <sch_no_connect.h>
|
#include <sch_no_connect.h>
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
||||||
#include <sch_sheet_pin.h>
|
#include <sch_sheet_pin.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_parser.h>
|
#include <sch_io/kicad/sch_sexpr_parser.h>
|
||||||
#include <template_fieldnames.h>
|
#include <template_fieldnames.h>
|
||||||
#include <trigo.h>
|
#include <trigo.h>
|
||||||
#include <progress_reporter.h>
|
#include <progress_reporter.h>
|
|
@ -46,17 +46,17 @@
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
#include <sch_sheet_pin.h>
|
#include <sch_sheet_pin.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_plugin.h>
|
#include <sch_io/kicad/sch_sexpr_plugin.h>
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
||||||
#include <lib_shape.h>
|
#include <lib_shape.h>
|
||||||
#include <lib_pin.h>
|
#include <lib_pin.h>
|
||||||
#include <lib_text.h>
|
#include <lib_text.h>
|
||||||
#include <lib_textbox.h>
|
#include <lib_textbox.h>
|
||||||
#include <eeschema_id.h> // for MAX_UNIT_COUNT_PER_PACKAGE definition
|
#include <eeschema_id.h> // for MAX_UNIT_COUNT_PER_PACKAGE definition
|
||||||
#include <plugins/kicad/kicad_plugin_utils.h>
|
#include <io/kicad/kicad_io_utils.h>
|
||||||
#include <sch_file_versions.h>
|
#include <sch_file_versions.h>
|
||||||
#include <schematic_lexer.h>
|
#include <schematic_lexer.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_parser.h>
|
#include <sch_io/kicad/sch_sexpr_parser.h>
|
||||||
#include "sch_sexpr_lib_plugin_cache.h"
|
#include "sch_sexpr_lib_plugin_cache.h"
|
||||||
#include "sch_sexpr_plugin_common.h"
|
#include "sch_sexpr_plugin_common.h"
|
||||||
#include <symbol_lib_table.h> // for PropPowerSymsOnly definition.
|
#include <symbol_lib_table.h> // for PropPowerSymsOnly definition.
|
|
@ -24,7 +24,8 @@
|
||||||
#define _SCH_SEXPR_PLUGIN_H_
|
#define _SCH_SEXPR_PLUGIN_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <sch_file_versions.h>
|
#include <sch_file_versions.h>
|
||||||
#include <sch_sheet_path.h>
|
#include <sch_sheet_path.h>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
@ -56,12 +57,12 @@ class SYMBOL_LIB;
|
||||||
class BUS_ALIAS;
|
class BUS_ALIAS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A #SCH_PLUGIN derivation for loading schematic files using the new s-expression
|
* A #SCH_IO derivation for loading schematic files using the new s-expression
|
||||||
* file format.
|
* file format.
|
||||||
*
|
*
|
||||||
* As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed.
|
* As with all SCH_IOs there is no UI dependencies i.e. windowing calls allowed.
|
||||||
*/
|
*/
|
||||||
class SCH_SEXPR_PLUGIN : public SCH_PLUGIN
|
class SCH_SEXPR_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include <eda_shape.h> // FILL_T
|
#include <eda_shape.h> // FILL_T
|
||||||
|
|
||||||
#include "../sch_lib_plugin_cache.h"
|
#include "sch_io/sch_lib_plugin_cache.h"
|
||||||
|
|
||||||
class FILE_LINE_READER;
|
class FILE_LINE_READER;
|
||||||
class LIB_FIELD;
|
class LIB_FIELD;
|
||||||
|
@ -47,7 +47,7 @@ public:
|
||||||
virtual ~SCH_LEGACY_PLUGIN_CACHE() {}
|
virtual ~SCH_LEGACY_PLUGIN_CACHE() {}
|
||||||
|
|
||||||
// Most all functions in this class throw IO_ERROR exceptions. There are no
|
// 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_PLUGIN objects.
|
// error codes nor user interface calls from here, nor in any SCH_IO objects.
|
||||||
// Catch these exceptions higher up please.
|
// Catch these exceptions higher up please.
|
||||||
|
|
||||||
/// Save the entire library to file m_libFileName;
|
/// Save the entire library to file m_libFileName;
|
|
@ -53,10 +53,10 @@
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
#include <sch_sheet_pin.h>
|
#include <sch_sheet_pin.h>
|
||||||
#include <bus_alias.h>
|
#include <bus_alias.h>
|
||||||
#include <plugins/plugin_utils.h>
|
#include <io/io_utils.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_lib_plugin_cache.h>
|
#include <sch_io/legacy/sch_legacy_lib_plugin_cache.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin_helpers.h>
|
#include <sch_io/legacy/sch_legacy_plugin_helpers.h>
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <symbol_library.h>
|
#include <symbol_library.h>
|
||||||
|
@ -2243,19 +2243,19 @@ void SCH_LEGACY_PLUGIN::SaveLibrary( const wxString& aLibraryPath, const STRING_
|
||||||
|
|
||||||
bool SCH_LEGACY_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
bool SCH_LEGACY_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadSchematicFile( aFileName ) )
|
if( !SCH_IO::CanReadSchematicFile( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return PLUGIN_UTILS::fileStartsWithPrefix( aFileName, wxT( "EESchema" ), true );
|
return IO_UTILS::fileStartsWithPrefix( aFileName, wxT( "EESchema" ), true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_LEGACY_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
bool SCH_LEGACY_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
if( !SCH_PLUGIN::CanReadLibrary( aFileName ) )
|
if( !SCH_IO::CanReadLibrary( aFileName ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return PLUGIN_UTILS::fileStartsWithPrefix( aFileName, wxT( "EESchema" ), true );
|
return IO_UTILS::fileStartsWithPrefix( aFileName, wxT( "EESchema" ), true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
#define _SCH_LEGACY_PLUGIN_H_
|
#define _SCH_LEGACY_PLUGIN_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <general.h> // for EESCHEMA_VERSION definition
|
#include <general.h> // for EESCHEMA_VERSION definition
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
|
@ -52,7 +53,7 @@ class OUTPUTFORMATTER;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A #SCH_PLUGIN derivation for loading schematic files created before the new s-expression
|
* A #SCH_IO derivation for loading schematic files created before the new s-expression
|
||||||
* file format.
|
* file format.
|
||||||
*
|
*
|
||||||
* The legacy parser and formatter attempt to be compatible with the legacy file format.
|
* The legacy parser and formatter attempt to be compatible with the legacy file format.
|
||||||
|
@ -60,9 +61,9 @@ class OUTPUTFORMATTER;
|
||||||
* So "$C", "$Co", and "$Com" could be used for "$Comp" and the old parser would allow
|
* So "$C", "$Co", and "$Com" could be used for "$Comp" and the old parser would allow
|
||||||
* this. This parser is not that forgiving and sticks to the legacy file format document.
|
* this. This parser is not that forgiving and sticks to the legacy file format document.
|
||||||
*
|
*
|
||||||
* As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed.
|
* As with all SCH_IO there is no UI dependencies i.e. windowing calls allowed.
|
||||||
*/
|
*/
|
||||||
class SCH_LEGACY_PLUGIN : public SCH_PLUGIN
|
class SCH_LEGACY_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
* schematic file.
|
* schematic file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sch_plugins/ltspice/ltspice_sch_parser.h>
|
#include <sch_io/ltspice/ltspice_sch_parser.h>
|
||||||
#include <sch_plugins/ltspice/ltspice_schematic.h>
|
#include <sch_io/ltspice/ltspice_schematic.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
#include <sch_sheet_pin.h>
|
#include <sch_sheet_pin.h>
|
|
@ -27,12 +27,12 @@
|
||||||
#ifndef LTSPICE_SCH_PARSER_H
|
#ifndef LTSPICE_SCH_PARSER_H
|
||||||
#define LTSPICE_SCH_PARSER_H
|
#define LTSPICE_SCH_PARSER_H
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <pin_type.h>
|
#include <pin_type.h>
|
||||||
#include <layer_ids.h>
|
#include <layer_ids.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <plotters/plotter.h>
|
#include <plotters/plotter.h>
|
||||||
#include <sch_plugins/ltspice/ltspice_schematic.h>
|
#include <sch_io/ltspice/ltspice_schematic.h>
|
||||||
|
|
||||||
|
|
||||||
class EDA_TEXT;
|
class EDA_TEXT;
|
|
@ -19,9 +19,9 @@
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sch_plugins/ltspice/ltspice_schematic.h>
|
#include <sch_io/ltspice/ltspice_schematic.h>
|
||||||
#include <sch_plugins/ltspice/ltspice_sch_plugin.h>
|
#include <sch_io/ltspice/ltspice_sch_plugin.h>
|
||||||
#include <sch_plugins/ltspice/ltspice_sch_parser.h>
|
#include <sch_io/ltspice/ltspice_sch_parser.h>
|
||||||
|
|
||||||
#include <project_sch.h>
|
#include <project_sch.h>
|
||||||
#include <schematic.h>
|
#include <schematic.h>
|
|
@ -22,7 +22,8 @@
|
||||||
#ifndef SCH_LTSPICE_PLUGIN_H_
|
#ifndef SCH_LTSPICE_PLUGIN_H_
|
||||||
#define SCH_LTSPICE_PLUGIN_H_
|
#define SCH_LTSPICE_PLUGIN_H_
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <reporter.h>
|
#include <reporter.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@ class SCH_SHEET;
|
||||||
class SCH_SCREEN;
|
class SCH_SCREEN;
|
||||||
|
|
||||||
|
|
||||||
class SCH_LTSPICE_PLUGIN : public SCH_PLUGIN
|
class SCH_LTSPICE_PLUGIN : public SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SCH_LTSPICE_PLUGIN()
|
SCH_LTSPICE_PLUGIN()
|
|
@ -23,8 +23,8 @@
|
||||||
* @brief Loads the asc file and asy files.
|
* @brief Loads the asc file and asy files.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sch_plugins/ltspice/ltspice_schematic.h>
|
#include <sch_io/ltspice/ltspice_schematic.h>
|
||||||
#include <sch_plugins/ltspice/ltspice_sch_parser.h>
|
#include <sch_io/ltspice/ltspice_sch_parser.h>
|
||||||
#include <sch_screen.h>
|
#include <sch_screen.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
#include <wx/dir.h>
|
#include <wx/dir.h>
|
|
@ -22,7 +22,7 @@
|
||||||
#ifndef LTSPICE_SCHEMATIC_LOADER_H
|
#ifndef LTSPICE_SCHEMATIC_LOADER_H
|
||||||
#define LTSPICE_SCHEMATIC_LOADER_H
|
#define LTSPICE_SCHEMATIC_LOADER_H
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <sch_sheet_path.h>
|
#include <sch_sheet_path.h>
|
||||||
#include <pin_type.h>
|
#include <pin_type.h>
|
||||||
#include <layer_ids.h>
|
#include <layer_ids.h>
|
|
@ -24,7 +24,8 @@
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#include <ki_exception.h>
|
#include <ki_exception.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <wx/translation.h>
|
#include <wx/translation.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <wx/dir.h>
|
#include <wx/dir.h>
|
||||||
|
@ -36,19 +37,19 @@
|
||||||
wxString::FromUTF8( aCaller ).GetData() ) );
|
wxString::FromUTF8( aCaller ).GetData() ) );
|
||||||
|
|
||||||
|
|
||||||
const PLUGIN_FILE_DESC SCH_PLUGIN::GetSchematicFileDesc() const
|
const PLUGIN_FILE_DESC SCH_IO::GetSchematicFileDesc() const
|
||||||
{
|
{
|
||||||
return PLUGIN_FILE_DESC( wxEmptyString, {} );
|
return PLUGIN_FILE_DESC( wxEmptyString, {} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const PLUGIN_FILE_DESC SCH_PLUGIN::GetLibraryFileDesc() const
|
const PLUGIN_FILE_DESC SCH_IO::GetLibraryFileDesc() const
|
||||||
{
|
{
|
||||||
return PLUGIN_FILE_DESC( wxEmptyString, {} );
|
return PLUGIN_FILE_DESC( wxEmptyString, {} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
bool SCH_IO::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
const std::vector<std::string>& exts = GetSchematicFileDesc().m_FileExtensions;
|
const std::vector<std::string>& exts = GetSchematicFileDesc().m_FileExtensions;
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ bool SCH_PLUGIN::CanReadSchematicFile( const wxString& aFileName ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
bool SCH_IO::CanReadLibrary( const wxString& aFileName ) const
|
||||||
{
|
{
|
||||||
const PLUGIN_FILE_DESC& desc = GetLibraryFileDesc();
|
const PLUGIN_FILE_DESC& desc = GetLibraryFileDesc();
|
||||||
|
|
||||||
|
@ -115,91 +116,91 @@ bool SCH_PLUGIN::CanReadLibrary( const wxString& aFileName ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties )
|
void SCH_IO::SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCH_SHEET* SCH_PLUGIN::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
|
SCH_SHEET* SCH_IO::LoadSchematicFile( const wxString& aFileName, SCHEMATIC* aSchematic,
|
||||||
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
SCH_SHEET* aAppendToMe, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
void SCH_IO::SaveSchematicFile( const wxString& aFileName, SCH_SHEET* aSheet, SCHEMATIC* aSchematic,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::EnumerateSymbolLib( wxArrayString& aAliasNameList,
|
void SCH_IO::EnumerateSymbolLib( wxArrayString& aAliasNameList,
|
||||||
const wxString& aLibraryPath,
|
const wxString& aLibraryPath,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
void SCH_IO::EnumerateSymbolLib( std::vector<LIB_SYMBOL*>& aSymbolList,
|
||||||
const wxString& aLibraryPath,
|
const wxString& aLibraryPath,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIB_SYMBOL* SCH_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
LIB_SYMBOL* SCH_IO::LoadSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
void SCH_IO::SaveSymbol( const wxString& aLibraryPath, const LIB_SYMBOL* aSymbol,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
void SCH_IO::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName,
|
||||||
const STRING_UTF8_MAP* aProperties )
|
const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::CreateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
void SCH_IO::CreateSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
bool SCH_IO::DeleteSymbolLib( const wxString& aLibraryPath, const STRING_UTF8_MAP* aProperties )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SCH_PLUGIN::IsSymbolLibWritable( const wxString& aLibraryPath )
|
bool SCH_IO::IsSymbolLibWritable( const wxString& aLibraryPath )
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_PLUGIN::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
|
void SCH_IO::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
|
||||||
{
|
{
|
||||||
// Empty for most plugins
|
// Empty for most plugins
|
||||||
//
|
//
|
||||||
|
@ -211,8 +212,8 @@ void SCH_PLUGIN::SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wxString& SCH_PLUGIN::GetError() const
|
const wxString& SCH_IO::GetError() const
|
||||||
{
|
{
|
||||||
// not pure virtual so that plugins only have to implement subset of the SCH_PLUGIN interface.
|
// not pure virtual so that plugins only have to implement subset of the SCH_IO interface.
|
||||||
NOT_IMPLEMENTED( __FUNCTION__ );
|
NOT_IMPLEMENTED( __FUNCTION__ );
|
||||||
}
|
}
|
|
@ -20,9 +20,10 @@
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SCH_IO_MGR_H_
|
#ifndef SCH_IO_H_
|
||||||
#define _SCH_IO_MGR_H_
|
#define SCH_IO_H_
|
||||||
|
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <import_export.h>
|
#include <import_export.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <enum_vector.h>
|
#include <enum_vector.h>
|
||||||
|
@ -31,99 +32,10 @@
|
||||||
#include <plugin_file_desc.h>
|
#include <plugin_file_desc.h>
|
||||||
#include <wx/arrstr.h>
|
#include <wx/arrstr.h>
|
||||||
|
|
||||||
|
|
||||||
class SCH_SHEET;
|
|
||||||
class SCH_SCREEN;
|
|
||||||
class SCH_PLUGIN;
|
|
||||||
class SCHEMATIC;
|
|
||||||
class SYMBOL_LIB_TABLE;
|
|
||||||
class KIWAY;
|
|
||||||
class LIB_SYMBOL;
|
|
||||||
class SYMBOL_LIB;
|
|
||||||
class STRING_UTF8_MAP;
|
|
||||||
class PROGRESS_REPORTER;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A factory which returns an instance of a #SCH_PLUGIN.
|
|
||||||
*/
|
|
||||||
class SCH_IO_MGR
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A set of file types that the #SCH_IO_MGR knows about, and for which there
|
|
||||||
* has been a plugin written, in alphabetical order.
|
|
||||||
*/
|
|
||||||
// clang-format off
|
|
||||||
DEFINE_ENUM_VECTOR( SCH_FILE_T,
|
|
||||||
{
|
|
||||||
SCH_KICAD, ///< The s-expression version of the schematic.
|
|
||||||
SCH_LEGACY, ///< Legacy Eeschema file formats prior to s-expression.
|
|
||||||
SCH_ALTIUM, ///< Altium file format
|
|
||||||
SCH_CADSTAR_ARCHIVE, ///< CADSTAR Schematic Archive
|
|
||||||
SCH_DATABASE, ///< KiCad database library
|
|
||||||
SCH_EAGLE, ///< Autodesk Eagle file format
|
|
||||||
SCH_EASYEDA, ///< EasyEDA Std schematic file
|
|
||||||
SCH_EASYEDAPRO, ///< EasyEDA Pro archive
|
|
||||||
SCH_LTSPICE, ///< LtSpice Schematic format
|
|
||||||
SCH_HTTP, ///< KiCad HTTP library
|
|
||||||
|
|
||||||
// Add your schematic type here.
|
|
||||||
SCH_FILE_UNKNOWN
|
|
||||||
} )
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a #SCH_PLUGIN which the caller can use to import, export, save, or load
|
|
||||||
* design documents.
|
|
||||||
*
|
|
||||||
* The returned #SCH_PLUGIN, may be reference counted, so please call PluginRelease()
|
|
||||||
* when you are done using the returned #SCH_PLUGIN. It may or may not be code running
|
|
||||||
* from a DLL/DSO.
|
|
||||||
*
|
|
||||||
* @param aFileType is from #SCH_FILE_T and tells which plugin to find.
|
|
||||||
*
|
|
||||||
* @return the plugin corresponding to aFileType or NULL if not found.
|
|
||||||
* Caller owns the returned object, and must call PluginRelease when done using it.
|
|
||||||
*/
|
|
||||||
APIEXPORT
|
|
||||||
static SCH_PLUGIN* FindPlugin( SCH_FILE_T aFileType );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Release a #SCH_PLUGIN back to the system, and may cause it to be unloaded from memory.
|
|
||||||
*
|
|
||||||
* @param aPlugin is the one to be released, and which is no longer usable
|
|
||||||
* after calling this.
|
|
||||||
*/
|
|
||||||
static void ReleasePlugin( SCH_PLUGIN* aPlugin );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a brief name for a plugin, given aFileType enum.
|
|
||||||
*/
|
|
||||||
static const wxString ShowType( SCH_FILE_T aFileType );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy", etc.
|
|
||||||
*/
|
|
||||||
static SCH_FILE_T EnumFromStr( const wxString& aFileType );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a plugin type given a symbol library using the file extension of \a aLibPath.
|
|
||||||
*/
|
|
||||||
static SCH_FILE_T GuessPluginTypeFromLibPath( const wxString& aLibPath, int aCtl = 0 );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a plugin type given a schematic using the file extension of \a aSchematicPath.
|
|
||||||
*/
|
|
||||||
static SCH_FILE_T GuessPluginTypeFromSchPath( const wxString& aSchematicPath, int aCtl = 0 );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class that schematic file and library loading and saving plugins should derive from.
|
* Base class that schematic file and library loading and saving plugins should derive from.
|
||||||
* Implementations can provide either LoadSchematicFile() or SaveSchematicFile() functions,
|
* Implementations can provide either LoadSchematicFile() or SaveSchematicFile() functions,
|
||||||
* or both. SCH_PLUGINs throw exceptions, so it is best that you wrap your calls to these
|
* or both. SCH_IOs throw exceptions, so it is best that you wrap your calls to these
|
||||||
* functions in a try catch block. Plugins throw exceptions because it is illegal
|
* functions in a try catch block. Plugins throw exceptions because it is illegal
|
||||||
* for them to have any user interface calls in them whatsoever, i.e. no windowing
|
* for them to have any user interface calls in them whatsoever, i.e. no windowing
|
||||||
* or screen printing at all.
|
* or screen printing at all.
|
||||||
|
@ -141,14 +53,14 @@ public:
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
class SCH_PLUGIN
|
class SCH_IO
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//-----<PUBLIC SCH_PLUGIN API>-------------------------------------------------
|
//-----<PUBLIC SCH_IO API>-------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a brief hard coded name for this SCH_PLUGIN.
|
* Return a brief hard coded name for this SCH_IO.
|
||||||
*/
|
*/
|
||||||
virtual const wxString GetName() const = 0;
|
virtual const wxString GetName() const = 0;
|
||||||
|
|
||||||
|
@ -163,23 +75,23 @@ public:
|
||||||
virtual void SetProgressReporter( PROGRESS_REPORTER* aReporter ) {}
|
virtual void SetProgressReporter( PROGRESS_REPORTER* aReporter ) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns schematic file description for the #SCH_PLUGIN.
|
* Returns schematic file description for the #SCH_IO.
|
||||||
*/
|
*/
|
||||||
virtual const PLUGIN_FILE_DESC GetSchematicFileDesc() const;
|
virtual const PLUGIN_FILE_DESC GetSchematicFileDesc() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns symbol library description for the #SCH_PLUGIN.
|
* Returns symbol library description for the #SCH_IO.
|
||||||
*/
|
*/
|
||||||
virtual const PLUGIN_FILE_DESC GetLibraryFileDesc() const;
|
virtual const PLUGIN_FILE_DESC GetLibraryFileDesc() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this SCH_PLUGIN can read the specified schematic file.
|
* Checks if this SCH_IO can read the specified schematic file.
|
||||||
* If not overriden, extension check is used.
|
* If not overriden, extension check is used.
|
||||||
*/
|
*/
|
||||||
virtual bool CanReadSchematicFile( const wxString& aFileName ) const;
|
virtual bool CanReadSchematicFile( const wxString& aFileName ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this SCH_PLUGIN can read the specified symbol library file.
|
* Checks if this SCH_IO can read the specified symbol library file.
|
||||||
* If not overriden, extension check is used.
|
* If not overriden, extension check is used.
|
||||||
*/
|
*/
|
||||||
virtual bool CanReadLibrary( const wxString& aFileName ) const;
|
virtual bool CanReadLibrary( const wxString& aFileName ) const;
|
||||||
|
@ -198,7 +110,7 @@ public:
|
||||||
virtual void SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties = nullptr );
|
virtual void SaveLibrary( const wxString& aFileName, const STRING_UTF8_MAP* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load information from some input file format that this #SCH_PLUGIN implementation
|
* Load information from some input file format that this #SCH_IO implementation
|
||||||
* knows about, into either a new #SCH_SHEET or an existing one. This may be used to load an
|
* knows about, into either a new #SCH_SHEET or an existing one. This may be used to load an
|
||||||
* entire new #SCH_SHEET, or to augment an existing one if \a aAppendToMe is not NULL.
|
* entire new #SCH_SHEET, or to augment an existing one if \a aAppendToMe is not NULL.
|
||||||
*
|
*
|
||||||
|
@ -230,7 +142,7 @@ public:
|
||||||
const STRING_UTF8_MAP* aProperties = nullptr );
|
const STRING_UTF8_MAP* aProperties = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write \a aSchematic to a storage file in a format that this #SCH_PLUGIN implementation
|
* Write \a aSchematic to a storage file in a format that this #SCH_IO implementation
|
||||||
* knows about, or it can be used to write a portion of \a aSchematic to a special kind
|
* knows about, or it can be used to write a portion of \a aSchematic to a special kind
|
||||||
* of export file.
|
* of export file.
|
||||||
*
|
*
|
||||||
|
@ -302,7 +214,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a #LIB_SYMBOL object having \a aPartName from the \a aLibraryPath containing
|
* Load a #LIB_SYMBOL object having \a aPartName from the \a aLibraryPath containing
|
||||||
* a library format that this #SCH_PLUGIN knows about.
|
* a library format that this #SCH_IO knows about.
|
||||||
*
|
*
|
||||||
* @param aLibraryPath is a locator for the "library", usually a directory, file,
|
* @param aLibraryPath is a locator for the "library", usually a directory, file,
|
||||||
* or URL containing several symbols.
|
* or URL containing several symbols.
|
||||||
|
@ -421,11 +333,11 @@ public:
|
||||||
virtual bool IsSymbolLibWritable( const wxString& aLibraryPath );
|
virtual bool IsSymbolLibWritable( const wxString& aLibraryPath );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append supported #SCH_PLUGIN options to \a aListToAppenTo along with internationalized
|
* Append supported #SCH_IO options to \a aListToAppenTo along with internationalized
|
||||||
* descriptions. Options are typically appended so that a derived SCH_PLUGIN can call
|
* descriptions. Options are typically appended so that a derived SCH_IO can call
|
||||||
* its base class function by the same name first, thus inheriting options declared there.
|
* its base class function by the same name first, thus inheriting options declared there.
|
||||||
* (Some base class options could pertain to all Symbol*() functions in all derived
|
* (Some base class options could pertain to all Symbol*() functions in all derived
|
||||||
* SCH_PLUGINs.) Note that since aListToAppendTo is a PROPERTIES object, all options
|
* SCH_IOs.) Note that since aListToAppendTo is a PROPERTIES object, all options
|
||||||
* will be unique and last guy wins.
|
* will be unique and last guy wins.
|
||||||
*
|
*
|
||||||
* @param aListToAppendTo holds a tuple of
|
* @param aListToAppendTo holds a tuple of
|
||||||
|
@ -442,7 +354,7 @@ public:
|
||||||
* holding a wxValidator for the cells in said dialog:
|
* holding a wxValidator for the cells in said dialog:
|
||||||
* http://forums.wxwidgets.org/viewtopic.php?t=23277&p=104180.
|
* http://forums.wxwidgets.org/viewtopic.php?t=23277&p=104180.
|
||||||
* This would require a 3 column list, and introducing wx GUI knowledge to
|
* This would require a 3 column list, and introducing wx GUI knowledge to
|
||||||
* #SCH_PLUGIN, which has been avoided to date.
|
* #SCH_IO, which has been avoided to date.
|
||||||
*/
|
*/
|
||||||
virtual void SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const;
|
virtual void SymbolLibOptions( STRING_UTF8_MAP* aListToAppendTo ) const;
|
||||||
|
|
||||||
|
@ -509,40 +421,40 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void SetLibTable( SYMBOL_LIB_TABLE* aTable ) {}
|
virtual void SetLibTable( SYMBOL_LIB_TABLE* aTable ) {}
|
||||||
|
|
||||||
//-----</PUBLIC SCH_PLUGIN API>------------------------------------------------
|
//-----</PUBLIC SCH_IO API>------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
/* The compiler writes the "zero argument" constructor for a SCH_PLUGIN
|
/* The compiler writes the "zero argument" constructor for a SCH_IO
|
||||||
automatically if you do not provide one. If you decide you need to
|
automatically if you do not provide one. If you decide you need to
|
||||||
provide a zero argument constructor of your own design, that is allowed.
|
provide a zero argument constructor of your own design, that is allowed.
|
||||||
It must be public, and it is what the SCH_IO_MGR uses. Parameters may be
|
It must be public, and it is what the SCH_IO_MGR uses. Parameters may be
|
||||||
passed into a SCH_PLUGIN via the PROPERTIES variable for any of the public
|
passed into a SCH_IO via the PROPERTIES variable for any of the public
|
||||||
API functions which take one.
|
API functions which take one.
|
||||||
*/
|
*/
|
||||||
virtual ~SCH_PLUGIN() { }
|
virtual ~SCH_IO() { }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper object to release a #SCH_PLUGIN in the context of a potential thrown exception
|
* Helper object to release a #SCH_IO in the context of a potential thrown exception
|
||||||
* through its destructor.
|
* through its destructor.
|
||||||
*/
|
*/
|
||||||
class SCH_PLUGIN_RELEASER
|
class SCH_IO_RELEASER
|
||||||
{
|
{
|
||||||
SCH_PLUGIN* plugin;
|
SCH_IO* plugin;
|
||||||
|
|
||||||
// private assignment operator so it's illegal
|
// private assignment operator so it's illegal
|
||||||
SCH_PLUGIN_RELEASER& operator=( SCH_PLUGIN_RELEASER& aOther ) { return *this; }
|
SCH_IO_RELEASER& operator=( SCH_IO_RELEASER& aOther ) { return *this; }
|
||||||
|
|
||||||
// private copy constructor so it's illegal
|
// private copy constructor so it's illegal
|
||||||
SCH_PLUGIN_RELEASER( const SCH_PLUGIN_RELEASER& aOther ) {}
|
SCH_IO_RELEASER( const SCH_IO_RELEASER& aOther ) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCH_PLUGIN_RELEASER( SCH_PLUGIN* aPlugin = nullptr ) :
|
SCH_IO_RELEASER( SCH_IO* aPlugin = nullptr ) :
|
||||||
plugin( aPlugin )
|
plugin( aPlugin )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~SCH_PLUGIN_RELEASER()
|
~SCH_IO_RELEASER()
|
||||||
{
|
{
|
||||||
if( plugin )
|
if( plugin )
|
||||||
release();
|
release();
|
||||||
|
@ -554,23 +466,24 @@ public:
|
||||||
plugin = nullptr;
|
plugin = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set( SCH_PLUGIN* aPlugin )
|
void set( SCH_IO* aPlugin )
|
||||||
{
|
{
|
||||||
if( plugin )
|
if( plugin )
|
||||||
release();
|
release();
|
||||||
plugin = aPlugin;
|
plugin = aPlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator SCH_PLUGIN* () const
|
operator SCH_IO* () const
|
||||||
{
|
{
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCH_PLUGIN* operator -> () const
|
SCH_IO* operator -> () const
|
||||||
{
|
{
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _SCH_IO_MGR_H_
|
|
||||||
|
#endif // SCH_IO_H_
|
|
@ -23,18 +23,18 @@
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <wx/uri.h>
|
#include <wx/uri.h>
|
||||||
|
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
#include <sch_plugins/eagle/sch_eagle_plugin.h>
|
#include <sch_io/eagle/sch_eagle_plugin.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_plugin.h>
|
#include <sch_io/kicad/sch_sexpr_plugin.h>
|
||||||
|
|
||||||
#include <sch_plugins/altium/sch_altium_plugin.h>
|
#include <sch_io/altium/sch_altium_plugin.h>
|
||||||
#include <sch_plugins/cadstar/cadstar_sch_archive_plugin.h>
|
#include <sch_io/cadstar/cadstar_sch_archive_plugin.h>
|
||||||
#include <sch_plugins/easyeda/sch_easyeda_plugin.h>
|
#include <sch_io/easyeda/sch_easyeda_plugin.h>
|
||||||
#include <sch_plugins/easyedapro/sch_easyedapro_plugin.h>
|
#include <sch_io/easyedapro/sch_easyedapro_plugin.h>
|
||||||
#include <sch_plugins/database/sch_database_plugin.h>
|
#include <sch_io/database/sch_database_plugin.h>
|
||||||
#include <sch_plugins/ltspice/ltspice_sch_plugin.h>
|
#include <sch_io/ltspice/ltspice_sch_plugin.h>
|
||||||
#include <sch_plugins/http_lib/sch_http_lib_plugin.h>
|
#include <sch_io/http_lib/sch_http_lib_plugin.h>
|
||||||
#include <common.h> // for ExpandEnvVarSubstitutions
|
#include <common.h> // for ExpandEnvVarSubstitutions
|
||||||
|
|
||||||
#include <wildcards_and_files_ext.h>
|
#include <wildcards_and_files_ext.h>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
// plugins coexisting.
|
// plugins coexisting.
|
||||||
|
|
||||||
|
|
||||||
SCH_PLUGIN* SCH_IO_MGR::FindPlugin( SCH_FILE_T aFileType )
|
SCH_IO* SCH_IO_MGR::FindPlugin( SCH_FILE_T aFileType )
|
||||||
{
|
{
|
||||||
// This implementation is subject to change, any magic is allowed here.
|
// This implementation is subject to change, any magic is allowed here.
|
||||||
// The public SCH_IO_MGR API is the only pertinent public information.
|
// The public SCH_IO_MGR API is the only pertinent public information.
|
||||||
|
@ -79,7 +79,7 @@ SCH_PLUGIN* SCH_IO_MGR::FindPlugin( SCH_FILE_T aFileType )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_IO_MGR::ReleasePlugin( SCH_PLUGIN* aPlugin )
|
void SCH_IO_MGR::ReleasePlugin( SCH_IO* aPlugin )
|
||||||
{
|
{
|
||||||
// This function is a place holder for a future point in time where
|
// This function is a place holder for a future point in time where
|
||||||
// the plugin is a DLL/DSO. It could do reference counting, and then
|
// the plugin is a DLL/DSO. It could do reference counting, and then
|
||||||
|
@ -158,7 +158,7 @@ SCH_IO_MGR::SCH_FILE_T SCH_IO_MGR::GuessPluginTypeFromLibPath( const wxString& a
|
||||||
if( ( aCtl & KICTL_NONKICAD_ONLY ) && isKiCad )
|
if( ( aCtl & KICTL_NONKICAD_ONLY ) && isKiCad )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
||||||
|
|
||||||
if( !pi )
|
if( !pi )
|
||||||
continue;
|
continue;
|
||||||
|
@ -184,7 +184,7 @@ SCH_IO_MGR::SCH_FILE_T SCH_IO_MGR::GuessPluginTypeFromSchPath( const wxString& a
|
||||||
if( ( aCtl & KICTL_NONKICAD_ONLY ) && isKiCad )
|
if( ( aCtl & KICTL_NONKICAD_ONLY ) && isKiCad )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
||||||
|
|
||||||
if( !pi )
|
if( !pi )
|
||||||
continue;
|
continue;
|
|
@ -0,0 +1,122 @@
|
||||||
|
/*
|
||||||
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 CERN
|
||||||
|
* Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
|
*
|
||||||
|
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 3
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SCH_IO_MGR_H_
|
||||||
|
#define _SCH_IO_MGR_H_
|
||||||
|
|
||||||
|
#include <import_export.h>
|
||||||
|
#include <map>
|
||||||
|
#include <enum_vector.h>
|
||||||
|
#include <reporter.h>
|
||||||
|
#include <i18n_utility.h>
|
||||||
|
#include <plugin_file_desc.h>
|
||||||
|
#include <wx/arrstr.h>
|
||||||
|
|
||||||
|
|
||||||
|
class SCH_SHEET;
|
||||||
|
class SCH_SCREEN;
|
||||||
|
class SCH_IO;
|
||||||
|
class SCHEMATIC;
|
||||||
|
class SYMBOL_LIB_TABLE;
|
||||||
|
class KIWAY;
|
||||||
|
class LIB_SYMBOL;
|
||||||
|
class SYMBOL_LIB;
|
||||||
|
class STRING_UTF8_MAP;
|
||||||
|
class PROGRESS_REPORTER;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A factory which returns an instance of a #SCH_IO.
|
||||||
|
*/
|
||||||
|
class SCH_IO_MGR
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of file types that the #SCH_IO_MGR knows about, and for which there
|
||||||
|
* has been a plugin written, in alphabetical order.
|
||||||
|
*/
|
||||||
|
// clang-format off
|
||||||
|
DEFINE_ENUM_VECTOR( SCH_FILE_T,
|
||||||
|
{
|
||||||
|
SCH_KICAD, ///< The s-expression version of the schematic.
|
||||||
|
SCH_LEGACY, ///< Legacy Eeschema file formats prior to s-expression.
|
||||||
|
SCH_ALTIUM, ///< Altium file format
|
||||||
|
SCH_CADSTAR_ARCHIVE, ///< CADSTAR Schematic Archive
|
||||||
|
SCH_DATABASE, ///< KiCad database library
|
||||||
|
SCH_EAGLE, ///< Autodesk Eagle file format
|
||||||
|
SCH_EASYEDA, ///< EasyEDA Std schematic file
|
||||||
|
SCH_EASYEDAPRO, ///< EasyEDA Pro archive
|
||||||
|
SCH_LTSPICE, ///< LtSpice Schematic format
|
||||||
|
SCH_HTTP, ///< KiCad HTTP library
|
||||||
|
|
||||||
|
// Add your schematic type here.
|
||||||
|
SCH_FILE_UNKNOWN
|
||||||
|
} )
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a #SCH_IO which the caller can use to import, export, save, or load
|
||||||
|
* design documents.
|
||||||
|
*
|
||||||
|
* The returned #SCH_IO, may be reference counted, so please call PluginRelease()
|
||||||
|
* when you are done using the returned #SCH_IO. It may or may not be code running
|
||||||
|
* from a DLL/DSO.
|
||||||
|
*
|
||||||
|
* @param aFileType is from #SCH_FILE_T and tells which plugin to find.
|
||||||
|
*
|
||||||
|
* @return the plugin corresponding to aFileType or NULL if not found.
|
||||||
|
* Caller owns the returned object, and must call PluginRelease when done using it.
|
||||||
|
*/
|
||||||
|
APIEXPORT
|
||||||
|
static SCH_IO* FindPlugin( SCH_FILE_T aFileType );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release a #SCH_IO back to the system, and may cause it to be unloaded from memory.
|
||||||
|
*
|
||||||
|
* @param aPlugin is the one to be released, and which is no longer usable
|
||||||
|
* after calling this.
|
||||||
|
*/
|
||||||
|
static void ReleasePlugin( SCH_IO* aPlugin );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a brief name for a plugin, given aFileType enum.
|
||||||
|
*/
|
||||||
|
static const wxString ShowType( SCH_FILE_T aFileType );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy", etc.
|
||||||
|
*/
|
||||||
|
static SCH_FILE_T EnumFromStr( const wxString& aFileType );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a plugin type given a symbol library using the file extension of \a aLibPath.
|
||||||
|
*/
|
||||||
|
static SCH_FILE_T GuessPluginTypeFromLibPath( const wxString& aLibPath, int aCtl = 0 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a plugin type given a schematic using the file extension of \a aSchematicPath.
|
||||||
|
*/
|
||||||
|
static SCH_FILE_T GuessPluginTypeFromSchPath( const wxString& aSchematicPath, int aCtl = 0 );
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _SCH_IO_MGR_H_
|
|
@ -35,7 +35,7 @@ class OUTPUTFORMATTER;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A base cache assistant implementation for the symbol library portion of the #SCH_PLUGIN API.
|
* A base cache assistant implementation for the symbol library portion of the #SCH_IO API.
|
||||||
*/
|
*/
|
||||||
class SCH_LIB_PLUGIN_CACHE
|
class SCH_LIB_PLUGIN_CACHE
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Most all functions in this class throw IO_ERROR exceptions. There are no
|
// 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_PLUGIN objects.
|
// error codes nor user interface calls from here, nor in any SCH_IO objects.
|
||||||
// Catch these exceptions higher up please.
|
// Catch these exceptions higher up please.
|
||||||
|
|
||||||
/// Save the entire library to file m_libFileName;
|
/// Save the entire library to file m_libFileName;
|
|
@ -31,7 +31,7 @@
|
||||||
#include <tool/tool_manager.h>
|
#include <tool/tool_manager.h>
|
||||||
#include <project_sch.h>
|
#include <project_sch.h>
|
||||||
#include <sch_edit_frame.h>
|
#include <sch_edit_frame.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
#include <sch_sheet.h>
|
#include <sch_sheet.h>
|
||||||
#include <sch_sheet_path.h>
|
#include <sch_sheet_path.h>
|
||||||
#include <sch_view.h>
|
#include <sch_view.h>
|
||||||
|
@ -169,7 +169,7 @@ bool SCH_EDIT_FRAME::LoadSheetFromFile( SCH_SHEET* aSheet, SCH_SHEET_PATH* aHier
|
||||||
if( schFileType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
if( schFileType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
||||||
schFileType = SCH_IO_MGR::SCH_KICAD;
|
schFileType = SCH_IO_MGR::SCH_KICAD;
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( schFileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( schFileType ) );
|
||||||
std::unique_ptr< SCH_SHEET> tmpSheet = std::make_unique<SCH_SHEET>( &Schematic() );
|
std::unique_ptr< SCH_SHEET> tmpSheet = std::make_unique<SCH_SHEET>( &Schematic() );
|
||||||
|
|
||||||
// This will cause the sheet UUID to be set to the UUID of the aSheet argument. This is
|
// This will cause the sheet UUID to be set to the UUID of the aSheet argument. This is
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
#include <symbol_tree_pane.h>
|
#include <symbol_tree_pane.h>
|
||||||
#include <project/project_file.h>
|
#include <project/project_file.h>
|
||||||
#include <widgets/lib_tree.h>
|
#include <widgets/lib_tree.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
#include <sch_plugins/kicad/sch_sexpr_plugin.h>
|
#include <sch_io/kicad/sch_sexpr_plugin.h>
|
||||||
#include <dialogs/dialog_lib_new_symbol.h>
|
#include <dialogs/dialog_lib_new_symbol.h>
|
||||||
#include <eda_list_dialog.h>
|
#include <eda_list_dialog.h>
|
||||||
#include <wx/clipbrd.h>
|
#include <wx/clipbrd.h>
|
||||||
|
|
|
@ -56,7 +56,7 @@ void SYMBOL_EDIT_FRAME::ImportSymbol()
|
||||||
if( fileType == SCH_IO_MGR::SCH_KICAD || fileType == SCH_IO_MGR::SCH_LEGACY )
|
if( fileType == SCH_IO_MGR::SCH_KICAD || fileType == SCH_IO_MGR::SCH_LEGACY )
|
||||||
continue; // this is "Import non-KiCad schematic"
|
continue; // this is "Import non-KiCad schematic"
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( fileType ) );
|
||||||
|
|
||||||
if( !pi )
|
if( !pi )
|
||||||
continue;
|
continue;
|
||||||
|
@ -98,7 +98,7 @@ void SYMBOL_EDIT_FRAME::ImportSymbol()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( piType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( piType ) );
|
||||||
|
|
||||||
// TODO dialog to select the symbol to be imported if there is more than one
|
// TODO dialog to select the symbol to be imported if there is more than one
|
||||||
try
|
try
|
||||||
|
@ -173,7 +173,7 @@ void SYMBOL_EDIT_FRAME::ExportSymbol()
|
||||||
if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
if( pluginType == SCH_IO_MGR::SCH_FILE_UNKNOWN )
|
||||||
pluginType = SCH_IO_MGR::SCH_KICAD;
|
pluginType = SCH_IO_MGR::SCH_KICAD;
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER pi( SCH_IO_MGR::FindPlugin( pluginType ) );
|
SCH_IO::SCH_IO_RELEASER pi( SCH_IO_MGR::FindPlugin( pluginType ) );
|
||||||
|
|
||||||
if( fn.FileExists() )
|
if( fn.FileExists() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <systemdirsappend.h>
|
#include <systemdirsappend.h>
|
||||||
#include <symbol_lib_table.h>
|
#include <symbol_lib_table.h>
|
||||||
#include <lib_symbol.h>
|
#include <lib_symbol.h>
|
||||||
#include <sch_plugins/database/sch_database_plugin.h>
|
#include <sch_io/database/sch_database_plugin.h>
|
||||||
#include <dialogs/dialog_database_lib_settings.h>
|
#include <dialogs/dialog_database_lib_settings.h>
|
||||||
|
|
||||||
#include <wx/dir.h>
|
#include <wx/dir.h>
|
||||||
|
@ -111,7 +111,7 @@ void SYMBOL_LIB_TABLE_ROW::ShowSettingsDialog( wxWindow* aParent ) const
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DIALOG_DATABASE_LIB_SETTINGS dlg( aParent,
|
DIALOG_DATABASE_LIB_SETTINGS dlg( aParent,
|
||||||
static_cast<SCH_DATABASE_PLUGIN*>( ( SCH_PLUGIN* )plugin ) );
|
static_cast<SCH_DATABASE_PLUGIN*>( ( SCH_IO* )plugin ) );
|
||||||
dlg.ShowModal();
|
dlg.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
#define _SYMBOL_LIB_TABLE_H_
|
#define _SYMBOL_LIB_TABLE_H_
|
||||||
|
|
||||||
#include <lib_table_base.h>
|
#include <lib_table_base.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io.h>
|
||||||
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <lib_id.h>
|
#include <lib_id.h>
|
||||||
|
|
||||||
//class LIB_SYMBOL;
|
//class LIB_SYMBOL;
|
||||||
|
@ -36,7 +37,7 @@ class DIALOG_SYMBOL_LIB_TABLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hold a record identifying a symbol library accessed by the appropriate symbol library
|
* Hold a record identifying a symbol library accessed by the appropriate symbol library
|
||||||
* #SCH_PLUGIN object in the #SYMBOL_LIB_TABLE.
|
* #SCH_IO object in the #SYMBOL_LIB_TABLE.
|
||||||
*/
|
*/
|
||||||
class SYMBOL_LIB_TABLE_ROW : public LIB_TABLE_ROW
|
class SYMBOL_LIB_TABLE_ROW : public LIB_TABLE_ROW
|
||||||
{
|
{
|
||||||
|
@ -95,7 +96,7 @@ public:
|
||||||
void GetSubLibraryNames( std::vector<wxString>& aNames ) const;
|
void GetSubLibraryNames( std::vector<wxString>& aNames ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SCH_PLUGIN::GetAvailableSymbolFields
|
* @see SCH_IO::GetAvailableSymbolFields
|
||||||
*/
|
*/
|
||||||
void GetAvailableSymbolFields( std::vector<wxString>& aNames ) const
|
void GetAvailableSymbolFields( std::vector<wxString>& aNames ) const
|
||||||
{
|
{
|
||||||
|
@ -104,7 +105,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see SCH_PLUGIN::GetDefaultSymbolFields
|
* @see SCH_IO::GetDefaultSymbolFields
|
||||||
*/
|
*/
|
||||||
void GetDefaultSymbolFields( std::vector<wxString>& aNames ) const
|
void GetDefaultSymbolFields( std::vector<wxString>& aNames ) const
|
||||||
{
|
{
|
||||||
|
@ -130,12 +131,12 @@ private:
|
||||||
return new SYMBOL_LIB_TABLE_ROW( *this );
|
return new SYMBOL_LIB_TABLE_ROW( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
void setPlugin( SCH_PLUGIN* aPlugin )
|
void setPlugin( SCH_IO* aPlugin )
|
||||||
{
|
{
|
||||||
plugin.set( aPlugin );
|
plugin.set( aPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin;
|
SCH_IO::SCH_IO_RELEASER plugin;
|
||||||
LIB_T type;
|
LIB_T type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -166,7 +167,7 @@ public:
|
||||||
* Return an SYMBOL_LIB_TABLE_ROW if \a aNickName is found in this table or in any chained
|
* Return an SYMBOL_LIB_TABLE_ROW if \a aNickName is found in this table or in any chained
|
||||||
* fallBack table fragment.
|
* fallBack table fragment.
|
||||||
*
|
*
|
||||||
* The #SCH_PLUGIN is loaded and attached to the "plugin" fieldf the #SYMBOL_LIB_TABLE_ROW if
|
* The #SCH_IO is loaded and attached to the "plugin" fieldf the #SYMBOL_LIB_TABLE_ROW if
|
||||||
* not already loaded.
|
* not already loaded.
|
||||||
*
|
*
|
||||||
* @param aNickName is the name of the row to find.
|
* @param aNickName is the name of the row to find.
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include <widgets/app_progress_dialog.h>
|
#include <widgets/app_progress_dialog.h>
|
||||||
|
|
||||||
#include <symbol_library.h>
|
#include <symbol_library.h>
|
||||||
#include <sch_plugins/legacy/sch_legacy_plugin.h>
|
#include <sch_io/legacy/sch_legacy_plugin.h>
|
||||||
|
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
#include <wx/progdlg.h>
|
#include <wx/progdlg.h>
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
|
|
||||||
#include <project.h>
|
#include <project.h>
|
||||||
#include <sch_io_mgr.h>
|
#include <sch_io/sch_io_mgr.h>
|
||||||
#include <symbol_library_common.h>
|
#include <symbol_library_common.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class LIB_ID;
|
||||||
class LINE_READER;
|
class LINE_READER;
|
||||||
class OUTPUTFORMATTER;
|
class OUTPUTFORMATTER;
|
||||||
class STRING_UTF8_MAP;
|
class STRING_UTF8_MAP;
|
||||||
class SCH_PLUGIN;
|
class SCH_IO;
|
||||||
class SYMBOL_LIB;
|
class SYMBOL_LIB;
|
||||||
|
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ private:
|
||||||
int m_mod_hash; ///< incremented each time library is changed.
|
int m_mod_hash; ///< incremented each time library is changed.
|
||||||
|
|
||||||
SCH_IO_MGR::SCH_FILE_T m_pluginType;
|
SCH_IO_MGR::SCH_FILE_T m_pluginType;
|
||||||
std::unique_ptr< SCH_PLUGIN > m_plugin;
|
std::unique_ptr< SCH_IO > m_plugin;
|
||||||
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library properties
|
std::unique_ptr<STRING_UTF8_MAP> m_properties; ///< Library properties
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue