Don't strip extensions twice in BOM export
Exporting the Bill of Materials uses the netlist exporter. Both of
these routines were stripping the extension, leading to projects like
"test.project.kicad_pro" having the project name stripped. We separate
the BOM netlist export from generic plugin netlist export to allow the
correct behavior when exporting netlists and generating BOMs
Fixes https://gitlab.com/kicad/code/kicad/issues/10270
(cherry picked from commit bef762e652
)
This commit is contained in:
parent
9ca41cc8ee
commit
30549a5e6a
|
@ -32,18 +32,19 @@
|
|||
#include <bom_plugins.h>
|
||||
#include <confirm.h>
|
||||
#include <dialog_bom_base.h>
|
||||
#include <string_utils.h>
|
||||
#include <dialogs/html_message_box.h>
|
||||
#include <eeschema_settings.h>
|
||||
#include <gestfich.h>
|
||||
#include <dialogs/html_message_box.h>
|
||||
#include <i18n_utility.h> // for _HKI definition used in dialog_bom_help_md.h
|
||||
#include <invoke_sch_dialog.h>
|
||||
#include <kiface_base.h>
|
||||
#include <netlist.h>
|
||||
#include <netlist_exporter_xml.h>
|
||||
#include <paths.h>
|
||||
#include <pgm_base.h>
|
||||
#include <reporter.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <paths.h>
|
||||
#include <string_utils.h>
|
||||
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/log.h>
|
||||
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue