Commit 2080739f authored by jean-pierre charras's avatar jean-pierre charras

Pcbbnew: fix bug Bug #1172892 (bad drill map file names, when a point is used...

Pcbbnew: fix bug Bug #1172892  (bad drill map file names, when a point is used inside a board file name)
parent ec497d5d
...@@ -440,9 +440,10 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap) ...@@ -440,9 +440,10 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles(bool aGenDrill, bool aGenMap)
if( choice >= m_Choice_Drill_Map->GetCount() ) if( choice >= m_Choice_Drill_Map->GetCount() )
choice = 1; choice = 1;
fn.SetExt( wxEmptyString ); // Will be modified by GenDrillMap fn.SetExt( wxEmptyString ); // Will be added by GenDrillMap
wxString fullfilename = fn.GetFullPath() + wxT( "-drl_map" );
GenDrillMap( fn.GetFullPath(), excellonWriter, filefmt[choice] ); GenDrillMap( fullfilename, excellonWriter, filefmt[choice] );
} }
} }
...@@ -530,7 +531,7 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event ) ...@@ -530,7 +531,7 @@ void DIALOG_GENDRILL::OnGenReportFile( wxCommandEvent& event )
// Generate the drill map of the board // Generate the drill map of the board
void DIALOG_GENDRILL::GenDrillMap( const wxString aFileName, void DIALOG_GENDRILL::GenDrillMap( const wxString aFullFileNameWithoutExt,
EXCELLON_WRITER& aExcellonWriter, EXCELLON_WRITER& aExcellonWriter,
PlotFormat format ) PlotFormat format )
{ {
...@@ -574,11 +575,9 @@ void DIALOG_GENDRILL::GenDrillMap( const wxString aFileName, ...@@ -574,11 +575,9 @@ void DIALOG_GENDRILL::GenDrillMap( const wxString aFileName,
return; return;
} }
/* Init file name */ // Add file name extension
wxFileName fn = aFileName; wxString fullFilename = aFullFileNameWithoutExt;
fn.SetName( fn.GetName() + wxT( "-drl_map" ) ); fullFilename << wxT(".") << ext;
fn.SetExt( ext );
wxString fullFilename = fn.GetFullPath();
bool success = aExcellonWriter.GenDrillMapFile( fullFilename, bool success = aExcellonWriter.GenDrillMapFile( fullFilename,
m_parent->GetPageSettings(), m_parent->GetPageSettings(),
......
...@@ -228,11 +228,12 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset ) ...@@ -228,11 +228,12 @@ public: EXCELLON_WRITER( BOARD* aPcb, wxPoint aOffset )
/** /**
* Function GenDrillMapFile * Function GenDrillMapFile
* Plot a map of drill marks for holes. * Plot a map of drill marks for holes.
* @param aFullFileName : the name of this file (to plot it) * @param aFullFileNameWithoutExt : the full filename of the file to create,
* without extension (will be added accordint ti the format)
* @param aSheet : the paper sheet touse for plot * @param aSheet : the paper sheet touse for plot
* @param aFormat : one of the supported plot formats (see enum PlotFormat ) * @param aFormat : one of the supported plot formats (see enum PlotFormat )
*/ */
bool GenDrillMapFile( const wxString& aFullFileName, bool GenDrillMapFile( const wxString& aFullFileNameWithoutExt,
const PAGE_INFO& aSheet, const PAGE_INFO& aSheet,
PlotFormat aFormat ); PlotFormat aFormat );
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment