BOM Generator: redirect BOM buttons to new exporter

Also add legacy generator menu item.
This commit is contained in:
Mike Williams 2023-09-20 11:12:03 -04:00
parent 9541e45502
commit 398a336d91
7 changed files with 27 additions and 0 deletions

View File

@ -1153,6 +1153,12 @@ BOM_FMT_PRESET DIALOG_SYMBOL_FIELDS_TABLE::GetCurrentBomFmtSettings()
}
void DIALOG_SYMBOL_FIELDS_TABLE::ShowExportTab()
{
m_nbPages->SetSelection( 1 );
}
void DIALOG_SYMBOL_FIELDS_TABLE::OnOutputFileBrowseClicked( wxCommandEvent& event )
{
// Build the absolute path of current output directory to preselect it in the file browser.

View File

@ -48,6 +48,8 @@ public:
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
void ShowExportTab();
private:
void SetupColumnProperties( int aCol );
void SetupAllColumnProperties();

View File

@ -288,6 +288,7 @@ void SCH_EDIT_FRAME::doReCreateMenuBar()
toolsMenu->AppendSeparator();
toolsMenu->Add( EE_ACTIONS::assignFootprints );
toolsMenu->Add( EE_ACTIONS::generateBOM );
toolsMenu->Add( EE_ACTIONS::generateBOMLegacy );
toolsMenu->AppendSeparator();
update = toolsMenu->Add( ACTIONS::updateSchematicFromPcb );

View File

@ -1047,6 +1047,13 @@ TOOL_ACTION EE_ACTIONS::generateBOM( TOOL_ACTION_ARGS()
.Tooltip( _( "Generate a bill of materials for the current schematic" ) )
.Icon( BITMAPS::post_bom ) );
TOOL_ACTION EE_ACTIONS::generateBOMLegacy( TOOL_ACTION_ARGS()
.Name( "eeschema.EditorControl.generateBOMLegacy" )
.Scope( AS_GLOBAL )
.MenuText( _( "Generate BOM (Legacy)..." ) )
.Tooltip( _( "Generate a bill of materials for the current schematic (Legacy Generator)" ) )
);
TOOL_ACTION EE_ACTIONS::exportSymbolsToLibrary( TOOL_ACTION_ARGS()
.Name( "eeschema.EditorControl.exportSymbolsToLibrary" )
.Scope( AS_GLOBAL )

View File

@ -173,6 +173,7 @@ public:
static TOOL_ACTION importFPAssignments;
static TOOL_ACTION exportNetlist;
static TOOL_ACTION generateBOM;
static TOOL_ACTION generateBOMLegacy;
static TOOL_ACTION addSymbolToSchematic;
static TOOL_ACTION exportSymbolsToLibrary;
static TOOL_ACTION exportSymbolsToNewLibrary;

View File

@ -2112,6 +2112,14 @@ int SCH_EDITOR_CONTROL::ExportNetlist( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::GenerateBOM( const TOOL_EVENT& aEvent )
{
EditSymbolFields( aEvent );
m_frame->GetSymbolFieldsTableDialog()->ShowExportTab();
return 0;
}
int SCH_EDITOR_CONTROL::GenerateBOMLegacy( const TOOL_EVENT& aEvent )
{
InvokeDialogCreateBOM( m_frame );
return 0;
@ -2462,6 +2470,7 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::UpdateFromPCB, ACTIONS::updateSchematicFromPcb.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ExportNetlist, EE_ACTIONS::exportNetlist.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::GenerateBOM, EE_ACTIONS::generateBOM.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::GenerateBOMLegacy, EE_ACTIONS::generateBOMLegacy.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::DrawSheetOnClipboard, EE_ACTIONS::drawSheetOnClipboard.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ShowSearch, EE_ACTIONS::showSearch.MakeEvent() );

View File

@ -121,6 +121,7 @@ public:
int ImportFPAssignments( const TOOL_EVENT& aEvent );
int ExportNetlist( const TOOL_EVENT& aEvent );
int GenerateBOM( const TOOL_EVENT& aEvent );
int GenerateBOMLegacy( const TOOL_EVENT& aEvent );
int DrawSheetOnClipboard( const TOOL_EVENT& aEvent );
int ShowSearch( const TOOL_EVENT& aEvent );