From cad1cb02629afd343e58467ee7127fdb6325cab9 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 16 Mar 2021 12:06:17 +0000 Subject: [PATCH] Improve naming. --- cvpcb/display_footprints_frame.cpp | 2 +- include/pcb_display_options.h | 22 ++++++---------------- pcbnew/dialogs/panel_display_options.cpp | 14 +++++++------- pcbnew/footprint_wizard_frame.cpp | 2 +- pcbnew/pcb_display_options.cpp | 4 ++-- pcbnew/pcb_edit_frame.cpp | 7 ++++--- pcbnew/pcb_painter.cpp | 10 +++++----- pcbnew/pcbnew_settings.cpp | 4 ++-- pcbnew/router/pns_kicad_iface.cpp | 8 ++++---- 9 files changed, 32 insertions(+), 41 deletions(-) diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 95475b962d..186f441307 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -95,7 +95,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa // Initialize some display options auto displ_opts = GetDisplayOptions(); - displ_opts.m_DisplayPadIsol = false; // Pad clearance has no meaning here + displ_opts.m_DisplayPadClearance = false; // Pad clearance has no meaning here // Track and via clearance has no meaning here. displ_opts.m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE; diff --git a/include/pcb_display_options.h b/include/pcb_display_options.h index 055db6c681..213cf95f20 100644 --- a/include/pcb_display_options.h +++ b/include/pcb_display_options.h @@ -46,27 +46,17 @@ public: * This parameter controls how to show tracks and vias clearance area. */ enum TRACE_CLEARANCE_DISPLAY_MODE_T { - DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas - SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only for new track - * during track creation. */ - SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only for new track - * during track creation, and shows a via - * clearance area at end of current new - * segment (guide to place a new via - */ - SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS, - /* Show clearance for new, moving and - * dragging tracks and vias - */ - SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas - * for track and vias - */ + DO_NOT_SHOW_CLEARANCE = 0, + SHOW_TRACK_CLEARANCE_WHILE_ROUTING, + SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING, + SHOW_WHILE_ROUTING_OR_DRAGGING, + SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS }; bool m_DisplayPadFill; bool m_DisplayViaFill; bool m_DisplayPadNum; // show pads numbers - bool m_DisplayPadIsol; + bool m_DisplayPadClearance; bool m_DisplayGraphicsFill; // How to display fp drawings ( sketch/ filled ) bool m_DisplayTextFill; // How to display fp texts ( sketch/ filled ) bool m_DisplayPcbTrackFill; // false : tracks are show in sketch mode, true = filled. diff --git a/pcbnew/dialogs/panel_display_options.cpp b/pcbnew/dialogs/panel_display_options.cpp index 6765e0d95b..97451fb3b9 100644 --- a/pcbnew/dialogs/panel_display_options.cpp +++ b/pcbnew/dialogs/panel_display_options.cpp @@ -31,11 +31,11 @@ static const UTIL::CFG_MAP traceClearanceSelectMap = { - { PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, 2 }, // Default - { PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE, 0 }, - { PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS, 1 }, - { PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS, 3 }, - { PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS, 4 }, + { PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING, 2 }, // Default + { PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE, 0 }, + { PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WHILE_ROUTING, 1 }, + { PCB_DISPLAY_OPTIONS::SHOW_WHILE_ROUTING_OR_DRAGGING, 3 }, + { PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS, 4 }, }; @@ -62,7 +62,7 @@ bool PANEL_DISPLAY_OPTIONS::TransferDataToWindow() m_OptDisplayTracksClearance->SetSelection( UTIL::GetConfigForVal( traceClearanceSelectMap, displ_opts.m_ShowTrackClearanceMode ) ); - m_OptDisplayPadClearence->SetValue( displ_opts.m_DisplayPadIsol ); + m_OptDisplayPadClearence->SetValue( displ_opts.m_DisplayPadClearance ); m_OptDisplayPadNumber->SetValue( displ_opts.m_DisplayPadNum ); m_OptDisplayPadNoConn->SetValue( pcbEdit->IsElementVisible( LAYER_NO_CONNECTS ) ); m_ShowNetNamesOption->SetSelection( displ_opts.m_DisplayNetNamesMode ); @@ -101,7 +101,7 @@ bool PANEL_DISPLAY_OPTIONS::TransferDataFromWindow() displ_opts.m_ShowTrackClearanceMode = UTIL::GetValFromConfig( traceClearanceSelectMap, m_OptDisplayTracksClearance->GetSelection() ); - displ_opts.m_DisplayPadIsol = m_OptDisplayPadClearence->GetValue(); + displ_opts.m_DisplayPadClearance = m_OptDisplayPadClearence->GetValue(); displ_opts.m_DisplayPadNum = m_OptDisplayPadNumber->GetValue(); pcbEdit->SetElementVisibility( LAYER_NO_CONNECTS, m_OptDisplayPadNoConn->GetValue() ); diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 25da336be3..0912a31df9 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -133,7 +133,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent PCB_DISPLAY_OPTIONS disp_opts = GetDisplayOptions(); - disp_opts.m_DisplayPadIsol = true; + disp_opts.m_DisplayPadClearance = true; disp_opts.m_DisplayPadNum = true; SetDisplayOptions( disp_opts ); diff --git a/pcbnew/pcb_display_options.cpp b/pcbnew/pcb_display_options.cpp index 4083c1e94d..1479c69f05 100644 --- a/pcbnew/pcb_display_options.cpp +++ b/pcbnew/pcb_display_options.cpp @@ -36,12 +36,12 @@ PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS() m_DisplayPadFill = FILLED; m_DisplayViaFill = FILLED; m_DisplayPadNum = true; - m_DisplayPadIsol = true; + m_DisplayPadClearance = true; m_DisplayGraphicsFill = FILLED; m_DisplayTextFill = FILLED; m_DisplayPcbTrackFill = FILLED; // false = sketch , true = filled - m_ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS; + m_ShowTrackClearanceMode = SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING; m_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED; m_DisplayNetNamesMode = 3; /* 0 do not show netnames, diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index d1cf15982b..b73b361fa5 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -904,7 +904,7 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage ) const PCB_DISPLAY_OPTIONS& opts = GetDisplayOptions(); - if( opts.m_ShowTrackClearanceMode || opts.m_DisplayPadIsol ) + if( opts.m_ShowTrackClearanceMode || opts.m_DisplayPadClearance ) { // Update clearance outlines GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT, @@ -916,7 +916,8 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage ) // TRACK is the base class of VIA and ARC so we don't need to // check them independently - return track || pad; + return ( track && opts.m_ShowTrackClearanceMode ) + || ( pad && opts.m_DisplayPadClearance ); } ); } @@ -1015,7 +1016,7 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer ) { // Clearances could be layer-dependent so redraw them when the active layer // is changed - if( GetDisplayOptions().m_DisplayPadIsol ) + if( GetDisplayOptions().m_DisplayPadClearance ) { // Round-corner rects are expensive to draw, but are mostly found on // SMD pads which only need redrawing on an active-to-not-active diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index ea35f55d09..ff4099f421 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -182,24 +182,24 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOption m_clearanceDisplayFlags = CL_NONE; break; - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS: + case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WHILE_ROUTING: m_clearanceDisplayFlags = CL_NEW | CL_TRACKS; break; - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS: + case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING: m_clearanceDisplayFlags = CL_NEW | CL_TRACKS | CL_VIAS; break; - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS: + case PCB_DISPLAY_OPTIONS::SHOW_WHILE_ROUTING_OR_DRAGGING: m_clearanceDisplayFlags = CL_NEW | CL_EDITED | CL_TRACKS | CL_VIAS; break; - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS: + case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS: m_clearanceDisplayFlags = CL_NEW | CL_EDITED | CL_EXISTING | CL_TRACKS | CL_VIAS; break; } - if( aOptions.m_DisplayPadIsol ) + if( aOptions.m_DisplayPadClearance ) m_clearanceDisplayFlags |= CL_PADS; m_contrastModeDisplay = aOptions.m_ContrastModeDisplay; diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 5a67eded5e..0cf601250c 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -143,7 +143,7 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() &m_Display.m_DisplayNetNamesMode, 3, 0, 3 ) ); m_params.emplace_back( new PARAM( "pcb_display.pad_clearance", - &m_Display.m_DisplayPadIsol, true ) ); + &m_Display.m_DisplayPadClearance, true ) ); m_params.emplace_back( new PARAM( "pcb_display.pad_fill", &m_Display.m_DisplayPadFill, true ) ); @@ -165,7 +165,7 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "pcb_display.track_clearance_mode", reinterpret_cast( &m_Display.m_ShowTrackClearanceMode ), - PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) ); + PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING ) ); m_params.emplace_back( new PARAM( "pcb_display.track_fill", &m_Display.m_DisplayPcbTrackFill, true ) ); diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 4f513b32ea..ae249d33e5 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -1363,18 +1363,18 @@ void PNS_KICAD_IFACE::DisplayItem( const PNS::ITEM* aItem, int aClearance, bool pitem->ShowTrackClearance( false ); pitem->ShowViaClearance( false ); break; - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS: - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS: + case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS: + case PCB_DISPLAY_OPTIONS::SHOW_WHILE_ROUTING_OR_DRAGGING: pitem->ShowTrackClearance( true ); pitem->ShowViaClearance( true ); break; - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS: + case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING: pitem->ShowTrackClearance( !aEdit ); pitem->ShowViaClearance( !aEdit ); break; - case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS: + case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WHILE_ROUTING: pitem->ShowTrackClearance( !aEdit ); pitem->ShowViaClearance( false ); break;