Improve naming.

This commit is contained in:
Jeff Young 2021-03-16 12:06:17 +00:00
parent c7648b4dba
commit cad1cb0262
9 changed files with 32 additions and 41 deletions

View File

@ -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;

View File

@ -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.

View File

@ -31,11 +31,11 @@
static const UTIL::CFG_MAP<PCB_DISPLAY_OPTIONS::TRACE_CLEARANCE_DISPLAY_MODE_T> 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() );

View File

@ -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 );

View File

@ -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,

View File

@ -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

View File

@ -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;

View File

@ -143,7 +143,7 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
&m_Display.m_DisplayNetNamesMode, 3, 0, 3 ) );
m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_clearance",
&m_Display.m_DisplayPadIsol, true ) );
&m_Display.m_DisplayPadClearance, true ) );
m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
&m_Display.m_DisplayPadFill, true ) );
@ -165,7 +165,7 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
m_params.emplace_back( new PARAM<int>( "pcb_display.track_clearance_mode",
reinterpret_cast<int*>( &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<bool>( "pcb_display.track_fill",
&m_Display.m_DisplayPcbTrackFill, true ) );

View File

@ -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;