From cdd9e8cabeae9c501274796ebdc3587b7084bbd3 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 26 Nov 2010 18:47:35 +0100 Subject: [PATCH] Pcbnew: code cleanup --- common/class_layerchoicebox.cpp | 1 - .../dialogs/dialog_print_using_printer.cpp | 1 - include/wxPcbStruct.h | 5 +- pcbnew/CMakeLists.txt | 23 +- pcbnew/ar_protos.h | 10 - pcbnew/attribut.cpp | 1 - pcbnew/automove.cpp | 101 +- pcbnew/autoplac.cpp | 250 ++- pcbnew/block.cpp | 1 - pcbnew/block_module_editor.cpp | 1 - pcbnew/class_module.cpp | 1 - pcbnew/class_netinfolist.cpp | 1 - ...ialog_general_options_BoardEditor_base.fbp | 1130 ---------- pcbnew/dialog_initpcb.rc | 1 - pcbnew/dialog_orient_footprints.cpp | 314 --- pcbnew/dialog_orient_footprints.h | 116 - pcbnew/dialog_orient_footprints.pjd | 911 -------- pcbnew/dialogs/dialog_copper_zones.cpp | 1 - pcbnew/{ => dialogs}/dialog_drc.cpp | 0 pcbnew/{ => dialogs}/dialog_drc.h | 0 pcbnew/{ => dialogs}/dialog_drc_base.cpp | 0 pcbnew/{ => dialogs}/dialog_drc_base.fbp | 0 pcbnew/{ => dialogs}/dialog_drc_base.h | 0 .../{ => dialogs}/dialog_general_options.cpp | 0 pcbnew/{ => dialogs}/dialog_general_options.h | 0 ...ialog_general_options_BoardEditor_base.cpp | 0 ...ialog_general_options_BoardEditor_base.fbp | 1130 ++++++++++ .../dialog_general_options_BoardEditor_base.h | 0 .../dialog_global_edit_tracks_and_vias.cpp | 0 .../dialog_global_edit_tracks_and_vias.h | 0 ...ialog_global_edit_tracks_and_vias_base.cpp | 0 ...ialog_global_edit_tracks_and_vias_base.fbp | 1894 ++++++++--------- .../dialog_global_edit_tracks_and_vias_base.h | 0 .../dialog_global_pads_edition_base.cpp | 0 .../dialog_global_pads_edition_base.fbp | 491 +++++ .../dialog_global_pads_edition_base.h | 0 pcbnew/{ => dialogs}/dialog_netlist.cpp | 0 pcbnew/{ => dialogs}/dialog_netlist.h | 0 pcbnew/{ => dialogs}/dialog_netlist_fbp.cpp | 0 pcbnew/{ => dialogs}/dialog_netlist_fbp.fbp | 1724 +++++++-------- pcbnew/{ => dialogs}/dialog_netlist_fbp.h | 0 pcbnew/dialogs/dialog_orient_footprints.cpp | 168 ++ .../dialogs/dialog_orient_footprints_base.cpp | 78 + .../dialog_orient_footprints_base.fbp} | 1016 ++++----- .../dialogs/dialog_orient_footprints_base.h | 57 + .../dialog_pcb_text_properties.cpp | 0 pcbnew/edit.cpp | 1 - pcbnew/ioascii.cpp | 1 - pcbnew/pcbframe.cpp | 7 +- pcbnew/pcbnew_id.h | 5 +- pcbnew/ratsnest.cpp | 1 - pcbnew/specctra_export.cpp | 1 - pcbnew/zone_filling_algorithm.cpp | 144 -- 53 files changed, 4491 insertions(+), 5096 deletions(-) delete mode 100644 pcbnew/dialog_general_options_BoardEditor_base.fbp delete mode 100644 pcbnew/dialog_initpcb.rc delete mode 100644 pcbnew/dialog_orient_footprints.cpp delete mode 100644 pcbnew/dialog_orient_footprints.h delete mode 100644 pcbnew/dialog_orient_footprints.pjd rename pcbnew/{ => dialogs}/dialog_drc.cpp (100%) rename pcbnew/{ => dialogs}/dialog_drc.h (100%) rename pcbnew/{ => dialogs}/dialog_drc_base.cpp (100%) rename pcbnew/{ => dialogs}/dialog_drc_base.fbp (100%) rename pcbnew/{ => dialogs}/dialog_drc_base.h (100%) rename pcbnew/{ => dialogs}/dialog_general_options.cpp (100%) rename pcbnew/{ => dialogs}/dialog_general_options.h (100%) rename pcbnew/{ => dialogs}/dialog_general_options_BoardEditor_base.cpp (100%) create mode 100644 pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp rename pcbnew/{ => dialogs}/dialog_general_options_BoardEditor_base.h (100%) rename pcbnew/{ => dialogs}/dialog_global_edit_tracks_and_vias.cpp (100%) rename pcbnew/{ => dialogs}/dialog_global_edit_tracks_and_vias.h (100%) rename pcbnew/{ => dialogs}/dialog_global_edit_tracks_and_vias_base.cpp (100%) rename pcbnew/{ => dialogs}/dialog_global_edit_tracks_and_vias_base.fbp (68%) rename pcbnew/{ => dialogs}/dialog_global_edit_tracks_and_vias_base.h (100%) rename pcbnew/{ => dialogs}/dialog_global_pads_edition_base.cpp (100%) create mode 100644 pcbnew/dialogs/dialog_global_pads_edition_base.fbp rename pcbnew/{ => dialogs}/dialog_global_pads_edition_base.h (100%) rename pcbnew/{ => dialogs}/dialog_netlist.cpp (100%) rename pcbnew/{ => dialogs}/dialog_netlist.h (100%) rename pcbnew/{ => dialogs}/dialog_netlist_fbp.cpp (100%) rename pcbnew/{ => dialogs}/dialog_netlist_fbp.fbp (56%) rename pcbnew/{ => dialogs}/dialog_netlist_fbp.h (100%) create mode 100644 pcbnew/dialogs/dialog_orient_footprints.cpp create mode 100644 pcbnew/dialogs/dialog_orient_footprints_base.cpp rename pcbnew/{dialog_global_pads_edition_base.fbp => dialogs/dialog_orient_footprints_base.fbp} (51%) create mode 100644 pcbnew/dialogs/dialog_orient_footprints_base.h rename pcbnew/{ => dialogs}/dialog_pcb_text_properties.cpp (100%) diff --git a/common/class_layerchoicebox.cpp b/common/class_layerchoicebox.cpp index 8679dfc8ad..96bfde1b88 100644 --- a/common/class_layerchoicebox.cpp +++ b/common/class_layerchoicebox.cpp @@ -5,7 +5,6 @@ #include "colors_selection.h" #include "bitmaps.h" -#include "pcbnew_id.h" #include "hotkeys.h" #include "help_common_strings.h" diff --git a/gerbview/dialogs/dialog_print_using_printer.cpp b/gerbview/dialogs/dialog_print_using_printer.cpp index 97a923cd6d..970c83e9f5 100644 --- a/gerbview/dialogs/dialog_print_using_printer.cpp +++ b/gerbview/dialogs/dialog_print_using_printer.cpp @@ -16,7 +16,6 @@ #include "gerbview.h" #include "wxGerberFrame.h" -#include "wxPcbStruct.h" #include "pcbplot.h" #include "class_board_design_settings.h" diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 7d75e5e541..82016d7694 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -1100,7 +1100,7 @@ public: * Function OnOrientFootprints * install the dialog box for the common Orient Footprints */ - void OnOrientFootprints( void ); + void OnOrientFootprints( wxCommandEvent& event ); /** * Function ReOrientModules @@ -1108,8 +1108,9 @@ public: * @param ModuleMask = mask (wildcard allowed) selection * @param Orient = new orientation * @param include_fixe = true to orient locked footprints + * @return true if some footprints modified, false if no change */ - void ReOrientModules( const wxString& ModuleMask, int Orient, + bool ReOrientModules( const wxString& ModuleMask, int Orient, bool include_fixe ); void FixeModule( MODULE* Module, bool Fixe ); void AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index a12c05e6b1..f0db648ada 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -31,8 +31,8 @@ set(PCBNEW_DIALOGS dialog_design_rules_base.cpp dialogs/dialog_display_options.cpp dialogs/dialog_display_options_base.cpp - dialog_drc_base.cpp - dialog_drc.cpp + dialogs/dialog_drc_base.cpp + dialogs/dialog_drc.cpp dialogs/dialog_edit_module_for_BoardEditor.cpp dialogs/dialog_edit_module_for_BoardEditor_base.cpp dialogs/dialog_edit_module_for_Modedit_base.cpp @@ -45,20 +45,20 @@ set(PCBNEW_DIALOGS dialog_freeroute_exchange_base.cpp dialogs/dialog_gendrill.cpp dialogs/dialog_gendrill_base.cpp - dialog_general_options.cpp - dialog_general_options_BoardEditor_base.cpp - dialog_global_edit_tracks_and_vias.cpp - dialog_global_edit_tracks_and_vias_base.cpp - dialog_global_pads_edition_base.cpp + dialogs/dialog_general_options.cpp + dialogs/dialog_general_options_BoardEditor_base.cpp + dialogs/dialog_global_edit_tracks_and_vias.cpp + dialogs/dialog_global_edit_tracks_and_vias_base.cpp + dialogs/dialog_global_pads_edition_base.cpp dialogs/dialog_graphic_items_options.cpp dialogs/dialog_graphic_items_options_base.cpp dialogs/dialog_graphic_item_properties.cpp dialogs/dialog_graphic_item_properties_base.cpp dialog_layers_setup.cpp dialog_layers_setup_base.cpp - dialog_netlist.cpp - dialog_netlist_fbp.cpp - dialog_pcb_text_properties.cpp + dialogs/dialog_netlist.cpp + dialogs/dialog_netlist_fbp.cpp + dialogs/dialog_pcb_text_properties.cpp dialogs/dialog_non_copper_zones_properties_base.cpp dialogs/dialog_pad_properties.cpp dialogs/dialog_pad_properties_base.cpp @@ -69,7 +69,8 @@ set(PCBNEW_DIALOGS dialogs/dialog_print_for_modedit_base.cpp dialogs/dialog_print_using_printer.cpp dialogs/dialog_print_using_printer_base.cpp - dialog_orient_footprints.cpp + dialogs/dialog_orient_footprints.cpp + dialogs/dialog_orient_footprints_base.cpp dialogs/dialog_mask_clearance.cpp dialogs/dialog_mask_clearance_base.cpp dialogs/dialog_SVG_print.cpp diff --git a/pcbnew/ar_protos.h b/pcbnew/ar_protos.h index 08a2e17644..e500ec8f90 100644 --- a/pcbnew/ar_protos.h +++ b/pcbnew/ar_protos.h @@ -2,13 +2,6 @@ /* ar-proto.h */ /**************/ -MODULE ** GenListeModules( BOARD * Pcb, int * NbModules ); - -/****************/ -/* GRAPHPCB.CPP */ -/****************/ - - /* Initialize a value type, the cells included in the board surface of the * pad edge by pt_pad, with the margin reserved for isolation. */ void Place_1_Pad_Board( BOARD * Pcb, D_PAD * pt_pad, int type, int marge, @@ -44,8 +37,6 @@ void TraceFilledRectangle( BOARD * Pcb, int ux0, int uy0, int ux1, int uy1, void TraceArc( int ux0,int uy0, int ux1, int uy1, int ArcAngle, int lg, int layer, int color, int op_logique); -/* SOLVE.CPP */ - /* QUEUE.CPP */ void FreeQueue(); void InitQueue(); @@ -53,7 +44,6 @@ void GetQueue( int *, int *, int *, int *, int * ); int SetQueue( int, int, int, int, int, int, int ); void ReSetQueue( int, int, int, int, int, int, int ); - /* WORK.CPP */ void InitWork(); void ReInitWork(); diff --git a/pcbnew/attribut.cpp b/pcbnew/attribut.cpp index 3e3f74aab5..92e9a4db2d 100644 --- a/pcbnew/attribut.cpp +++ b/pcbnew/attribut.cpp @@ -8,7 +8,6 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "autorout.h" #include "protos.h" diff --git a/pcbnew/automove.cpp b/pcbnew/automove.cpp index e5a75e4a4d..d8ac334327 100644 --- a/pcbnew/automove.cpp +++ b/pcbnew/automove.cpp @@ -2,6 +2,8 @@ /* Routines for automatic displacement and rotation of modules. */ /****************************************************************/ +#include + #include "fctsys.h" #include "gr_basic.h" #include "common.h" @@ -25,7 +27,7 @@ typedef enum { } SelectFixeFct; -static int tri_modules( MODULE** pt_ref, MODULE** pt_compare ); +static bool sortModulesbySize( MODULE* ref, MODULE* compare ); wxString ModulesMaskSelection = wxT( "*" ); @@ -132,10 +134,6 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) AutoMoveModulesOnPcb( TRUE ); break; - case ID_POPUP_PCB_REORIENT_ALL_MODULES: - OnOrientFootprints(); - break; - case ID_POPUP_PCB_AUTOROUTE_ALL_MODULES: Autoroute( &dc, ROUTE_ALL ); break; @@ -172,13 +170,12 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) */ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) { - MODULE** pt_Dmod, ** BaseListeModules; - MODULE* Module; + std::vector moduleList; wxPoint start, current; int Ymax_size, Xsize_allowed; int pas_grille = (int) GetScreen()->GetGridSize().x; - bool EdgeExists; - float surface; + bool edgesExists; + double surface; if( GetBoard()->m_Modules == NULL ) { @@ -190,28 +187,29 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) if( !IsOK( this, _( "Move modules?" ) ) ) return; - EdgeExists = SetBoardBoundaryBoxFromEdgesOnly(); + edgesExists = SetBoardBoundaryBoxFromEdgesOnly(); - if( PlaceModulesHorsPcb && !EdgeExists ) + if( PlaceModulesHorsPcb && !edgesExists ) { DisplayError( this, _( "Could not automatically place modules. No board outlines detected." ) ); return; } - Module = GetBoard()->m_Modules; + // Build sorted footprints list (sort by decreasing size ) + MODULE* Module = GetBoard()->m_Modules; for( ; Module != NULL; Module = Module->Next() ) { Module->Set_Rectangle_Encadrement(); Module->SetRectangleExinscrit(); + moduleList.push_back(Module); } + sort( moduleList.begin(), moduleList.end(), sortModulesbySize ); - BaseListeModules = GenListeModules( GetBoard(), NULL ); - - /* If allocation of modules not PCBs, the cursor is placed below - * PCB, to avoid placing components in PCB area. + /* to move modules outside the board, the cursor is placed below + * the current board, to avoid placing components in board area. */ - if( PlaceModulesHorsPcb && EdgeExists ) + if( PlaceModulesHorsPcb && edgesExists ) { if( GetScreen()->m_Curseur.y < (GetBoard()->m_BoundaryBox.GetBottom() + 2000) ) @@ -219,12 +217,12 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) 2000; } - /* calculating the area occupied by the circuits */ + /* calculate the area needed by footprints */ surface = 0.0; - for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ ) + for( unsigned ii = 0; ii < moduleList.size(); ii++ ) { - Module = *pt_Dmod; - if( PlaceModulesHorsPcb && EdgeExists ) + Module = moduleList[ii]; + if( PlaceModulesHorsPcb && edgesExists ) { if( GetBoard()->m_BoundaryBox.Inside( Module->m_Pos ) ) continue; @@ -237,13 +235,13 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) start = current = GetScreen()->m_Curseur; Ymax_size = 0; - for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ ) + for( unsigned ii = 0; ii < moduleList.size(); ii++ ) { - Module = *pt_Dmod; + Module = moduleList[ii]; if( Module->IsLocked() ) continue; - if( PlaceModulesHorsPcb && EdgeExists ) + if( PlaceModulesHorsPcb && edgesExists ) { if( GetBoard()->m_BoundaryBox.Inside( Module->m_Pos ) ) continue; @@ -269,7 +267,6 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( bool PlaceModulesHorsPcb ) current.x += Module->m_RealBoundaryBox.GetWidth() + pas_grille; } - MyFree( BaseListeModules ); DrawPanel->Refresh(); } @@ -302,58 +299,8 @@ void WinEDA_PcbFrame::FixeModule( MODULE* Module, bool Fixe ) } -/* Create memory allocation by the ordered list of structures D_MODULES - * Describing the module to move - * The end of the list is indicated by NULL - * Also returns the number of modules per NbModules * - * Deallocates memory after use - */ -MODULE** GenListeModules( BOARD* Pcb, int* NbModules ) +static bool sortModulesbySize( MODULE* ref, MODULE* compare ) { - MODULE* Module; - MODULE** ListeMod, ** PtList; - int NbMod; - - /* Reserve memory for descriptions of modules that are to be moved. */ - Module = Pcb->m_Modules; - NbMod = 0; - for( ; Module != NULL; Module = Module->Next() ) - NbMod++; - - ListeMod = (MODULE**) MyZMalloc( (NbMod + 1) * sizeof(MODULE*) ); - if( ListeMod == NULL ) - { - if( NbModules != NULL ) - *NbModules = 0; - return NULL; - } - - PtList = ListeMod; - Module = Pcb->m_Modules; - for( ; Module != NULL; Module = Module->Next() ) - { - *PtList = Module; PtList++; - Module->SetRectangleExinscrit(); - } - - /* Sort by surface area module largest to smallest */ - qsort( ListeMod, NbMod, sizeof(MODULE * *), - ( int ( * )( const void*, const void* ) )tri_modules ); - - if( NbModules != NULL ) - *NbModules = NbMod; - return ListeMod; + return compare->m_Surface < ref->m_Surface; } - -static int tri_modules( MODULE** pt_ref, MODULE** pt_compare ) -{ - float ff; - - ff = (*pt_ref)->m_Surface - (*pt_compare)->m_Surface; - if( ff < 0 ) - return 1; - if( ff > 0 ) - return -1; - return 0; -} diff --git a/pcbnew/autoplac.cpp b/pcbnew/autoplac.cpp index 92621cdf0e..3c2848a4f1 100644 --- a/pcbnew/autoplac.cpp +++ b/pcbnew/autoplac.cpp @@ -51,7 +51,6 @@ static bool AutoPlaceShowAll = TRUE; float MinCout; static int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide ); -static int Tri_PlaceModules( MODULE** pt_ref, MODULE** pt_compare ); static void TracePenaliteRectangle( BOARD* Pcb, int ux0, @@ -74,7 +73,6 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, { int ii, activ; MODULE* ThisModule = NULL; - MODULE** BaseListeModules; wxPoint PosOK; wxPoint memopos; int error; @@ -125,19 +123,17 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, /* Compute module parmeters used in auto place */ Module = GetBoard()->m_Modules; + NbTotalModules = 0; for( ; Module != NULL; Module = Module->Next() ) { Module->Set_Rectangle_Encadrement(); Module->SetRectangleExinscrit(); + NbTotalModules ++; } if( GenPlaceBoard() == 0 ) return; - /* Updating the parameters useful for module placement. */ - BaseListeModules = GenListeModules( GetBoard(), &NbTotalModules ); - MyFree( BaseListeModules ); - Module = GetBoard()->m_Modules; for( ; Module != NULL; Module = Module->Next() ) { @@ -1003,37 +999,23 @@ static void TracePenaliteRectangle( BOARD* Pcb, } -/************************************/ -/* Sort routines for use with qsort */ -/************************************/ - -static int Tri_PlaceModules( MODULE** pt_ref, MODULE** pt_compare ) +/* Sort routines */ +static bool Tri_PlaceModules( MODULE* ref, MODULE* compare ) { - float ff, ff1, ff2; + double ff1, ff2; - ff1 = (*pt_ref)->m_Surface * (*pt_ref)->m_PadNum; - ff2 = (*pt_compare)->m_Surface * (*pt_compare)->m_PadNum; - ff = ff1 - ff2; - if( ff < 0 ) - return 1; - if( ff > 0 ) - return -1; - return 0; + ff1 = ref->m_Surface * ref->m_PadNum; + ff2 = compare->m_Surface * compare->m_PadNum; + return ff2 < ff1; } - -static int Tri_RatsModules( MODULE** pt_ref, MODULE** pt_compare ) +static bool Tri_RatsModules( MODULE* ref, MODULE* compare ) { - float ff, ff1, ff2; + double ff1, ff2; - ff1 = (*pt_ref)->m_Surface * (*pt_ref)->flag; - ff2 = (*pt_compare)->m_Surface * (*pt_compare)->flag; - ff = ff1 - ff2; - if( ff < 0 ) - return 1; - if( ff > 0 ) - return -1; - return 0; + ff1 = ref->m_Surface * ref->flag; + ff2 = compare->m_Surface * compare->flag; + return ff2 < ff1; } @@ -1044,28 +1026,28 @@ static int Tri_RatsModules( MODULE** pt_ref, MODULE** pt_compare ) */ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC ) { - MODULE** BaseListeModules, ** pt_Dmod; - MODULE* Module = NULL, * AltModule = NULL; - int NbModules; + MODULE* Module; + std::vector moduleList; - BaseListeModules = GenListeModules( pcbframe->GetBoard(), &NbModules ); - if( BaseListeModules == NULL ) - return NULL; - - /* Sort surface area of modules from greatest to least. Surface area - * weighted by the number of pads - */ - qsort( BaseListeModules, NbModules, sizeof(MODULE * *), - ( int (*)( const void*, const void* ) )Tri_PlaceModules ); - - for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ ) + // Build sorted footprints list (sort by decreasing size ) + Module = pcbframe->GetBoard()->m_Modules; + for( ; Module != NULL; Module = Module->Next() ) { - (*pt_Dmod)->flag = 0; - if( !( (*pt_Dmod)->m_ModuleStatus & MODULE_to_PLACE ) ) + Module->Set_Rectangle_Encadrement(); + Module->SetRectangleExinscrit(); + moduleList.push_back(Module); + } + sort( moduleList.begin(), moduleList.end(), Tri_PlaceModules ); + + for( unsigned ii = 0; ii < moduleList.size(); ii++ ) + { + Module = moduleList[ii]; + Module->flag = 0; + if( !( Module->m_ModuleStatus & MODULE_to_PLACE ) ) continue; pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; - (*pt_Dmod)->DisplayInfo( pcbframe ); - pcbframe->build_ratsnest_module( DC, *pt_Dmod ); + Module->DisplayInfo( pcbframe ); + pcbframe->build_ratsnest_module( DC, Module ); /* Calculate external ratsnet. */ for( unsigned ii = 0; @@ -1074,33 +1056,33 @@ static MODULE* PickModule( WinEDA_PcbFrame* pcbframe, wxDC* DC ) { if( ( pcbframe->GetBoard()->m_LocalRatsnest[ii].m_Status & LOCAL_RATSNEST_ITEM ) == 0 ) - (*pt_Dmod)->flag++; + Module->flag++; } } pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; - qsort( BaseListeModules, NbModules, sizeof(MODULE * *), - ( int (*)( const void*, const void* ) )Tri_RatsModules ); - + sort( moduleList.begin(), moduleList.end(), Tri_RatsModules ); /* Search for "best" module. */ - Module = NULL; - for( pt_Dmod = BaseListeModules; *pt_Dmod != NULL; pt_Dmod++ ) + MODULE* bestModule = NULL; + MODULE* altModule = NULL; + for( unsigned ii = 0; ii < moduleList.size(); ii++ ) { - if( !( (*pt_Dmod)->m_ModuleStatus & MODULE_to_PLACE ) ) + Module = moduleList[ii]; + if( !( Module->m_ModuleStatus & MODULE_to_PLACE ) ) continue; - AltModule = *pt_Dmod; - if( (*pt_Dmod)->flag == 0 ) + altModule = Module; + if( Module->flag == 0 ) continue; - Module = *pt_Dmod; break; + bestModule = Module; + break; } - MyFree( BaseListeModules ); - if( Module ) - return Module; + if( bestModule ) + return bestModule; else - return AltModule; + return altModule; } @@ -1169,3 +1151,145 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly() ymax - GetBoard()->m_BoundaryBox.m_Pos.y ); return succes; } + + +/********************************************/ +int Propagation( WinEDA_PcbFrame* frame ) +/********************************************/ + +/** + * Function Propagation + * Used now only in autoplace calculations + * Uses the routing matrix to fill the cells within the zone + * Search and mark cells within the zone, and agree with DRC options. + * Requirements: + * Start from an initial point, to fill zone + * The zone must have no "copper island" + * Algorithm: + * If the current cell has a neightbour flagged as "cell in the zone", it + * become a cell in the zone + * The first point in the zone is the starting point + * 4 searches within the matrix are made: + * 1 - Left to right and top to bottom + * 2 - Right to left and top to bottom + * 3 - bottom to top and Right to left + * 4 - bottom to top and Left to right + * Given the current cell, for each search, we consider the 2 neightbour cells + * the previous cell on the same line and the previous cell on the same column. + * + * This funtion can request some iterations + * Iterations are made until no cell is added to the zone. + * @return: added cells count (i.e. which the attribute CELL_is_ZONE is set) + */ +{ + int row, col, nn; + long current_cell, old_cell_H; + int long* pt_cell_V; + int nbpoints = 0; + +#define NO_CELL_ZONE (HOLE | CELL_is_EDGE | CELL_is_ZONE) + wxString msg; + + Affiche_1_Parametre( frame, 57, wxT( "Detect" ), msg, CYAN ); + Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "1" ), CYAN ); + + // Alloc memory to handle 1 line or 1 colunmn on the routing matrix + nn = MAX( Nrows, Ncols ) * sizeof(*pt_cell_V); + pt_cell_V = (long*) MyMalloc( nn ); + + /* search 1 : from left to right and top to bottom */ + memset( pt_cell_V, 0, nn ); + for( row = 0; row < Nrows; row++ ) + { + old_cell_H = 0; + for( col = 0; col < Ncols; col++ ) + { + current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; + if( current_cell == 0 ) /* a free cell is found */ + { + if( (old_cell_H & CELL_is_ZONE) + || (pt_cell_V[col] & CELL_is_ZONE) ) + { + OrCell( row, col, BOTTOM, CELL_is_ZONE ); + current_cell = CELL_is_ZONE; + nbpoints++; + } + } + pt_cell_V[col] = old_cell_H = current_cell; + } + } + + /* search 2 : from right to left and top to bottom */ + Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "2" ), CYAN ); + memset( pt_cell_V, 0, nn ); + for( row = 0; row < Nrows; row++ ) + { + old_cell_H = 0; + for( col = Ncols - 1; col >= 0; col-- ) + { + current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; + if( current_cell == 0 ) /* a free cell is found */ + { + if( (old_cell_H & CELL_is_ZONE) + || (pt_cell_V[col] & CELL_is_ZONE) ) + { + OrCell( row, col, BOTTOM, CELL_is_ZONE ); + current_cell = CELL_is_ZONE; + nbpoints++; + } + } + pt_cell_V[col] = old_cell_H = current_cell; + } + } + + /* search 3 : from bottom to top and right to left balayage */ + Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "3" ), CYAN ); + memset( pt_cell_V, 0, nn ); + for( col = Ncols - 1; col >= 0; col-- ) + { + old_cell_H = 0; + for( row = Nrows - 1; row >= 0; row-- ) + { + current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; + if( current_cell == 0 ) /* a free cell is found */ + { + if( (old_cell_H & CELL_is_ZONE) + || (pt_cell_V[row] & CELL_is_ZONE) ) + { + OrCell( row, col, BOTTOM, CELL_is_ZONE ); + current_cell = CELL_is_ZONE; + nbpoints++; + } + } + pt_cell_V[row] = old_cell_H = current_cell; + } + } + + /* search 4 : from bottom to top and left to right */ + Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "4" ), CYAN ); + memset( pt_cell_V, 0, nn ); + for( col = 0; col < Ncols; col++ ) + { + old_cell_H = 0; + for( row = Nrows - 1; row >= 0; row-- ) + { + current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; + if( current_cell == 0 ) /* a free cell is found */ + { + if( (old_cell_H & CELL_is_ZONE) + || (pt_cell_V[row] & CELL_is_ZONE) ) + { + OrCell( row, col, BOTTOM, CELL_is_ZONE ); + current_cell = CELL_is_ZONE; + nbpoints++; + } + } + pt_cell_V[row] = old_cell_H = current_cell; + } + } + + MyFree( pt_cell_V ); + + return nbpoints; +} + diff --git a/pcbnew/block.cpp b/pcbnew/block.cpp index 19beff3010..c96df3cddd 100644 --- a/pcbnew/block.cpp +++ b/pcbnew/block.cpp @@ -12,7 +12,6 @@ #include "pcbnew.h" #include "wxPcbStruct.h" -#include "autorout.h" #include "pcbplot.h" #include "trigo.h" diff --git a/pcbnew/block_module_editor.cpp b/pcbnew/block_module_editor.cpp index b7c734c88d..fec12017cc 100644 --- a/pcbnew/block_module_editor.cpp +++ b/pcbnew/block_module_editor.cpp @@ -14,7 +14,6 @@ #include "pcbnew.h" #include "wxPcbStruct.h" #include "module_editor_frame.h" -#include "autorout.h" #include "pcbplot.h" #include "trigo.h" diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 3b74c89887..a701e3bf91 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -17,7 +17,6 @@ #include "class_board_design_settings.h" #include "colors_selection.h" -#include "autorout.h" #include "drag.h" #include "3d_struct.h" diff --git a/pcbnew/class_netinfolist.cpp b/pcbnew/class_netinfolist.cpp index 65947a3052..23c6725cce 100644 --- a/pcbnew/class_netinfolist.cpp +++ b/pcbnew/class_netinfolist.cpp @@ -7,7 +7,6 @@ #include "common.h" #include "class_drawpanel.h" #include "pcbnew.h" -#include "autorout.h" // Constructor and destructor diff --git a/pcbnew/dialog_general_options_BoardEditor_base.fbp b/pcbnew/dialog_general_options_BoardEditor_base.fbp deleted file mode 100644 index cbae000860..0000000000 --- a/pcbnew/dialog_general_options_BoardEditor_base.fbp +++ /dev/null @@ -1,1130 +0,0 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_general_options_BoardEditor_base - 1000 - none - 1 - DialogGeneralOptionsBoardEditor_base - - . - - 1 - 1 - 0 - - - - - 1 - - - - 0 - wxID_ANY - - - DialogGeneralOptionsBoardEditor_base - - 585,280 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - General settings - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bLeftSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - - "No Display" "Display" - - 1 - - - 0 - wxID_POLAR_CTRL - Display Polar Coord - 1 - - - m_PolarDisplay - protected - - 1 - - wxRA_SPECIFY_COLS - - Activates the display of relative coordinates from relative origin (set by the space key) to the cursor, in polar coordinates (angle and distance) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - "Inches" "Millimeters" - - 1 - - - 0 - wxID_UNITS - Units - 1 - - - m_UnitsSelection - protected - - 1 - - wxRA_SPECIFY_COLS - - Selection of units used to display dimensions and positions of items - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - "Small cross" "Full screen cursor" - - 1 - - - 0 - wxID_CURSOR_SHAPE - Cursor - 1 - - - m_CursorShape - protected - - 0 - - wxRA_SPECIFY_COLS - - Main cursor shape selection (small cross or large cursor) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bMiddleLeftSizer - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Max Links: - - - m_staticTextmaxlinks - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_ANY - 1 - 5 - - 1 - - m_MaxShowLinks - protected - - - wxSP_ARROW_KEYS - - Adjust the number of ratsnets shown from cursor to closest pads - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_ANY - Auto Save (minutes): - - - m_staticTextautosave - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_ANY - 0 - 60 - - 0 - - m_SaveTime - protected - - - wxSP_ARROW_KEYS - - Delay after the first change to create a backup file of the board on disk. - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 1 - - wxID_ANY - Options: - - bMiddleRightBoxSizer - wxVERTICAL - none - - - 5 - wxALL|wxEXPAND - 0 - - - 1 - - 1 - - - 0 - wxID_DRC_ONOFF - Drc ON - - - m_DrcOn - protected - - - - - Enable/disable the DRC control. When DRC is disable, all connections are allowed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_GENERAL_RATSNEST - Show Ratsnest - - - m_ShowGlobalRatsnest - protected - - - - - Show (or not) the full rastnest. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_RATSNEST_MODULE - Show Mod Ratsnest - - - m_ShowModuleRatsnest - protected - - - - - Shows (or not) the local ratsnest relative to a footprint, when moving it. This ratsnest is useful to place a footprint. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_TRACK_AUTODEL - Tracks Auto Del - - - m_TrackAutodel - protected - - - - - Enable/disable the automatic track deletion when recreating a track. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_TRACKS45 - Track only 45 degrees - - - m_Track_45_Only_Ctrl - protected - - - - - If enabled, force tracks directions to H, V or 45 degrees, when creating a track. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_SEGMENTS45 - Segments 45 Only - - - m_Segments_45_Only_Ctrl - protected - - - - - If enabled, force segments directions to H, V or 45 degrees, when creating a segment on technical layers. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_AUTOPAN - Auto PAN - - - m_AutoPANOpt - protected - - - - - Allows auto pan when creating a track, or moving an item. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Double Segm Track - - - m_Track_DoubleSegm_Ctrl - protected - - - - - If enabled, uses two track segments, with 45 degrees angle between them when creating a new track - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bRightSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - - "Never" "When creating tracks" "Always" - - 1 - - - 0 - wxID_ANY - Magnetic Pads - 1 - - - m_MagneticPadOptCtrl - protected - - 0 - - wxRA_SPECIFY_COLS - - control the capture of the pcb cursor when the mouse cursor enters a pad area - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - "Never" "When creating tracks" "Always" - - 1 - - - 0 - wxID_MAGNETIC_TRACKS - Magnetic Tracks - 1 - - - m_MagneticTrackOptCtrl - protected - - 0 - - wxRA_SPECIFY_COLS - - Control the capture of the pcb cursor when the mouse cursor enters a track - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - - - 1 - 1 - - - 0 - wxID_OK - OK - - - m_buttonOK - protected - - - - - - - - - OnOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_HORIZONTAL|wxALL - 0 - - - - 0 - 1 - - - 0 - wxID_CANCEL - Cancel - - - m_buttonCANCEL - protected - - - - - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pcbnew/dialog_initpcb.rc b/pcbnew/dialog_initpcb.rc deleted file mode 100644 index b86c4e2265..0000000000 --- a/pcbnew/dialog_initpcb.rc +++ /dev/null @@ -1 +0,0 @@ -#include "wx/msw/wx.rc" diff --git a/pcbnew/dialog_orient_footprints.cpp b/pcbnew/dialog_orient_footprints.cpp deleted file mode 100644 index 8e3683c4b7..0000000000 --- a/pcbnew/dialog_orient_footprints.cpp +++ /dev/null @@ -1,314 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_orient_footprints.cpp -// Purpose: -// Author: j-p Charras -// Modified by: -// Created: 11/07/2008 13:32:12 -// RCS-ID: -// Copyright: j-p Charras -// Licence: GPL -///////////////////////////////////////////////////////////////////////////// - -// Generated by DialogBlocks (unregistered), 11/07/2008 13:32:12 - -////@begin includes -////@end includes - -#include "fctsys.h" -#include "class_drawpanel.h" -#include "confirm.h" -#include "kicad_string.h" -#include "pcbnew.h" -#include "wxPcbStruct.h" - -#include "dialog_orient_footprints.h" - -////@begin XPM images -////@end XPM images - - -int s_NewOrientation = 0; - -/*! - * dialog_orient_footprints type definition - */ - -IMPLEMENT_DYNAMIC_CLASS( dialog_orient_footprints, wxDialog ) - - -/*! - * dialog_orient_footprints event table definition - */ - -BEGIN_EVENT_TABLE( dialog_orient_footprints, wxDialog ) - -////@begin dialog_orient_footprints event table entries - EVT_CLOSE( dialog_orient_footprints::OnCloseWindow ) - - EVT_BUTTON( wxID_OK, dialog_orient_footprints::OnOkClick ) - - EVT_BUTTON( wxID_CANCEL, dialog_orient_footprints::OnCancelClick ) - -////@end dialog_orient_footprints event table entries - -END_EVENT_TABLE() - - -/*! - * dialog_orient_footprints constructors - */ - -dialog_orient_footprints::dialog_orient_footprints() -{ - Init(); -} - -dialog_orient_footprints::dialog_orient_footprints( WinEDA_PcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ - m_Parent = parent; - Init(); - Create(parent, id, caption, pos, size, style); -} - - -/*! - * dialog_orient_footprints creator - */ - -bool dialog_orient_footprints::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) -{ -////@begin dialog_orient_footprints creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS); - wxDialog::Create( parent, id, caption, pos, size, style ); - - CreateControls(); - if (GetSizer()) - { - GetSizer()->SetSizeHints(this); - } - Centre(); -////@end dialog_orient_footprints creation - return true; -} - - -/*! - * dialog_orient_footprints destructor - */ - -dialog_orient_footprints::~dialog_orient_footprints() -{ -////@begin dialog_orient_footprints destruction -////@end dialog_orient_footprints destruction -} - - -/*! - * Member initialisation - */ - -void dialog_orient_footprints::Init() -{ -////@begin dialog_orient_footprints member initialisation - m_OrientationCtrl = NULL; - m_FilterPattern = NULL; - m_ApplyToLocked = NULL; - m_CloseButton = NULL; -////@end dialog_orient_footprints member initialisation -} - - -/*! - * Control creation for dialog_orient_footprints - */ - -void dialog_orient_footprints::CreateControls() -{ -////@begin dialog_orient_footprints content construction - // Generated by DialogBlocks, 11/07/2008 16:49:18 (unregistered) - - dialog_orient_footprints* itemDialog1 = this; - - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); - itemDialog1->SetSizer(itemBoxSizer2); - - wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer3, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer3->Add(itemStaticText4, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - - m_OrientationCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRLROT_VALUE, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - if (dialog_orient_footprints::ShowToolTips()) - m_OrientationCtrl->SetToolTip(_("New orientation (0.1 degree resolution)")); - itemBoxSizer3->Add(m_OrientationCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("Filter:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer3->Add(itemStaticText6, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - - m_FilterPattern = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_FOOTPRINTS_FILTER, _("*"), wxDefaultPosition, wxDefaultSize, 0 ); - if (dialog_orient_footprints::ShowToolTips()) - m_FilterPattern->SetToolTip(_("Filter to select footprints by reference")); - itemBoxSizer3->Add(m_FilterPattern, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - - itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5); - - m_ApplyToLocked = new wxCheckBox( itemDialog1, ID_CHECKBOX_APPLY_TO_LOCKED, _("Include Locked Footprints"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ApplyToLocked->SetValue(false); - if (dialog_orient_footprints::ShowToolTips()) - m_ApplyToLocked->SetToolTip(_("Force locked footprints to be modified")); - itemBoxSizer3->Add(m_ApplyToLocked, 0, wxGROW|wxALL, 5); - - wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - - wxButton* itemButton11 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - - m_CloseButton = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_CloseButton->SetDefault(); - itemBoxSizer10->Add(m_CloseButton, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); - -////@end dialog_orient_footprints content construction - - wxString txt; - txt.Printf(wxT("%g"), (double) s_NewOrientation/10); - m_OrientationCtrl->SetValue(txt); - - m_CloseButton->SetFocus( ); -} - - -/*! - * Should we show tooltips? - */ - -bool dialog_orient_footprints::ShowToolTips() -{ - return true; -} - -/*! - * Get bitmap resources - */ - -wxBitmap dialog_orient_footprints::GetBitmapResource( const wxString& name ) -{ - // Bitmap retrieval -////@begin dialog_orient_footprints bitmap retrieval - wxUnusedVar(name); - return wxNullBitmap; -////@end dialog_orient_footprints bitmap retrieval -} - -/*! - * Get icon resources - */ - -wxIcon dialog_orient_footprints::GetIconResource( const wxString& name ) -{ - // Icon retrieval -////@begin dialog_orient_footprints icon retrieval - wxUnusedVar(name); - return wxNullIcon; -////@end dialog_orient_footprints icon retrieval -} - - -/***********************************************/ -void WinEDA_PcbFrame::OnOrientFootprints( void ) -/***********************************************/ -/** - * Function OnOrientFootprints - * install the dialog box for the comman Orient Footprints - */ -{ - dialog_orient_footprints dialogbox(this); - dialogbox.ShowModal(); - dialogbox.Destroy(); -} - - -/*******************************************************************/ -void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask, - int Orient, bool include_fixe ) -/*******************************************************************/ -/** - * Function ReOrientModules - * Set the orientation of footprints - * @param ModuleMask = mask (wildcard allowed) selection - * @param Orient = new orientation - * @param include_fixe = true to orient locked footprints - */ -{ - wxString line; - bool redraw = false; - - line.Printf( _( "Ok to set footprints orientation to %g degrees ?" ), (double)Orient / 10 ); - if( !IsOK( this, line ) ) - return; - - for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() ) - { - if( module->IsLocked() && !include_fixe ) - continue; - - if( WildCompareString( ModuleMask, module->m_Reference->m_Text, FALSE ) ) - { - OnModify(); - redraw = true; - Rotate_Module( NULL, module, Orient, FALSE ); - } - } - - if ( redraw ) - DrawPanel->Refresh(); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK - */ - -void dialog_orient_footprints::OnOkClick( wxCommandEvent& event ) -{ - double d_orient; - wxString text = m_OrientationCtrl->GetValue(); - - if ( ! text.ToDouble(&d_orient) ) - { - DisplayError(this, _("Bad value for footprints orientation")); - return; - } - - s_NewOrientation = wxRound(d_orient * 10); - if ( s_NewOrientation > 3600 ) - s_NewOrientation = 3600; - if ( s_NewOrientation < -3600 ) - s_NewOrientation = -3600; - - text = m_FilterPattern->GetValue(); - m_Parent->ReOrientModules( text, s_NewOrientation, m_ApplyToLocked->IsChecked() ); - Close(); -} - - -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL - */ - -void dialog_orient_footprints::OnCancelClick( wxCommandEvent& event ) -{ - Close(); -} - - -/*! - * wxEVT_CLOSE_WINDOW event handler for ID_DIALOG_ORIENT_FOOTPRINTS - */ - -void dialog_orient_footprints::OnCloseWindow( wxCloseEvent& event ) -{ - EndModal(1); -} - diff --git a/pcbnew/dialog_orient_footprints.h b/pcbnew/dialog_orient_footprints.h deleted file mode 100644 index 2b199509bb..0000000000 --- a/pcbnew/dialog_orient_footprints.h +++ /dev/null @@ -1,116 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_orient_footprints.h -// Purpose: -// Author: -// Modified by: -// Created: 11/07/2008 13:32:12 -// RCS-ID: -// Copyright: -// Licence: -///////////////////////////////////////////////////////////////////////////// - -// Generated by DialogBlocks (unregistered), 11/07/2008 13:32:12 - -#ifndef _DIALOG_ORIENT_FOOTPRINTS_H_ -#define _DIALOG_ORIENT_FOOTPRINTS_H_ - - -/*! - * Includes - */ - -////@begin includes -////@end includes - -/*! - * Forward declarations - */ - -////@begin forward declarations -////@end forward declarations - -/*! - * Control identifiers - */ - -////@begin control identifiers -#define ID_DIALOG_ORIENT_FOOTPRINTS 10000 -#define ID_TEXTCTRLROT_VALUE 10003 -#define ID_TEXTCTRL_FOOTPRINTS_FILTER 10001 -#define ID_CHECKBOX_APPLY_TO_LOCKED 10002 -#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE wxDEFAULT_DIALOG_STYLE -#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_TITLE _("Footprints Orientation") -#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_IDNAME ID_DIALOG_ORIENT_FOOTPRINTS -#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_SIZE wxSize(400, 300) -#define SYMBOL_DIALOG_ORIENT_FOOTPRINTS_POSITION wxDefaultPosition -////@end control identifiers - - -/*! - * dialog_orient_footprints class declaration - */ - -class dialog_orient_footprints: public wxDialog -{ - DECLARE_DYNAMIC_CLASS( dialog_orient_footprints ) - DECLARE_EVENT_TABLE() - -public: - /// Constructors - dialog_orient_footprints(); - dialog_orient_footprints( WinEDA_PcbFrame* parent, - wxWindowID id = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_IDNAME, - const wxString& caption = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_TITLE, - const wxPoint& pos = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_POSITION, - const wxSize& size = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_SIZE, - long style = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE ); - - /// Creation - bool Create( wxWindow* parent, wxWindowID id = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_IDNAME, const wxString& caption = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_TITLE, const wxPoint& pos = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_POSITION, const wxSize& size = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_SIZE, long style = SYMBOL_DIALOG_ORIENT_FOOTPRINTS_STYLE ); - - /// Destructor - ~dialog_orient_footprints(); - - /// Initialises member variables - void Init(); - - /// Creates the controls and sizers - void CreateControls(); - -////@begin dialog_orient_footprints event handler declarations - - /// wxEVT_CLOSE_WINDOW event handler for ID_DIALOG_ORIENT_FOOTPRINTS - void OnCloseWindow( wxCloseEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK - void OnOkClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL - void OnCancelClick( wxCommandEvent& event ); - -////@end dialog_orient_footprints event handler declarations - -////@begin dialog_orient_footprints member function declarations - - /// Retrieves bitmap resources - wxBitmap GetBitmapResource( const wxString& name ); - - /// Retrieves icon resources - wxIcon GetIconResource( const wxString& name ); -////@end dialog_orient_footprints member function declarations - - /// Should we show tooltips? - static bool ShowToolTips(); - -////@begin dialog_orient_footprints member variables - wxTextCtrl* m_OrientationCtrl; - wxTextCtrl* m_FilterPattern; - wxCheckBox* m_ApplyToLocked; - wxButton* m_CloseButton; -////@end dialog_orient_footprints member variables - - WinEDA_PcbFrame * m_Parent; -}; - -#endif - // _DIALOG_ORIENT_FOOTPRINTS_H_ diff --git a/pcbnew/dialog_orient_footprints.pjd b/pcbnew/dialog_orient_footprints.pjd deleted file mode 100644 index 07139213b6..0000000000 --- a/pcbnew/dialog_orient_footprints.pjd +++ /dev/null @@ -1,911 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - "" - "" - "" - 0 - 0 - "<All platforms>" - "2.6.4" - "///////////////////////////////////////////////////////////////////////////// -// 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: -///////////////////////////////////////////////////////////////////////////// - -" - "" - "// 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 - 0 - 1 - 1 - 0 - 1 - 0 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - -8519680 - "" - "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%" - 0 - 1 - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "dialog_orient_footprints" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - 0 - 0 - "wxEVT_CLOSE_WINDOW|OnCloseWindow|NONE||" - "ID_DIALOG_ORIENT_FOOTPRINTS" - 10000 - "dialog_orient_footprints" - "wxDialog" - "wxDialog" - "dialog_orient_footprints.cpp" - "dialog_orient_footprints.h" - "" - "Footprints Orientation" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 1 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 1 - 0 - "" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Horizontal" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 1 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Orientation:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRLROT_VALUE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbTextCtrlProxy" - "ID_TEXTCTRLROT_VALUE" - 10003 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_OrientationCtrl" - "" - 0 - "" - "New orientation (0.1 degree resolution)" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Filter:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRL_FOOTPRINTS_FILTER" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbTextCtrlProxy" - "ID_TEXTCTRL_FOOTPRINTS_FILTER" - 10001 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_FilterPattern" - "*" - 0 - "" - "Filter to select footprints by reference" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 1 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbSpacerProxy" - 5 - 5 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - - "wxCheckBox: ID_CHECKBOX_APPLY_TO_LOCKED" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbCheckBoxProxy" - "ID_CHECKBOX_APPLY_TO_LOCKED" - 10002 - "" - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_ApplyToLocked" - "Include Locked Footprints" - 0 - "" - "Force locked footprints to be modified" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: wxID_OK" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||dialog_orient_footprints" - "wxID_OK" - 5100 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "OK" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 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 - "" - "" - - - "wxButton: wxID_CANCEL" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "11/7/2008" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||dialog_orient_footprints" - "wxID_CANCEL" - 5101 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "m_CloseButton" - "Cancel" - 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 - - "dialog_orient_footprints.rc" - "source-editor-document" - "dialog_orient_footprints.rc" - "source-editor" - 0 - 0 - 1 - 0 - "11/7/2008" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 56da7d2536..41cfa15e2f 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -14,7 +14,6 @@ #include "pcbnew.h" #include "wxPcbStruct.h" #include "trigo.h" -#include "autorout.h" #include "zones.h" #include "dialog_copper_zones.h" diff --git a/pcbnew/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp similarity index 100% rename from pcbnew/dialog_drc.cpp rename to pcbnew/dialogs/dialog_drc.cpp diff --git a/pcbnew/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h similarity index 100% rename from pcbnew/dialog_drc.h rename to pcbnew/dialogs/dialog_drc.h diff --git a/pcbnew/dialog_drc_base.cpp b/pcbnew/dialogs/dialog_drc_base.cpp similarity index 100% rename from pcbnew/dialog_drc_base.cpp rename to pcbnew/dialogs/dialog_drc_base.cpp diff --git a/pcbnew/dialog_drc_base.fbp b/pcbnew/dialogs/dialog_drc_base.fbp similarity index 100% rename from pcbnew/dialog_drc_base.fbp rename to pcbnew/dialogs/dialog_drc_base.fbp diff --git a/pcbnew/dialog_drc_base.h b/pcbnew/dialogs/dialog_drc_base.h similarity index 100% rename from pcbnew/dialog_drc_base.h rename to pcbnew/dialogs/dialog_drc_base.h diff --git a/pcbnew/dialog_general_options.cpp b/pcbnew/dialogs/dialog_general_options.cpp similarity index 100% rename from pcbnew/dialog_general_options.cpp rename to pcbnew/dialogs/dialog_general_options.cpp diff --git a/pcbnew/dialog_general_options.h b/pcbnew/dialogs/dialog_general_options.h similarity index 100% rename from pcbnew/dialog_general_options.h rename to pcbnew/dialogs/dialog_general_options.h diff --git a/pcbnew/dialog_general_options_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp similarity index 100% rename from pcbnew/dialog_general_options_BoardEditor_base.cpp rename to pcbnew/dialogs/dialog_general_options_BoardEditor_base.cpp diff --git a/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp new file mode 100644 index 0000000000..074fdb0faa --- /dev/null +++ b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.fbp @@ -0,0 +1,1130 @@ + + + + + + C++ + 1 + UTF-8 + connect + dialog_general_options_BoardEditor_base + 1000 + none + 1 + DialogGeneralOptionsBoardEditor_base + + . + + 1 + 1 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + + DialogGeneralOptionsBoardEditor_base + + 585,280 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + General settings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "No Display" "Display" + + 1 + + + 0 + wxID_POLAR_CTRL + Display Polar Coord + 1 + + + m_PolarDisplay + protected + + 1 + + wxRA_SPECIFY_COLS + + Activates the display of relative coordinates from relative origin (set by the space key) to the cursor, in polar coordinates (angle and distance) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Inches" "Millimeters" + + 1 + + + 0 + wxID_UNITS + Units + 1 + + + m_UnitsSelection + protected + + 1 + + wxRA_SPECIFY_COLS + + Selection of units used to display dimensions and positions of items + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Small cross" "Full screen cursor" + + 1 + + + 0 + wxID_CURSOR_SHAPE + Cursor + 1 + + + m_CursorShape + protected + + 0 + + wxRA_SPECIFY_COLS + + Main cursor shape selection (small cross or large cursor) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bMiddleLeftSizer + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Max Links: + + + m_staticTextmaxlinks + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + 1 + 5 + + 1 + + m_MaxShowLinks + protected + + + wxSP_ARROW_KEYS + + Adjust the number of ratsnets shown from cursor to closest pads + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + Auto Save (minutes): + + + m_staticTextautosave + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + 0 + 60 + + 0 + + m_SaveTime + protected + + + wxSP_ARROW_KEYS + + Delay after the first change to create a backup file of the board on disk. + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 1 + + wxID_ANY + Options: + + bMiddleRightBoxSizer + wxVERTICAL + none + + + 5 + wxALL|wxEXPAND + 0 + + + 1 + + 1 + + + 0 + wxID_DRC_ONOFF + Drc ON + + + m_DrcOn + protected + + + + + Enable/disable the DRC control. When DRC is disable, all connections are allowed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_GENERAL_RATSNEST + Show Ratsnest + + + m_ShowGlobalRatsnest + protected + + + + + Show (or not) the full rastnest. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_RATSNEST_MODULE + Show Mod Ratsnest + + + m_ShowModuleRatsnest + protected + + + + + Shows (or not) the local ratsnest relative to a footprint, when moving it. This ratsnest is useful to place a footprint. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_TRACK_AUTODEL + Tracks Auto Del + + + m_TrackAutodel + protected + + + + + Enable/disable the automatic track deletion when recreating a track. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_TRACKS45 + Track only 45 degrees + + + m_Track_45_Only_Ctrl + protected + + + + + If enabled, force tracks directions to H, V or 45 degrees, when creating a track. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_SEGMENTS45 + Segments 45 Only + + + m_Segments_45_Only_Ctrl + protected + + + + + If enabled, force segments directions to H, V or 45 degrees, when creating a segment on technical layers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_AUTOPAN + Auto PAN + + + m_AutoPANOpt + protected + + + + + Allows auto pan when creating a track, or moving an item. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Double Segm Track + + + m_Track_DoubleSegm_Ctrl + protected + + + + + If enabled, uses two track segments, with 45 degrees angle between them when creating a new track + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bRightSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "Never" "When creating tracks" "Always" + + 1 + + + 0 + wxID_ANY + Magnetic Pads + 1 + + + m_MagneticPadOptCtrl + protected + + 0 + + wxRA_SPECIFY_COLS + + control the capture of the pcb cursor when the mouse cursor enters a pad area + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Never" "When creating tracks" "Always" + + 1 + + + 0 + wxID_MAGNETIC_TRACKS + Magnetic Tracks + 1 + + + m_MagneticTrackOptCtrl + protected + + 0 + + wxRA_SPECIFY_COLS + + Control the capture of the pcb cursor when the mouse cursor enters a track + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + + + 1 + 1 + + + 0 + wxID_OK + OK + + + m_buttonOK + protected + + + + + + + + + OnOkClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_HORIZONTAL|wxALL + 0 + + + + 0 + 1 + + + 0 + wxID_CANCEL + Cancel + + + m_buttonCANCEL + protected + + + + + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialog_general_options_BoardEditor_base.h b/pcbnew/dialogs/dialog_general_options_BoardEditor_base.h similarity index 100% rename from pcbnew/dialog_general_options_BoardEditor_base.h rename to pcbnew/dialogs/dialog_general_options_BoardEditor_base.h diff --git a/pcbnew/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp similarity index 100% rename from pcbnew/dialog_global_edit_tracks_and_vias.cpp rename to pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp diff --git a/pcbnew/dialog_global_edit_tracks_and_vias.h b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.h similarity index 100% rename from pcbnew/dialog_global_edit_tracks_and_vias.h rename to pcbnew/dialogs/dialog_global_edit_tracks_and_vias.h diff --git a/pcbnew/dialog_global_edit_tracks_and_vias_base.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.cpp similarity index 100% rename from pcbnew/dialog_global_edit_tracks_and_vias_base.cpp rename to pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.cpp diff --git a/pcbnew/dialog_global_edit_tracks_and_vias_base.fbp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.fbp similarity index 68% rename from pcbnew/dialog_global_edit_tracks_and_vias_base.fbp rename to pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.fbp index cb07e08471..1e0d5702bb 100644 --- a/pcbnew/dialog_global_edit_tracks_and_vias_base.fbp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.fbp @@ -1,947 +1,947 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_global_edit_tracks_and_vias_base - 1000 - none - 1 - dialog_global_edit_tracks_and_vias_base - - . - - 1 - 0 - 0 - - - - - 1 - - - - 0 - wxID_ANY - - - DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE - - 711,376 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - Global Edition of Tracks and Vias - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxVERTICAL - none - - 5 - wxEXPAND - 0 - - - bSizerCurrSettings - wxVERTICAL - none - - 5 - wxALL - 0 - - - - 1 - - ,90,92,-1,70,0 - 0 - wxID_ANY - Current Settings: - - - m_staticText12 - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bSizerCurrSettingsLeft - wxHORIZONTAL - none - - 5 - - 0 - - 0 - protected - 20 - - - - 5 - wxEXPAND - 1 - - - bSizerGrids - wxVERTICAL - none - - 5 - wxEXPAND - 0 - - 2 - wxBOTH - - - 0 - - fgSizeNetInfo - wxFLEX_GROWMODE_SPECIFIED - none - 2 - 0 - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Current Net: - - - m_CurrentNetText - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - ,90,92,-1,70,0 - 0 - wxID_ANY - NetName - - - m_CurrentNetName - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - - 0 - wxID_ANY - Current NetClass: - - - m_CurrentNetclassText - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - ,90,92,-1,70,0 - 0 - wxID_ANY - NetClassName - - - m_CurrentNetclassName - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - 10 - protected - 10 - - - - 5 - wxALL|wxEXPAND - 1 - - 1 - 1 - - - - wxALIGN_CENTRE - - wxALIGN_CENTRE - wxALIGN_CENTRE - 30 - "Track size" "Via diameter" "Via drill" "uVia size" "uVia Drill" - wxALIGN_CENTRE - 5 - - - 0 - 1 - 1 - 1 - 1 - 1 - - - - 1 - 0 - wxID_ANY - - - - 0 - 10 - - - m_gridDisplayCurrentSettings - protected - - wxALIGN_CENTRE - 100 - "Netclass value" "Current value" - wxALIGN_CENTRE - - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 1 - - - 0 - wxID_ANY - - - m_staticline1 - protected - - - wxLI_HORIZONTAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - bLowerSizer - wxVERTICAL - none - - 5 - wxALL - 0 - - - - 1 - - ,90,92,-1,70,0 - 0 - wxID_ANY - Global Edition Option: - - - m_staticText11 - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bSizerOptions - wxHORIZONTAL - none - - 5 - - 0 - - 0 - protected - 20 - - - - 5 - wxEXPAND - 1 - - - bSizerRadioButtons - wxVERTICAL - none - - 5 - wxALL - 0 - - - - 1 - - - 0 - ID_CURRENT_VALUES_TO_CURRENT_NET - Set tracks and vias of the current Net to the current value - - - m_Net2CurrValueButton - protected - - - wxRB_GROUP - - - 1 - - - - - - - - - - - - - - - - - - - - - OnSelectionClick - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - - 0 - ID_NETCLASS_VALUES_TO_CURRENT_NET - Set tracks and vias of the current Net to the Netclass value - - - m_NetUseNetclassValueButton - protected - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - OnSelectionClick - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - - 0 - ID_ALL_TRACKS_VIAS - Set all tracks and vias to their Netclass value - - - m_radioBtn3 - protected - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - OnSelectionClick - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - - 0 - ID_ALL_VIAS - Set all vias (no track) to their Netclass value - - - m_radioBtn4 - protected - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - OnSelectionClick - - - - - - - - - - 5 - wxALL - 0 - - - - 1 - - - 0 - ID_ALL_TRACKS - Set all tracks (no via) to their Netclass value - - - m_radioBtn5 - protected - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - OnSelectionClick - - - - - - - - - - - - - - 5 - wxEXPAND|wxALL - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_sdbSizer1 - protected - - OnCancelClick - - - - OnOkClick - - - - - - - - + + + + + + C++ + 1 + UTF-8 + connect + dialog_global_edit_tracks_and_vias_base + 1000 + none + 1 + dialog_global_edit_tracks_and_vias_base + + . + + 1 + 0 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + + DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS_BASE + + 711,376 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Global Edition of Tracks and Vias + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + + bSizerCurrSettings + wxVERTICAL + none + + 5 + wxALL + 0 + + + + 1 + + ,90,92,-1,70,0 + 0 + wxID_ANY + Current Settings: + + + m_staticText12 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizerCurrSettingsLeft + wxHORIZONTAL + none + + 5 + + 0 + + 0 + protected + 20 + + + + 5 + wxEXPAND + 1 + + + bSizerGrids + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + 2 + wxBOTH + + + 0 + + fgSizeNetInfo + wxFLEX_GROWMODE_SPECIFIED + none + 2 + 0 + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Current Net: + + + m_CurrentNetText + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + ,90,92,-1,70,0 + 0 + wxID_ANY + NetName + + + m_CurrentNetName + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + Current NetClass: + + + m_CurrentNetclassText + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + ,90,92,-1,70,0 + 0 + wxID_ANY + NetClassName + + + m_CurrentNetclassName + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 0 + + 10 + protected + 10 + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + + + + wxALIGN_CENTRE + + wxALIGN_CENTRE + wxALIGN_CENTRE + 30 + "Track size" "Via diameter" "Via drill" "uVia size" "uVia Drill" + wxALIGN_CENTRE + 5 + + + 0 + 1 + 1 + 1 + 1 + 1 + + + + 1 + 0 + wxID_ANY + + + + 0 + 10 + + + m_gridDisplayCurrentSettings + protected + + wxALIGN_CENTRE + 100 + "Netclass value" "Current value" + wxALIGN_CENTRE + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + bLowerSizer + wxVERTICAL + none + + 5 + wxALL + 0 + + + + 1 + + ,90,92,-1,70,0 + 0 + wxID_ANY + Global Edition Option: + + + m_staticText11 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizerOptions + wxHORIZONTAL + none + + 5 + + 0 + + 0 + protected + 20 + + + + 5 + wxEXPAND + 1 + + + bSizerRadioButtons + wxVERTICAL + none + + 5 + wxALL + 0 + + + + 1 + + + 0 + ID_CURRENT_VALUES_TO_CURRENT_NET + Set tracks and vias of the current Net to the current value + + + m_Net2CurrValueButton + protected + + + wxRB_GROUP + + + 1 + + + + + + + + + + + + + + + + + + + + + OnSelectionClick + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + ID_NETCLASS_VALUES_TO_CURRENT_NET + Set tracks and vias of the current Net to the Netclass value + + + m_NetUseNetclassValueButton + protected + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + OnSelectionClick + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + ID_ALL_TRACKS_VIAS + Set all tracks and vias to their Netclass value + + + m_radioBtn3 + protected + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + OnSelectionClick + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + ID_ALL_VIAS + Set all vias (no track) to their Netclass value + + + m_radioBtn4 + protected + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + OnSelectionClick + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + + + 0 + ID_ALL_TRACKS + Set all tracks (no via) to their Netclass value + + + m_radioBtn5 + protected + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + OnSelectionClick + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer1 + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/pcbnew/dialog_global_edit_tracks_and_vias_base.h b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.h similarity index 100% rename from pcbnew/dialog_global_edit_tracks_and_vias_base.h rename to pcbnew/dialogs/dialog_global_edit_tracks_and_vias_base.h diff --git a/pcbnew/dialog_global_pads_edition_base.cpp b/pcbnew/dialogs/dialog_global_pads_edition_base.cpp similarity index 100% rename from pcbnew/dialog_global_pads_edition_base.cpp rename to pcbnew/dialogs/dialog_global_pads_edition_base.cpp diff --git a/pcbnew/dialogs/dialog_global_pads_edition_base.fbp b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp new file mode 100644 index 0000000000..17ae2af460 --- /dev/null +++ b/pcbnew/dialogs/dialog_global_pads_edition_base.fbp @@ -0,0 +1,491 @@ + + + + + + C++ + 1 + UTF-8 + connect + dialog_global_pads_edition_base + 1000 + none + 0 + dialog_global_pads_edition + + . + + 1 + 0 + 0 + + + + + 1 + + + + 0 + wxID_ANY + + + DIALOG_GLOBAL_PADS_EDITION_BASE + + 482,165 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Global Pads Edition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + wxID_ANY + Pad Filter : + + sbSizer1 + wxVERTICAL + none + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Do not modify pads having a different shape + + + m_Pad_Shape_Filter_CB + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Do not modify pads having different layers + + + m_Pad_Layer_Filter_CB + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + 0 + + 1 + + + 0 + wxID_ANY + Do not modify pads having a different orientation + + + m_Pad_Orient_Filter_CB + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bRightSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_CHANGE_GET_PAD_SETTINGS + Pad Editor + + + m_buttonPadEditor + protected + + + + + + + + + InstallPadEditor + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 0 + + 10 + protected + 10 + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_CHANGE_CURRENT_MODULE + Change Pads on Module + + + m_button2 + protected + + + + + + + + + PadPropertiesAccept + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_CHANGE_ID_MODULES + Change Pads on Same Modules + + + m_button3 + protected + + + + + + + + + PadPropertiesAccept + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_CANCEL + Cancel + + + m_button4 + protected + + + + + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialog_global_pads_edition_base.h b/pcbnew/dialogs/dialog_global_pads_edition_base.h similarity index 100% rename from pcbnew/dialog_global_pads_edition_base.h rename to pcbnew/dialogs/dialog_global_pads_edition_base.h diff --git a/pcbnew/dialog_netlist.cpp b/pcbnew/dialogs/dialog_netlist.cpp similarity index 100% rename from pcbnew/dialog_netlist.cpp rename to pcbnew/dialogs/dialog_netlist.cpp diff --git a/pcbnew/dialog_netlist.h b/pcbnew/dialogs/dialog_netlist.h similarity index 100% rename from pcbnew/dialog_netlist.h rename to pcbnew/dialogs/dialog_netlist.h diff --git a/pcbnew/dialog_netlist_fbp.cpp b/pcbnew/dialogs/dialog_netlist_fbp.cpp similarity index 100% rename from pcbnew/dialog_netlist_fbp.cpp rename to pcbnew/dialogs/dialog_netlist_fbp.cpp diff --git a/pcbnew/dialog_netlist_fbp.fbp b/pcbnew/dialogs/dialog_netlist_fbp.fbp similarity index 56% rename from pcbnew/dialog_netlist_fbp.fbp rename to pcbnew/dialogs/dialog_netlist_fbp.fbp index be2207dca1..3cc5821359 100644 --- a/pcbnew/dialog_netlist_fbp.fbp +++ b/pcbnew/dialogs/dialog_netlist_fbp.fbp @@ -1,862 +1,862 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_netlist_fbp - 1000 - none - 1 - dialog_netlist_fbp - - . - - 1 - 1 - 0 - - - - - 1 - - - - 0 - wxID_CANCEL - - - DIALOG_NETLIST_FBP - - 519,431 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - Netlist Dialog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxVERTICAL - none - - 5 - wxEXPAND - 0 - - - bUpperSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bLeftSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - - "Reference" "Timestamp" - - 1 - - - 0 - wxID_ANY - Module Selection: - 1 - - - m_Select_By_Timestamp - protected - - 0 - - wxRA_SPECIFY_COLS - - Select how footprints are recognized: by their reference (U1, R3...) (normal setting) or their time stamp (special setting after a full schematic reannotation) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - "Keep" "Change" - - 1 - - - 0 - wxID_ANY - Exchange Module: - 1 - - - m_ChangeExistingFootprintCtrl - protected - - 0 - - wxRA_SPECIFY_COLS - - Keep or change an existing footprint when the netlist gives a different footprint - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bMiddleSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - - "Keep" "Delete" - - 1 - - - 0 - wxID_ANY - Bad Tracks Deletion: - 1 - - - m_DeleteBadTracks - protected - - 0 - - wxRA_SPECIFY_COLS - - Keep or delete bad tracks after a netlist change - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - "Keep" "Delete" - - 1 - - - 0 - wxID_ANY - Extra Footprints - 1 - - - m_RemoveExtraFootprintsCtrl - protected - - 0 - - wxRA_SPECIFY_COLS - - Remove footprints found on the Board but not in netlist Note: only not locked footprints will be removed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 0 - - - bRightSizerButtons - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - ID_OPEN_NELIST - Browse Netlist Files - - - m_button1 - protected - - - - - - - - - OnOpenNelistClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - ID_READ_NETLIST_FILE - Read Current Netlist - - - m_button2 - protected - - - - - Read the current netlist and update connections and connectivity info - - - - OnReadNetlistFileClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - ID_TEST_NETLIST - Footprints Test - - - m_button3 - protected - - - - - Read the current neltist file and list missing and extra footprints - - - - OnTestFootprintsClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - ID_COMPILE_RATSNEST - Rebuild Board Connectivity - - - m_button4 - protected - - - - - Rebuild the full ratsnest (usefull after a manual pad netname edition) - - - - OnCompileRatsnestClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - wxID_CANCEL - Close - - - m_button5 - protected - - - - - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND | wxALL - 0 - - - - 1 - - - 0 - wxID_ANY - - - m_staticline1 - protected - - - wxLI_HORIZONTAL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Netlist File: - - - m_staticTextNetfilename - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - - 0 - - m_NetlistFilenameCtrl - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 1 - - - 0 - wxID_ANY - Messages: - - - m_staticText1 - protected - - - - - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - - - 1 - - - 0 - wxID_ANY - - 0 - -1,200 - m_MessageWindow - protected - - - wxTE_CHARWRAP|wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + UTF-8 + connect + dialog_netlist_fbp + 1000 + none + 1 + dialog_netlist_fbp + + . + + 1 + 1 + 0 + + + + + 1 + + + + 0 + wxID_CANCEL + + + DIALOG_NETLIST_FBP + + 519,431 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Netlist Dialog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxEXPAND + 0 + + + bUpperSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + bLeftSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "Reference" "Timestamp" + + 1 + + + 0 + wxID_ANY + Module Selection: + 1 + + + m_Select_By_Timestamp + protected + + 0 + + wxRA_SPECIFY_COLS + + Select how footprints are recognized: by their reference (U1, R3...) (normal setting) or their time stamp (special setting after a full schematic reannotation) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Keep" "Change" + + 1 + + + 0 + wxID_ANY + Exchange Module: + 1 + + + m_ChangeExistingFootprintCtrl + protected + + 0 + + wxRA_SPECIFY_COLS + + Keep or change an existing footprint when the netlist gives a different footprint + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bMiddleSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + "Keep" "Delete" + + 1 + + + 0 + wxID_ANY + Bad Tracks Deletion: + 1 + + + m_DeleteBadTracks + protected + + 0 + + wxRA_SPECIFY_COLS + + Keep or delete bad tracks after a netlist change + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + "Keep" "Delete" + + 1 + + + 0 + wxID_ANY + Extra Footprints + 1 + + + m_RemoveExtraFootprintsCtrl + protected + + 0 + + wxRA_SPECIFY_COLS + + Remove footprints found on the Board but not in netlist Note: only not locked footprints will be removed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bRightSizerButtons + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_OPEN_NELIST + Browse Netlist Files + + + m_button1 + protected + + + + + + + + + OnOpenNelistClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_READ_NETLIST_FILE + Read Current Netlist + + + m_button2 + protected + + + + + Read the current netlist and update connections and connectivity info + + + + OnReadNetlistFileClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_TEST_NETLIST + Footprints Test + + + m_button3 + protected + + + + + Read the current neltist file and list missing and extra footprints + + + + OnTestFootprintsClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + ID_COMPILE_RATSNEST + Rebuild Board Connectivity + + + m_button4 + protected + + + + + Rebuild the full ratsnest (usefull after a manual pad netname edition) + + + + OnCompileRatsnestClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + + + 0 + 1 + + + 0 + wxID_CANCEL + Close + + + m_button5 + protected + + + + + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + + + 1 + + + 0 + wxID_ANY + + + m_staticline1 + protected + + + wxLI_HORIZONTAL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Netlist File: + + + m_staticTextNetfilename + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + + 0 + + m_NetlistFilenameCtrl + protected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + + + 0 + wxID_ANY + Messages: + + + m_staticText1 + protected + + + + + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + + + 1 + + + 0 + wxID_ANY + + 0 + -1,200 + m_MessageWindow + protected + + + wxTE_CHARWRAP|wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialog_netlist_fbp.h b/pcbnew/dialogs/dialog_netlist_fbp.h similarity index 100% rename from pcbnew/dialog_netlist_fbp.h rename to pcbnew/dialogs/dialog_netlist_fbp.h diff --git a/pcbnew/dialogs/dialog_orient_footprints.cpp b/pcbnew/dialogs/dialog_orient_footprints.cpp new file mode 100644 index 0000000000..e048bb8215 --- /dev/null +++ b/pcbnew/dialogs/dialog_orient_footprints.cpp @@ -0,0 +1,168 @@ +/** + * @file DIALOG_ORIENT_FOOTPRINTS.cpp + */ +/* + * This program source code file is part of KICAD, a free EDA CAD application. + * + * Copyright (C) 1992-2010 Jean_Pierre Charras + * Copyright (C) 1992-2010 Kicad Developers, see change_log.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 + */ + + +#include "fctsys.h" +#include "class_drawpanel.h" +#include "confirm.h" +#include "kicad_string.h" +#include "pcbnew.h" +#include "wxPcbStruct.h" +#include "macros.h" + +#include "dialog_orient_footprints_base.h" + + + +/* DIALOG_ORIENT_FOOTPRINTS class declaration + */ + +class DIALOG_ORIENT_FOOTPRINTS: public DIALOG_ORIENT_FOOTPRINTS_BASE +{ +private: + WinEDA_PcbFrame * m_Parent; + static int newOrientation; + +public: + DIALOG_ORIENT_FOOTPRINTS( WinEDA_PcbFrame* parent ); + ~DIALOG_ORIENT_FOOTPRINTS() {} + + bool ApplyToLockedModules() + { + return m_ApplyToLocked->IsChecked(); + } + int GetOrientation() + { + return newOrientation; + } + wxString GetFilter() + { + return m_FilterPattern->GetValue(); + } + +private: + void init(); + + void OnOkClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); +}; +int DIALOG_ORIENT_FOOTPRINTS::newOrientation = 0; + + +DIALOG_ORIENT_FOOTPRINTS::DIALOG_ORIENT_FOOTPRINTS( WinEDA_PcbFrame* parent ) + : DIALOG_ORIENT_FOOTPRINTS_BASE( parent ) +{ + m_Parent = parent; + wxString txt; + txt.Printf(wxT("%g"), (double) newOrientation/10); + m_OrientationCtrl->SetValue(txt); + SetFocus( ); + GetSizer()->SetSizeHints(this); + Centre(); +} + + +/****************************************************************/ +void WinEDA_PcbFrame::OnOrientFootprints( wxCommandEvent& event ) +/****************************************************************/ +/** + * Function OnOrientFootprints + * install the dialog box for the comman Orient Footprints + */ +{ + DIALOG_ORIENT_FOOTPRINTS dlg(this); + if( dlg.ShowModal() != wxID_OK ) + return; + + wxString text = dlg.GetFilter(); + if( ReOrientModules( text, dlg.GetOrientation(), dlg.ApplyToLockedModules() ) ) + { + DrawPanel->Refresh(); + Compile_Ratsnest( NULL, true ); + } +} + + +/*******************************************************************/ +bool WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask, + int Orient, bool include_fixe ) +/*******************************************************************/ +/** + * Function ReOrientModules + * Set the orientation of footprints + * @param ModuleMask = mask (wildcard allowed) selection + * @param Orient = new orientation + * @param include_fixe = true to orient locked footprints + * @return true if some footprints modified, false if no change + */ +{ + wxString line; + bool modified = false; + + line.Printf( _( "Ok to set footprints orientation to %.1f degrees ?" ), (double)Orient / 10 ); + if( !IsOK( this, line ) ) + return false; + + for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() ) + { + if( module->IsLocked() && !include_fixe ) + continue; + + if( WildCompareString( ModuleMask, module->m_Reference->m_Text, FALSE ) ) + { + modified = true; + Rotate_Module( NULL, module, Orient, FALSE ); + } + } + + if ( modified ) + OnModify(); + + return modified; +} + + +void DIALOG_ORIENT_FOOTPRINTS::OnOkClick( wxCommandEvent& event ) +{ + double d_orient; + wxString text = m_OrientationCtrl->GetValue(); + + if ( ! text.ToDouble(&d_orient) ) + { + DisplayError(this, _("Bad value for footprints orientation")); + return; + } + + newOrientation = wxRound(d_orient * 10); + NORMALIZE_ANGLE_180( newOrientation ); + EndModal( wxID_OK ); +} + +void DIALOG_ORIENT_FOOTPRINTS::OnCancelClick( wxCommandEvent& event ) +{ + EndModal( wxID_CANCEL ); +} diff --git a/pcbnew/dialogs/dialog_orient_footprints_base.cpp b/pcbnew/dialogs/dialog_orient_footprints_base.cpp new file mode 100644 index 0000000000..096343ab5f --- /dev/null +++ b/pcbnew/dialogs/dialog_orient_footprints_base.cpp @@ -0,0 +1,78 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_orient_footprints_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_ORIENT_FOOTPRINTS_BASE::DIALOG_ORIENT_FOOTPRINTS_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( wxHORIZONTAL ); + + wxBoxSizer* bSizerLeft; + bSizerLeft = new wxBoxSizer( wxVERTICAL ); + + m_staticText1 = new wxStaticText( this, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1->Wrap( -1 ); + bSizerLeft->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_OrientationCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OrientationCtrl->SetToolTip( _("New orientation (0.1 degree resolution)") ); + + bSizerLeft->Add( m_OrientationCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_staticText2 = new wxStaticText( this, wxID_ANY, _("Filter:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText2->Wrap( -1 ); + bSizerLeft->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_FilterPattern = new wxTextCtrl( this, wxID_ANY, _("*"), wxDefaultPosition, wxDefaultSize, 0 ); + m_FilterPattern->SetToolTip( _("Filter to select footprints by reference") ); + + bSizerLeft->Add( m_FilterPattern, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizerLeft->Add( 0, 0, 0, wxTOP|wxBOTTOM, 5 ); + + m_ApplyToLocked = new wxCheckBox( this, wxID_ANY, _("Include Locked Footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ApplyToLocked->SetToolTip( _("Force locked footprints to be modified") ); + + bSizerLeft->Add( m_ApplyToLocked, 0, wxALL, 5 ); + + bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer( wxVERTICAL ); + + m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonOK->SetDefault(); + bSizerRight->Add( m_buttonOK, 0, wxALL, 5 ); + + m_buttonClose = new wxButton( this, wxID_ANY, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerRight->Add( m_buttonClose, 0, wxALL, 5 ); + + bSizerMain->Add( bSizerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + this->SetSizer( bSizerMain ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnOkClick ), NULL, this ); + m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnCancelClick ), NULL, this ); +} + +DIALOG_ORIENT_FOOTPRINTS_BASE::~DIALOG_ORIENT_FOOTPRINTS_BASE() +{ + // Disconnect Events + m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnOkClick ), NULL, this ); + m_buttonClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ORIENT_FOOTPRINTS_BASE::OnCancelClick ), NULL, this ); + +} diff --git a/pcbnew/dialog_global_pads_edition_base.fbp b/pcbnew/dialogs/dialog_orient_footprints_base.fbp similarity index 51% rename from pcbnew/dialog_global_pads_edition_base.fbp rename to pcbnew/dialogs/dialog_orient_footprints_base.fbp index f2d43f1f07..3ce26da429 100644 --- a/pcbnew/dialog_global_pads_edition_base.fbp +++ b/pcbnew/dialogs/dialog_orient_footprints_base.fbp @@ -1,491 +1,525 @@ - - - - - - C++ - 1 - UTF-8 - connect - dialog_global_pads_edition_base - 1000 - none - 0 - dialog_global_pads_edition - - . - - 1 - 0 - 0 - - - - - 1 - - - - 0 - wxID_ANY - - - DIALOG_GLOBAL_PADS_EDITION_BASE - - 482,165 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - - Global Pads Edition - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - bLeftSizer - wxVERTICAL - none - - 5 - wxEXPAND - 1 - - wxID_ANY - Pad Filter : - - sbSizer1 - wxVERTICAL - none - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Do not modify pads having a different shape - - - m_Pad_Shape_Filter_CB - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Do not modify pads having different layers - - - m_Pad_Layer_Filter_CB - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - - 0 - - 1 - - - 0 - wxID_ANY - Do not modify pads having a different orientation - - - m_Pad_Orient_Filter_CB - protected - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bRightSizer - wxVERTICAL - none - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - ID_CHANGE_GET_PAD_SETTINGS - Pad Editor - - - m_buttonPadEditor - protected - - - - - - - - - InstallPadEditor - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - 10 - protected - 10 - - - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - ID_CHANGE_CURRENT_MODULE - Change Pads on Module - - - m_button2 - protected - - - - - - - - - PadPropertiesAccept - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - ID_CHANGE_ID_MODULES - Change Pads on Same Modules - - - m_button3 - protected - - - - - - - - - PadPropertiesAccept - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - - - 0 - 1 - - - 0 - wxID_CANCEL - Cancel - - - m_button4 - protected - - - - - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + UTF-8 + connect + dialog_orient_footprints_base + 1000 + none + 1 + dialog_orient_footprints + + . + + 1 + 1 + 0 + 0 + + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_ORIENT_FOOTPRINTS_BASE + + 403,160 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + + Footprints Orientation + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + bSizerLeft + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + Orientation: + + + m_staticText1 + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + + 0 + + m_OrientationCtrl + protected + + + + + New orientation (0.1 degree resolution) + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + Filter: + + + m_staticText2 + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + + 1 + 1 + + + 0 + wxID_ANY + + 0 + + m_FilterPattern + protected + + + + + Filter to select footprints by reference + + wxFILTER_NONE + wxDefaultValidator + + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxBOTTOM + 0 + + 0 + protected + 0 + + + + 5 + wxALL + 0 + + + 0 + + 1 + 1 + + + 0 + wxID_ANY + Include Locked Footprints + + + m_ApplyToLocked + protected + + + + + Force locked footprints to be modified + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER_VERTICAL + 0 + + + bSizerRight + wxVERTICAL + none + + 5 + wxALL + 0 + + + + 1 + 1 + 1 + + + 0 + wxID_OK + OK + + + m_buttonOK + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnOkClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + + 1 + 0 + 1 + + + 0 + wxID_ANY + Close + + + m_buttonClose + protected + + + + + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_orient_footprints_base.h b/pcbnew/dialogs/dialog_orient_footprints_base.h new file mode 100644 index 0000000000..d2008166a1 --- /dev/null +++ b/pcbnew/dialogs/dialog_orient_footprints_base.h @@ -0,0 +1,57 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Sep 8 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_orient_footprints_base__ +#define __dialog_orient_footprints_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_ORIENT_FOOTPRINTS_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_ORIENT_FOOTPRINTS_BASE : public wxDialog +{ + private: + + protected: + wxStaticText* m_staticText1; + wxTextCtrl* m_OrientationCtrl; + wxStaticText* m_staticText2; + wxTextCtrl* m_FilterPattern; + + wxCheckBox* m_ApplyToLocked; + wxButton* m_buttonOK; + wxButton* m_buttonClose; + + // Virtual event handlers, overide them in your derived class + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_ORIENT_FOOTPRINTS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprints Orientation"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 403,160 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_ORIENT_FOOTPRINTS_BASE(); + +}; + +#endif //__dialog_orient_footprints_base__ diff --git a/pcbnew/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp similarity index 100% rename from pcbnew/dialog_pcb_text_properties.cpp rename to pcbnew/dialogs/dialog_pcb_text_properties.cpp diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index b00e21ba1d..6b556fe266 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -14,7 +14,6 @@ #include "wxPcbStruct.h" #include "module_editor_frame.h" #include "class_board_design_settings.h" -#include "autorout.h" #include "protos.h" #include "dialog_drc.h" diff --git a/pcbnew/ioascii.cpp b/pcbnew/ioascii.cpp index 47833a7ce1..7961b4e2a8 100644 --- a/pcbnew/ioascii.cpp +++ b/pcbnew/ioascii.cpp @@ -13,7 +13,6 @@ #include "class_board_design_settings.h" #ifdef PCBNEW -#include "autorout.h" #include "zones.h" #endif diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 5e719031a8..6847e15fc8 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -233,6 +233,9 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ID_POPUP_PCB_AUTOPLACE_END_RANGE, WinEDA_PcbFrame::AutoPlace ) + EVT_MENU( ID_POPUP_PCB_REORIENT_ALL_MODULES, + WinEDA_PcbFrame::OnOrientFootprints ) + EVT_MENU_RANGE( ID_POPUP_PCB_START_RANGE, ID_POPUP_PCB_END_RANGE, WinEDA_PcbFrame::Process_Special_Functions ) @@ -253,11 +256,11 @@ END_EVENT_TABLE() ///////****************************///////////: -WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, +WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : - WinEDA_BasePcbFrame( father, PCB_FRAME, title, pos, size, style ) + WinEDA_BasePcbFrame( parent, PCB_FRAME, title, pos, size, style ) { m_FrameName = wxT( "PcbFrame" ); m_Draw_Sheet_Ref = true; // true to display sheet references diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index df87fa3c12..5b170d90b8 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -187,9 +187,6 @@ enum pcbnew_ids ID_POPUP_PCB_AUTOMOVE_ALL_MODULES, ID_POPUP_PCB_AUTOMOVE_NEW_MODULES, ID_POPUP_PCB_AUTOPLACE_COMMANDS, - - ID_POPUP_PCB_REORIENT_ALL_MODULES, - ID_POPUP_PCB_AUTOPLACE_ALL_MODULES, ID_POPUP_PCB_AUTOPLACE_NEW_MODULES, ID_POPUP_PCB_AUTOPLACE_NEXT_MODULE, @@ -204,6 +201,8 @@ enum pcbnew_ids ID_POPUP_PCB_AUTOROUTE_SELECT_LAYERS, ID_POPUP_PCB_AUTOPLACE_END_RANGE, + ID_POPUP_PCB_REORIENT_ALL_MODULES, + ID_MENU_RECOVER_BOARD, ID_MENU_READ_LAST_SAVED_VERSION_BOARD, ID_MENU_ARCHIVE_MODULES, diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index 8a965f5bcf..e874b88858 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -9,7 +9,6 @@ #include "class_drawpanel.h" #include "confirm.h" #include "pcbnew.h" -#include "autorout.h" #include "class_board_design_settings.h" #include "colors_selection.h" diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index 3ee8c92b02..fa5daa6806 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -38,7 +38,6 @@ #include "pcbstruct.h" // HISTORY_NUMBER #include "confirm.h" // DisplayError() #include "gestfich.h" // EDA_FileSelector() -#include "autorout.h" // NET_CODES_OK #include "class_board_design_settings.h" #include "trigo.h" // RotatePoint() diff --git a/pcbnew/zone_filling_algorithm.cpp b/pcbnew/zone_filling_algorithm.cpp index 50a5ef9cdc..0b888182e2 100644 --- a/pcbnew/zone_filling_algorithm.cpp +++ b/pcbnew/zone_filling_algorithm.cpp @@ -10,10 +10,7 @@ #include "common.h" #include "pcbnew.h" #include "wxPcbStruct.h" - -#include "autorout.h" #include "zones.h" -#include "cell.h" #include "trigo.h" #include "protos.h" @@ -214,144 +211,3 @@ int ZONE_CONTAINER::Fill_Zone_Areas_With_Segments( ) } - -/********************************************/ -int Propagation( WinEDA_PcbFrame* frame ) -/********************************************/ - -/** - * Function Propagation - * Used now only in autoplace calculations - * Uses the routing matrix to fill the cells within the zone - * Search and mark cells within the zone, and agree with DRC options. - * Requirements: - * Start from an initial point, to fill zone - * The zone must have no "copper island" - * Algorithm: - * If the current cell has a neightbour flagged as "cell in the zone", it - * become a cell in the zone - * The first point in the zone is the starting point - * 4 searches within the matrix are made: - * 1 - Left to right and top to bottom - * 2 - Right to left and top to bottom - * 3 - bottom to top and Right to left - * 4 - bottom to top and Left to right - * Given the current cell, for each search, we consider the 2 neightbour cells - * the previous cell on the same line and the previous cell on the same column. - * - * This funtion can request some iterations - * Iterations are made until no cell is added to the zone. - * @return: added cells count (i.e. which the attribute CELL_is_ZONE is set) - */ -{ - int row, col, nn; - long current_cell, old_cell_H; - int long* pt_cell_V; - int nbpoints = 0; - -#define NO_CELL_ZONE (HOLE | CELL_is_EDGE | CELL_is_ZONE) - wxString msg; - - Affiche_1_Parametre( frame, 57, wxT( "Detect" ), msg, CYAN ); - Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "1" ), CYAN ); - - // Alloc memory to handle 1 line or 1 colunmn on the routing matrix - nn = MAX( Nrows, Ncols ) * sizeof(*pt_cell_V); - pt_cell_V = (long*) MyMalloc( nn ); - - /* search 1 : from left to right and top to bottom */ - memset( pt_cell_V, 0, nn ); - for( row = 0; row < Nrows; row++ ) - { - old_cell_H = 0; - for( col = 0; col < Ncols; col++ ) - { - current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) /* a free cell is found */ - { - if( (old_cell_H & CELL_is_ZONE) - || (pt_cell_V[col] & CELL_is_ZONE) ) - { - OrCell( row, col, BOTTOM, CELL_is_ZONE ); - current_cell = CELL_is_ZONE; - nbpoints++; - } - } - pt_cell_V[col] = old_cell_H = current_cell; - } - } - - /* search 2 : from right to left and top to bottom */ - Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "2" ), CYAN ); - memset( pt_cell_V, 0, nn ); - for( row = 0; row < Nrows; row++ ) - { - old_cell_H = 0; - for( col = Ncols - 1; col >= 0; col-- ) - { - current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) /* a free cell is found */ - { - if( (old_cell_H & CELL_is_ZONE) - || (pt_cell_V[col] & CELL_is_ZONE) ) - { - OrCell( row, col, BOTTOM, CELL_is_ZONE ); - current_cell = CELL_is_ZONE; - nbpoints++; - } - } - pt_cell_V[col] = old_cell_H = current_cell; - } - } - - /* search 3 : from bottom to top and right to left balayage */ - Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "3" ), CYAN ); - memset( pt_cell_V, 0, nn ); - for( col = Ncols - 1; col >= 0; col-- ) - { - old_cell_H = 0; - for( row = Nrows - 1; row >= 0; row-- ) - { - current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) /* a free cell is found */ - { - if( (old_cell_H & CELL_is_ZONE) - || (pt_cell_V[row] & CELL_is_ZONE) ) - { - OrCell( row, col, BOTTOM, CELL_is_ZONE ); - current_cell = CELL_is_ZONE; - nbpoints++; - } - } - pt_cell_V[row] = old_cell_H = current_cell; - } - } - - /* search 4 : from bottom to top and left to right */ - Affiche_1_Parametre( frame, -1, wxEmptyString, wxT( "4" ), CYAN ); - memset( pt_cell_V, 0, nn ); - for( col = 0; col < Ncols; col++ ) - { - old_cell_H = 0; - for( row = Nrows - 1; row >= 0; row-- ) - { - current_cell = GetCell( row, col, BOTTOM ) & NO_CELL_ZONE; - if( current_cell == 0 ) /* a free cell is found */ - { - if( (old_cell_H & CELL_is_ZONE) - || (pt_cell_V[row] & CELL_is_ZONE) ) - { - OrCell( row, col, BOTTOM, CELL_is_ZONE ); - current_cell = CELL_is_ZONE; - nbpoints++; - } - } - pt_cell_V[row] = old_cell_H = current_cell; - } - } - - MyFree( pt_cell_V ); - - return nbpoints; -} -