Commit 0224bc2f authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Fix but reading empty footprints in netlist. (fixes lp:1226283)

* Remove fp_lib token from board and s-expr netlist file format.
* Fix a bunch of Doxygen warnings.
* Remove some extra debug log messages.
parent 7de43e4a
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -1173,7 +1173,6 @@ bool EDA_APP::SetFootprintLibTablePath()
    if( m_commonSettings->Read( kicadFpLibPath, &path ) && wxFileName::DirExists( path ) )
    if( m_commonSettings->Read( kicadFpLibPath, &path ) && wxFileName::DirExists( path ) )
    {
    {
        wxSetEnv( wxT( "KISYSMOD" ), path );
        wxSetEnv( wxT( "KISYSMOD" ), path );
        wxLogDebug( wxT( "Setting $KISYSMOD=\"%s\"." ), GetChars( path ) );
        return true;
        return true;
    }
    }


@@ -1199,7 +1198,6 @@ bool EDA_APP::SetFootprintLibTablePath()


        if( modFileCount != 0 )
        if( modFileCount != 0 )
        {
        {
            wxLogDebug( wxT( "Setting $KISYSMOD=\"%s\"." ), GetChars( bestPath ) );
            wxSetEnv( wxT( "KISYSMOD" ), bestPath );
            wxSetEnv( wxT( "KISYSMOD" ), bestPath );
            return true;
            return true;
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -190,7 +190,7 @@ FOOTPRINT_INFO* FOOTPRINT_LIST::GetModuleInfo( const wxString & aFootprintName )
#if defined( USE_FP_LIB_TABLE )
#if defined( USE_FP_LIB_TABLE )
        FPID fpid;
        FPID fpid;


        wxCHECK_MSG( fpid.Parse( TO_UTF8( aFootprintName ) ) < 0, NULL,
        wxCHECK_MSG( fpid.Parse( aFootprintName ) < 0, NULL,
                     wxString::Format( wxT( "<%s> is not a valid FPID." ),
                     wxString::Format( wxT( "<%s> is not a valid FPID." ),
                                       GetChars( aFootprintName ) ) );
                                       GetChars( aFootprintName ) ) );


+0 −13
Original line number Original line Diff line number Diff line
@@ -103,7 +103,6 @@ void FP_LIB_TABLE::Parse( FP_LIB_TABLE_LEXER* in ) throw( IO_ERROR, PARSE_ERROR


        // After (name), remaining (lib) elements are order independent, and in
        // After (name), remaining (lib) elements are order independent, and in
        // some cases optional.
        // some cases optional.

        bool    sawType = false;
        bool    sawType = false;
        bool    sawOpts = false;
        bool    sawOpts = false;
        bool    sawDesc = false;
        bool    sawDesc = false;
@@ -460,11 +459,6 @@ bool FP_LIB_TABLE::ConvertFromLegacy( NETLIST& aNetList, const wxArrayString& aL
        }
        }
        else
        else
        {
        {
            wxLogDebug( wxT( "Found component %s footprint %s in legacy library <%s>." ),
                        GetChars( component->GetReference() ),
                        GetChars( GetChars( FROM_UTF8( component->GetFPID().Format().c_str() ) ) ),
                        GetChars( libPath ) );

            wxString libNickname;
            wxString libNickname;


            FP_LIB_TABLE* cur = this;
            FP_LIB_TABLE* cur = this;
@@ -481,9 +475,6 @@ bool FP_LIB_TABLE::ConvertFromLegacy( NETLIST& aNetList, const wxArrayString& aL
                      && uri.Find( wxChar( '/' ) ) >= 0 )
                      && uri.Find( wxChar( '/' ) ) >= 0 )
                        uri.Replace( wxT( "/"), wxT( "\\" ) );
                        uri.Replace( wxT( "/"), wxT( "\\" ) );


                    wxLogDebug( wxT( "Comparing legacy path <%s> to lib table path <%s>." ),
                                GetChars( libPath ), GetChars( uri ) );

                    if( uri == libPath )
                    if( uri == libPath )
                    {
                    {
                        libNickname = cur->rows[i].GetNickName();
                        libNickname = cur->rows[i].GetNickName();
@@ -537,8 +528,6 @@ bool FP_LIB_TABLE::LoadGlobalTable( FP_LIB_TABLE& aTable ) throw (IO_ERROR, PARS
    bool tableExists = true;
    bool tableExists = true;
    wxFileName fn = GetGlobalTableFileName();
    wxFileName fn = GetGlobalTableFileName();


    wxLogDebug( wxT( "Loading global footprint table file: %s" ), GetChars( fn.GetFullPath() ) );

    if( !fn.FileExists() )
    if( !fn.FileExists() )
    {
    {
        tableExists = false;
        tableExists = false;
@@ -548,8 +537,6 @@ bool FP_LIB_TABLE::LoadGlobalTable( FP_LIB_TABLE& aTable ) throw (IO_ERROR, PARS
        wxString fileName( wxT( "fp_global_table" ) );
        wxString fileName( wxT( "fp_global_table" ) );
        fileName = wxGetApp().FindLibraryPath( fileName );
        fileName = wxGetApp().FindLibraryPath( fileName );


        wxLogDebug( wxT( "Copying global footprint table from <%s>." ), GetChars( fileName ) );

        // The fallback is to create an empty global footprint table for the user to populate.
        // The fallback is to create an empty global footprint table for the user to populate.
        if( fileName.IsEmpty() || !::wxCopyFile( fileName, fn.GetFullPath(), false ) )
        if( fileName.IsEmpty() || !::wxCopyFile( fileName, fn.GetFullPath(), false ) )
        {
        {
+6 −0
Original line number Original line Diff line number Diff line
@@ -171,6 +171,12 @@ int FPID::Parse( const std::string& aId )
}
}




int FPID::Parse( const wxString& aId )
{
    return Parse( std::string( TO_UTF8( aId ) ) );
}


FPID::FPID( const std::string& aId ) throw( PARSE_ERROR )
FPID::FPID( const std::string& aId ) throw( PARSE_ERROR )
{
{
    int offset = Parse( aId );
    int offset = Parse( aId );
+0 −1
Original line number Original line Diff line number Diff line
@@ -12,7 +12,6 @@ fields
footprint
footprint
footprints
footprints
fp
fp
fp_lib
lib
lib
libpart
libpart
libparts
libparts
Loading