Pcbnew: add a GAL layer (LAYER_LOCKED_ITEM_SHADOW) to draw markers on locked footprints
This commit is contained in:
parent
e37bb2e0c3
commit
016af235db
|
@ -176,6 +176,7 @@ wxString LayerName( int aLayer )
|
|||
case LAYER_GRID_AXES: return _( "Grid axes" );
|
||||
case LAYER_PCB_BACKGROUND: return _( "Background" );
|
||||
case LAYER_SELECT_OVERLAY: return _( "Selection highlight" );
|
||||
case LAYER_LOCKED_ITEM_SHADOW: return _( "Locked item shadow" );
|
||||
|
||||
default:
|
||||
wxCHECK_MSG( false, wxEmptyString, wxString::Format( "Unknown layer ID %d", aLayer ) );
|
||||
|
|
|
@ -976,6 +976,7 @@ GAL_SET GAL_SET::DefaultVisible()
|
|||
LAYER_DRAW_BITMAPS,
|
||||
LAYER_PADS,
|
||||
LAYER_ZONES,
|
||||
LAYER_LOCKED_ITEM_SHADOW
|
||||
};
|
||||
|
||||
static const GAL_SET saved( visible, arrayDim( visible ) );
|
||||
|
|
|
@ -79,6 +79,7 @@ static const std::map<int, COLOR4D> s_defaultTheme =
|
|||
{ LAYER_GERBVIEW_DRAWINGSHEET, CSS_COLOR( 0, 0, 132, 1 ) },
|
||||
|
||||
{ LAYER_ANCHOR, CSS_COLOR( 255, 38, 226, 1 ) },
|
||||
{ LAYER_LOCKED_ITEM_SHADOW, CSS_COLOR( 255, 38, 226, 0.5 ) },
|
||||
{ LAYER_AUX_ITEMS, CSS_COLOR( 255, 255, 255, 1 ) },
|
||||
{ LAYER_PCB_BACKGROUND, CSS_COLOR( 0, 16, 35, 1 ) },
|
||||
{ LAYER_CURSOR, CSS_COLOR( 255, 255, 255, 1 ) },
|
||||
|
@ -227,6 +228,7 @@ static const std::map<int, COLOR4D> s_classicTheme =
|
|||
{ LAYER_GERBVIEW_DRAWINGSHEET, COLOR4D( RED ) },
|
||||
|
||||
{ LAYER_ANCHOR, COLOR4D( BLUE ) },
|
||||
{ LAYER_LOCKED_ITEM_SHADOW, COLOR4D( BLUE ) },
|
||||
{ LAYER_AUX_ITEMS, COLOR4D( WHITE ) },
|
||||
{ LAYER_PCB_BACKGROUND, COLOR4D( BLACK ) },
|
||||
{ LAYER_CURSOR, COLOR4D( WHITE ) },
|
||||
|
|
|
@ -132,6 +132,7 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
|
|||
}
|
||||
|
||||
CLR( "board.anchor", LAYER_ANCHOR );
|
||||
CLR( "board.locked_shadow", LAYER_LOCKED_ITEM_SHADOW );
|
||||
CLR( "board.aux_items", LAYER_AUX_ITEMS );
|
||||
CLR( "board.background", LAYER_PCB_BACKGROUND );
|
||||
CLR( "board.cursor", LAYER_CURSOR );
|
||||
|
|
|
@ -225,6 +225,8 @@ enum GAL_LAYER_ID: int
|
|||
LAYER_DRC_EXCLUSION = GAL_LAYER_ID_START + 37, ///< layer for drc markers which have been individually excluded
|
||||
LAYER_MARKER_SHADOWS = GAL_LAYER_ID_START + 38, ///< shadows for drc markers
|
||||
|
||||
LAYER_LOCKED_ITEM_SHADOW = GAL_LAYER_ID_START + 39, ///< shadow layer for locked items
|
||||
|
||||
// Add layers below this point that do not have visibility controls, so don't need explicit
|
||||
// enum values
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ std::string g_previewBoard =
|
|||
" (net 0 \"\")\n"
|
||||
" (net 1 \"GND\")\n"
|
||||
"\n"
|
||||
" (module \"Wire_Pads:SolderWirePad_single_1-2mmDrill\" (layer \"F.Cu\") (tedit 5F2C4AD9) (tstamp 196cc548-e42d-4d1f-b07f-f00a85d6308b)\n"
|
||||
" (footprint \"Wire_Pads:SolderWirePad_single_1-2mmDrill\" (layer \"F.Cu\") (tedit 5F2C4AD9) (tstamp 196cc548-e42d-4d1f-b07f-f00a85d6308b)\n"
|
||||
" (at 22.7 34.09)\n"
|
||||
" (fp_text reference \"\" (at 0 -3.81) (layer \"F.SilkS\") hide\n"
|
||||
" (effects (font (size 1 1) (thickness 0.15)))\n"
|
||||
|
@ -53,7 +53,7 @@ std::string g_previewBoard =
|
|||
" (net 1 \"GND\") (tstamp 907d213c-9e76-496e-8ff8-f5d804b4ebf3))\n"
|
||||
" )\n"
|
||||
"\n"
|
||||
" (module \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE58) (tstamp 380485fd-bd1d-4d52-80be-e1a4da6db230)\n"
|
||||
" (footprint \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE58) (tstamp 380485fd-bd1d-4d52-80be-e1a4da6db230)\n"
|
||||
" (at 21.675 27.9525)\n"
|
||||
" (descr \"CP, Radial series, Radial, pin pitch=2.00mm, , diameter=5mm, Electrolytic Capacitor\")\n"
|
||||
" (tags \"CP Radial series Radial pin pitch 2.00mm diameter 5mm Electrolytic Capacitor\")\n"
|
||||
|
@ -88,7 +88,7 @@ std::string g_previewBoard =
|
|||
" )\n"
|
||||
" )\n"
|
||||
"\n"
|
||||
" (module \"Wire_Pads:SolderWirePad_single_1mmDrill\" (layer \"F.Cu\") (tedit 0) (tstamp 473e3291-e4a8-4615-824b-1aa98b60e481)\n"
|
||||
" (footprint \"Wire_Pads:SolderWirePad_single_1mmDrill\" locked (layer \"F.Cu\") (tedit 0) (tstamp 473e3291-e4a8-4615-824b-1aa98b60e481)\n"
|
||||
" (at 44.8525 24.46)\n"
|
||||
" (fp_text reference \"Hidden RefDes\" (at -0.2835 7.47025 180) (layer \"F.SilkS\") hide\n"
|
||||
" (effects (font (size 1 1) (thickness 0.15)))\n"
|
||||
|
@ -105,7 +105,7 @@ std::string g_previewBoard =
|
|||
" (pad \"1\" thru_hole circle (at 0 0) (size 2.49936 2.49936) (drill 1.00076) (layers *.Cu *.Mask) (tstamp ec712720-3eda-4621-ad13-dc832c80aef6))\n"
|
||||
" )\n"
|
||||
"\n"
|
||||
" (module \"Wire_Pads:SolderWirePad_single_1mmDrill\" (layer \"F.Cu\") (tedit 0) (tstamp 621d7aa9-bc19-436a-9ebe-ef9cdda47103)\n"
|
||||
" (footprint \"Wire_Pads:SolderWirePad_single_1mmDrill\" (layer \"F.Cu\") (tedit 0) (tstamp 621d7aa9-bc19-436a-9ebe-ef9cdda47103)\n"
|
||||
" (at 44.8525 20.9675)\n"
|
||||
" (fp_text reference \"\" (at 2.2225 0 90) (layer \"F.SilkS\") hide\n"
|
||||
" (effects (font (size 1.3 1.5) (thickness 0.25)))\n"
|
||||
|
@ -123,7 +123,7 @@ std::string g_previewBoard =
|
|||
" (net 1 \"GND\") (tstamp 5c04f147-7717-4bbf-88a9-07e172a78a08))\n"
|
||||
" )\n"
|
||||
"\n"
|
||||
" (module \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp 90b0a5fc-e8b0-4fa0-a8bd-198c1d756a29)\n"
|
||||
" (footprint \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp 90b0a5fc-e8b0-4fa0-a8bd-198c1d756a29)\n"
|
||||
" (at 28.9775 20.9675)\n"
|
||||
" (descr \"Resistor, Axial_DIN0207 series, Axial, Horizontal, pin pitch=10.16mm, 0.25W = 1/4W, length*diameter=6.3*2.5mm^2, http://cdn-reichelt.de/documents/datenblatt/B400/1_4W%23YAG.pdf\")\n"
|
||||
" (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
|
||||
|
@ -161,7 +161,7 @@ std::string g_previewBoard =
|
|||
" )\n"
|
||||
" )\n"
|
||||
"\n"
|
||||
" (module \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp c3f66ae9-669e-4889-915f-2cccae13db42)\n"
|
||||
" (footprint \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp c3f66ae9-669e-4889-915f-2cccae13db42)\n"
|
||||
" (at 28.9775 27.9525)\n"
|
||||
" (descr \"Resistor, Axial_DIN0207 series, Axial, Horizontal, pin pitch=10.16mm, 0.25W = 1/4W, length*diameter=6.3*2.5mm^2, http://cdn-reichelt.de/documents/datenblatt/B400/1_4W%23YAG.pdf\")\n"
|
||||
" (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
|
||||
|
@ -199,7 +199,7 @@ std::string g_previewBoard =
|
|||
" )\n"
|
||||
" )\n"
|
||||
"\n"
|
||||
" (module \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp e072334e-f411-41c9-ade0-5444e440897b)\n"
|
||||
" (footprint \"Resistors_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal\" (layer \"F.Cu\") (tedit 5A1048BD) (tstamp e072334e-f411-41c9-ade0-5444e440897b)\n"
|
||||
" (at 39.1375 24.46 180)\n"
|
||||
" (descr \"Resistor, Axial_DIN0207 series, Axial, Horizontal, pin pitch=10.16mm, 0.25W = 1/4W, length*diameter=6.3*2.5mm^2, http://cdn-reichelt.de/documents/datenblatt/B400/1_4W%23YAG.pdf\")\n"
|
||||
" (tags \"Resistor Axial_DIN0207 series Axial Horizontal pin pitch 10.16mm 0.25W = 1/4W length 6.3mm diameter 2.5mm\")\n"
|
||||
|
@ -236,7 +236,7 @@ std::string g_previewBoard =
|
|||
" )\n"
|
||||
" )\n"
|
||||
"\n"
|
||||
" (module \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE41) (tstamp fa4fd0e8-6269-4cb7-a049-03c4e343895c)\n"
|
||||
" (footprint \"Capacitors_THT:CP_Radial_D5.0mm_P2.00mm\" (layer \"F.Cu\") (tedit 5C22DE41) (tstamp fa4fd0e8-6269-4cb7-a049-03c4e343895c)\n"
|
||||
" (at 21.675 20.9675)\n"
|
||||
" (descr \"CP, Radial series, Radial, pin pitch=2.00mm, , diameter=5mm, Electrolytic Capacitor\")\n"
|
||||
" (tags \"CP Radial series Radial pin pitch 2.00mm diameter 5mm Electrolytic Capacitor\")\n"
|
||||
|
@ -401,6 +401,8 @@ PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS( wxWindow* aParent, BOA
|
|||
m_validLayers.push_back( id );
|
||||
}
|
||||
|
||||
m_validLayers.push_back( LAYER_LOCKED_ITEM_SHADOW );
|
||||
|
||||
// NOTE: Main board layers are added by createSwatches()
|
||||
|
||||
m_backgroundLayer = LAYER_PCB_BACKGROUND;
|
||||
|
|
|
@ -1399,6 +1399,8 @@ void FOOTPRINT::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
break;
|
||||
}
|
||||
|
||||
aLayers[ aCount++ ] = LAYER_LOCKED_ITEM_SHADOW;
|
||||
|
||||
// If there are no pads, and only drawings on a silkscreen layer, then report the silkscreen
|
||||
// layer as well so that the component can be edited with the silkscreen layer
|
||||
bool f_silk = false, b_silk = false, non_silk = false;
|
||||
|
@ -1426,6 +1428,9 @@ void FOOTPRINT::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
|
||||
double FOOTPRINT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
||||
{
|
||||
if( aLayer == LAYER_LOCKED_ITEM_SHADOW )
|
||||
return 0.0;
|
||||
|
||||
int layer = ( m_layer == F_Cu ) ? LAYER_MOD_FR :
|
||||
( m_layer == B_Cu ) ? LAYER_MOD_BK : LAYER_ANCHOR;
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ const int GAL_LAYER_ORDER[] =
|
|||
|
||||
LAYER_RATSNEST,
|
||||
LAYER_ANCHOR,
|
||||
LAYER_LOCKED_ITEM_SHADOW,
|
||||
LAYER_VIA_HOLES, LAYER_VIA_HOLEWALLS,
|
||||
LAYER_PAD_PLATEDHOLES, LAYER_PAD_HOLEWALLS, LAYER_NON_PLATEDHOLES,
|
||||
LAYER_VIA_THROUGH, LAYER_VIA_BBLIND, LAYER_VIA_MICROVIA,
|
||||
|
@ -276,7 +277,7 @@ void PCB_DRAW_PANEL_GAL::SetHighContrastLayer( PCB_LAYER_ID aLayer )
|
|||
LAYER_VIA_HOLEWALLS,
|
||||
LAYER_DRC_ERROR, LAYER_DRC_WARNING, LAYER_DRC_EXCLUSION, LAYER_MARKER_SHADOWS,
|
||||
LAYER_SELECT_OVERLAY, LAYER_GP_OVERLAY,
|
||||
LAYER_RATSNEST, LAYER_CURSOR, LAYER_ANCHOR
|
||||
LAYER_RATSNEST, LAYER_CURSOR, LAYER_ANCHOR, LAYER_LOCKED_ITEM_SHADOW
|
||||
};
|
||||
|
||||
for( unsigned int i : layers )
|
||||
|
@ -560,6 +561,9 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps()
|
|||
m_view->SetLayerTarget( LAYER_ANCHOR, KIGFX::TARGET_NONCACHED );
|
||||
m_view->SetLayerDisplayOnly( LAYER_ANCHOR );
|
||||
|
||||
m_view->SetLayerTarget( LAYER_LOCKED_ITEM_SHADOW, KIGFX::TARGET_NONCACHED );
|
||||
m_view->SetLayerDisplayOnly( LAYER_LOCKED_ITEM_SHADOW );
|
||||
|
||||
// Some more required layers settings
|
||||
m_view->SetRequired( LAYER_VIA_NETNAMES, LAYER_VIAS );
|
||||
m_view->SetRequired( LAYER_PAD_NETNAMES, LAYER_PADS );
|
||||
|
|
|
@ -1872,6 +1872,18 @@ void PCB_PAINTER::draw( const FOOTPRINT* aFootprint, int aLayer )
|
|||
m_gal->DrawLine( center - VECTOR2D( anchorSize, 0 ), center + VECTOR2D( anchorSize, 0 ) );
|
||||
m_gal->DrawLine( center - VECTOR2D( 0, anchorSize ), center + VECTOR2D( 0, anchorSize ) );
|
||||
}
|
||||
|
||||
if( aLayer == LAYER_LOCKED_ITEM_SHADOW && aFootprint->IsLocked() )
|
||||
{
|
||||
const COLOR4D color = m_pcbSettings.GetColor( aFootprint, aLayer );
|
||||
|
||||
m_gal->SetIsFill( true );
|
||||
m_gal->SetIsStroke( false );
|
||||
m_gal->SetFillColor( color );
|
||||
|
||||
SHAPE_POLY_SET poly = aFootprint->GetBoundingHull();
|
||||
m_gal->DrawPolygon( poly );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -352,6 +352,7 @@ const APPEARANCE_CONTROLS::APPEARANCE_SETTING APPEARANCE_CONTROLS::s_objectSetti
|
|||
RR( _HKI( "DRC Errors" ), LAYER_DRC_ERROR, _HKI( "DRC violations with an Error severity" ) ),
|
||||
RR( _HKI( "DRC Exclusions" ), LAYER_DRC_EXCLUSION, _HKI( "DRC violations which have been individually excluded" ) ),
|
||||
RR( _HKI( "Anchors" ), LAYER_ANCHOR, _HKI( "Show footprint and text origins as a cross" ) ),
|
||||
RR( _HKI( "Locked Marker" ), LAYER_LOCKED_ITEM_SHADOW, _HKI( "Show marker shadow on locked footprints" ) ),
|
||||
RR( _HKI( "Drawing Sheet" ), LAYER_DRAWINGSHEET, _HKI( "Show drawing sheet borders and title block" ) ),
|
||||
RR( _HKI( "Grid" ), LAYER_GRID, _HKI( "Show the (x,y) grid dots" ) )
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue