fixed seg fault in DRC just after a .ses import

This commit is contained in:
charras 2009-02-26 09:33:14 +00:00
parent 64f501ba7f
commit b0a2d7a48f
4 changed files with 16 additions and 3 deletions

View File

@ -187,6 +187,10 @@ int DRC::Drc( ZONE_CONTAINER * aArea, int CornerIndex )
void DRC::RunTests() void DRC::RunTests()
{ {
// Ensure ratsnest is up to date:
if( (m_pcb->m_Status_Pcb & LISTE_CHEVELU_OK) == 0 )
m_mainWindow->Compile_Ratsnest( NULL, true );
// someone should have cleared the two lists before calling this. // someone should have cleared the two lists before calling this.
// test pad to pad clearances, nothing to do with tracks, vias or zones. // test pad to pad clearances, nothing to do with tracks, vias or zones.
@ -197,7 +201,7 @@ void DRC::RunTests()
testTracks(); testTracks();
// Before testing segments and unconnected, refill all zones: // Before testing segments and unconnected, refill all zones:
// this is a good caution, and mandatory if using filling zones by solid polygons // this is a good caution, because filled areas can be outdated.
m_mainWindow->Fill_All_Zones( false ); m_mainWindow->Fill_All_Zones( false );
// test zone clearances to other zones, pads, tracks, and vias // test zone clearances to other zones, pads, tracks, and vias

View File

@ -256,7 +256,7 @@ librairi.o: librairi.cpp
edgemod.o: edgemod.cpp edgemod.o: edgemod.cpp
muonde.o: muonde.cpp drag.h gen_self.h muonde.o: muonde.cpp drag.h
autorout.o: autorout.cpp cell.h autorout.h autorout.o: autorout.cpp cell.h autorout.h

View File

@ -104,7 +104,7 @@ void WinEDA_BasePcbFrame::Compile_Ratsnest( wxDC* DC, bool display_status_pcb )
* Must be called after a board change (changes for * Must be called after a board change (changes for
* pads, footprints or a read netlist ). * pads, footprints or a read netlist ).
* *
* if display_status_pcb != 0 : Display the computation results * if display_status_pcb == true : Display the computation results
*/ */
{ {
wxString msg; wxString msg;

View File

@ -115,6 +115,15 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
GetScreen()->SetModify(); GetScreen()->SetModify();
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
/* At this point we should call Compile_Ratsnest()
* but this could be time consumming.
* So if incorrect number of Connecred and No connected pads is accepted
* until Compile_Ratsnest() is called (when track tool selected for instance)
* leave the next line commented
* Otherwise uncomment this line
*/
//Compile_Ratsnest( NULL, true );
Affiche_Message( wxString( _("Session file imported and merged OK.")) ); Affiche_Message( wxString( _("Session file imported and merged OK.")) );