2011-09-30 14:15:37 -04:00
|
|
|
/**
|
|
|
|
|
* @file pcbnew/netlist.cpp
|
|
|
|
|
*/
|
2012-01-26 10:37:36 +01:00
|
|
|
/*
|
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
|
*
|
2013-08-24 15:03:59 +02:00
|
|
|
* Copyright (C) 1992-2013 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
|
|
|
|
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
2016-11-20 18:35:08 -05:00
|
|
|
* Copyright (C) 2013-2016 Wayne Stambaugh <stambaughw@verizon.net>
|
2016-01-10 16:24:13 -05:00
|
|
|
* Copyright (C) 1992-2016 KiCad Developers, see change_log.txt for contributors.
|
2012-01-26 10:37:36 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2016-06-29 12:23:11 +02:00
|
|
|
#include <functional>
|
|
|
|
|
using namespace std::placeholders;
|
|
|
|
|
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <fctsys.h>
|
2014-03-19 19:42:08 -05:00
|
|
|
#include <pgm_base.h>
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <class_drawpanel.h>
|
2014-04-04 17:42:35 +02:00
|
|
|
#include <class_draw_panel_gal.h>
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <confirm.h>
|
|
|
|
|
#include <dialog_helpers.h>
|
2013-04-25 12:29:35 -04:00
|
|
|
#include <wxPcbStruct.h>
|
2013-09-14 16:33:22 -04:00
|
|
|
#include <pcb_netlist.h>
|
2013-04-25 12:29:35 -04:00
|
|
|
#include <netlist_reader.h>
|
|
|
|
|
#include <reporter.h>
|
|
|
|
|
#include <wildcards_and_files_ext.h>
|
2016-11-20 18:35:08 -05:00
|
|
|
#include <lib_id.h>
|
2013-05-28 12:54:59 -04:00
|
|
|
#include <fp_lib_table.h>
|
2013-04-25 12:29:35 -04:00
|
|
|
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <class_board.h>
|
|
|
|
|
#include <class_module.h>
|
2014-06-03 16:08:23 +02:00
|
|
|
#include <ratsnest_data.h>
|
2012-01-22 22:33:36 -06:00
|
|
|
#include <pcbnew.h>
|
2013-04-25 12:29:35 -04:00
|
|
|
#include <io_mgr.h>
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2015-04-07 18:31:37 +02:00
|
|
|
#include <tool/tool_manager.h>
|
|
|
|
|
#include <tools/common_actions.h>
|
2016-12-02 18:58:12 +01:00
|
|
|
#include <view/view.h>
|
2015-04-07 18:31:37 +02:00
|
|
|
|
2011-09-16 10:13:02 -04:00
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
|
|
|
|
|
const wxString& aCmpFileName,
|
|
|
|
|
REPORTER* aReporter,
|
|
|
|
|
bool aChangeFootprints,
|
|
|
|
|
bool aDeleteUnconnectedTracks,
|
2011-05-03 14:57:44 +02:00
|
|
|
bool aDeleteExtraFootprints,
|
2013-04-25 12:29:35 -04:00
|
|
|
bool aSelectByTimeStamp,
|
2013-08-24 10:08:55 +02:00
|
|
|
bool aDeleteSinglePadNets,
|
2013-04-25 12:29:35 -04:00
|
|
|
bool aIsDryRun )
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2013-04-25 12:29:35 -04:00
|
|
|
wxString msg;
|
|
|
|
|
NETLIST netlist;
|
2014-04-04 17:42:35 +02:00
|
|
|
KIGFX::VIEW* view = GetGalCanvas()->GetView();
|
2014-06-05 09:54:47 +02:00
|
|
|
BOARD* board = GetBoard();
|
2016-01-10 16:24:13 -05:00
|
|
|
std::vector<MODULE*> newFootprints;
|
2016-07-11 09:48:51 +02:00
|
|
|
// keep trace of the initial baord area, if we want to place new footprints
|
|
|
|
|
// outside the existinag board
|
2016-10-25 15:34:59 +02:00
|
|
|
EDA_RECT bbox = board->ComputeBoundingBox( false );
|
2007-08-20 19:33:15 +00:00
|
|
|
|
2013-08-23 08:38:57 +02:00
|
|
|
netlist.SetIsDryRun( aIsDryRun );
|
|
|
|
|
netlist.SetFindByTimeStamp( aSelectByTimeStamp );
|
|
|
|
|
netlist.SetDeleteExtraFootprints( aDeleteExtraFootprints );
|
|
|
|
|
netlist.SetReplaceFootprints( aChangeFootprints );
|
|
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
try
|
2009-04-24 07:36:36 +00:00
|
|
|
{
|
2016-05-29 17:02:34 +02:00
|
|
|
std::unique_ptr<NETLIST_READER> netlistReader( NETLIST_READER::GetNetlistReader(
|
2015-06-07 14:18:45 -04:00
|
|
|
&netlist, aNetlistFileName, aCmpFileName ) );
|
2011-09-16 10:13:02 -04:00
|
|
|
|
2015-06-07 14:18:45 -04:00
|
|
|
if( !netlistReader.get() )
|
2011-05-03 14:57:44 +02:00
|
|
|
{
|
2013-04-25 12:29:35 -04:00
|
|
|
msg.Printf( _( "Cannot open netlist file \"%s\"." ), GetChars( aNetlistFileName ) );
|
|
|
|
|
wxMessageBox( msg, _( "Netlist Load Error." ), wxOK | wxICON_ERROR, this );
|
|
|
|
|
return;
|
2011-05-03 14:57:44 +02:00
|
|
|
}
|
2012-01-26 10:37:36 +01:00
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
SetLastNetListRead( aNetlistFileName );
|
|
|
|
|
netlistReader->LoadNetlist();
|
2016-01-29 11:21:13 +01:00
|
|
|
LoadFootprints( netlist, aReporter );
|
2013-04-25 12:29:35 -04:00
|
|
|
}
|
2014-04-09 08:33:04 -05:00
|
|
|
catch( const IO_ERROR& ioe )
|
2013-04-25 12:29:35 -04:00
|
|
|
{
|
2016-09-14 17:36:45 -05:00
|
|
|
msg.Printf( _( "Error loading netlist.\n%s" ), ioe.What().GetData() );
|
2013-04-25 12:29:35 -04:00
|
|
|
wxMessageBox( msg, _( "Netlist Load Error" ), wxOK | wxICON_ERROR );
|
|
|
|
|
return;
|
2013-03-18 21:25:19 -04:00
|
|
|
}
|
2007-08-20 19:33:15 +00:00
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
// Clear undo and redo lists to avoid inconsistencies between lists
|
|
|
|
|
if( !netlist.IsDryRun() )
|
|
|
|
|
GetScreen()->ClearUndoRedoList();
|
2011-05-03 14:57:44 +02:00
|
|
|
|
2014-04-04 17:42:35 +02:00
|
|
|
if( !netlist.IsDryRun() )
|
|
|
|
|
{
|
|
|
|
|
// Remove old modules
|
2014-06-05 09:54:47 +02:00
|
|
|
for( MODULE* module = board->m_Modules; module; module = module->Next() )
|
2014-04-04 17:42:35 +02:00
|
|
|
{
|
2016-06-29 12:23:11 +02:00
|
|
|
module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view, _1 ) );
|
2014-04-04 17:42:35 +02:00
|
|
|
view->Remove( module );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-07 18:31:37 +02:00
|
|
|
// Clear selection, just in case a selected item has to be removed
|
|
|
|
|
m_toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
|
|
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
netlist.SortByReference();
|
2016-01-10 16:24:13 -05:00
|
|
|
board->ReplaceNetlist( netlist, aDeleteSinglePadNets, &newFootprints, aReporter );
|
2012-01-26 10:37:36 +01:00
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
// If it was a dry run, nothing has changed so we're done.
|
|
|
|
|
if( netlist.IsDryRun() )
|
|
|
|
|
return;
|
2012-02-01 20:49:37 +01:00
|
|
|
|
2016-01-10 16:24:13 -05:00
|
|
|
if( IsGalCanvasActive() )
|
|
|
|
|
{
|
2016-07-11 09:48:51 +02:00
|
|
|
SpreadFootprints( &newFootprints, false, false, GetCrossHairPosition() );
|
|
|
|
|
|
2016-02-01 19:43:28 -05:00
|
|
|
if( !newFootprints.empty() )
|
2016-01-10 16:24:13 -05:00
|
|
|
{
|
2016-06-29 16:07:55 -04:00
|
|
|
for( MODULE* footprint : newFootprints )
|
2016-02-01 19:43:28 -05:00
|
|
|
{
|
|
|
|
|
m_toolManager->RunAction( COMMON_ACTIONS::selectItem, true, footprint );
|
|
|
|
|
}
|
|
|
|
|
m_toolManager->InvokeTool( "pcbnew.InteractiveEdit" );
|
2016-01-10 16:24:13 -05:00
|
|
|
}
|
|
|
|
|
}
|
2016-07-11 09:48:51 +02:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
wxPoint placementAreaPosition;
|
|
|
|
|
|
|
|
|
|
// Place area to the left side of the board.
|
|
|
|
|
// if the board is empty, the bbox position is (0,0)
|
|
|
|
|
placementAreaPosition.x = bbox.GetEnd().x + Millimeter2iu( 10 );
|
|
|
|
|
placementAreaPosition.y = bbox.GetOrigin().y;
|
|
|
|
|
|
|
|
|
|
SpreadFootprints( &newFootprints, false, false, placementAreaPosition );
|
|
|
|
|
}
|
2016-01-10 16:24:13 -05:00
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
OnModify();
|
2013-03-18 21:25:19 -04:00
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
SetCurItem( NULL );
|
2011-05-03 14:57:44 +02:00
|
|
|
|
2014-04-04 17:42:35 +02:00
|
|
|
// Reload modules
|
2014-06-05 09:54:47 +02:00
|
|
|
for( MODULE* module = board->m_Modules; module; module = module->Next() )
|
2014-04-04 17:42:35 +02:00
|
|
|
{
|
2016-06-29 12:23:11 +02:00
|
|
|
module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) );
|
2014-06-03 16:08:23 +02:00
|
|
|
view->Add( module );
|
2014-04-04 17:42:35 +02:00
|
|
|
}
|
|
|
|
|
|
2014-06-05 09:54:47 +02:00
|
|
|
if( aDeleteUnconnectedTracks && board->m_Track )
|
2011-05-03 14:57:44 +02:00
|
|
|
{
|
2013-04-25 12:29:35 -04:00
|
|
|
// Remove erroneous tracks. This should probably pushed down to the #BOARD object.
|
|
|
|
|
RemoveMisConnectedTracks();
|
2011-05-03 14:57:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Rebuild the board connectivity:
|
2015-07-06 10:52:58 +02:00
|
|
|
Compile_Ratsnest( NULL, true );
|
|
|
|
|
board->GetRatsnest()->ProcessBoard();
|
2015-03-10 19:31:21 +01:00
|
|
|
|
2014-06-05 09:54:47 +02:00
|
|
|
SetMsgPanel( board );
|
2011-12-22 08:28:11 -05:00
|
|
|
m_canvas->Refresh();
|
2011-05-03 14:57:44 +02:00
|
|
|
}
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2013-04-25 12:29:35 -04:00
|
|
|
MODULE* PCB_EDIT_FRAME::ListAndSelectModuleName()
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2009-01-05 05:21:35 +00:00
|
|
|
if( GetBoard()->m_Modules == NULL )
|
2007-08-20 19:33:15 +00:00
|
|
|
{
|
2014-11-02 07:44:57 -05:00
|
|
|
DisplayError( this, _( "No footprints" ) );
|
2010-11-19 19:50:23 +01:00
|
|
|
return 0;
|
2007-08-20 19:33:15 +00:00
|
|
|
}
|
|
|
|
|
|
2010-11-19 19:50:23 +01:00
|
|
|
wxArrayString listnames;
|
2011-09-16 10:13:02 -04:00
|
|
|
|
2013-11-18 16:42:01 -06:00
|
|
|
MODULE* module;
|
|
|
|
|
|
|
|
|
|
for( module = GetBoard()->m_Modules; module; module = module->Next() )
|
|
|
|
|
listnames.Add( module->GetReference() );
|
2007-08-20 19:33:15 +00:00
|
|
|
|
2013-03-18 21:25:19 -04:00
|
|
|
wxArrayString headers;
|
2013-04-25 12:29:35 -04:00
|
|
|
headers.Add( wxT( "Module" ) );
|
2013-03-18 21:25:19 -04:00
|
|
|
std::vector<wxArrayString> itemsToDisplay;
|
2013-04-25 12:29:35 -04:00
|
|
|
|
2013-03-18 21:25:19 -04:00
|
|
|
// Conversion from wxArrayString to vector of ArrayString
|
|
|
|
|
for( unsigned i = 0; i < listnames.GetCount(); i++ )
|
|
|
|
|
{
|
|
|
|
|
wxArrayString item;
|
|
|
|
|
item.Add( listnames[i] );
|
|
|
|
|
itemsToDisplay.push_back( item );
|
|
|
|
|
}
|
2013-04-25 12:29:35 -04:00
|
|
|
|
2013-03-18 21:25:19 -04:00
|
|
|
EDA_LIST_DIALOG dlg( this, _( "Components" ), headers, itemsToDisplay, wxEmptyString );
|
2007-08-20 19:33:15 +00:00
|
|
|
|
2010-11-19 19:50:23 +01:00
|
|
|
if( dlg.ShowModal() != wxID_OK )
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
wxString ref = dlg.GetTextSelection();
|
2011-09-06 15:42:46 -04:00
|
|
|
|
2013-11-18 16:42:01 -06:00
|
|
|
for( module = GetBoard()->m_Modules; module; module = module->Next() )
|
2007-08-20 19:33:15 +00:00
|
|
|
{
|
2013-11-18 16:42:01 -06:00
|
|
|
if( module->GetReference() == ref )
|
2010-11-19 19:50:23 +01:00
|
|
|
break;
|
2007-08-20 19:33:15 +00:00
|
|
|
}
|
|
|
|
|
|
2013-11-18 16:42:01 -06:00
|
|
|
return module;
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
2007-08-20 19:33:15 +00:00
|
|
|
|
2013-11-01 19:24:38 -05:00
|
|
|
#define ALLOW_PARTIAL_FPID 1
|
|
|
|
|
|
2016-01-29 11:21:13 +01:00
|
|
|
void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
|
2013-05-28 12:54:59 -04:00
|
|
|
throw( IO_ERROR, PARSE_ERROR )
|
|
|
|
|
{
|
|
|
|
|
wxString msg;
|
2016-11-20 18:35:08 -05:00
|
|
|
LIB_ID lastFPID;
|
2013-05-28 12:54:59 -04:00
|
|
|
COMPONENT* component;
|
|
|
|
|
MODULE* module = 0;
|
|
|
|
|
MODULE* fpOnBoard;
|
|
|
|
|
|
2014-05-09 13:35:48 -05:00
|
|
|
if( aNetlist.IsEmpty() || Prj().PcbFootprintLibs()->IsEmpty() )
|
2013-05-28 12:54:59 -04:00
|
|
|
return;
|
|
|
|
|
|
2013-09-08 14:31:21 -04:00
|
|
|
aNetlist.SortByFPID();
|
2013-05-28 12:54:59 -04:00
|
|
|
|
|
|
|
|
for( unsigned ii = 0; ii < aNetlist.GetCount(); ii++ )
|
|
|
|
|
{
|
|
|
|
|
component = aNetlist.GetComponent( ii );
|
|
|
|
|
|
2013-11-01 19:24:38 -05:00
|
|
|
#if ALLOW_PARTIAL_FPID
|
|
|
|
|
// The FPID is ok as long as there is a footprint portion coming
|
|
|
|
|
// from eeschema.
|
2016-11-20 18:35:08 -05:00
|
|
|
if( !component->GetFPID().GetLibItemName().size() )
|
2013-11-01 19:24:38 -05:00
|
|
|
#else
|
2013-09-08 14:31:21 -04:00
|
|
|
if( component->GetFPID().empty() )
|
2013-11-01 19:24:38 -05:00
|
|
|
#endif
|
2013-06-15 12:55:51 -04:00
|
|
|
{
|
|
|
|
|
if( aReporter )
|
|
|
|
|
{
|
2013-11-01 19:24:38 -05:00
|
|
|
msg.Printf( _( "No footprint defined for component '%s'.\n" ),
|
2013-06-15 12:55:51 -04:00
|
|
|
GetChars( component->GetReference() ) );
|
2015-06-16 14:20:42 +02:00
|
|
|
aReporter->Report( msg, REPORTER::RPT_ERROR );
|
2013-06-15 12:55:51 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-28 12:54:59 -04:00
|
|
|
// Check if component footprint is already on BOARD and only load the footprint from
|
2013-11-01 19:24:38 -05:00
|
|
|
// the library if it's needed. Nickname can be blank.
|
2013-05-28 12:54:59 -04:00
|
|
|
if( aNetlist.IsFindByTimeStamp() )
|
|
|
|
|
fpOnBoard = m_Pcb->FindModule( aNetlist.GetComponent( ii )->GetTimeStamp(), true );
|
|
|
|
|
else
|
|
|
|
|
fpOnBoard = m_Pcb->FindModule( aNetlist.GetComponent( ii )->GetReference() );
|
|
|
|
|
|
2013-08-23 08:38:57 +02:00
|
|
|
bool footprintMisMatch = fpOnBoard &&
|
2013-09-08 14:31:21 -04:00
|
|
|
fpOnBoard->GetFPID() != component->GetFPID();
|
2013-08-23 08:38:57 +02:00
|
|
|
|
|
|
|
|
if( footprintMisMatch && !aNetlist.GetReplaceFootprints() )
|
|
|
|
|
{
|
|
|
|
|
if( aReporter )
|
|
|
|
|
{
|
2015-06-12 14:46:41 +02:00
|
|
|
msg.Printf( _( "* Warning: component '%s': board footprint '%s', netlist footprint '%s'\n" ),
|
2013-08-23 08:38:57 +02:00
|
|
|
GetChars( component->GetReference() ),
|
2014-08-31 18:19:07 +02:00
|
|
|
GetChars( fpOnBoard->GetFPID().Format() ),
|
|
|
|
|
GetChars( component->GetFPID().Format() ) );
|
2013-08-23 08:38:57 +02:00
|
|
|
aReporter->Report( msg );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !aNetlist.GetReplaceFootprints() )
|
|
|
|
|
footprintMisMatch = false;
|
|
|
|
|
|
|
|
|
|
bool loadFootprint = (fpOnBoard == NULL) || footprintMisMatch;
|
2013-05-28 12:54:59 -04:00
|
|
|
|
2013-09-08 14:31:21 -04:00
|
|
|
if( loadFootprint && (component->GetFPID() != lastFPID) )
|
2013-05-28 12:54:59 -04:00
|
|
|
{
|
|
|
|
|
module = NULL;
|
|
|
|
|
|
2013-11-01 19:24:38 -05:00
|
|
|
#if ALLOW_PARTIAL_FPID
|
2016-11-20 18:35:08 -05:00
|
|
|
// The LIB_ID is ok as long as there is a footprint portion coming
|
2013-11-01 19:24:38 -05:00
|
|
|
// the library if it's needed. Nickname can be blank.
|
2016-11-20 18:35:08 -05:00
|
|
|
if( !component->GetFPID().GetLibItemName().size() )
|
2013-11-01 19:24:38 -05:00
|
|
|
#else
|
2013-09-08 14:31:21 -04:00
|
|
|
if( !component->GetFPID().IsValid() )
|
2013-11-01 19:24:38 -05:00
|
|
|
#endif
|
2013-05-28 12:54:59 -04:00
|
|
|
{
|
|
|
|
|
if( aReporter )
|
|
|
|
|
{
|
2015-06-16 14:20:42 +02:00
|
|
|
msg.Printf( _( "Component '%s' footprint ID '%s' is not "
|
|
|
|
|
"valid.\n" ),
|
2013-05-28 12:54:59 -04:00
|
|
|
GetChars( component->GetReference() ),
|
2014-08-31 18:19:07 +02:00
|
|
|
GetChars( component->GetFPID().Format() ) );
|
2015-06-16 14:20:42 +02:00
|
|
|
aReporter->Report( msg, REPORTER::RPT_ERROR );
|
2013-05-28 12:54:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-01 19:24:38 -05:00
|
|
|
// loadFootprint() can find a footprint with an empty nickname in fpid.
|
2013-09-08 14:31:21 -04:00
|
|
|
module = PCB_BASE_FRAME::loadFootprint( component->GetFPID() );
|
2013-05-28 12:54:59 -04:00
|
|
|
|
|
|
|
|
if( module )
|
|
|
|
|
{
|
2013-09-08 14:31:21 -04:00
|
|
|
lastFPID = component->GetFPID();
|
2013-05-28 12:54:59 -04:00
|
|
|
}
|
2013-11-01 19:24:38 -05:00
|
|
|
else
|
2013-05-28 12:54:59 -04:00
|
|
|
{
|
|
|
|
|
if( aReporter )
|
|
|
|
|
{
|
2015-06-16 14:20:42 +02:00
|
|
|
msg.Printf( _( "Component '%s' footprint '%s' was not found in "
|
|
|
|
|
"any libraries in the footprint library table.\n" ),
|
2013-05-28 12:54:59 -04:00
|
|
|
GetChars( component->GetReference() ),
|
2016-11-20 18:35:08 -05:00
|
|
|
GetChars( component->GetFPID().GetLibItemName() ) );
|
2015-06-16 14:20:42 +02:00
|
|
|
aReporter->Report( msg, REPORTER::RPT_ERROR );
|
2013-05-28 12:54:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Footprint already loaded from a library, duplicate it (faster)
|
|
|
|
|
if( module == NULL )
|
|
|
|
|
continue; // Module does not exist in any library.
|
|
|
|
|
|
|
|
|
|
module = new MODULE( *module );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( loadFootprint && module != NULL )
|
|
|
|
|
component->SetModule( module );
|
|
|
|
|
}
|
2016-02-01 19:43:28 -05:00
|
|
|
}
|