← Back to team overview

kicad-developers team mailing list archive

New BOARD File Format (*.kicad_pcb)

 

Guys,


Wayne & co.'s fabulous work on the new BOARD file format is now standard.


I have committed the changes necessary to use *.kicad_pcb as default.

This could a fairly disruptive change for some, but you can still load and save legacy
(*.brd) files.  The new format is *.kicad_pcb, called KiCad format.

How do you make the transition?

Well you control that entirely:

1) File Save.  When you "save" a BOARD now, this logic comes into play

        pcbFileName = aFileName;

        if( pcbFileName.GetExt() == LegacyPcbFileExtension )
            pluginType = IO_MGR::LEGACY;
        else
        {
            pluginType = IO_MGR::KICAD;
            pcbFileName.SetExt( KiCadPcbFileExtension );
        }



In otherwords, legacy stays in effect if it was in effect.


2) File Save As.  The default file format is *.kicad_pcb unless you use the dropdown box
near the OK Cancel button to select legacy.


3) When launching pcbnew from kicad project manager, the project manager looks for both
the *.brd and *.kicad_pcb files.

It follows this logic when deciding which one to give to pcbnew:


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

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

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



Give Wayne credit if you like it.

If you don't like it, well then submit a patch  :)


Thanks,

Dick




Follow ups

References