Improve naming.
This commit is contained in:
parent
c7648b4dba
commit
cad1cb0262
|
@ -95,7 +95,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
|
||||||
|
|
||||||
// Initialize some display options
|
// Initialize some display options
|
||||||
auto displ_opts = GetDisplayOptions();
|
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.
|
// Track and via clearance has no meaning here.
|
||||||
displ_opts.m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE;
|
displ_opts.m_ShowTrackClearanceMode = PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE;
|
||||||
|
|
|
@ -46,27 +46,17 @@ public:
|
||||||
* This parameter controls how to show tracks and vias clearance area.
|
* This parameter controls how to show tracks and vias clearance area.
|
||||||
*/
|
*/
|
||||||
enum TRACE_CLEARANCE_DISPLAY_MODE_T {
|
enum TRACE_CLEARANCE_DISPLAY_MODE_T {
|
||||||
DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas
|
DO_NOT_SHOW_CLEARANCE = 0,
|
||||||
SHOW_CLEARANCE_NEW_TRACKS, /* Show clearance areas only for new track
|
SHOW_TRACK_CLEARANCE_WHILE_ROUTING,
|
||||||
* during track creation. */
|
SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING,
|
||||||
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clearance areas only for new track
|
SHOW_WHILE_ROUTING_OR_DRAGGING,
|
||||||
* during track creation, and shows a via
|
SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool m_DisplayPadFill;
|
bool m_DisplayPadFill;
|
||||||
bool m_DisplayViaFill;
|
bool m_DisplayViaFill;
|
||||||
bool m_DisplayPadNum; // show pads numbers
|
bool m_DisplayPadNum; // show pads numbers
|
||||||
bool m_DisplayPadIsol;
|
bool m_DisplayPadClearance;
|
||||||
bool m_DisplayGraphicsFill; // How to display fp drawings ( sketch/ filled )
|
bool m_DisplayGraphicsFill; // How to display fp drawings ( sketch/ filled )
|
||||||
bool m_DisplayTextFill; // How to display fp texts ( sketch/ filled )
|
bool m_DisplayTextFill; // How to display fp texts ( sketch/ filled )
|
||||||
bool m_DisplayPcbTrackFill; // false : tracks are show in sketch mode, true = filled.
|
bool m_DisplayPcbTrackFill; // false : tracks are show in sketch mode, true = filled.
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
|
|
||||||
static const UTIL::CFG_MAP<PCB_DISPLAY_OPTIONS::TRACE_CLEARANCE_DISPLAY_MODE_T> traceClearanceSelectMap =
|
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::SHOW_TRACK_CLEARANCE_WITH_VIA_WHILE_ROUTING, 2 }, // Default
|
||||||
{ PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE, 0 },
|
{ PCB_DISPLAY_OPTIONS::DO_NOT_SHOW_CLEARANCE, 0 },
|
||||||
{ PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS, 1 },
|
{ PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WHILE_ROUTING, 1 },
|
||||||
{ PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS, 3 },
|
{ PCB_DISPLAY_OPTIONS::SHOW_WHILE_ROUTING_OR_DRAGGING, 3 },
|
||||||
{ PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS, 4 },
|
{ PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS, 4 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ bool PANEL_DISPLAY_OPTIONS::TransferDataToWindow()
|
||||||
m_OptDisplayTracksClearance->SetSelection( UTIL::GetConfigForVal(
|
m_OptDisplayTracksClearance->SetSelection( UTIL::GetConfigForVal(
|
||||||
traceClearanceSelectMap, displ_opts.m_ShowTrackClearanceMode ) );
|
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_OptDisplayPadNumber->SetValue( displ_opts.m_DisplayPadNum );
|
||||||
m_OptDisplayPadNoConn->SetValue( pcbEdit->IsElementVisible( LAYER_NO_CONNECTS ) );
|
m_OptDisplayPadNoConn->SetValue( pcbEdit->IsElementVisible( LAYER_NO_CONNECTS ) );
|
||||||
m_ShowNetNamesOption->SetSelection( displ_opts.m_DisplayNetNamesMode );
|
m_ShowNetNamesOption->SetSelection( displ_opts.m_DisplayNetNamesMode );
|
||||||
|
@ -101,7 +101,7 @@ bool PANEL_DISPLAY_OPTIONS::TransferDataFromWindow()
|
||||||
displ_opts.m_ShowTrackClearanceMode = UTIL::GetValFromConfig(
|
displ_opts.m_ShowTrackClearanceMode = UTIL::GetValFromConfig(
|
||||||
traceClearanceSelectMap, m_OptDisplayTracksClearance->GetSelection() );
|
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();
|
displ_opts.m_DisplayPadNum = m_OptDisplayPadNumber->GetValue();
|
||||||
|
|
||||||
pcbEdit->SetElementVisibility( LAYER_NO_CONNECTS, m_OptDisplayPadNoConn->GetValue() );
|
pcbEdit->SetElementVisibility( LAYER_NO_CONNECTS, m_OptDisplayPadNoConn->GetValue() );
|
||||||
|
|
|
@ -133,7 +133,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
|
||||||
|
|
||||||
PCB_DISPLAY_OPTIONS disp_opts = GetDisplayOptions();
|
PCB_DISPLAY_OPTIONS disp_opts = GetDisplayOptions();
|
||||||
|
|
||||||
disp_opts.m_DisplayPadIsol = true;
|
disp_opts.m_DisplayPadClearance = true;
|
||||||
disp_opts.m_DisplayPadNum = true;
|
disp_opts.m_DisplayPadNum = true;
|
||||||
SetDisplayOptions( disp_opts );
|
SetDisplayOptions( disp_opts );
|
||||||
|
|
||||||
|
|
|
@ -36,12 +36,12 @@ PCB_DISPLAY_OPTIONS::PCB_DISPLAY_OPTIONS()
|
||||||
m_DisplayPadFill = FILLED;
|
m_DisplayPadFill = FILLED;
|
||||||
m_DisplayViaFill = FILLED;
|
m_DisplayViaFill = FILLED;
|
||||||
m_DisplayPadNum = true;
|
m_DisplayPadNum = true;
|
||||||
m_DisplayPadIsol = true;
|
m_DisplayPadClearance = true;
|
||||||
|
|
||||||
m_DisplayGraphicsFill = FILLED;
|
m_DisplayGraphicsFill = FILLED;
|
||||||
m_DisplayTextFill = FILLED;
|
m_DisplayTextFill = FILLED;
|
||||||
m_DisplayPcbTrackFill = FILLED; // false = sketch , true = 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_ZoneDisplayMode = ZONE_DISPLAY_MODE::SHOW_FILLED;
|
||||||
m_DisplayNetNamesMode = 3; /* 0 do not show netnames,
|
m_DisplayNetNamesMode = 3; /* 0 do not show netnames,
|
||||||
|
|
|
@ -904,7 +904,7 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
|
||||||
|
|
||||||
const PCB_DISPLAY_OPTIONS& opts = GetDisplayOptions();
|
const PCB_DISPLAY_OPTIONS& opts = GetDisplayOptions();
|
||||||
|
|
||||||
if( opts.m_ShowTrackClearanceMode || opts.m_DisplayPadIsol )
|
if( opts.m_ShowTrackClearanceMode || opts.m_DisplayPadClearance )
|
||||||
{
|
{
|
||||||
// Update clearance outlines
|
// Update clearance outlines
|
||||||
GetCanvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
|
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
|
// TRACK is the base class of VIA and ARC so we don't need to
|
||||||
// check them independently
|
// 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
|
// Clearances could be layer-dependent so redraw them when the active layer
|
||||||
// is changed
|
// is changed
|
||||||
if( GetDisplayOptions().m_DisplayPadIsol )
|
if( GetDisplayOptions().m_DisplayPadClearance )
|
||||||
{
|
{
|
||||||
// Round-corner rects are expensive to draw, but are mostly found on
|
// Round-corner rects are expensive to draw, but are mostly found on
|
||||||
// SMD pads which only need redrawing on an active-to-not-active
|
// SMD pads which only need redrawing on an active-to-not-active
|
||||||
|
|
|
@ -182,24 +182,24 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const PCB_DISPLAY_OPTIONS& aOption
|
||||||
m_clearanceDisplayFlags = CL_NONE;
|
m_clearanceDisplayFlags = CL_NONE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS:
|
case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WHILE_ROUTING:
|
||||||
m_clearanceDisplayFlags = CL_NEW | CL_TRACKS;
|
m_clearanceDisplayFlags = CL_NEW | CL_TRACKS;
|
||||||
break;
|
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;
|
m_clearanceDisplayFlags = CL_NEW | CL_TRACKS | CL_VIAS;
|
||||||
break;
|
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;
|
m_clearanceDisplayFlags = CL_NEW | CL_EDITED | CL_TRACKS | CL_VIAS;
|
||||||
break;
|
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;
|
m_clearanceDisplayFlags = CL_NEW | CL_EDITED | CL_EXISTING | CL_TRACKS | CL_VIAS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aOptions.m_DisplayPadIsol )
|
if( aOptions.m_DisplayPadClearance )
|
||||||
m_clearanceDisplayFlags |= CL_PADS;
|
m_clearanceDisplayFlags |= CL_PADS;
|
||||||
|
|
||||||
m_contrastModeDisplay = aOptions.m_ContrastModeDisplay;
|
m_contrastModeDisplay = aOptions.m_ContrastModeDisplay;
|
||||||
|
|
|
@ -143,7 +143,7 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
||||||
&m_Display.m_DisplayNetNamesMode, 3, 0, 3 ) );
|
&m_Display.m_DisplayNetNamesMode, 3, 0, 3 ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_clearance",
|
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_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
|
||||||
&m_Display.m_DisplayPadFill, true ) );
|
&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",
|
m_params.emplace_back( new PARAM<int>( "pcb_display.track_clearance_mode",
|
||||||
reinterpret_cast<int*>( &m_Display.m_ShowTrackClearanceMode ),
|
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_params.emplace_back( new PARAM<bool>( "pcb_display.track_fill",
|
||||||
&m_Display.m_DisplayPcbTrackFill, true ) );
|
&m_Display.m_DisplayPcbTrackFill, true ) );
|
||||||
|
|
|
@ -1363,18 +1363,18 @@ void PNS_KICAD_IFACE::DisplayItem( const PNS::ITEM* aItem, int aClearance, bool
|
||||||
pitem->ShowTrackClearance( false );
|
pitem->ShowTrackClearance( false );
|
||||||
pitem->ShowViaClearance( false );
|
pitem->ShowViaClearance( false );
|
||||||
break;
|
break;
|
||||||
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_ALWAYS:
|
case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WITH_VIA_ALWAYS:
|
||||||
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS:
|
case PCB_DISPLAY_OPTIONS::SHOW_WHILE_ROUTING_OR_DRAGGING:
|
||||||
pitem->ShowTrackClearance( true );
|
pitem->ShowTrackClearance( true );
|
||||||
pitem->ShowViaClearance( true );
|
pitem->ShowViaClearance( true );
|
||||||
break;
|
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->ShowTrackClearance( !aEdit );
|
||||||
pitem->ShowViaClearance( !aEdit );
|
pitem->ShowViaClearance( !aEdit );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_DISPLAY_OPTIONS::SHOW_CLEARANCE_NEW_TRACKS:
|
case PCB_DISPLAY_OPTIONS::SHOW_TRACK_CLEARANCE_WHILE_ROUTING:
|
||||||
pitem->ShowTrackClearance( !aEdit );
|
pitem->ShowTrackClearance( !aEdit );
|
||||||
pitem->ShowViaClearance( false );
|
pitem->ShowViaClearance( false );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue