diff --git a/gerbview/class_gerber_draw_item.cpp b/gerbview/class_gerber_draw_item.cpp index 653c5c0b56..6cea3a714d 100644 --- a/gerbview/class_gerber_draw_item.cpp +++ b/gerbview/class_gerber_draw_item.cpp @@ -1,8 +1,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2016 - * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2017 + * Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -502,7 +502,7 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) msg = ShowGBRShape(); aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) ); - // Display D_Code value: + // Display D_Code value with its attributes: msg.Printf( _( "D Code %d" ), m_DCode ); D_CODE* apertDescr = GetDcodeDescr(); @@ -513,9 +513,9 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) aList.push_back( MSG_PANEL_ITEM( msg, text, RED ) ); - // Display graphic layer number + // Display graphic layer name msg = GERBER_FILE_IMAGE_LIST::GetImagesList().GetDisplayName( GetLayer(), true ); - aList.push_back( MSG_PANEL_ITEM( _( "Graphic Layer" ), msg, BROWN ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Graphic Layer" ), msg, DARKGREEN ) ); // Display item rotation // The full rotation is Image rotation + m_lyrRotation @@ -550,6 +550,7 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) { net_msg = _( "Net:" ); net_msg << " "; + if( m_netAttributes.m_Netname.IsEmpty() ) net_msg << ""; else @@ -569,8 +570,7 @@ void GERBER_DRAW_ITEM::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) cmp_pad_msg << " " << m_netAttributes.m_Cmpref; } - - aList.push_back( MSG_PANEL_ITEM( net_msg, cmp_pad_msg, CYAN ) ); + aList.push_back( MSG_PANEL_ITEM( net_msg, cmp_pad_msg, DARKCYAN ) ); } diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 4c58679cee..e5abf7a504 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -28,12 +28,12 @@ #include #include +#include #include #include #include #include #include -//#include #include #include @@ -386,7 +386,6 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap ) UpdateConfig(); // set params and Save drill options m_parent->ClearMsgPanel(); - wxString defaultPath = Prj().AbsolutePath( m_plotOpts.GetOutputDirectory() ); WX_TEXT_CTRL_REPORTER reporter( m_messagesBox ); const PlotFormat filefmt[6] = @@ -400,6 +399,20 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap ) if( choice >= DIM( filefmt ) ) choice = 1; + // Create output directory if it does not exist (also transform it in + // absolute form). Bail if it fails + wxFileName outputDir = wxFileName::DirName( m_plotOpts.GetOutputDirectory() ); + wxString boardFilename = m_parent->GetBoard()->GetFileName(); + + if( !EnsureFileDirectoryExists( &outputDir, boardFilename, &reporter ) ) + { + wxString msg; + msg.Printf( _( "Could not write drill and/or map files to folder \"%s\"." ), + GetChars( outputDir.GetPath() ) ); + DisplayError( this, msg ); + return; + } + if( m_drillFileType == 0 ) { EXCELLON_WRITER excellonWriter( m_parent->GetBoard() ); @@ -408,7 +421,8 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap ) excellonWriter.SetOptions( m_Mirror, m_MinimalHeader, m_FileDrillOffset, m_Merge_PTH_NPTH ); excellonWriter.SetMapFileFormat( filefmt[choice] ); - excellonWriter.CreateDrillandMapFilesSet( defaultPath, aGenDrill, aGenMap, &reporter ); + excellonWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), + aGenDrill, aGenMap, &reporter ); } else { @@ -420,7 +434,8 @@ void DIALOG_GENDRILL::GenDrillAndMapFiles( bool aGenDrill, bool aGenMap ) gerberWriter.SetOptions( m_FileDrillOffset ); gerberWriter.SetMapFileFormat( filefmt[choice] ); - gerberWriter.CreateDrillandMapFilesSet( defaultPath, aGenDrill, aGenMap, &reporter ); + gerberWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), + aGenDrill, aGenMap, &reporter ); } }