Commit ec763dfe authored by Maciej Suminski's avatar Maciej Suminski

NETINFO_ITEM for orphaned items now have empty netname and net code = 0 (to avoid problems).

Fixed case for the footprint legacy plugin when added module's do not have set parent (BOARD).
Added copyright notice for pcbnew/class_netinfolist.cpp (feel free to correct, it is just copied from corresponding header file).
parent e6a01e5a
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* 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
*/
/** /**
* @file class_netinfolist.cpp * @file class_netinfolist.cpp
*/ */
...@@ -230,7 +254,8 @@ void NETINFO_MAPPING::Update() ...@@ -230,7 +254,8 @@ void NETINFO_MAPPING::Update()
// Prepare the new mapping // Prepare the new mapping
m_netMapping.clear(); m_netMapping.clear();
// Now the nets variable stores all the used net codes (not only for pads) // Now the nets variable stores all the used net codes (not only for pads) and we are ready to
// assign new consecutive net numbers
int newNetCode = 0; int newNetCode = 0;
for( std::set<int>::const_iterator it = nets.begin(), itEnd = nets.end(); it != itEnd; ++it ) for( std::set<int>::const_iterator it = nets.begin(), itEnd = nets.end(); it != itEnd; ++it )
m_netMapping[*it] = newNetCode++; m_netMapping[*it] = newNetCode++;
...@@ -249,5 +274,6 @@ NETINFO_ITEM* NETINFO_MAPPING::iterator::operator->() const ...@@ -249,5 +274,6 @@ NETINFO_ITEM* NETINFO_MAPPING::iterator::operator->() const
} }
const NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxString::FromUTF8( "orphaned" ), -1 );
const int NETINFO_LIST::UNCONNECTED = 0; const int NETINFO_LIST::UNCONNECTED = 0;
const NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxEmptyString,
NETINFO_LIST::UNCONNECTED );
...@@ -1303,7 +1303,10 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule ) ...@@ -1303,7 +1303,10 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
// read Netname // read Netname
ReadDelimitedText( buf, data, sizeof(buf) ); ReadDelimitedText( buf, data, sizeof(buf) );
assert( m_board->FindNet( netcode )->GetNetname() == FROM_UTF8( StrPurge( buf ) ) ); #ifndef NDEBUG
if( m_board )
assert( m_board->FindNet( netcode )->GetNetname() == FROM_UTF8( StrPurge( buf ) ) );
#endif /* NDEBUG */
} }
else if( TESTLINE( "Po" ) ) // (Po)sition else if( TESTLINE( "Po" ) ) // (Po)sition
......
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