Add Gerbers to Fabrication Outputs menu.

Fixes: lp:1817124
* https://bugs.launchpad.net/kicad/+bug/1817124
This commit is contained in:
Jeff Young 2019-03-08 20:02:48 +00:00
parent ea43866563
commit e563184eac
2 changed files with 31 additions and 10 deletions

View File

@ -833,8 +833,8 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
//----- Import submenu ------------------------------------------------------ //----- Import submenu ------------------------------------------------------
wxMenu* submenuImport = new wxMenu(); wxMenu* submenuImport = new wxMenu();
AddMenuItem( aParentMenu, ID_GET_NETLIST, AddMenuItem( submenuImport, ID_GET_NETLIST,
_( "Import &Netlist..." ), _( "&Netlist..." ),
_( "Read netlist and update board connectivity" ), _( "Read netlist and update board connectivity" ),
KiBitmap( netlist_xpm ) ); KiBitmap( netlist_xpm ) );
@ -844,7 +844,7 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
KiBitmap( import_xpm ) ); KiBitmap( import_xpm ) );
AddMenuItem( submenuImport, ID_GEN_IMPORT_GRAPHICS_FILE, AddMenuItem( submenuImport, ID_GEN_IMPORT_GRAPHICS_FILE,
_( "Import &Graphics..." ), _( "&Graphics..." ),
_( "Import 2D Drawing file to Pcbnew on Drawings layer" ), _( "Import 2D Drawing file to Pcbnew on Drawings layer" ),
KiBitmap( import_xpm ) ); KiBitmap( import_xpm ) );
@ -864,18 +864,23 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
//----- Fabrication Outputs submenu ----------------------------------------- //----- Fabrication Outputs submenu -----------------------------------------
wxMenu* fabricationOutputsMenu = new wxMenu; wxMenu* fabricationOutputsMenu = new wxMenu;
AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE, AddMenuItem( fabricationOutputsMenu, ID_GEN_PLOT_GERBER,
_( "Footprint &Position (.pos) File..." ), _( "&Gerbers (.gbr)..." ),
_( "Generate footprint position file for pick and place" ), _( "Generate Gerbers for fabrication" ),
KiBitmap( post_compo_xpm ) ); KiBitmap( post_compo_xpm ) );
AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE, AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
_( "&Drill (.drl) File..." ), _( "&Drill Files (.drl)..." ),
_( "Generate excellon2 drill file" ), _( "Generate excellon2 drill file(s)" ),
KiBitmap( post_drill_xpm ) ); KiBitmap( post_drill_xpm ) );
AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
_( "Footprint &Positions (.pos)..." ),
_( "Generate footprint position file for pick and place" ),
KiBitmap( post_compo_xpm ) );
AddMenuItem( fabricationOutputsMenu, ID_GEN_EXPORT_FILE_MODULE_REPORT, AddMenuItem( fabricationOutputsMenu, ID_GEN_EXPORT_FILE_MODULE_REPORT,
_( "&Footprint (.rpt) Report..." ), _( "&Footprint Report (.rpt)..." ),
_( "Create report of all footprints from current board" ), _( "Create report of all footprints from current board" ),
KiBitmap( tools_xpm ) ); KiBitmap( tools_xpm ) );
@ -885,7 +890,7 @@ void prepareFilesMenu( wxMenu* aParentMenu, bool aIsOutsideProject )
KiBitmap( netlist_xpm ) ); KiBitmap( netlist_xpm ) );
AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD, AddMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
_( "&BOM File..." ), _( "&BOM..." ),
_( "Create bill of materials from current schematic" ), _( "Create bill of materials from current schematic" ),
KiBitmap( bom_xpm ) ); KiBitmap( bom_xpm ) );

View File

@ -121,6 +121,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, PCB_EDIT_FRAME::OnFileHistory ) EVT_MENU_RANGE( ID_FILE1, ID_FILEMAX, PCB_EDIT_FRAME::OnFileHistory )
EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter ) EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter )
EVT_MENU( ID_GEN_PLOT_GERBER, PCB_EDIT_FRAME::ToPlotter )
EVT_MENU( ID_GEN_EXPORT_SPECCTRA, PCB_EDIT_FRAME::ExportToSpecctra ) EVT_MENU( ID_GEN_EXPORT_SPECCTRA, PCB_EDIT_FRAME::ExportToSpecctra )
EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, PCB_EDIT_FRAME::ExportToGenCAD ) EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, PCB_EDIT_FRAME::ExportToGenCAD )
@ -1098,8 +1099,23 @@ void PCB_EDIT_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent )
syncRenderStates(); syncRenderStates();
} }
void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event ) void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event )
{ {
PCB_PLOT_PARAMS plotSettings = GetPlotSettings();
switch( event.GetId() )
{
case ID_GEN_PLOT_GERBER: plotSettings.SetFormat( PLOT_FORMAT_GERBER ); break;
case ID_GEN_PLOT_DXF: plotSettings.SetFormat( PLOT_FORMAT_DXF ); break;
case ID_GEN_PLOT_HPGL: plotSettings.SetFormat( PLOT_FORMAT_HPGL ); break;
case ID_GEN_PLOT_PDF: plotSettings.SetFormat( PLOT_FORMAT_PDF ); break;
case ID_GEN_PLOT_PS: plotSettings.SetFormat( PLOT_FORMAT_POST ); break;
case ID_GEN_PLOT_SVG: wxFAIL_MSG( "Should have gone to ExportSVG()" ); break;
}
SetPlotSettings( plotSettings );
// Force rebuild the dialog if currently open because the old dialog can be not up to date // Force rebuild the dialog if currently open because the old dialog can be not up to date
// if the board (or units) has changed // if the board (or units) has changed
wxWindow* dlg = wxWindow::FindWindowByName( DLG_WINDOW_NAME ); wxWindow* dlg = wxWindow::FindWindowByName( DLG_WINDOW_NAME );