Commit 79b48462 authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

Switch over to *.kicad_pcb format as the default BOARD format.

Add KiCadPcbFileExt global.
parent 312254bc
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -44,7 +44,10 @@ const wxString NetlistFileExtension( wxT( "net" ) );
const wxString LegacyFootprintLibPathExtension( wxT( "mod" ) );
const wxString ComponentFileExtension( wxT( "cmp" ) );
const wxString GerberFileExtension( wxT( "pho" ) );
const wxString PcbFileExtension( wxT( "brd" ) );

const wxString LegacyPcbFileExtension( wxT( "brd" ) );
const wxString KiCadPcbFileExtension( wxT( "kicad_pcb" ) );

const wxString PdfFileExtension( wxT( "pdf" ) );
const wxString MacrosFileExtension( wxT( "mcr" ) );
const wxString DrillFileExtension( wxT( "drl" ) );
+4 −2
Original line number Diff line number Diff line
@@ -1666,19 +1666,21 @@ void TITLE_BLOCK::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aCont
    throw( IO_ERROR )
{
    // Don't write the title block information if there is nothing to write.
    if(  !m_title.IsEmpty() || !m_date.IsEmpty() || !m_revision.IsEmpty()
    if(  !m_title.IsEmpty() || /* !m_date.IsEmpty() || */ !m_revision.IsEmpty()
      || !m_company.IsEmpty() || !m_comment1.IsEmpty() || !m_comment2.IsEmpty()
      || !m_comment3.IsEmpty() || !m_comment4.IsEmpty()  )
    {
        aFormatter->Print( aNestLevel, "(title_block\n" );
        aFormatter->Print( aNestLevel, "(title_block " );

        if( !m_title.IsEmpty() )
            aFormatter->Print( aNestLevel+1, "(title %s)\n",
                               aFormatter->Quotew( m_title ).c_str() );

        /* version control users were complaining, see mailing list.
        if( !m_date.IsEmpty() )
            aFormatter->Print( aNestLevel+1, "(date %s)\n",
                               aFormatter->Quotew( m_date ).c_str() );
        */

        if( !m_revision.IsEmpty() )
            aFormatter->Print( aNestLevel+1, "(rev %s)\n",
+5 −1
Original line number Diff line number Diff line
@@ -51,7 +51,11 @@ extern const wxString ProjectFileExtension;
extern const wxString SchematicFileExtension;
extern const wxString NetlistFileExtension;
extern const wxString GerberFileExtension;
extern const wxString PcbFileExtension;

extern const wxString LegacyPcbFileExtension;
extern const wxString KiCadPcbFileExtension;
#define PcbFileExtension    KiCadPcbFileExtension       // symlink choice

extern const wxString LegacyFootprintLibPathExtension;
extern const wxString PdfFileExtension;
extern const wxString MacrosFileExtension;
+9 −3
Original line number Diff line number Diff line
@@ -199,10 +199,16 @@ void KICAD_MANAGER_FRAME::OnRunPcbCalculator( wxCommandEvent& event )

void KICAD_MANAGER_FRAME::OnRunPcbNew( wxCommandEvent& event )
{
    wxFileName fn( m_ProjectFileName );
    wxFileName  legacy_board( m_ProjectFileName );
    wxFileName  kicad_board( m_ProjectFileName );

    legacy_board.SetExt( LegacyPcbFileExtension );
    kicad_board.SetExt( KiCadPcbFileExtension );

    fn.SetExt( PcbFileExtension );
    ExecuteFile( this, PCBNEW_EXE, QuoteFullPath( fn ) );
    if( !legacy_board.FileExists() || kicad_board.FileExists() )
        ExecuteFile( this, PCBNEW_EXE, QuoteFullPath( kicad_board ) );
    else
        ExecuteFile( this, PCBNEW_EXE, QuoteFullPath( legacy_board ) );
}


+2 −4
Original line number Diff line number Diff line
@@ -45,8 +45,6 @@
#include <wx/imaglist.h>
#include <menus_helpers.h>

// TODO: use the wxString defined in wildcards_and_files_ext.h, when exists
const wxString PcbSexpFileExtension( wxT("kicad_brd") );

/* Note about the tree project build process:
 * Building the tree project can be *very* long if there are a lot of subdirectories
@@ -419,11 +417,11 @@ wxString TREE_PROJECT_FRAME::GetFileExt( TreeFileType type )
        break;

    case TREE_LEGACY_PCB:
        ext = PcbFileExtension;
        ext = LegacyPcbFileExtension;
        break;

    case TREE_SEXP_PCB:
        ext = PcbSexpFileExtension;
        ext = KiCadPcbFileExtension;
        break;

    case TREE_GERBER:
Loading