diff --git a/common/eda_doc.cpp b/common/eda_doc.cpp index 8e63ff66ee..6d30e651e2 100644 --- a/common/eda_doc.cpp +++ b/common/eda_doc.cpp @@ -54,14 +54,14 @@ static const wxFileTypeInfo EDAfallbacks[] = wxT( "wxhtml %s" ), wxT( "html document (from Kicad)" ), wxT( "htm" ), - wxT( "html" ),NULL ), + wxT( "html" ),wxNullPtr ), wxFileTypeInfo( wxT( "application/sch" ), wxT( "eeschema %s" ), wxT( "eeschema -p %s" ), wxT( "sch document (from Kicad)" ), wxT( "sch" ), - wxT( "SCH" ), NULL ), + wxT( "SCH" ), wxNullPtr ), // must terminate the table with this! wxFileTypeInfo() diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index 784fbb226f..ea88aa2fad 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -318,12 +318,12 @@ void LIB_COMPONENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDc, const wxPoint& aO if( drawItem.Type() == COMPONENT_FIELD_DRAW_TYPE ) { - drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, NULL, aTransform ); + drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, (void*) NULL, aTransform ); } // Now, draw only the background for items with // m_Fill == FILLED_WITH_BG_BODYCOLOR: - drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, false, aTransform ); + drawItem.Draw( aPanel, aDc, aOffset, aColor, aDrawMode, (void*) false, aTransform ); } } diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index ec1c64368f..c42d50fb15 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -151,8 +151,7 @@ void SCH_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, DrawGraphicText( panel, DC, textpos, color, fulltext, orient, m_Size, hjustify, vjustify, - LineWidth, m_Italic, - m_Bold, false ); + LineWidth, m_Italic, m_Bold ); } /* Enable this to draw the bounding box around the text field to validate diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index ca6b0a4bef..bf28709725 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -584,7 +584,7 @@ void SCH_SHEET::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, (EDA_Colors) txtcolor, Text, name_orientation, wxSize( m_SheetNameSize, m_SheetNameSize ), GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_BOTTOM, LineWidth, - false, false, false ); + false, false ); /* Draw text : FileName */ if( aColor >= 0 ) @@ -596,7 +596,7 @@ void SCH_SHEET::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, (EDA_Colors) txtcolor, Text, name_orientation, wxSize( m_FileNameSize, m_FileNameSize ), GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_TOP, LineWidth, - false, false, false ); + false, false ); /* Draw text : SheetLabel */ diff --git a/gerbview/draw_gerber_screen.cpp b/gerbview/draw_gerber_screen.cpp index b060756064..2b205e1eb2 100644 --- a/gerbview/draw_gerber_screen.cpp +++ b/gerbview/draw_gerber_screen.cpp @@ -205,7 +205,7 @@ void Show_Items_DCode_Value( WinEDA_DrawPanel* aPanel, wxDC* aDC, BOARD* aPcb, i pos, (EDA_Colors) color, Line, orient, wxSize( width, width ), GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, - 0, false, false, false ); + 0, false, false ); } } diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 96f39ae396..7d75e5e541 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -1088,10 +1088,9 @@ public: * When such a bad segment is found, mark it as needing to be removed. * and remove all tracks having at least one flagged segment. * @param aDC = the current device context (can be NULL) - * @param aDisplayActivity = true to display activity on the frame status bar and message panel * @return true if any change is made */ - bool RemoveMisConnectedTracks( wxDC* aDC, bool aDisplayActivity ); + bool RemoveMisConnectedTracks( wxDC* aDC ); // Autoplacement: diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index b26d3fb07b..c2e1a41ee2 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -35,7 +35,6 @@ set(PCBNEW_SRCS build_BOM_from_board.cpp class_pcb_layer_widget.cpp clean.cpp -# cleaningoptions_dialog.cpp connect.cpp controle.cpp dimension.cpp @@ -43,6 +42,8 @@ set(PCBNEW_SRCS debug_kbool_key_file_fct.cpp deltrack.cpp dialogs/dialog_block_options_base.cpp + dialogs/dialog_cleaning_options_base.cpp + dialogs/dialog_cleaning_options.cpp dialog_copper_zones.cpp dialog_copper_zones_base.cpp dialog_design_rules.cpp diff --git a/pcbnew/class_pad_draw_functions.cpp b/pcbnew/class_pad_draw_functions.cpp index 321b09f6de..e281a9c528 100644 --- a/pcbnew/class_pad_draw_functions.cpp +++ b/pcbnew/class_pad_draw_functions.cpp @@ -590,8 +590,7 @@ void D_PAD::DrawShape( EDA_Rect* aClipBox, wxDC* aDC, PAD_DRAWINFO& aDrawInfo ) tsize = (int) ( tsize * 0.8 ); DrawGraphicText( aDrawInfo.m_DrawPanel, aDC, tpos, WHITE, buffer, t_angle, wxSize( tsize, tsize ), GR_TEXT_HJUSTIFY_CENTER, - GR_TEXT_VJUSTIFY_CENTER, tsize / 7, false, false, - false ); + GR_TEXT_VJUSTIFY_CENTER, tsize / 7, false, false ); } } diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index 7bedaca792..e00b9db5dc 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -1,41 +1,27 @@ -/******************************************************/ -/* editeur de PCB PCBNEW */ -/* Fonctions de Nettoyage et reorganisation de Pistes */ -/******************************************************/ +/** + * @file clean.cpp + * functions to clean tracks: remove null and redundant segments + */ -/* Fichier CLEAN.CPP */ #include "fctsys.h" -#include "gr_basic.h" #include "common.h" #include "class_drawpanel.h" #include "pcbnew.h" #include "wxPcbStruct.h" -#include "autorout.h" #include "protos.h" -/* Position of messages on the bottom display */ -#define AFFICHE 1 -#define POS_AFF_PASSE 40 -#define POS_AFF_VAR 50 -#define POS_AFF_MAX 60 -#define POS_AFF_NUMSEGM 70 - /* local functions : */ -static int clean_segments( WinEDA_PcbFrame* frame ); +static void clean_segments( WinEDA_PcbFrame* frame ); +static void clean_vias( BOARD* aPcb ); static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ); static TRACK* AlignSegment( BOARD* Pcb, TRACK* pt_ref, TRACK* pt_segm, int extremite ); -static void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC ); +static void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC, + bool aCleanVias, bool aMergeSegments, + bool aDeleteUnconnectedSegm, bool aConnectToPads ); -/* Local Variables: */ -static int a_color; /* message color */ -static bool s_CleanVias = true; -static bool s_MergeSegments = true; -static bool s_DeleteUnconnectedSegm = true; -static bool s_ConnectToPads = false; - -#include "cleaningoptions_dialog.cpp" +#include "dialog_cleaning_options.h" #define CONN2PAD_ENBL @@ -52,17 +38,15 @@ void WinEDA_PcbFrame::Clean_Pcb( wxDC* DC ) /* Install the track operation dialog frame */ { - s_ConnectToPads = false; - WinEDA_CleaningOptionsFrame* frame = new WinEDA_CleaningOptionsFrame( this, DC ); - frame->ShowModal(); - frame->Destroy(); + DIALOG_CLEANING_OPTIONS::connectToPads = false; + DIALOG_CLEANING_OPTIONS dlg( this ); + if( dlg.ShowModal() == wxID_OK ) + Clean_Pcb_Items( this, DC, dlg.cleanVias, dlg.mergeSegments, + dlg.deleteUnconnectedSegm, dlg.connectToPads ); DrawPanel->Refresh( true ); } -/************************************************************/ -void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC ) -/************************************************************/ /* Main cleaning function. * Delete * - Redundant points on tracks (merge aligned segments) @@ -72,7 +56,12 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC ) * Create segments when track ends are incorrecty connected: * i.e. when a track end covers a pad or a via but is not exactly on the pad or the via center */ +void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC, + bool aCleanVias, bool aMergeSegments, + bool aDeleteUnconnectedSegm, bool aConnectToPads ) { + wxBusyCursor( dummy ); + frame->MsgPanel->EraseMsgBox(); frame->GetBoard()->GetNumSegmTrack(); // update the count @@ -83,80 +72,94 @@ void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC ) frame->GetBoard()->m_Status_Pcb = 0; frame->GetBoard()->m_NetInfo->BuildListOfNets(); - if( s_CleanVias ) // delete redundant vias + if( aCleanVias ) // delete redundant vias { - TRACK* track; - TRACK* next_track; - for( track = frame->GetBoard()->m_Track; track; track = track->Next() ) - { - if( track->Shape() != VIA_THROUGH ) - continue; - - // Search and delete others vias at same location - TRACK* alt_track = track->Next(); - for( ; alt_track != NULL; alt_track = next_track ) - { - next_track = alt_track->Next(); - if( alt_track->m_Shape != VIA_THROUGH ) - continue; - - if( alt_track->m_Start != track->m_Start ) - continue; - - /* delete via */ - alt_track->UnLink(); - delete alt_track; - } - } - - /* Delete Via on pads at same location */ - for( track = frame->GetBoard()->m_Track; track != NULL; track = next_track ) - { - next_track = track->Next(); - if( track->m_Shape != VIA_THROUGH ) - continue; - - D_PAD* pad = Fast_Locate_Pad_Connecte( frame->GetBoard(), track->m_Start, ALL_CU_LAYERS ); - if( pad && (pad->m_Masque_Layer & EXTERNAL_LAYERS) == EXTERNAL_LAYERS ) // redundant Via - { - /* delete via */ - track->UnLink(); - delete track; - } - } + frame->Affiche_Message( _( "Clean vias" ) ); + clean_vias( frame->GetBoard() ); } #ifdef CONN2PAD_ENBL /* Create missing segments when a track end covers a pad or a via, but is not on the pad or the via center */ - if( s_ConnectToPads ) + if( aConnectToPads ) { + frame->Affiche_Message( _( "Reconnect pads" ) ); /* Create missing segments when a track end covers a pad, but is not on the pad center */ - if( s_ConnectToPads ) - ConnectDanglingEndToPad( frame, DC ); + ConnectDanglingEndToPad( frame, DC ); // creation of points of connections at the intersection of tracks // Gen_Raccord_Track(frame, DC); /* Create missing segments when a track end covers a via, but is not on the via center */ - if( s_ConnectToPads ) - ConnectDanglingEndToVia( frame->GetBoard() ); + ConnectDanglingEndToVia( frame->GetBoard() ); } #endif /* Remove null segments and intermediate points on aligned segments */ - if( s_MergeSegments ) + if( aMergeSegments ) + { + frame->Affiche_Message( _( "Merge track segments" ) ); clean_segments( frame ); + } /* Delete dangling tracks */ - if( s_DeleteUnconnectedSegm ) + if( aDeleteUnconnectedSegm ) + { + frame->Affiche_Message( _( "Delete unconnected tracks" ) ); DeleteUnconnectedTracks( frame, DC ); + } - frame->Compile_Ratsnest( DC, AFFICHE ); + frame->Affiche_Message( _( "Cleanup finished" ) ); + + frame->Compile_Ratsnest( DC, true ); frame->OnModify(); } +void clean_vias( BOARD * aPcb ) +{ + TRACK* track; + TRACK* next_track; + + for( track = aPcb->m_Track; track; track = track->Next() ) + { + if( track->Shape() != VIA_THROUGH ) + continue; + + // Search and delete others vias at same location + TRACK* alt_track = track->Next(); + for( ; alt_track != NULL; alt_track = next_track ) + { + next_track = alt_track->Next(); + if( alt_track->m_Shape != VIA_THROUGH ) + continue; + + if( alt_track->m_Start != track->m_Start ) + continue; + + /* delete via */ + alt_track->UnLink(); + delete alt_track; + } + } + + /* Delete Via on pads at same location */ + for( track = aPcb->m_Track; track != NULL; track = next_track ) + { + next_track = track->Next(); + if( track->m_Shape != VIA_THROUGH ) + continue; + + D_PAD* pad = Fast_Locate_Pad_Connecte( aPcb, track->m_Start, ALL_CU_LAYERS ); + if( pad && (pad->m_Masque_Layer & EXTERNAL_LAYERS) == EXTERNAL_LAYERS ) // redundant Via + { + /* delete via */ + track->UnLink(); + delete track; + } + } +} + /*****************************************************************************/ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ) @@ -173,18 +176,15 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ) TRACK* startNetcode; TRACK* next; ZONE_CONTAINER* zone; - - int nbpoints_supprimes = 0; int masklayer, oldnetcode; int type_end, flag_erase; - int ii, percent, oldpercent; - wxString msg; - frame->Affiche_Message( _( "Delete unconnected tracks:" ) ); + if( frame->GetBoard()->m_Track == NULL ) + return; + frame->DrawPanel->m_AbortRequest = FALSE; // correct via m_End defects - ii = 0; for( segment = frame->GetBoard()->m_Track; segment; segment = next ) { next = segment->Next(); @@ -192,41 +192,18 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ) if( segment->Type() == TYPE_VIA ) { if( segment->m_Start != segment->m_End ) - { segment->m_End = segment->m_Start; - - ii++; - msg.Printf( wxT( "%d " ), ii ); - Affiche_1_Parametre( frame, POS_AFF_PASSE, _( "ViaDef" ), msg, LIGHTRED ); - } continue; } } // removal of unconnected tracks - percent = 0; - oldpercent = -1; - oldnetcode = 0; - segment = startNetcode = frame->GetBoard()->m_Track; - for( ii = 0; segment; segment = next, ii++ ) + oldnetcode = segment->GetNet(); + for( int ii = 0; segment ; segment = next, ii++ ) { next = segment->Next(); - // display activity - percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount(); - if( percent != oldpercent ) - { - oldpercent = percent; - frame->DisplayActivity( percent, wxT( "No Conn: " ) ); - - msg.Printf( wxT( "%d " ), frame->GetBoard()->m_Track.GetCount() ); - Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); - - msg.Printf( wxT( "%d " ), ii ); - Affiche_1_Parametre( frame, POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN ); - } - if( frame->DrawPanel->m_AbortRequest ) break; @@ -363,14 +340,6 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ) if( flag_erase ) { - oldpercent = -1; // force dispay activity - - nbpoints_supprimes++; - ii--; - - msg.Printf( wxT( "%d " ), nbpoints_supprimes ); - Affiche_1_Parametre( frame, POS_AFF_VAR, wxT( "NoConn." ), msg, LIGHTRED ); - // update the pointer to start of the contiguous netcode group if( segment == startNetcode ) { @@ -392,32 +361,19 @@ static void DeleteUnconnectedTracks( WinEDA_PcbFrame* frame, wxDC* DC ) /************************************************************/ -static int clean_segments( WinEDA_PcbFrame* frame ) +static void clean_segments( WinEDA_PcbFrame* frame ) /************************************************************/ /* Delete null lenght segments, and intermediate points .. */ { TRACK* segment, * nextsegment; TRACK* other; - int ii, nbpoints_supprimes = 0; - int flag, no_inc, percent, oldpercent; + int ii; + int flag, no_inc; wxString msg; frame->DrawPanel->m_AbortRequest = FALSE; - /**********************************************/ - /* Delete null segments */ - /**********************************************/ - - a_color = GREEN; - nbpoints_supprimes = 0; - percent = 0; - oldpercent = -1; - - frame->MsgPanel->EraseMsgBox(); - frame->Affiche_Message( _( "Clean Null Segments" ) ); - - Affiche_1_Parametre( frame, POS_AFF_VAR, wxT( "NullSeg" ), wxT( "0" ), a_color ); - + // Delete null segments for( segment = frame->GetBoard()->m_Track; segment; segment = nextsegment ) { nextsegment = segment->Next(); @@ -426,40 +382,11 @@ static int clean_segments( WinEDA_PcbFrame* frame ) /* Length segment = 0; delete it */ segment->DeleteStructure(); - nbpoints_supprimes++; - - msg.Printf( wxT( " %d" ), nbpoints_supprimes ); - Affiche_1_Parametre( frame, POS_AFF_VAR, wxEmptyString, msg, a_color ); } - /**************************************/ /* Delete redundant segments */ - /**************************************/ - - Affiche_1_Parametre( frame, POS_AFF_VAR, wxT( "Ident" ), wxT( "0" ), a_color ); - - percent = 0; - oldpercent = -1; - for( segment = frame->GetBoard()->m_Track, ii = 0; segment; segment = segment->Next(), ii++ ) { - /* Display activity */ - percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount(); - if( percent != oldpercent ) - { - frame->DisplayActivity( percent, wxT( "Id segm: " ) ); - oldpercent = percent; - - msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() ); - Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); - - msg.Printf( wxT( "%d" ), ii ); - Affiche_1_Parametre( frame, POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN ); - - if( frame->DrawPanel->m_AbortRequest ) - return -1; - } - for( other = segment->Next(); other; other = nextsegment ) { nextsegment = other->Next(); @@ -491,25 +418,11 @@ static int clean_segments( WinEDA_PcbFrame* frame ) { ii--; other->DeleteStructure(); - nbpoints_supprimes++; - - msg.Printf( wxT( " %d" ), nbpoints_supprimes ); - Affiche_1_Parametre( frame, 50, wxEmptyString, msg, a_color ); } } } - /*******************************/ /* delete intermediate points */ - /*******************************/ - - nbpoints_supprimes = 0; - percent = 0; - oldpercent = -1; - frame->Affiche_Message( _( "Merging Segments:" ) ); - - Affiche_1_Parametre( frame, POS_AFF_VAR, _( "Merge" ), _( "0" ), a_color ); - ii = 0; for( segment = frame->GetBoard()->m_Track; segment; segment = nextsegment ) { @@ -518,23 +431,8 @@ static int clean_segments( WinEDA_PcbFrame* frame ) TRACK* segDelete; nextsegment = segment->Next(); - - ii++; - percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount(); - if( percent != oldpercent ) - { - frame->DisplayActivity( percent, _( "Merge: " ) ); - oldpercent = percent; - - msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() ); - Affiche_1_Parametre( frame, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); - - msg.Printf( wxT( "%d" ), ii ); - Affiche_1_Parametre( frame, POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN ); - - if( frame->DrawPanel->m_AbortRequest ) - return -1; - } + if( frame->DrawPanel->m_AbortRequest ) + return; if( segment->Type() != TYPE_TRACK ) continue; @@ -575,7 +473,7 @@ static int clean_segments( WinEDA_PcbFrame* frame ) segDelete = AlignSegment( frame->GetBoard(), segment, segStart, START ); if( segDelete ) { - nbpoints_supprimes++; no_inc = 1; + no_inc = 1; segDelete->DeleteStructure(); } } @@ -612,22 +510,16 @@ static int clean_segments( WinEDA_PcbFrame* frame ) segDelete = AlignSegment( frame->GetBoard(), segment, segEnd, END ); if( segDelete ) { - nbpoints_supprimes++; no_inc = 1; segDelete->DeleteStructure(); } } if( no_inc ) /* The current segment was modified, retry to merge it */ - { - msg.Printf( wxT( "%d " ), nbpoints_supprimes ); - Affiche_1_Parametre( frame, POS_AFF_VAR, wxEmptyString, msg, a_color ); - nextsegment = segment->Next(); - } } - return 0; + return; } @@ -740,51 +632,16 @@ static TRACK* AlignSegment( BOARD* Pcb, TRACK* pt_ref, TRACK* pt_segm, int extre * @param aDisplayActivity = true to display activity on the frame status bar and message panel * @return true if any change is made */ -bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC, bool aDisplayActivity ) +bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC ) { TRACK* segment; TRACK* other; TRACK* next; int net_code_s, net_code_e; - int nbpoints_modifies = 0; - bool flag = false; - wxString msg; - int percent = 0; - int oldpercent = -1; + bool isModified = false; - a_color = RED; - - if( aDisplayActivity ) - Affiche_Message( _( "DRC Control:" ) ); - - DrawPanel->m_AbortRequest = FALSE; - - if( aDisplayActivity ) - Affiche_1_Parametre( this, POS_AFF_VAR, _( "NetCtr" ), wxT( "0 " ), a_color ); - - int ii = 0; for( segment = GetBoard()->m_Track; segment; segment = (TRACK*) segment->Next() ) { - ii++; - if( aDisplayActivity ) // display activity - { - percent = (100 * ii) / GetBoard()->m_Track.GetCount(); - if( percent != oldpercent ) - { - DisplayActivity( percent, wxT( "Drc: " ) ); - oldpercent = percent; - - msg.Printf( wxT( "%d" ), GetBoard()->m_Track.GetCount() ); - Affiche_1_Parametre( this, POS_AFF_MAX, wxT( "Max" ), msg, GREEN ); - - msg.Printf( wxT( "%d" ), GetBoard()->m_Track.GetCount() ); - Affiche_1_Parametre( this, POS_AFF_NUMSEGM, wxT( "Segm" ), msg, CYAN ); - - if( DrawPanel->m_AbortRequest ) - return flag; - } - } - segment->SetState( FLAG0, OFF ); // find the netcode for segment using anything connected to the "start" of "segment" @@ -822,39 +679,30 @@ bool WinEDA_PcbFrame::RemoveMisConnectedTracks( wxDC* aDC, bool aDisplayActivity if( net_code_e < 0 ) continue; // the "end" of segment is not connected - // the obtained netcodes do not agree, mark the segment as needing to be removed + // Netcodes do not agree, so mark the segment as needed to be removed if( net_code_s != net_code_e ) { segment->SetState( FLAG0, ON ); } } - // Removal of flagged segments + // Remove flagged segments for( segment = GetBoard()->m_Track; segment; segment = next ) { next = (TRACK*) segment->Next(); - if( segment->GetState( FLAG0 ) ) //* if segment is marked as needing to be removed + if( segment->GetState( FLAG0 ) ) // Ssegment is flagged to be removed { segment->SetState( FLAG0, OFF ); - - flag = true; - oldpercent = -1; + isModified = true; GetBoard()->m_Status_Pcb = 0; - Remove_One_Track( aDC, segment ); - - next = GetBoard()->m_Track; /* the current segment can be deleted, so restart to the beginning */ - if( aDisplayActivity ) - { - nbpoints_modifies++; - msg.Printf( wxT( "%d " ), nbpoints_modifies ); - Affiche_1_Parametre( this, POS_AFF_VAR, wxEmptyString, msg, a_color ); - } + // the current segment could be deleted, so restart to the beginning + next = GetBoard()->m_Track; } } - return flag; + return isModified; } @@ -1100,36 +948,15 @@ void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC ) TRACK* segment; int nb_new_piste = 0; wxString msg; - int percent = 0; - int oldpercent = -1; - - a_color = GREEN; frame->DrawPanel->m_AbortRequest = FALSE; - Affiche_1_Parametre( frame, POS_AFF_VAR, _( "Centre" ), _( "0 " ), a_color ); - - int ii = 0; for( segment = frame->GetBoard()->m_Track; segment; segment = segment->Next() ) { D_PAD* pad; - ii++; - percent = (100 * ii) / frame->GetBoard()->m_Track.GetCount(); - if( percent != oldpercent ) - { - frame->DisplayActivity( percent, _( "Pads: " ) ); - oldpercent = percent; - - msg.Printf( wxT( "%d" ), frame->GetBoard()->m_Track.GetCount() ); - Affiche_1_Parametre( frame, POS_AFF_MAX, _( "Max" ), msg, GREEN ); - - msg.Printf( wxT( "%d" ), ii ); - Affiche_1_Parametre( frame, POS_AFF_NUMSEGM, _( "Segm" ), msg, CYAN ); - - if( frame->DrawPanel->m_AbortRequest ) - return; - } + if( frame->DrawPanel->m_AbortRequest ) + return; pad = Locate_Pad_Connecte( frame->GetBoard(), segment, START ); if( pad ) @@ -1152,7 +979,6 @@ void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC ) nb_new_piste++; newTrack->Draw( frame->DrawPanel, DC, GR_OR ); - Affiche_1_Parametre( frame, POS_AFF_VAR, wxEmptyString, msg, a_color ); } } } @@ -1174,11 +1000,7 @@ void ConnectDanglingEndToPad( WinEDA_PcbFrame* frame, wxDC* DC ) newTrack->start = pad; newTrack->end = segment; - nb_new_piste++; - - msg.Printf( wxT( "e %d" ), nb_new_piste ); - Affiche_1_Parametre( frame, POS_AFF_VAR, wxEmptyString, msg, a_color ); } } } diff --git a/pcbnew/cleaningoptions_dialog.cpp b/pcbnew/cleaningoptions_dialog.cpp deleted file mode 100644 index 315ec05ac4..0000000000 --- a/pcbnew/cleaningoptions_dialog.cpp +++ /dev/null @@ -1,255 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: cleaningoptions_dialog.cpp -// Purpose: -// Author: jean-pierre Charras -// Modified by: -// Created: 25/05/2007 14:24:54 -// RCS-ID: -// Copyright: GNU License -// Licence: -///////////////////////////////////////////////////////////////////////////// - -// Generated by DialogBlocks (unregistered), 25/05/2007 14:24:54 - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "cleaningoptions_dialog.h" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -////@begin includes -////@end includes - -#include "cleaningoptions_dialog.h" - -////@begin XPM images -////@end XPM images - - -/*! - * WinEDA_CleaningOptionsFrame type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( WinEDA_CleaningOptionsFrame, wxDialog ) - - -/*! - * WinEDA_CleaningOptionsFrame event table definition - */ - -BEGIN_EVENT_TABLE( WinEDA_CleaningOptionsFrame, wxDialog ) - -////@begin WinEDA_CleaningOptionsFrame event table entries - EVT_CLOSE( WinEDA_CleaningOptionsFrame::OnCloseWindow ) - - EVT_BUTTON( ID_BUTTON_EXECUTE, WinEDA_CleaningOptionsFrame::OnButtonExecuteClick ) - -////@end WinEDA_CleaningOptionsFrame event table entries - -END_EVENT_TABLE() - - -/*! - * WinEDA_CleaningOptionsFrame constructors - */ - -WinEDA_CleaningOptionsFrame::WinEDA_CleaningOptionsFrame() -{ - Init(); -} - -WinEDA_CleaningOptionsFrame::WinEDA_CleaningOptionsFrame( WinEDA_PcbFrame* parent, wxDC * DC, wxWindowID id, - const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ - Init(); - m_Parent = parent; - m_DC = DC; - Create(parent, id, caption, pos, size, style); -} - - -/*! - * WinEDA_CleaningOptionsFrame creator - */ - -bool WinEDA_CleaningOptionsFrame::Create( wxWindow * parent, wxWindowID id, - const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin WinEDA_CleaningOptionsFrame creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS); - wxDialog::Create( parent, id, caption, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end WinEDA_CleaningOptionsFrame creation - return true; -} - - -/*! - * WinEDA_CleaningOptionsFrame destructor - */ - -WinEDA_CleaningOptionsFrame::~WinEDA_CleaningOptionsFrame() -{ -////@begin WinEDA_CleaningOptionsFrame destruction -////@end WinEDA_CleaningOptionsFrame destruction -} - - -/*! - * Member initialisation - */ - -void WinEDA_CleaningOptionsFrame::Init() -{ - m_Parent = NULL; -////@begin WinEDA_CleaningOptionsFrame member initialisation - m_CleanViasOpt = NULL; - m_MergetSegmOpt = NULL; - m_DeleteunconnectedOpt = NULL; - m_ConnectToPadsOpt = NULL; -////@end WinEDA_CleaningOptionsFrame member initialisation -} - - -/*! - * Control creation for WinEDA_CleaningOptionsFrame - */ - -void WinEDA_CleaningOptionsFrame::CreateControls() -{ -////@begin WinEDA_CleaningOptionsFrame content construction - // Generated by DialogBlocks, 21/10/2007 19:42:47 (unregistered) - - WinEDA_CleaningOptionsFrame* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); - itemDialog1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Static")); - wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL); - itemBoxSizer3->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - m_CleanViasOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_CLEAN_VIAS, _("Delete redundant vias"), wxDefaultPosition, wxDefaultSize, 0 ); - m_CleanViasOpt->SetValue(false); - if (ShowToolTips()) - m_CleanViasOpt->SetToolTip(_("remove vias on pads with a through hole")); - itemStaticBoxSizer4->Add(m_CleanViasOpt, 0, wxALIGN_LEFT|wxALL, 5); - - m_MergetSegmOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX_MERGE_SEGMENTS, _("Merge segments"), wxDefaultPosition, wxDefaultSize, 0 ); - m_MergetSegmOpt->SetValue(false); - if (ShowToolTips()) - m_MergetSegmOpt->SetToolTip(_("merge aligned track segments, and remove null segments")); - itemStaticBoxSizer4->Add(m_MergetSegmOpt, 0, wxALIGN_LEFT|wxALL, 5); - - m_DeleteunconnectedOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 ); - m_DeleteunconnectedOpt->SetValue(false); - if (ShowToolTips()) - m_DeleteunconnectedOpt->SetToolTip(_("delete track segment having a dangling end")); - itemStaticBoxSizer4->Add(m_DeleteunconnectedOpt, 0, wxALIGN_LEFT|wxALL, 5); - - m_ConnectToPadsOpt = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Connect to Pads"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ConnectToPadsOpt->SetValue(false); - if (ShowToolTips()) - m_ConnectToPadsOpt->SetToolTip(_("Extend dangling tracks which partially cover a pad or via, all the way to pad or via center")); - itemStaticBoxSizer4->Add(m_ConnectToPadsOpt, 0, wxALIGN_LEFT|wxALL, 5); - - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer3->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton10 = new wxButton( itemDialog1, ID_BUTTON_EXECUTE, _("Clean pcb"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton10->SetDefault(); - itemBoxSizer9->Add(itemButton10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - // Set validators - m_CleanViasOpt->SetValidator( wxGenericValidator(& s_CleanVias ) ); - m_MergetSegmOpt->SetValidator( wxGenericValidator(& s_MergeSegments) ); - m_DeleteunconnectedOpt->SetValidator( wxGenericValidator(& s_DeleteUnconnectedSegm) ); -////@end WinEDA_CleaningOptionsFrame content construction -} - - -/*! - * Should we show tooltips? - */ - -bool WinEDA_CleaningOptionsFrame::ShowToolTips() -{ - return true; -} - -/*! - * Get bitmap resources - */ - -wxBitmap WinEDA_CleaningOptionsFrame::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin WinEDA_CleaningOptionsFrame bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end WinEDA_CleaningOptionsFrame bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon WinEDA_CleaningOptionsFrame::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin WinEDA_CleaningOptionsFrame icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end WinEDA_CleaningOptionsFrame icon retrieval -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_EXECUTE - */ - -void WinEDA_CleaningOptionsFrame::OnButtonExecuteClick( wxCommandEvent& event ) -{ - s_CleanVias = m_CleanViasOpt->GetValue(); - s_MergeSegments = m_MergetSegmOpt->GetValue(); - s_DeleteUnconnectedSegm = m_DeleteunconnectedOpt->GetValue(); - s_ConnectToPads = m_ConnectToPadsOpt->GetValue(); - - Clean_Pcb_Items(m_Parent, m_DC ); - - Close(TRUE); -} - - -/*! - * wxEVT_CLOSE_WINDOW event handler for ID_WIN_EDA_CLEANINGOPTIONSFRAME - */ - -void WinEDA_CleaningOptionsFrame::OnCloseWindow( wxCloseEvent& event ) -{ - s_CleanVias = m_CleanViasOpt->GetValue(); - s_MergeSegments = m_MergetSegmOpt->GetValue(); - s_DeleteUnconnectedSegm = m_DeleteunconnectedOpt->GetValue(); - s_ConnectToPads = m_ConnectToPadsOpt->GetValue(); - - event.Skip(); -} - diff --git a/pcbnew/cleaningoptions_dialog.h b/pcbnew/cleaningoptions_dialog.h deleted file mode 100644 index 2d905463ad..0000000000 --- a/pcbnew/cleaningoptions_dialog.h +++ /dev/null @@ -1,122 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: cleaningoptions_dialog.h -// Purpose: -// Author: jean-pierre Charras -// Modified by: -// Created: 25/05/2007 14:24:54 -// RCS-ID: -// Copyright: GNU License -// Licence: -///////////////////////////////////////////////////////////////////////////// - -// Generated by DialogBlocks (unregistered), 25/05/2007 14:24:54 - -#ifndef _CLEANINGOPTIONS_DIALOG_H_ -#define _CLEANINGOPTIONS_DIALOG_H_ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "cleaningoptions_dialog.h" -#endif - -/*! - * Includes - */ - -////@begin includes -#include "wx/valgen.h" -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define ID_WIN_EDA_CLEANINGOPTIONSFRAME 10000 -#define ID_CHECKBOX_CLEAN_VIAS 10001 -#define ID_CHECKBOX_MERGE_SEGMENTS 10003 -#define ID_CHECKBOX1 10005 -#define ID_CHECKBOX 10004 -#define ID_BUTTON_EXECUTE 10006 -#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER -#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE _("Cleaning options") -#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME ID_WIN_EDA_CLEANINGOPTIONSFRAME -#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE wxSize(400, 300) -#define SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION wxDefaultPosition -////@end control identifiers - -class WinEDA_PcbFrame; - -/*declared in clean.cpp: -extern static bool s_CleanVias; -extern static bool s_MergeSegments; -extern static bool s_DeleteUnconnectedSegm; -void Clean_Pcb_Items( WinEDA_PcbFrame* frame, wxDC* DC ); -//end clean.cpp */ -/*! - * WinEDA_CleaningOptionsFrame class declaration - */ - -class WinEDA_CleaningOptionsFrame: public wxDialog -{ - DECLARE_DYNAMIC_CLASS( WinEDA_CleaningOptionsFrame ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - WinEDA_CleaningOptionsFrame(); - WinEDA_CleaningOptionsFrame( WinEDA_PcbFrame * parent, wxDC * DC, - wxWindowID id = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_SIZE, long style = SYMBOL_WINEDA_CLEANINGOPTIONSFRAME_STYLE ); - - /// Destructor - ~WinEDA_CleaningOptionsFrame(); - - /// Initialises member variables - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - -////@begin WinEDA_CleaningOptionsFrame event handler declarations - - /// wxEVT_CLOSE_WINDOW event handler for ID_WIN_EDA_CLEANINGOPTIONSFRAME - void OnCloseWindow( wxCloseEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_EXECUTE - void OnButtonExecuteClick( wxCommandEvent& event ); - -////@end WinEDA_CleaningOptionsFrame event handler declarations - -////@begin WinEDA_CleaningOptionsFrame member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end WinEDA_CleaningOptionsFrame member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin WinEDA_CleaningOptionsFrame member variables - wxCheckBox* m_CleanViasOpt; - wxCheckBox* m_MergetSegmOpt; - wxCheckBox* m_DeleteunconnectedOpt; - wxCheckBox* m_ConnectToPadsOpt; -////@end WinEDA_CleaningOptionsFrame member variables - WinEDA_PcbFrame * m_Parent; - wxDC * m_DC; -}; - -#endif - // _CLEANINGOPTIONS_DIALOG_H_ diff --git a/pcbnew/cleaningoptions_dialog.pjd b/pcbnew/cleaningoptions_dialog.pjd deleted file mode 100644 index 8994c2d20f..0000000000 --- a/pcbnew/cleaningoptions_dialog.pjd +++ /dev/null @@ -1,703 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 0 - "jean-pierre Charras" - "GNU License" - "" - 0 - 0 - "<All platforms>" - "2.8.3" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -" - " /// %BODY% -" - " -/*! - * %BODY% - */ - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "iso-8859-1" - "utf-8" - "utf-8" - "" - 0 - 0 - 4 - " " - "" - 0 - 0 - 1 - 1 - 1 - 0 - 1 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "Cleaning options" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - 0 - "wxEVT_CLOSE_WINDOW|OnCloseWindow|NONE||" - "ID_WIN_EDA_CLEANINGOPTIONSFRAME" - 10000 - "WinEDA_CleaningOptionsFrame" - "wxDialog" - "wxDialog" - "cleaningoptions_dialog.cpp" - "cleaningoptions_dialog.h" - "" - "Cleaning options" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "MAYBE_RESIZE_BORDER" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Static" - "" - "" - "" - "" - 0 - 1 - "wxStaticBox" - "Vertical" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxCheckBox: ID_CHECKBOX_CLEAN_VIAS" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbCheckBoxProxy" - "ID_CHECKBOX_CLEAN_VIAS" - 10001 - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_CleanViasOpt" - "Delete redundant vias" - 0 - "" - "remove vias on pads with a through hole" - "s_CleanVias" - "wxGenericValidator(& %VARIABLE%)" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_CHECKBOX_MERGE_SEGMENTS" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbCheckBoxProxy" - "ID_CHECKBOX_MERGE_SEGMENTS" - 10003 - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_MergetSegmOpt" - "Merge segments" - 0 - "" - "merge aligned track segments, and remove null segments" - "s_MergeSegments" - "wxGenericValidator(& %VARIABLE%)" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_CHECKBOX1" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbCheckBoxProxy" - "ID_CHECKBOX1" - 10005 - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_DeleteunconnectedOpt" - "Delete unconnected tracks" - 0 - "" - "delete track segment having a dangling end" - "s_DeleteUnconnectedSegm" - "wxGenericValidator(& %VARIABLE%)" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxCheckBox: ID_CHECKBOX" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbCheckBoxProxy" - "ID_CHECKBOX" - 10004 - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_ConnectToPadsOpt" - "Connect to Pads" - 0 - "" - "Extend dangling tracks which partially cover a pad or via, all the way to pad or via center" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_BUTTON_EXECUTE" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "25/5/2007" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnButtonExecuteClick|NONE||" - "ID_BUTTON_EXECUTE" - 10006 - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Clean pcb" - 1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - "cleaningoptions_dialog.rc" - "source-editor-document" - "cleaningoptions_dialog.rc" - "source-editor" - 0 - 0 - 1 - 0 - "25/5/2007" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/pcbnew/dialog_drc_base.fbp b/pcbnew/dialog_drc_base.fbp index 1056a17f45..56efabdafd 100644 --- a/pcbnew/dialog_drc_base.fbp +++ b/pcbnew/dialog_drc_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 UTF-8 @@ -12,66 +12,66 @@ none 1 dialog_drc_base - + . - + 1 0 0 - - - + + + 1 - - - + + + 0 wxID_ANY - - + + DIALOG_DRC_CONTROL_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - + DRC Control - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + m_MainSizer wxVERTICAL none @@ -80,28 +80,28 @@ wxALL|wxEXPAND 0 - + m_CommandSizer wxHORIZONTAL none 5 - + 1 wxID_ANY Options: - + sbSizerOptions wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizer7 wxVERTICAL none @@ -113,9 +113,9 @@ 2 wxHORIZONTAL 1 - + 0 - + fgMinValuesSizer wxFLEX_GROWMODE_SPECIFIED none @@ -126,50 +126,50 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - - + + 1 - - + + 0 wxID_ANY Clearance - - + + m_ClearanceTitle protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -177,54 +177,54 @@ wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - - + + 0 - - + + 0 wxID_ANY - + 0 - + m_SetClearance public - - - - - + + + + + By Netclass - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -232,50 +232,50 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - - + + 1 - - + + 0 wxID_ANY Min track width - - + + m_TrackMinWidthTitle protected - - - - + + + + Enter the minimum acceptable value for a track width - - - + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -283,54 +283,54 @@ wxALL|wxEXPAND 0 - - + + 1 - - + + 0 wxID_ANY - + 0 - + m_SetTrackMinWidthCtrl public - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -338,50 +338,50 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - + Enter the minimum acceptable diameter for a standard via 1 - - + + 0 wxID_ANY Min via size - - + + m_ViaMinTitle protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -389,54 +389,54 @@ wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND 0 - - + + 1 - - + + 0 wxID_ANY - + 0 - + m_SetViaMinSizeCtrl public - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -444,50 +444,50 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 0 - - + + 1 - - + + 0 wxID_ANY Min uVia size - - + + m_MicroViaMinTitle protected - - - - + + + + Enter the minimum acceptable diameter for a micro via - - - + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -495,54 +495,54 @@ wxALL|wxEXPAND 0 - - + + 1 - - + + 0 wxID_ANY - + 0 - + m_SetMicroViakMinSizeCtrl public - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -554,61 +554,61 @@ wxID_ANY Create Report File - + ReportFileSizer wxHORIZONTAL none - + 5 wxALL|wxALIGN_CENTER_VERTICAL 0 - + 0 - + 1 - - + + 0 ID_CHECKBOX_RPT_FILE - - - + + + m_CreateRptCtrl public - - - - + + + + Enable writing report to this file - - - - + + + + OnReportCheckBoxClicked - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -616,54 +616,54 @@ wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL 1 - - + + 1 - - + + 0 wxID_ANY - + 0 180,-1 m_RptFilenameCtrl public - - - - + + + + Enter the report filename - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -671,51 +671,51 @@ wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT 0 - - + + 0 1 - - + + 0 ID_BUTTON_BROWSE_RPT_FILE ... -1,-1 - + m_BrowseButton protected - + 50,-1 - - - - - - + + + + + + OnButtonBrowseRptFileClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -729,7 +729,7 @@ wxEXPAND 1 - + bSizerMessages wxVERTICAL none @@ -738,50 +738,50 @@ wxRIGHT|wxLEFT 0 - - + + 1 - - + + 0 wxID_ANY Messages: - - + + m_staticText6 protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -789,54 +789,54 @@ wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND 1 - - + + 1 - - + + 0 wxID_ANY - + 0 220,-1 m_Messages protected - - + + wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -846,7 +846,7 @@ wxALIGN_CENTER_VERTICAL 0 - + bSizer11 wxVERTICAL none @@ -855,51 +855,51 @@ wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 - - + + 1 1 - - + + 0 ID_STARTDRC Start DRC - - + + m_buttonRunDRC protected - - - - + + + + Start the Design Rule Checker - - - + + + OnStartdrcClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -907,51 +907,51 @@ wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 - - + + 0 1 - - + + 0 ID_LIST_UNCONNECTED List Unconnected - - + + m_buttonListUnconnected protected - - - - + + + + List unconnected pads or tracks - - - + + + OnListUnconnectedClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -959,51 +959,51 @@ wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 - - + + 0 1 - - + + 0 ID_DELETE_ALL Delete All Markers - - + + m_DeleteAllButton protected - - - - + + + + Delete every marker - - - + + + OnDeleteAllClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1011,51 +1011,51 @@ wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL 0 - - + + 0 1 - - + + 0 wxID_ANY Delete Current Marker - - + + m_DeleteCurrentMarkerButton protected - - - - + + + + Delete the marker selected in the listBox below - - - + + + OnDeleteOneClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1067,50 +1067,50 @@ wxALL 0 - - + + 1 - - + + 0 wxID_ANY Error Messages: - - + + m_staticTextErrMsg protected - - - - - - - - + + + + + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1118,99 +1118,99 @@ wxEXPAND | wxALL 1 - - - + + + 1 - - + + 0 ID_NOTEBOOK1 - - + + m_Notebook protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Problems / Markers 1 - - + + 1 - - + + 0 wxID_ANY - - + + m_panelClearanceListBox protected - - + + ; - - - + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bSizeClearanceBox wxVERTICAL none @@ -1219,104 +1219,104 @@ wxALL|wxEXPAND 1 - - - + + + 1 - - + + 0 ID_CLEARANCE_LIST - + -1,80 m_ClearanceListBox public - - - + + + DRCLISTBOX; dialog_drc.h MARKERs, double click any to go there in PCB, right click for popup menu - - - - - - - - - - + + + + + + + + + + OnLeftDClickClearance - - - - - - - - - - - - - + + + + + + + + + + + + + OnRightUpClearance - - - + + + - + Unconnected 0 - - + + 1 - - + + 0 wxID_ANY - - + + m_panelUnconnectedBox protected - - - - - - + + + + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + bSizerUnconnectedBox wxVERTICAL none @@ -1325,51 +1325,51 @@ wxALL|wxEXPAND 1 - - - + + + 1 - - + + 0 ID_UNCONNECTED_LIST - - + + m_UnconnectedListBox public - - - + + + DRCLISTBOX; A list of unconnected pads, right click for popup menu - - - - - - - - - - + + + + + + + + + + OnLeftDClickUnconnected - - - - - - - - - - - - - + + + + + + + + + + + + + OnRightUpUnconnected - - - + + + @@ -1390,17 +1390,17 @@ 1 0 0 - + m_sdbSizer1 protected - + OnCancelClick - - - + + + OnOkClick - - + + diff --git a/pcbnew/dialogs/dialog_cleaning_options.cpp b/pcbnew/dialogs/dialog_cleaning_options.cpp new file mode 100644 index 0000000000..0c504adef4 --- /dev/null +++ b/pcbnew/dialogs/dialog_cleaning_options.cpp @@ -0,0 +1,28 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: dialog_cleaning_options.cpp +// Author: jean-pierre Charras +///////////////////////////////////////////////////////////////////////////// + +#include "wx/wx.h" + +#include "dialog_cleaning_options.h" + + +DIALOG_CLEANING_OPTIONS::DIALOG_CLEANING_OPTIONS( wxWindow* parent ): + DIALOG_CLEANING_OPTIONS_BASE( parent ) +{ + m_cleanViasOpt->SetValue( cleanVias ); + m_mergeSegmOpt->SetValue( mergeSegments ); + m_deleteUnconnectedOpt->SetValue( deleteUnconnectedSegm ); + m_reconnectToPadsOpt->SetValue( connectToPads ); + + GetSizer()->SetSizeHints(this); + Centre(); +} + +// Static members of DIALOG_CLEANING_OPTIONS +bool DIALOG_CLEANING_OPTIONS::cleanVias = true; +bool DIALOG_CLEANING_OPTIONS::mergeSegments = true; +bool DIALOG_CLEANING_OPTIONS::deleteUnconnectedSegm = true; +bool DIALOG_CLEANING_OPTIONS::connectToPads = false; + diff --git a/pcbnew/dialogs/dialog_cleaning_options.h b/pcbnew/dialogs/dialog_cleaning_options.h new file mode 100644 index 0000000000..642268fd10 --- /dev/null +++ b/pcbnew/dialogs/dialog_cleaning_options.h @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: dialog_cleaning_options.h +// Author: jean-pierre Charras +///////////////////////////////////////////////////////////////////////////// + +#ifndef DIALOG_CLEANING_OPTIONS_H_ +#define DIALOG_CLEANING_OPTIONS_H_ + +#include "dialog_cleaning_options_base.h" + +class DIALOG_CLEANING_OPTIONS: public DIALOG_CLEANING_OPTIONS_BASE +{ +public: + static bool cleanVias; + static bool mergeSegments; + static bool deleteUnconnectedSegm; + static bool connectToPads; + +public: + DIALOG_CLEANING_OPTIONS( wxWindow* parent ); + + ~DIALOG_CLEANING_OPTIONS() + { + } + +private: + void OnCancelClick( wxCommandEvent& event ) + { + EndModal( wxID_CANCEL ); + } + void OnOKClick( wxCommandEvent& event ) + { + GetOpts( ); + EndModal( wxID_OK ); + } + + void OnCloseWindow( wxCloseEvent& event ) + { + GetOpts( ); + } + + void GetOpts( ) + { + cleanVias = m_cleanViasOpt->GetValue( ); + mergeSegments = m_mergeSegmOpt->GetValue( ); + deleteUnconnectedSegm = m_deleteUnconnectedOpt->GetValue( ); + connectToPads = m_reconnectToPadsOpt->GetValue( ); + } +}; + +#endif + // DIALOG_CLEANING_OPTIONS_H_ diff --git a/pcbnew/dialogs/dialog_cleaning_options_base.cpp b/pcbnew/dialogs/dialog_cleaning_options_base.cpp new file mode 100644 index 0000000000..86043c9837 --- /dev/null +++ b/pcbnew/dialogs/dialog_cleaning_options_base.cpp @@ -0,0 +1,73 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_cleaning_options_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_CLEANING_OPTIONS_BASE::DIALOG_CLEANING_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizerMain; + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizerUpper; + bSizerUpper = new wxBoxSizer( wxVERTICAL ); + + m_cleanViasOpt = new wxCheckBox( this, wxID_ANY, _("Delete redundant vias"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cleanViasOpt->SetToolTip( _("remove vias on pads with a through hole") ); + + bSizerUpper->Add( m_cleanViasOpt, 0, wxALL, 5 ); + + m_mergeSegmOpt = new wxCheckBox( this, wxID_ANY, _("Merge segments"), wxDefaultPosition, wxDefaultSize, 0 ); + m_mergeSegmOpt->SetToolTip( _("merge aligned track segments, and remove null segments") ); + + bSizerUpper->Add( m_mergeSegmOpt, 0, wxALL, 5 ); + + m_deleteUnconnectedOpt = new wxCheckBox( this, wxID_ANY, _("Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_deleteUnconnectedOpt->SetToolTip( _("delete track segment having a dangling end") ); + + bSizerUpper->Add( m_deleteUnconnectedOpt, 0, wxALL, 5 ); + + m_reconnectToPadsOpt = new wxCheckBox( this, wxID_ANY, _("Connect to pads"), wxDefaultPosition, wxDefaultSize, 0 ); + m_reconnectToPadsOpt->SetToolTip( _("Extend dangling tracks which partially cover a pad or via, all the way to pad or via center") ); + + bSizerUpper->Add( m_reconnectToPadsOpt, 0, wxALL, 5 ); + + bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxALL, 5 ); + + m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMain->Add( m_staticline, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); + m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer->AddButton( m_sdbSizerCancel ); + m_sdbSizer->Realize(); + bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxALL, 5 ); + + this->SetSizer( bSizerMain ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCloseWindow ) ); + m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCancelClick ), NULL, this ); + m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnOKClick ), NULL, this ); +} + +DIALOG_CLEANING_OPTIONS_BASE::~DIALOG_CLEANING_OPTIONS_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCloseWindow ) ); + m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnCancelClick ), NULL, this ); + m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CLEANING_OPTIONS_BASE::OnOKClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_cleaning_options_base.fbp b/pcbnew/dialogs/dialog_cleaning_options_base.fbp new file mode 100644 index 0000000000..bd09b4c5d4 --- /dev/null +++ b/pcbnew/dialogs/dialog_cleaning_options_base.fbp @@ -0,0 +1,409 @@ + + + + + + C++ + 1 + source_name + 0 + UTF-8 + connect + dialog_cleaning_options_base + 1000 + none + 1 + dialog_cleaning_options + + . + + 1 + 1 + 0 + 0 + + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_CLEANING_OPTIONS_BASE + + 243,181 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Cleaning options + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + OnCloseWindow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 1 + + + bSizerUpper + wxVERTICAL + none + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Delete redundant vias + + + m_cleanViasOpt + protected + + + + + remove vias on pads with a through hole + bool + wxFILTER_NUMERIC + wxDefaultValidator + cleanVias + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Merge segments + + + m_mergeSegmOpt + protected + + + + + merge aligned track segments, and remove null segments + bool + wxFILTER_NUMERIC + wxDefaultValidator + mergeSegments + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Delete unconnected tracks + + + m_deleteUnconnectedOpt + protected + + + + + delete track segment having a dangling end + bool + wxFILTER_NUMERIC + wxDefaultValidator + deleteUnconnectedSegm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Connect to pads + + + m_reconnectToPadsOpt + protected + + + + + Extend dangling tracks which partially cover a pad or via, all the way to pad or via center + bool + wxFILTER_NUMERIC + wxDefaultValidator + connectToPads + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + + + m_staticline + protected + + + wxLI_HORIZONTAL + + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxALL + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + + OnCancelClick + + + + OnOKClick + + + + + + + + diff --git a/pcbnew/dialogs/dialog_cleaning_options_base.h b/pcbnew/dialogs/dialog_cleaning_options_base.h new file mode 100644 index 0000000000..cda49ed323 --- /dev/null +++ b/pcbnew/dialogs/dialog_cleaning_options_base.h @@ -0,0 +1,61 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_cleaning_options_base__ +#define __dialog_cleaning_options_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_CLEANING_OPTIONS_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_CLEANING_OPTIONS_BASE : public wxDialog +{ + private: + + protected: + wxCheckBox* m_cleanViasOpt; + wxCheckBox* m_mergeSegmOpt; + wxCheckBox* m_deleteUnconnectedOpt; + wxCheckBox* m_reconnectToPadsOpt; + wxStaticLine* m_staticline; + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; + wxButton* m_sdbSizerCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + bool cleanVias; + bool mergeSegments; + bool deleteUnconnectedSegm; + bool connectToPads; + + DIALOG_CLEANING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Cleaning options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 243,181 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_CLEANING_OPTIONS_BASE(); + +}; + +#endif //__dialog_cleaning_options_base__ diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 221252dfd0..34d3d9d5c2 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -217,8 +217,7 @@ void WinEDA_ModuleEditFrame::Export_Module( MODULE* ptmod, bool createlib ) } -void WinEDA_ModuleEditFrame::Delete_Module_In_Library( - const wxString& aLibname ) +void WinEDA_ModuleEditFrame::Delete_Module_In_Library( const wxString& aLibname ) { wxFileName newFileName; wxFileName oldFileName; diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp index 2e6415a7ca..1389212d34 100644 --- a/pcbnew/netlist.cpp +++ b/pcbnew/netlist.cpp @@ -367,7 +367,7 @@ bool WinEDA_PcbFrame::ReadPcbNetlist( const wxString& aNetlistFullFilename, { if( aDeleteBadTracks ) // Remove erroneous tracks { - RemoveMisConnectedTracks( NULL, true ); + RemoveMisConnectedTracks( NULL ); Compile_Ratsnest( NULL, true ); } }