Commit 218fb338 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Pcbnew bug and warning fixes.

* Fixed a bug in PCB_EDIT_FRAME::loadFootprints when no footprint libraries
  are found when attempting to load footprints.
* Add a warning to PCB_EDIT_FRAME::loadFootprints to inform the user when
  a footprint library file cannot be found in any of the standard library
  search paths.
* Changed FOOTPRINT_INFO::m_padCount to unsigned to prevent signed/unsigned
  comparison compiler warnings.
* Put NestedSpace() function in netlist_reader.cpp inside conditional debug
  build statement to prevent warning in release builds.
parent f92cfcae
......@@ -23,7 +23,7 @@ public:
int m_Num; ///< Order number in the display list.
wxString m_Doc; ///< Footprint description.
wxString m_KeyWord; ///< Footprint key words.
int m_padCount; ///< Number of pads
unsigned m_padCount; ///< Number of pads
FOOTPRINT_INFO()
{
......@@ -80,7 +80,7 @@ public:
*/
void AddItem( FOOTPRINT_INFO* aItem )
{
m_List.push_back( aItem);
m_List.push_back( aItem );
}
/**
......
......@@ -188,7 +188,7 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
else
fpOnBoard = m_Pcb->FindModule( aNetlist.GetComponent( ii )->GetReference() );
loadFootprint = (fpOnBoard != NULL) &&
loadFootprint = (fpOnBoard == NULL) ||
(fpOnBoard->GetPath() != component->GetFootprintName());
if( loadFootprint && (component->GetFootprintName() != lastFootprintLibName) )
......@@ -203,7 +203,17 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
libPath = wxGetApp().FindLibraryPath( fn );
if( !libPath )
{
if( aReporter )
{
msg.Printf( _( "*** Warning: Cannot find footprint library file \"%s\" "
"in any of the standard KiCad library search paths. ***\n" ),
GetChars( fn.GetFullPath() ) );
aReporter->Report( msg );
}
continue;
}
module = pi->FootprintLoad( libPath, component->GetFootprintName() );
......@@ -238,7 +248,7 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
module = new MODULE( *module );
}
wxASSERT( module != NULL );
component->SetModule( module );
if( loadFootprint && module != NULL )
component->SetModule( module );
}
}
......@@ -37,6 +37,7 @@
#include <wx/regex.h>
#if defined(DEBUG)
/**
* Function NestedSpace
* outputs nested space for pretty indenting.
......@@ -53,7 +54,6 @@ static REPORTER& NestedSpace( int aNestLevel, REPORTER& aReporter )
}
#if defined(DEBUG)
void COMPONENT_NET::Show( int aNestLevel, REPORTER& aReporter )
{
NestedSpace( aNestLevel, aReporter );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment