fixed a minor problem in pcbnew compiled in DEBUG mode, that prints a lot of error messages when loading a board

This commit is contained in:
charras 2009-10-13 16:29:02 +00:00
parent 71e537b058
commit ae12e69860
4 changed files with 20 additions and 15 deletions

View File

@ -890,7 +890,8 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const
{
if( anetcode != net->GetNet() )
{
printf("FindNet() anetcode %d != GetNet() %d\n", anetcode, net->GetNet());
printf("FindNet() anetcode %d != GetNet() %d (net: %s)\n",
anetcode, net->GetNet(), CONV_TO_UTF8(net->GetNetname()));
}
}
#endif

View File

@ -62,15 +62,6 @@ int NETINFO_ITEM:: ReadDescr( FILE* File, int* LineNum )
m_Netname = CONV_FROM_UTF8( Ltmp );
continue;
}
/*
if( strncmp( Line, "NetClass", 8 ) == 0 )
{
ReadDelimitedText( Ltmp, Line + 8, sizeof(Ltmp) );
m_NetClassName = CONV_FROM_UTF8( Ltmp );
continue;
}
*/
}
return 1;

View File

@ -139,6 +139,16 @@ void NETINFO_LIST::BuildListOfNets()
m_Parent->m_Status_Pcb |= NET_CODES_OK;
m_Parent->SetAreasNetCodesFromNetNames();
// For test and debug purposes only
#if 0
for( unsigned icnt = 0; icnt < GetCount(); icnt++)
{
wxLogWarning(wxT("icnt %d, netcode %d, netname <%s>\n"),
icnt, m_NetBuffer[icnt]->GetNet(),
GetChars( m_NetBuffer[icnt]->GetNetname() ) );
}
#endif
}

View File

@ -997,13 +997,15 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
SetLocaleTo_Default( ); // revert to the current locale
Affiche_Message( wxEmptyString );
BestZoom();
GetBoard()->m_Status_Pcb = 0;
// Build the net info list
GetBoard()->m_NetInfo->BuildListOfNets();
board->SynchronizeNetsAndNetClasses( );
board->m_Status_Pcb = 0;
m_TrackAndViasSizesList_Changed = true;
Affiche_Message( wxEmptyString );
BestZoom();
SetToolbars();
return 1;
}
@ -1036,7 +1038,8 @@ int WinEDA_PcbFrame::SavePcbFormatAscii( FILE* aFile )
fprintf( aFile, "# Created by Pcbnew%s\n\n", CONV_TO_UTF8( GetBuildVersion() ) );
GetBoard()->SynchronizeNetsAndNetClasses();
// Select default Netclass. Useful to save default values in headers
// Select default Netclass before writing file.
// Useful to save default values in headers
GetBoard()->SetCurrentNetClass( GetBoard()->m_NetClasses.GetDefault()->GetName( ));
m_TrackAndViasSizesList_Changed = true;
AuxiliaryToolBar_Update_UI();