when drc denies via insertion, bridge track not deleted

This commit is contained in:
dickelbeck 2007-12-18 02:34:54 +00:00
parent 10ece80b5a
commit fbe304722e
5 changed files with 25 additions and 9 deletions

View File

@ -4,19 +4,27 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2007-Dec-17 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
WinEDA_PcbFrame::Other_Layer_Route() was leaving in the bridging segment
when the DRC denied the via insertion.
2007-Dec-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2007-Dec-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
+pcbnew: +pcbnew:
some changes about zones: enhanced dialog, and files reorganisation. some changes about zones: enhanced dialog, and files reorganisation
2007-Dec-14 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Dec-14 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew
WinEDA_PcbFrame::Other_Layer_Route() now returns bool, so that if the DRC WinEDA_PcbFrame::Other_Layer_Route() now returns bool, so that if the DRC
would not allow the new via placement, then it can be checked and the layer would not allow the new via placement, then it can be checked and the layer
change can also then be aborted. Previously the layer change would happen change can also then be aborted. Previously the layer change would happen
in mid track if the via could not be placed. in mid track even if the via could not be placed.
2007-Dec-13 UPDATE Dick Hollenbeck <dick@softplc.com> 2007-Dec-13 UPDATE Dick Hollenbeck <dick@softplc.com>

View File

@ -53,7 +53,6 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] =
{ wxT( "Esc" ), WXK_ESCAPE }, { wxT( "Esc" ), WXK_ESCAPE },
{ wxT( "Delete" ), WXK_DELETE }, { wxT( "Delete" ), WXK_DELETE },
{ wxT( "Esc" ), WXK_ESCAPE },
{ wxT( "Tab" ), '\t' }, { wxT( "Tab" ), '\t' },
{ wxT( "Backspace" ), WXK_BACK }, { wxT( "Backspace" ), WXK_BACK },
{ wxT( "Insert" ), WXK_INSERT }, { wxT( "Insert" ), WXK_INSERT },

View File

@ -60,7 +60,10 @@ TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track )
// modification du trace // modification du trace
Track = g_CurrentTrackSegment; Track = g_CurrentTrackSegment;
g_CurrentTrackSegment = (TRACK*) g_CurrentTrackSegment->Pback; g_CurrentTrackSegment = (TRACK*) g_CurrentTrackSegment->Pback;
delete Track; g_TrackSegmentCount--;
delete Track;
g_TrackSegmentCount--;
if( g_TrackSegmentCount && (g_CurrentTrackSegment->Type() == TYPEVIA) ) if( g_TrackSegmentCount && (g_CurrentTrackSegment->Type() == TYPEVIA) )
{ {
@ -87,6 +90,7 @@ TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track )
return g_CurrentTrackSegment; return g_CurrentTrackSegment;
} }
} }
return NULL; return NULL;
} // Fin traitement si trace en cours } // Fin traitement si trace en cours

View File

@ -245,16 +245,21 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
{ {
/* DRC fault: the Via cannot be placed here ... */ /* DRC fault: the Via cannot be placed here ... */
delete Via; delete Via;
GetScreen()->m_Active_Layer = old_layer;
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); GetScreen()->m_Active_Layer = old_layer;
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
// delete the track(s) added in Begin_Route() // delete the track(s) added in Begin_Route()
while( g_TrackSegmentCount > itmp ) while( g_TrackSegmentCount > itmp )
{ {
Delete_Segment( DC, g_CurrentTrackSegment ); Delete_Segment( DC, g_CurrentTrackSegment );
} }
SetCurItem( g_CurrentTrackSegment );
// use the form of SetCurItem() which does not write to the msg panel,
// SCREEN::SetCurItem(), so the DRC error remains on screen.
// WinEDA_PcbFrame::SetCurItem() calls Display_Infos().
GetScreen()->SetCurItem( g_CurrentTrackSegment );
return false; return false;
} }

View File

@ -1105,7 +1105,7 @@ void WinEDA_DrawPanel::OnKeyEvent( wxKeyEvent& event )
/* Compute absolute m_MousePosition in user units: */ /* Compute absolute m_MousePosition in user units: */
Screen->m_MousePosition = CursorRealPosition( Screen->m_MousePositionInPixels ); Screen->m_MousePosition = CursorRealPosition( Screen->m_MousePositionInPixels );
#else #else
/* if wxGetMousePosition() does not exist, /* if wxGetMousePosition() does not exist,
* m_Cursor should be ok, use it to calculate the cursor position on screen * m_Cursor should be ok, use it to calculate the cursor position on screen