diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp index 64244b7093..a758c384ea 100644 --- a/eeschema/dialogs/dialog_bom.cpp +++ b/eeschema/dialogs/dialog_bom.cpp @@ -32,18 +32,19 @@ #include #include #include -#include +#include #include #include -#include #include // for _HKI definition used in dialog_bom_help_md.h #include #include +#include #include +#include #include #include #include -#include +#include #include #include @@ -341,7 +342,7 @@ void DIALOG_BOM::OnRunGenerator( wxCommandEvent& event ) #endif if( m_parent->ReadyToNetlist( _( "Generating BOM requires a fully annotated schematic." ) ) ) - m_parent->WriteNetListFile( -1, fullfilename, GNL_OPT_BOM, &reporter ); + m_parent->WriteNetListFile( NET_TYPE_BOM, fullfilename, GNL_OPT_BOM, &reporter ); m_Messages->SetValue( reportmsg ); diff --git a/eeschema/netlist_exporters/netlist.h b/eeschema/netlist_exporters/netlist.h index 9043bb8bb3..6556ee1729 100644 --- a/eeschema/netlist_exporters/netlist.h +++ b/eeschema/netlist_exporters/netlist.h @@ -34,6 +34,7 @@ /// netlist types enum NETLIST_TYPE_ID { NET_TYPE_UNINIT = 0, + NET_TYPE_BOM, // Used by the BOM generator NET_TYPE_PCBNEW, NET_TYPE_ORCADPCB2, NET_TYPE_CADSTAR, diff --git a/eeschema/netlist_exporters/netlist_generator.cpp b/eeschema/netlist_exporters/netlist_generator.cpp index 3fb6ab8d14..7a418d1c58 100644 --- a/eeschema/netlist_exporters/netlist_generator.cpp +++ b/eeschema/netlist_exporters/netlist_generator.cpp @@ -81,6 +81,15 @@ bool SCH_EDIT_FRAME::WriteNetListFile( int aFormat, const wxString& aFullFileNam helper = new NETLIST_EXPORTER_PSPICE( sch ); break; + case NET_TYPE_BOM: + // When generating the BOM, we have a bare filename so don't strip + // the extension or you might string a '.' from the middle of the filename + fileName += wxT( "." GENERIC_INTERMEDIATE_NETLIST_EXT ); + + helper = new NETLIST_EXPORTER_XML( sch ); + executeCommandLine = true; + break; + default: { wxFileName tmpFile = fileName;