ACTION-ize fab outputs.

This commit is contained in:
Jeff Young 2019-06-04 21:59:59 +01:00
parent 1ea5b04e22
commit 1222f3cc72
15 changed files with 282 additions and 304 deletions

View File

@ -1,7 +1,3 @@
/**
* @file dialog_gendrill.cpp
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
@ -35,15 +31,13 @@
#include <gendrill_Excellon_writer.h> #include <gendrill_Excellon_writer.h>
#include <gendrill_gerber_writer.h> #include <gendrill_gerber_writer.h>
#include <bitmaps.h> #include <bitmaps.h>
#include <tools/pcb_editor_control.h>
#include <class_board.h> #include <class_board.h>
#include <class_track.h> #include <class_track.h>
#include <class_module.h> #include <class_module.h>
#include <dialog_gendrill.h> #include <dialog_gendrill.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <reporter.h> #include <reporter.h>
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
@ -67,11 +61,11 @@ static DRILL_PRECISION precisionListForMetric( 3, 3 );
/* This function displays the dialog frame for drill tools /* This function displays the dialog frame for drill tools
*/ */
void PCB_EDIT_FRAME::InstallDrillFrame( wxCommandEvent& event ) int PCB_EDITOR_CONTROL::GenerateDrillFiles( const TOOL_EVENT& aEvent )
{ {
DIALOG_GENDRILL dlg( this, this ); DIALOG_GENDRILL dlg( frame(), frame() );
dlg.ShowModal(); dlg.ShowModal();
return 0;
} }

View File

@ -1,12 +1,7 @@
/**
* @file pcbnew/dialogs/dialog_netlist.cpp
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 1992-2017 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -150,6 +145,7 @@ void DIALOG_NETLIST::OnOpenNetlistClick( wxCommandEvent& event )
void DIALOG_NETLIST::OnUpdatePCB( wxCommandEvent& event ) void DIALOG_NETLIST::OnUpdatePCB( wxCommandEvent& event )
{ {
BOARD* pcb = m_parent->GetBoard();
wxFileName fn = m_NetlistFilenameCtrl->GetValue(); wxFileName fn = m_NetlistFilenameCtrl->GetValue();
if( !fn.IsOk() ) if( !fn.IsOk() )
@ -165,8 +161,8 @@ void DIALOG_NETLIST::OnUpdatePCB( wxCommandEvent& event )
} }
// Give the user a chance to bail out when making changes from a netlist. // Give the user a chance to bail out when making changes from a netlist.
if( m_parent->GetBoard()->IsEmpty() if( pcb->IsEmpty() || IsOK( this, _( "The changes made cannot be undone. "
|| IsOK( this, _( "The changes made cannot be undone. Are you sure you want to update the PCB?" ) ) ) "Are you sure you want to update the PCB?" ) ) )
{ {
m_MessageWindow->SetLabel( _( "Changes Applied To PCB" ) ); m_MessageWindow->SetLabel( _( "Changes Applied To PCB" ) );
loadNetlist( false ); loadNetlist( false );

View File

@ -111,10 +111,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
} }
break; break;
case ID_GET_NETLIST:
InstallNetlistFrame();
break;
case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER:
SetActiveLayer( ToLAYER_ID( m_SelLayerBox->GetLayerSelection() ) ); SetActiveLayer( ToLAYER_ID( m_SelLayerBox->GetLayerSelection() ) );

View File

@ -1,10 +1,7 @@
/**
* @file gen_modules_placefile.cpp
*/
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2015-2018 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2015-2019 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -39,17 +36,15 @@
#include <build_version.h> #include <build_version.h>
#include <macros.h> #include <macros.h>
#include <reporter.h> #include <reporter.h>
#include <tools/pcb_editor_control.h>
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <kiface_i.h> #include <kiface_i.h>
#include <wx_html_report_panel.h> #include <wx_html_report_panel.h>
#include <dialog_gen_footprint_position_file_base.h> #include <dialog_gen_footprint_position_file_base.h>
/* /*
* The ASCII format of the kicad place file is: * The ASCII format of the kicad place file is:
* ### Module positions - created on 04/12/2012 15:24:24 ### * ### Module positions - created on 04/12/2012 15:24:24 ###
@ -410,10 +405,11 @@ static bool HasNonSMDPins( MODULE* aModule )
return false; return false;
} }
void PCB_EDIT_FRAME::GenFootprintsPositionFile( wxCommandEvent& event ) int PCB_EDITOR_CONTROL::GeneratePosFile( const TOOL_EVENT& aEvent )
{ {
DIALOG_GEN_FOOTPRINT_POSITION dlg( this ); DIALOG_GEN_FOOTPRINT_POSITION dlg( frame() );
dlg.ShowModal(); dlg.ShowModal();
return 0;
} }
/* /*
@ -424,10 +420,8 @@ void PCB_EDIT_FRAME::GenFootprintsPositionFile( wxCommandEvent& event )
* if aFullFileName is empty, the file is not created, only the * if aFullFileName is empty, the file is not created, only the
* count of footprints to place is returned * count of footprints to place is returned
*/ */
int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
bool aUnitsMM, bool aForceSmdItems, int aSide, bool aFormatCSV )
bool aForceSmdItems, int aSide,
bool aFormatCSV )
{ {
// Minimal text lengths: // Minimal text lengths:
int lenRefText = 8; int lenRefText = 8;
@ -476,8 +470,8 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName,
} }
else else
{ {
DBG(printf( "skipping %s because its attribute is not CMS and it has non SMD pins\n", DBG( printf( "skipping %s because it is not marked CMS and has non-SMD pins\n",
TO_UTF8(footprint->GetReference()) ) ); TO_UTF8( footprint->GetReference() ) ) );
continue; continue;
} }
} }
@ -503,6 +497,7 @@ int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName,
return footprintCount; return footprintCount;
FILE * file = wxFopen( aFullFileName, wxT( "wt" ) ); FILE * file = wxFopen( aFullFileName, wxT( "wt" ) );
if( file == NULL ) if( file == NULL )
return -1; return -1;

View File

@ -117,10 +117,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
submenuImport->SetTitle( _( "Import" ) ); submenuImport->SetTitle( _( "Import" ) );
submenuImport->SetIcon( import_xpm ); submenuImport->SetIcon( import_xpm );
submenuImport->Add( _( "Netlist..." ), _( "Read netlist and update board connectivity" ), submenuImport->Add( PCB_ACTIONS::importNetlist );
ID_GET_NETLIST, netlist_xpm ); submenuImport->Add( PCB_ACTIONS::importSpecctraSession );
submenuImport->Add( _( "Specctra Session..." ), _( "Import routed Specctra session (*.ses) file" ),
ID_GEN_IMPORT_SPECCTRA_SESSION, import_xpm );
submenuImport->Add( _( "Graphics..." ), _( "Import 2D drawing file" ), submenuImport->Add( _( "Graphics..." ), _( "Import 2D drawing file" ),
ID_GEN_IMPORT_GRAPHICS_FILE, import_vector_xpm ); ID_GEN_IMPORT_GRAPHICS_FILE, import_vector_xpm );
@ -133,8 +131,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
submenuExport->SetTitle( _( "Export" ) ); submenuExport->SetTitle( _( "Export" ) );
submenuExport->SetIcon( export_xpm ); submenuExport->SetIcon( export_xpm );
submenuExport->Add( _( "Specctra DSN..." ), _( "Export Specctra DSN routing info" ), submenuExport->Add( PCB_ACTIONS::exportSpecctraDSN );
ID_GEN_EXPORT_SPECCTRA, export_dsn_xpm );
submenuExport->Add( _( "GenCAD..." ), _( "Export GenCAD board representation" ), submenuExport->Add( _( "GenCAD..." ), _( "Export GenCAD board representation" ),
ID_GEN_EXPORT_FILE_GENCADFORMAT, export_xpm ); ID_GEN_EXPORT_FILE_GENCADFORMAT, export_xpm );
submenuExport->Add( _( "VRML..." ), _( "Export VRML 3D board representation" ), submenuExport->Add( _( "VRML..." ), _( "Export VRML 3D board representation" ),
@ -159,32 +156,17 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
submenuFabOutputs->SetTitle( _( "Fabrication Outputs" ) ); submenuFabOutputs->SetTitle( _( "Fabrication Outputs" ) );
submenuFabOutputs->SetIcon( fabrication_xpm ); submenuFabOutputs->SetIcon( fabrication_xpm );
submenuFabOutputs->Add( _( "&Gerbers (.gbr)..." ), submenuFabOutputs->Add( PCB_ACTIONS::generateGerbers );
_( "Generate Gerbers for fabrication" ), submenuFabOutputs->Add( PCB_ACTIONS::generateDrillFiles );
ID_GEN_PLOT_GERBER, post_compo_xpm ); submenuFabOutputs->Add( PCB_ACTIONS::generatePosFile );
submenuFabOutputs->Add( _( "&Drill Files (.drl)..." ), submenuFabOutputs->Add( PCB_ACTIONS::generateReportFile );
_( "Generate Excellon drill file(s)" ), submenuFabOutputs->Add( PCB_ACTIONS::generateD356File );
ID_PCB_GEN_DRILL_FILE, post_drill_xpm ); submenuFabOutputs->Add( PCB_ACTIONS::generateBOM );
submenuFabOutputs->Add( _( "Footprint &Positions (.pos)..." ),
_( "Generate footprint position file for pick and place" ),
ID_PCB_GEN_POS_MODULES_FILE, post_compo_xpm );
submenuFabOutputs->Add( _( "&Footprint Report (.rpt)..." ),
_( "Create report of all footprints from current board" ),
ID_GEN_EXPORT_FILE_MODULE_REPORT, tools_xpm );
submenuFabOutputs->Add( _( "IPC-D-356 Netlist File..." ),
_( "Generate IPC-D-356 netlist file" ),
ID_PCB_GEN_D356_FILE, netlist_xpm );
submenuFabOutputs->Add( _( "&BOM..." ),
_( "Create bill of materials from current schematic" ),
ID_PCB_GEN_BOM_FILE_FROM_BOARD, bom_xpm );
fileMenu->AddMenu( submenuFabOutputs, SELECTION_CONDITIONS::ShowAlways ); fileMenu->AddMenu( submenuFabOutputs, SELECTION_CONDITIONS::ShowAlways );
fileMenu->AddSeparator(); fileMenu->AddSeparator();
fileMenu->AddItem( ID_BOARD_SETUP_DIALOG, fileMenu->AddItem( PCB_ACTIONS::boardSetup, SELECTION_CONDITIONS::ShowAlways );
_( "&Board Setup..." ),
_( "Edit board setup including layers, design rules and various defaults" ),
options_board_xpm, SELECTION_CONDITIONS::ShowAlways );
fileMenu->AddSeparator(); fileMenu->AddSeparator();
fileMenu->AddItem( ACTIONS::pageSettings, SELECTION_CONDITIONS::ShowAlways ); fileMenu->AddItem( ACTIONS::pageSettings, SELECTION_CONDITIONS::ShowAlways );

View File

@ -127,20 +127,12 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_IMPORT_NON_KICAD_BOARD, PCB_EDIT_FRAME::Files_io ) EVT_MENU( ID_IMPORT_NON_KICAD_BOARD, PCB_EDIT_FRAME::Files_io )
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_GERBER, PCB_EDIT_FRAME::ToPlotter )
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 )
EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT, PCB_EDIT_FRAME::GenFootprintsReport )
EVT_MENU( ID_GEN_EXPORT_FILE_VRML, PCB_EDIT_FRAME::OnExportVRML ) EVT_MENU( ID_GEN_EXPORT_FILE_VRML, PCB_EDIT_FRAME::OnExportVRML )
EVT_MENU( ID_GEN_EXPORT_FILE_IDF3, PCB_EDIT_FRAME::OnExportIDF3 ) EVT_MENU( ID_GEN_EXPORT_FILE_IDF3, PCB_EDIT_FRAME::OnExportIDF3 )
EVT_MENU( ID_GEN_EXPORT_FILE_STEP, PCB_EDIT_FRAME::OnExportSTEP ) 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_GEN_EXPORT_FILE_HYPERLYNX, PCB_EDIT_FRAME::OnExportHyperlynx )
EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,PCB_EDIT_FRAME::ImportSpecctraSession )
EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, PCB_EDIT_FRAME::ImportSpecctraDesign )
EVT_MENU( ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES, PCB_EDIT_FRAME::Process_Special_Functions )
@ -153,19 +145,11 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_GRID_SETTINGS, PCB_EDIT_FRAME::OnGridSettings ) EVT_MENU( ID_GRID_SETTINGS, PCB_EDIT_FRAME::OnGridSettings )
// menu Postprocess // menu Postprocess
EVT_MENU( ID_PCB_GEN_POS_MODULES_FILE, PCB_EDIT_FRAME::GenFootprintsPositionFile )
EVT_MENU( ID_PCB_GEN_DRILL_FILE, PCB_EDIT_FRAME::InstallDrillFrame )
EVT_MENU( ID_PCB_GEN_D356_FILE, PCB_EDIT_FRAME::GenD356File )
EVT_MENU( ID_PCB_GEN_CMP_FILE, PCB_EDIT_FRAME::RecreateCmpFileFromBoard ) EVT_MENU( ID_PCB_GEN_CMP_FILE, PCB_EDIT_FRAME::RecreateCmpFileFromBoard )
EVT_MENU( ID_PCB_GEN_BOM_FILE_FROM_BOARD, PCB_EDIT_FRAME::RecreateBOMFileFromBoard )
// Menu Get Design Rules Editor
EVT_MENU( ID_BOARD_SETUP_DIALOG, PCB_EDIT_FRAME::ShowBoardSetupDialog )
// Horizontal toolbar // Horizontal toolbar
EVT_TOOL( ID_RUN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( ID_RUN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( ID_GEN_PLOT_SVG, PCB_EDIT_FRAME::ExportSVG ) EVT_TOOL( ID_GEN_PLOT_SVG, PCB_EDIT_FRAME::ExportSVG )
EVT_TOOL( ID_GET_NETLIST, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event ) EVT_TOOL( ID_AUX_TOOLBAR_PCB_SELECT_AUTO_WIDTH, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event )
EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_COMBOBOX( ID_TOOLBARH_PCB_SELECT_LAYER, PCB_EDIT_FRAME::Process_Special_Functions )
@ -569,12 +553,6 @@ void PCB_EDIT_FRAME::ActivateGalCanvas()
} }
void PCB_EDIT_FRAME::ShowBoardSetupDialog( wxCommandEvent& event )
{
DoShowBoardSetupDialog();
}
void PCB_EDIT_FRAME::DoShowBoardSetupDialog( const wxString& aInitialPage, void PCB_EDIT_FRAME::DoShowBoardSetupDialog( const wxString& aInitialPage,
const wxString& aInitialParentPage ) const wxString& aInitialParentPage )
{ {
@ -917,20 +895,20 @@ void PCB_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
} }
void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event ) void PCB_EDIT_FRAME::ToPlotter( int aID )
{ {
PCB_PLOT_PARAMS plotSettings = GetPlotSettings(); PCB_PLOT_PARAMS plotSettings = GetPlotSettings();
switch( event.GetId() ) switch( aID )
{ {
case ID_GEN_PLOT_GERBER: plotSettings.SetFormat( PLOT_FORMAT_GERBER ); break; 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_DXF: plotSettings.SetFormat( PLOT_FORMAT_DXF ); break;
case ID_GEN_PLOT_HPGL: plotSettings.SetFormat( PLOT_FORMAT_HPGL ); 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_PDF: plotSettings.SetFormat( PLOT_FORMAT_PDF ); break;
case ID_GEN_PLOT_PS: plotSettings.SetFormat( PLOT_FORMAT_POST ); break; case ID_GEN_PLOT_PS: plotSettings.SetFormat( PLOT_FORMAT_POST ); break;
case ID_GEN_PLOT_SVG: wxFAIL_MSG( "Must be handled by ExportSVG()" ); break; case ID_GEN_PLOT: /* keep the previous setup */ break;
case ID_GEN_PLOT: default:
default: // called with no specified plot type: keep the previous setup wxFAIL_MSG( "ToPlotter(): unexpected plot type" ); break;
break; break;
} }

View File

@ -288,7 +288,7 @@ public:
* Function ToPlotter * Function ToPlotter
* Open a dialog frame to create plot and drill files relative to the current board. * Open a dialog frame to create plot and drill files relative to the current board.
*/ */
void ToPlotter( wxCommandEvent& event ); void ToPlotter( int aID );
/** /**
* Function SVG_Print * Function SVG_Print
@ -561,14 +561,6 @@ public:
void PrepareLayerIndicator(); void PrepareLayerIndicator();
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void OnFlipPcbView( wxCommandEvent& event );
/**
* Function GenFootprintsPositionFile
* Calls DoGenFootprintsPositionFile to create a footprint position file
* See DoGenFootprintsPositionFile for options and file format
*/
void GenFootprintsPositionFile( wxCommandEvent& event );
/** /**
* Function DoGenFootprintsPositionFile * Function DoGenFootprintsPositionFile
@ -604,7 +596,6 @@ public:
*/ */
bool DoGenFootprintsReport( const wxString& aFullFilename, bool aUnitsMM ); bool DoGenFootprintsReport( const wxString& aFullFilename, bool aUnitsMM );
void InstallDrillFrame( wxCommandEvent& event );
void GenD356File( wxCommandEvent& event ); void GenD356File( wxCommandEvent& event );
void OnFileHistory( wxCommandEvent& event ); void OnFileHistory( wxCommandEvent& event );
@ -801,13 +792,6 @@ public:
*/ */
void OnExportSTEP( wxCommandEvent& event ); void OnExportSTEP( wxCommandEvent& event );
/**
* Function ExporttoSPECCTRA
* Ask for a filename and call ExportSpecctraFile to export the current BOARD
* to a specctra dsn file.
*/
void ExportToSpecctra( wxCommandEvent& event );
/** /**
* Function ExportSpecctraFile * Function ExportSpecctraFile
* will export the current BOARD to a specctra dsn file. * will export the current BOARD to a specctra dsn file.
@ -817,15 +801,6 @@ public:
*/ */
bool ExportSpecctraFile( const wxString& aFullFilename ); bool ExportSpecctraFile( const wxString& aFullFilename );
/**
* Function ImportSpecctraSession
* will import a specctra *.ses file and use it to relocate MODULEs and
* to replace all vias and tracks in an existing and loaded BOARD.
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification.
*/
void ImportSpecctraSession( wxCommandEvent& event );
/** /**
* Function ImportSpecctraSession * Function ImportSpecctraSession
* will import a specctra *.ses file and use it to relocate MODULEs and * will import a specctra *.ses file and use it to relocate MODULEs and
@ -835,18 +810,6 @@ public:
*/ */
bool ImportSpecctraSession( const wxString& aFullFilename ); bool ImportSpecctraSession( const wxString& aFullFilename );
/**
* Function ImportSpecctraDesign
* will import a specctra *.dsn file and use it to replace an entire BOARD.
* The new board will not have any graphics, only components, tracks and
* vias.
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification.
*/
void ImportSpecctraDesign( wxCommandEvent& event );
void Swap_Layers( wxCommandEvent& event );
// Footprint editing (see also PCB_BASE_FRAME) // Footprint editing (see also PCB_BASE_FRAME)
void InstallFootprintPropertiesDialog( MODULE* Module ); void InstallFootprintPropertiesDialog( MODULE* Module );

View File

@ -109,11 +109,7 @@ enum pcbnew_ids
ID_GEN_EXPORT_FILE_VRML, ID_GEN_EXPORT_FILE_VRML,
ID_GEN_EXPORT_FILE_STEP, ID_GEN_EXPORT_FILE_STEP,
ID_GEN_EXPORT_FILE_HYPERLYNX, ID_GEN_EXPORT_FILE_HYPERLYNX,
ID_GEN_EXPORT_SPECCTRA,
ID_GEN_EXPORT_FILE_GENCADFORMAT, ID_GEN_EXPORT_FILE_GENCADFORMAT,
ID_GEN_EXPORT_FILE_MODULE_REPORT,
ID_GEN_IMPORT_SPECCTRA_SESSION,
ID_GEN_IMPORT_SPECCTRA_DESIGN,
ID_GEN_IMPORT_GRAPHICS_FILE, ID_GEN_IMPORT_GRAPHICS_FILE,
ID_TOOLBARH_PCB_ACTION_PLUGIN, ID_TOOLBARH_PCB_ACTION_PLUGIN,
@ -121,14 +117,9 @@ enum pcbnew_ids
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR, ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR,
ID_PCB_GEN_POS_MODULES_FILE,
ID_PCB_GEN_DRILL_FILE,
ID_PCB_GEN_D356_FILE,
ID_PCB_GEN_CMP_FILE, ID_PCB_GEN_CMP_FILE,
ID_PCB_GEN_BOM_FILE_FROM_BOARD, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
ID_PCB_3DSHAPELIB_WIZARD, ID_PCB_3DSHAPELIB_WIZARD,
ID_BOARD_SETUP_DIALOG,
ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR, ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR,
ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE, ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE,

View File

@ -3935,12 +3935,10 @@ public:
/** /**
* Function FromBOARD * Function FromBOARD
* adds the entire BOARD to the PCB but does not write it out. Note that * adds the entire BOARD to the PCB but does not write it out. Note that the BOARD given
* the BOARD given to this function must have all the MODULEs on the component * to this function must have all the MODULEs on the component side of the BOARD.
* side of the BOARD.
* *
* See void PCB_EDIT_FRAME::ExportToSpecctra( wxCommandEvent& event ) * See PCB_EDIT_FRAME::ExportToSpecctra() for an example before calling this function.
* for how this can be done before calling this function.
* *
* @param aBoard The BOARD to convert to a PCB. * @param aBoard The BOARD to convert to a PCB.
*/ */
@ -3948,9 +3946,9 @@ public:
/** /**
* Function FromSESSION * Function FromSESSION
* adds the entire SESSION info to a BOARD but does not write it out. The * adds the entire SESSION info to a BOARD but does not write it out. The BOARD given to
* the BOARD given to this function will have all its tracks and via's replaced, * this function will have all its tracks and via's replaced, and all its components are
* and all its components are subject to being moved. * subject to being moved.
* *
* @param aBoard The BOARD to merge the SESSION information into. * @param aBoard The BOARD to merge the SESSION information into.
*/ */

View File

@ -82,32 +82,6 @@ using namespace DSN;
static const double safetyMargin = 0.1; static const double safetyMargin = 0.1;
// see pcb_edit_frame.h
void PCB_EDIT_FRAME::ExportToSpecctra( wxCommandEvent& event )
{
wxString fullFileName;
wxString dsn_ext = SpecctraDsnFileExtension;
wxString mask = SpecctraDsnFileWildcard();
wxFileName fn( GetBoard()->GetFileName() );
fn.SetExt( dsn_ext );
fullFileName = EDA_FILE_SELECTOR( _( "Specctra DSN File" ),
fn.GetPath(),
fn.GetFullName(),
dsn_ext,
mask,
this,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
false );
if( fullFileName == wxEmptyString )
return;
ExportSpecctraFile( fullFileName );
}
bool PCB_EDIT_FRAME::ExportSpecctraFile( const wxString& aFullFilename ) bool PCB_EDIT_FRAME::ExportSpecctraFile( const wxString& aFullFilename )
{ {
SPECCTRA_DB db; SPECCTRA_DB db;

View File

@ -44,52 +44,10 @@
#include <class_drawsegment.h> #include <class_drawsegment.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
#include <view/view.h> #include <view/view.h>
#include "specctra.h" #include "specctra.h"
using namespace DSN; using namespace DSN;
void PCB_EDIT_FRAME::ImportSpecctraDesign( wxCommandEvent& event )
{
/* @todo write this someday
if( !Clear_Pcb( true ) )
return;
*/
}
void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
{
wxString fullFileName = GetBoard()->GetFileName();
wxString path;
wxString name;
wxString ext;
wxString sessionExt( wxT( ".ses" ) );
wxString mask = wxT( "*" ) + sessionExt;
wxFileName::SplitPath( fullFileName, &path, &name, &ext );
name += sessionExt;
fullFileName = EDA_FILE_SELECTOR( _( "Merge Specctra Session file:" ),
path,
name,
sessionExt,
mask,
this,
wxFD_OPEN,
false );
if( fullFileName == wxEmptyString )
{
return;
}
ImportSpecctraSession( fullFileName );
}
bool PCB_EDIT_FRAME::ImportSpecctraSession( const wxString& fullFileName ) bool PCB_EDIT_FRAME::ImportSpecctraSession( const wxString& fullFileName )
{ {
@ -108,10 +66,7 @@ bool PCB_EDIT_FRAME::ImportSpecctraSession( const wxString& fullFileName )
} }
catch( const IO_ERROR& ioe ) catch( const IO_ERROR& ioe )
{ {
wxString msg = _( wxString msg = _( "Board may be corrupted, do not save it.\n Fix problem and try again" );
"Board may be corrupted, do not save it.\n"
"Fix problem and try again"
);
wxString extra = ioe.What(); wxString extra = ioe.What();

View File

@ -245,7 +245,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->Add( ACTIONS::save ); m_mainToolBar->Add( ACTIONS::save );
KiScaledSeparator( m_mainToolBar, this ); KiScaledSeparator( m_mainToolBar, this );
ADD_TOOL( ID_BOARD_SETUP_DIALOG, options_board_xpm, _( "Board setup" ) ); m_mainToolBar->Add( PCB_ACTIONS::boardSetup );
KiScaledSeparator( m_mainToolBar, this ); KiScaledSeparator( m_mainToolBar, this );
m_mainToolBar->Add( ACTIONS::pageSettings ); m_mainToolBar->Add( ACTIONS::pageSettings );

View File

@ -253,6 +253,7 @@ public:
static TOOL_ACTION zoneDuplicate; static TOOL_ACTION zoneDuplicate;
// Global edit tool // Global edit tool
static TOOL_ACTION boardSetup;
static TOOL_ACTION editTracksAndVias; static TOOL_ACTION editTracksAndVias;
static TOOL_ACTION editTextAndGraphics; static TOOL_ACTION editTextAndGraphics;
static TOOL_ACTION globalDeletions; static TOOL_ACTION globalDeletions;
@ -263,6 +264,18 @@ public:
static TOOL_ACTION changeFootprints; static TOOL_ACTION changeFootprints;
static TOOL_ACTION swapLayers; static TOOL_ACTION swapLayers;
static TOOL_ACTION importNetlist;
static TOOL_ACTION importSpecctraSession;
static TOOL_ACTION exportSpecctraDSN;
static TOOL_ACTION generateGerbers;
static TOOL_ACTION generateDrillFiles;
static TOOL_ACTION generatePosFile;
static TOOL_ACTION generateReportFile;
static TOOL_ACTION generateD356File;
static TOOL_ACTION generateBOM;
static TOOL_ACTION listNets; static TOOL_ACTION listNets;
static TOOL_ACTION runDRC; static TOOL_ACTION runDRC;

View File

@ -63,10 +63,65 @@
#include <dialogs/dialog_page_settings.h> #include <dialogs/dialog_page_settings.h>
#include <pcb_netlist.h> #include <pcb_netlist.h>
#include <dialogs/dialog_update_pcb.h> #include <dialogs/dialog_update_pcb.h>
#include <gestfich.h>
#include <wildcards_and_files_ext.h>
using namespace std::placeholders; using namespace std::placeholders;
TOOL_ACTION PCB_ACTIONS::boardSetup( "pcbnew.EditorControl.boardSetup",
AS_GLOBAL, 0,
_( "Board Setup..." ),
_( "Edit board setup including layers, design rules and various defaults" ),
options_board_xpm );
TOOL_ACTION PCB_ACTIONS::importNetlist( "pcbnew.EditorControl.importNetlist",
AS_GLOBAL, 0,
_( "Netlist..." ), _( "Read netlist and update board connectivity" ),
netlist_xpm );
TOOL_ACTION PCB_ACTIONS::importSpecctraSession( "pcbnew.EditorControl.importSpecctraSession",
AS_GLOBAL, 0,
_( "Specctra Session..." ), _( "Import routed Specctra session (*.ses) file" ),
import_xpm );
TOOL_ACTION PCB_ACTIONS::exportSpecctraDSN( "pcbnew.EditorControl.exportSpecctraDSN",
AS_GLOBAL, 0,
_( "Specctra DSN..." ), _( "Export Specctra DSN routing info" ),
export_dsn_xpm );
TOOL_ACTION PCB_ACTIONS::generateGerbers( "pcbnew.EditorControl.generateGerbers",
AS_GLOBAL, 0,
_( "&Gerbers (.gbr)..." ), _( "Generate Gerbers for fabrication" ),
post_compo_xpm );
TOOL_ACTION PCB_ACTIONS::generateDrillFiles( "pcbnew.EditorControl.generateDrillFiles",
AS_GLOBAL, 0,
_( "&Drill Files (.drl)..." ), _( "Generate Excellon drill file(s)" ),
post_drill_xpm );
TOOL_ACTION PCB_ACTIONS::generatePosFile( "pcbnew.EditorControl.generatePosFile",
AS_GLOBAL, 0,
_( "Footprint &Positions (.pos)..." ),
_( "Generate footprint position file for pick and place" ),
post_compo_xpm );
TOOL_ACTION PCB_ACTIONS::generateReportFile( "pcbnew.EditorControl.generateReportFile",
AS_GLOBAL, 0,
_( "&Footprint Report (.rpt)..." ),
_( "Create report of all footprints from current board" ),
tools_xpm );
TOOL_ACTION PCB_ACTIONS::generateD356File( "pcbnew.EditorControl.generateD356File",
AS_GLOBAL, 0,
_( "IPC-D-356 Netlist File..." ), _( "Generate IPC-D-356 netlist file" ),
netlist_xpm );
TOOL_ACTION PCB_ACTIONS::generateBOM( "pcbnew.EditorControl.generateBOM",
AS_GLOBAL, 0,
_( "&BOM..." ), _( "Create bill of materials from current schematic" ),
bom_xpm );
// Track & via size control // Track & via size control
TOOL_ACTION PCB_ACTIONS::trackWidthInc( "pcbnew.EditorControl.trackWidthInc", TOOL_ACTION PCB_ACTIONS::trackWidthInc( "pcbnew.EditorControl.trackWidthInc",
AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_TRACK_WIDTH_TO_NEXT ), AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_SWITCH_TRACK_WIDTH_TO_NEXT ),
@ -434,8 +489,78 @@ int PCB_EDITOR_CONTROL::PageSettings( const TOOL_EVENT& aEvent )
int PCB_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent ) int PCB_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent )
{ {
wxCommandEvent evt( wxEVT_NULL, ID_GEN_PLOT ); m_frame->ToPlotter( ID_GEN_PLOT );
m_frame->ToPlotter( evt ); return 0;
}
int PCB_EDITOR_CONTROL::BoardSetup( const TOOL_EVENT& aEvent )
{
frame()->DoShowBoardSetupDialog();
return 0;
}
int PCB_EDITOR_CONTROL::ImportNetlist( const TOOL_EVENT& aEvent )
{
frame()->InstallNetlistFrame();
return 0;
}
int PCB_EDITOR_CONTROL::ImportSpecctraSession( const TOOL_EVENT& aEvent )
{
wxString fullFileName = frame()->GetBoard()->GetFileName();
wxString path;
wxString name;
wxString ext;
wxFileName::SplitPath( fullFileName, &path, &name, &ext );
name += wxT( ".ses" );
fullFileName = EDA_FILE_SELECTOR( _( "Merge Specctra Session file:" ), path, name,
wxT( ".ses" ), wxT( "*.ses" ), frame(), wxFD_OPEN, false );
if( !fullFileName.IsEmpty() )
frame()->ImportSpecctraSession( fullFileName );
return 0;
}
int PCB_EDITOR_CONTROL::ExportSpecctraDSN( const TOOL_EVENT& aEvent )
{
wxString fullFileName;
wxFileName fn( frame()->GetBoard()->GetFileName() );
fn.SetExt( SpecctraDsnFileExtension );
fullFileName = EDA_FILE_SELECTOR( _( "Specctra DSN File" ), fn.GetPath(), fn.GetFullName(),
SpecctraDsnFileExtension, SpecctraDsnFileWildcard(),
frame(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT, false );
if( !fullFileName.IsEmpty() )
frame()->ExportSpecctraFile( fullFileName );
return 0;
}
int PCB_EDITOR_CONTROL::GenerateFabFiles( const TOOL_EVENT& aEvent )
{
wxCommandEvent dummy;
if( aEvent.IsAction( &PCB_ACTIONS::generateGerbers ) )
m_frame->ToPlotter( ID_GEN_PLOT_GERBER );
else if( aEvent.IsAction( &PCB_ACTIONS::generateReportFile ) )
m_frame->GenFootprintsReport( dummy );
else if( aEvent.IsAction( &PCB_ACTIONS::generateD356File ) )
m_frame->GenD356File( dummy );
else if( aEvent.IsAction( &PCB_ACTIONS::generateBOM ) )
m_frame->RecreateBOMFileFromBoard( dummy );
else
wxFAIL_MSG( "GenerateFabFiles(): unexpected request" );
return 0; return 0;
} }
@ -472,7 +597,6 @@ int PCB_EDITOR_CONTROL::Find( const TOOL_EVENT& aEvent )
{ {
DIALOG_FIND dlg( m_frame ); DIALOG_FIND dlg( m_frame );
dlg.ShowModal(); dlg.ShowModal();
return 0; return 0;
} }
@ -1407,6 +1531,17 @@ void PCB_EDITOR_CONTROL::setTransitions()
Go( &PCB_EDITOR_CONTROL::PageSettings, ACTIONS::pageSettings.MakeEvent() ); Go( &PCB_EDITOR_CONTROL::PageSettings, ACTIONS::pageSettings.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() ); Go( &PCB_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::BoardSetup, PCB_ACTIONS::boardSetup.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ImportNetlist, PCB_ACTIONS::importNetlist.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ImportSpecctraSession, PCB_ACTIONS::importSpecctraSession.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::ExportSpecctraDSN, PCB_ACTIONS::exportSpecctraDSN.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::GenerateDrillFiles, PCB_ACTIONS::generateDrillFiles.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateGerbers.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::GeneratePosFile, PCB_ACTIONS::generatePosFile.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateReportFile.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateD356File.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateBOM.MakeEvent() );
Go( &PCB_EDITOR_CONTROL::Find, ACTIONS::find.MakeEvent() ); Go( &PCB_EDITOR_CONTROL::Find, ACTIONS::find.MakeEvent() );
// Track & via size control // Track & via size control

View File

@ -59,6 +59,14 @@ public:
int PageSettings( const TOOL_EVENT& aEvent ); int PageSettings( const TOOL_EVENT& aEvent );
int Plot( const TOOL_EVENT& aEvent ); int Plot( const TOOL_EVENT& aEvent );
int BoardSetup( const TOOL_EVENT& aEvent );
int ImportNetlist( const TOOL_EVENT& aEvent );
int ImportSpecctraSession( const TOOL_EVENT& aEvent );
int ExportSpecctraDSN( const TOOL_EVENT& aEvent );
int GenerateDrillFiles( const TOOL_EVENT& aEvent );
int GeneratePosFile( const TOOL_EVENT& aEvent );
int GenerateFabFiles( const TOOL_EVENT& aEvent );
int UpdatePCBFromSchematic( const TOOL_EVENT& aEvent ); int UpdatePCBFromSchematic( const TOOL_EVENT& aEvent );
int TogglePythonConsole( const TOOL_EVENT& aEvent ); int TogglePythonConsole( const TOOL_EVENT& aEvent );