Pcbnew: fix error message on footprint ID load failure.

This commit is contained in:
Wayne Stambaugh 2015-09-22 13:05:07 -04:00
parent 0c92a8583a
commit 41242a5a00
3 changed files with 9 additions and 8 deletions

View File

@ -369,7 +369,7 @@ void KICAD_NETLIST_PARSER::parseComponent() throw( IO_ERROR, PARSE_ERROR, boost:
if( !footprint.IsEmpty() && fpid.Parse( footprint ) >= 0 ) if( !footprint.IsEmpty() && fpid.Parse( footprint ) >= 0 )
{ {
wxString error; wxString error;
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ), error.Printf( _( "invalid footprint ID in\nfile: <%s>\nline: %d\noffset: %d" ),
GetChars( CurSource() ), CurLineNumber(), CurOffset() ); GetChars( CurSource() ), CurLineNumber(), CurOffset() );
THROW_IO_ERROR( error ); THROW_IO_ERROR( error );

View File

@ -5,8 +5,8 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 1992-2011 Jean-Pierre Charras. * Copyright (C) 1992-2011 Jean-Pierre Charras.
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@verizon.net>. * Copyright (C) 2013-2015 Wayne Stambaugh <stambaughw@verizon.net>.
* Copyright (C) 1992-2011 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -170,7 +170,7 @@ bool CMP_READER::Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR )
COMPONENT* component = aNetlist->GetComponentByReference( reference ); COMPONENT* component = aNetlist->GetComponentByReference( reference );
// The corresponding component could no longer existing in the netlist. This // The corresponding component could no longer existing in the netlist. This
// can happed when it is removed from schematic and still exists in footprint // can happen when it is removed from schematic and still exists in footprint
// assignment list. This is an usual case during the life of a design. // assignment list. This is an usual case during the life of a design.
if( component ) if( component )
{ {
@ -179,7 +179,7 @@ bool CMP_READER::Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR )
if( !footprint.IsEmpty() && fpid.Parse( footprint ) >= 0 ) if( !footprint.IsEmpty() && fpid.Parse( footprint ) >= 0 )
{ {
wxString error; wxString error;
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d" ), error.Printf( _( "invalid footprint ID in\nfile: <%s>\nline: %d" ),
GetChars( m_lineReader->GetSource() ), GetChars( m_lineReader->GetSource() ),
m_lineReader->LineNumber() ); m_lineReader->LineNumber() );
@ -188,8 +188,8 @@ bool CMP_READER::Load( NETLIST* aNetlist ) throw( IO_ERROR, PARSE_ERROR )
// For checking purpose, store the existing FPID (if any) in the alternate fpid copy // For checking purpose, store the existing FPID (if any) in the alternate fpid copy
// if this existing FPID differs from the FPID read from the .cmp file. // if this existing FPID differs from the FPID read from the .cmp file.
// Cvpcb can ask for user to chose the right FPID. // CvPcb can ask for user to chose the right FPID.
// It happens if the FPIT was modified outside CvPcb. // It happens if the FPID was modified outside CvPcb.
if( fpid != component->GetFPID() && !component->GetFPID().empty() ) if( fpid != component->GetFPID() && !component->GetFPID().empty() )
component->SetAltFPID( component->GetFPID() ); component->SetAltFPID( component->GetFPID() );

View File

@ -2,6 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2012 CERN * Copyright (C) 2012 CERN
* Copyright (C) 2012-2015 KiCad Developers, see change_log.txt for contributors.
* @author Wayne Stambaugh <stambaughw@verizon.net> * @author Wayne Stambaugh <stambaughw@verizon.net>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -1670,7 +1671,7 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
if( !name.IsEmpty() && fpid.Parse( FromUTF8() ) >= 0 ) if( !name.IsEmpty() && fpid.Parse( FromUTF8() ) >= 0 )
{ {
wxString error; wxString error;
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ), error.Printf( _( "invalid footprint ID in\nfile: <%s>\nline: %d\noffset: %d" ),
GetChars( CurSource() ), CurLineNumber(), CurOffset() ); GetChars( CurSource() ), CurLineNumber(), CurOffset() );
THROW_IO_ERROR( error ); THROW_IO_ERROR( error );
} }