Harvest -> Export

This commit is contained in:
Jeff Young 2020-11-09 16:45:36 +00:00
parent a6997e6236
commit 6417015b8a
9 changed files with 31 additions and 31 deletions

View File

@ -61,12 +61,12 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
GetCanvas()->Refresh();
break;
case ID_MENU_HARVEST_FOOTPRINTS_TO_LIBRARY:
HarvestFootprintsToLibrary( false );
case ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY:
ExportFootprintsToLibrary( false );
break;
case ID_MENU_HARVEST_FOOTPRINTS_TO_NEW_LIBRARY:
HarvestFootprintsToLibrary( true );
case ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY:
ExportFootprintsToLibrary( true );
break;
default:

View File

@ -1067,7 +1067,7 @@ bool PCB_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType )
// Extract a footprint library from the design and add it to the fp-lib-table
wxString newLibPath;
HarvestFootprintsToLibrary( true, newfilename.GetName(), &newLibPath );
ExportFootprintsToLibrary( true, newfilename.GetName(), &newLibPath );
if( newLibPath.Length() > 0 )
{

View File

@ -609,12 +609,12 @@ bool FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary( const LIB_ID& aFPID, bool aC
}
void PCB_EDIT_FRAME::HarvestFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName,
wxString* aLibPath )
void PCB_EDIT_FRAME::ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName,
wxString* aLibPath )
{
if( GetBoard()->GetFirstFootprint() == NULL )
{
DisplayInfoMessage( this, _( "No footprints to harvest!" ) );
DisplayInfoMessage( this, _( "No footprints to export!" ) );
return;
}

View File

@ -149,6 +149,17 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
submenuExport->Add( _( "Hyperlynx..." ), "",
ID_GEN_EXPORT_FILE_HYPERLYNX, export_step_xpm );
submenuExport->AppendSeparator();
submenuExport->Add( _( "Export Footprints to Library..." ),
_( "Add footprints used on board to an existing footprint library\n"
"(does not remove other footprints from this library)" ),
ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY, library_archive_xpm );
submenuExport->Add( _( "Export Footprints to New Library..." ),
_( "Create a new footprint library containing the footprints used on board\n"
"(if the library already exists it will be replaced)" ),
ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY, library_archive_as_xpm );
fileMenu->Add( submenuExport );
// Fabrication Outputs submenu
@ -377,17 +388,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
toolsMenu->Add( PCB_ACTIONS::removeUnusedPads );
toolsMenu->Add( PCB_ACTIONS::repairBoard );
toolsMenu->AppendSeparator();
toolsMenu->Add( _( "&Harvest Footprints to Library..." ),
_( "Add footprints used on board to an existing footprint library\n"
"(does not remove other footprints from this library)" ),
ID_MENU_HARVEST_FOOTPRINTS_TO_LIBRARY, library_archive_xpm );
toolsMenu->Add( _( "&Harvest Footprints to New Library..." ),
_( "Create a new footprint library containing the footprints used on board\n"
"(if the library already exists it will be replaced)" ),
ID_MENU_HARVEST_FOOTPRINTS_TO_NEW_LIBRARY, library_archive_as_xpm );
#if defined(KICAD_SCRIPTING_WXPYTHON)
toolsMenu->AppendSeparator();
toolsMenu->Add( PCB_ACTIONS::showPythonConsole );

View File

@ -128,8 +128,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_GEN_EXPORT_FILE_STEP, PCB_EDIT_FRAME::OnExportSTEP )
EVT_MENU( ID_GEN_EXPORT_FILE_HYPERLYNX, PCB_EDIT_FRAME::OnExportHyperlynx )
EVT_MENU( ID_MENU_HARVEST_FOOTPRINTS_TO_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_HARVEST_FOOTPRINTS_TO_NEW_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit )
EVT_MENU( wxID_CLOSE, PCB_EDIT_FRAME::OnQuit )

View File

@ -616,7 +616,7 @@ public:
void RecreateCmpFileFromBoard( wxCommandEvent& aEvent );
/**
* Function HarvestFootprintsToLibrary
* Function ExportFootprintsToLibrary
* Save footprints in a library:
* @param aStoreInNewLib:
* true : save footprints in a existing lib. Existing footprints will be kept
@ -629,8 +629,8 @@ public:
* optional library name to create, stops dialog call.
* must be called with aStoreInNewLib as true
*/
void HarvestFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName = wxEmptyString,
wxString* aLibPath = NULL );
void ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName = wxEmptyString,
wxString* aLibPath = NULL );
/**
* Function RecreateBOMFileFromBoard

View File

@ -78,8 +78,8 @@ enum pcbnew_ids
ID_POPUP_PCB_SELECT_WIDTH_END_RANGE,
ID_MENU_RECOVER_BOARD_AUTOSAVE,
ID_MENU_HARVEST_FOOTPRINTS_TO_LIBRARY,
ID_MENU_HARVEST_FOOTPRINTS_TO_NEW_LIBRARY,
ID_MENU_EXPORT_FOOTPRINTS_TO_LIBRARY,
ID_MENU_EXPORT_FOOTPRINTS_TO_NEW_LIBRARY,
ID_GEN_EXPORT_FILE_IDF3,
ID_GEN_EXPORT_FILE_VRML,

View File

@ -301,11 +301,11 @@ bool ImportSpecctraSES( wxString& aFullFilename )
}
bool HarvestFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName, wxString* aLibPath )
bool ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName, wxString* aLibPath )
{
if( s_PcbEditFrame )
{
s_PcbEditFrame->HarvestFootprintsToLibrary( aStoreInNewLib, aLibName, aLibPath );
s_PcbEditFrame->ExportFootprintsToLibrary( aStoreInNewLib, aLibName, aLibPath );
return true;
}
else

View File

@ -98,7 +98,7 @@ bool ExportVRML( const wxString& aFullFileName, double aMMtoWRMLunit,
bool ImportSpecctraSES( wxString& aFullFilename );
/**
* Function HarvestFootprintsToLibrary
* Function ExportFootprintsToLibrary
* Save footprints in a library:
* @param aStoreInNewLib:
* true : save footprints in a existing lib. Existing footprints will be kept
@ -111,8 +111,8 @@ bool ImportSpecctraSES( wxString& aFullFilename );
* optional library name to create, stops dialog call.
* must be called with aStoreInNewLib as true
*/
bool HarvestFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName = wxEmptyString,
wxString* aLibPath = NULL );
bool ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName = wxEmptyString,
wxString* aLibPath = NULL );
/**
* Update the board display after modifying it by a python script