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:
qu1ck
2021-07-31 09:55:48 +00:00
committed by jean-pierre charras
parent a2bb176b68
commit 7b4dcb6e10
4 changed files with 79 additions and 34 deletions
@@ -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 )
{