Refactor ExportSpecctraFile to be usable in API
Currently there is pcbnew.ExportSpecctraDSN() but it needs a pcbnew frame set which makes it unusable outside of the scripting window or a plugin. This refactors actual exporting logic into separate helper and adds an overload to ExportSpecctraDSN(board, filename) that doesn't need pcbnew window.
This commit is contained in:
committed by
jean-pierre charras
parent
a2bb176b68
commit
7b4dcb6e10
@@ -46,6 +46,7 @@
|
||||
#include <pcbnew_scripting_helpers.h>
|
||||
#include <project.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <specctra.h>
|
||||
#include <project/project_local_settings.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <locale_io.h>
|
||||
@@ -270,6 +271,22 @@ bool ExportSpecctraDSN( wxString& aFullFilename )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool ExportSpecctraDSN( BOARD* aBoard, wxString& aFullFilename )
|
||||
{
|
||||
try
|
||||
{
|
||||
ExportBoardToSpecctraFile( aBoard, aFullFilename );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ExportVRML( const wxString& aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles,
|
||||
bool aUseRelativePaths, const wxString& a3D_Subdir, double aXRef, double aYRef )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user