Browse Source

Enable user layers in footprint editor.

Fixes: lp:1746279
* https://bugs.launchpad.net/kicad/+bug/1746279
pull/13/head
Jeff Young 7 years ago
parent
commit
a860a8db54
  1. 7
      common/lset.cpp
  2. 12
      include/layers_id_colors_and_visibility.h
  3. 16
      pcbnew/pcb_layer_widget.cpp

7
common/lset.cpp

@ -783,6 +783,13 @@ LSET LSET::BackMask()
}
LSET LSET::ForbiddenFootprintLayers()
{
static const LSET saved = InternalCuMask().set( Edge_Cuts ).set( Margin );
return saved;
}
LSET LSET::ForbiddenTextLayers()
{
static const LSET saved( 2, Edge_Cuts, Margin );

12
include/layers_id_colors_and_visibility.h

@ -523,6 +523,18 @@ public:
static LSET UserMask();
/**
* Function ForbiddenFootprintLayers
* Layers which are not allowed within footprint definitions. Currently internal
* copper layers, Edge.Cuts and Margin.
*/
static LSET ForbiddenFootprintLayers();
/**
* Function ForbiddenTextLayers
* Layers which are now allowed to have text on them. Currently Edge.Cuts and Margin.
*/
static LSET ForbiddenTextLayers();
/**

16
pcbnew/pcb_layer_widget.cpp

@ -156,9 +156,7 @@ bool PCB_LAYER_WIDGET::isAllowedInFpMode( int aId )
bool PCB_LAYER_WIDGET::isLayerAllowedInFpMode( PCB_LAYER_ID aLayer )
{
static LSET allowed = LSET::AllTechMask();
// Currently not in use because putting a graphic item on a copper layer
// is not currently supported by DRC.
// allowed.set( F_Cu ).set( B_Cu );
allowed.set( F_Cu ).set( B_Cu );
return allowed.test( aLayer );
}
@ -519,11 +517,10 @@ void PCB_LAYER_WIDGET::ReFill()
brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ),
dsc, true ) );
if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) )
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
{
getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false );
getLayerComp( GetLayerRowCount()-1,
COLUMN_COLORBM )->SetToolTip( wxEmptyString );
getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString );
}
}
@ -568,11 +565,10 @@ void PCB_LAYER_WIDGET::ReFill()
brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ),
wxGetTranslation( non_cu_seq[i].tooltip ), true ) );
if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) )
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
{
getLayerComp( GetLayerRowCount()-1, COLUMN_COLOR_LYRNAME )->Enable( false );
getLayerComp( GetLayerRowCount()-1,
COLUMN_COLORBM )->SetToolTip( wxEmptyString );
getLayerComp( GetLayerRowCount()-1, COLUMN_COLORBM )->SetToolTip( wxEmptyString );
}
}
}
@ -616,7 +612,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer )
// false from this function.
PCB_LAYER_ID layer = ToLAYER_ID( aLayer );
if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) )
if( m_fp_editor_mode && LSET::ForbiddenFootprintLayers().test( layer ) )
return false;
myframe->SetActiveLayer( layer );

Loading…
Cancel
Save