Split prohibited text layers for footprints and the rest of the PCB

Fixes: lp:1788268
* https://bugs.launchpad.net/kicad/+bug/1788268
This commit is contained in:
Andrew Zonenberg 2018-08-21 12:01:07 -07:00 committed by Seth Hillbrand
parent d8782b7515
commit 60a55d75fa
4 changed files with 72 additions and 5 deletions

View File

@ -783,9 +783,58 @@ LSET LSET::BackMask()
}
LSET LSET::ForbiddenTextLayers()
LSET LSET::ForbiddenTextLayersForBoard()
{
static const LSET saved( 6, Edge_Cuts, Margin, F_Paste, B_Paste, F_Mask, B_Mask );
static const LSET saved( 2, Edge_Cuts, Margin );
return saved;
}
LSET LSET::ForbiddenTextLayersForFootprint()
{
static const PCB_LAYER_ID bad_layers[] = {
F_Cu,
B_Cu,
In1_Cu,
In2_Cu,
In3_Cu,
In4_Cu,
In5_Cu,
In6_Cu,
In7_Cu,
In8_Cu,
In9_Cu,
In10_Cu,
In11_Cu,
In12_Cu,
In13_Cu,
In14_Cu,
In15_Cu,
In16_Cu,
In17_Cu,
In18_Cu,
In19_Cu,
In20_Cu,
In21_Cu,
In22_Cu,
In23_Cu,
In24_Cu,
In25_Cu,
In26_Cu,
In27_Cu,
In28_Cu,
In29_Cu,
In30_Cu,
Edge_Cuts,
Margin,
F_Paste,
B_Paste,
F_Mask,
B_Mask,
F_Adhes,
B_Adhes
};
static const LSET saved( bad_layers, DIM( bad_layers ) );
return saved;
}

View File

@ -523,7 +523,20 @@ public:
static LSET UserMask();
static LSET ForbiddenTextLayers();
/**
* Function ForbiddenTextLayersForBoard
* returns the layer set that should not be allowed for free text on the board
* Currently this is only EdgeCuts and Margin
*/
static LSET ForbiddenTextLayersForBoard();
/**
* Function ForbiddenTextLayersForFootprint
* returns the layer set that should not be allowed in text that is attached to a
* footprint. Currently, this is any copper layer (not handled by router or fills)
* and any of the aperture layers (mask, paste, adhesive)
*/
static LSET ForbiddenTextLayersForFootprint();
/**
* Function CuStack

View File

@ -120,7 +120,12 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO
m_LayerSelectionCtrl->ShowNonActivatedLayers( true );
m_LayerSelectionCtrl->SetLayersHotkeys( false );
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::ForbiddenTextLayers() );
if( m_item->Type() == PCB_MODULE_TEXT_T )
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::ForbiddenTextLayersForFootprint() );
else
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::ForbiddenTextLayersForBoard() );
m_LayerSelectionCtrl->SetBoardFrame( m_Parent );
m_LayerSelectionCtrl->Resync();

View File

@ -65,7 +65,7 @@ TEXT_MOD_GRID_TABLE::TEXT_MOD_GRID_TABLE( EDA_UNITS_T aUserUnits, PCB_BASE_FRAME
m_layerColAttr = new wxGridCellAttr;
m_layerColAttr->SetRenderer( new GRID_CELL_LAYER_RENDERER( m_frame ) );
m_layerColAttr->SetEditor( new GRID_CELL_LAYER_SELECTOR( m_frame, LSET::ForbiddenTextLayers() ) );
m_layerColAttr->SetEditor( new GRID_CELL_LAYER_SELECTOR( m_frame, LSET::ForbiddenTextLayersForBoard() ) );
}