From 58a9b75883ff6a96bb35175dd36705c76bfc2b5d Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 16 Jul 2023 19:04:21 +0200 Subject: [PATCH] Eechema: Do Not Place markers: add a specific setting for their color. Previously, the color was the ERROR ERC marker color. Now they have a specific color. --- common/layer_id.cpp | 1 + common/settings/builtin_color_themes.h | 2 ++ common/settings/color_settings.cpp | 1 + eeschema/sch_painter.cpp | 4 ++-- eeschema/sch_symbol.cpp | 4 ++-- include/layer_ids.h | 1 + 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/layer_id.cpp b/common/layer_id.cpp index 0e3b79a786..cfee608577 100644 --- a/common/layer_id.cpp +++ b/common/layer_id.cpp @@ -132,6 +132,7 @@ wxString LayerName( int aLayer ) case LAYER_SHEETFILENAME: return _( "Sheet file names" ); case LAYER_SHEETLABEL: return _( "Sheet pins" ); case LAYER_NOCONNECT: return _( "No-connect symbols" ); + case LAYER_DNP_MARKER: return _( "DNP markers" ); case LAYER_ERC_WARN: return _( "ERC warnings" ); case LAYER_ERC_ERR: return _( "ERC errors" ); case LAYER_ERC_EXCLUSION: return _( "ERC exclusions" ); diff --git a/common/settings/builtin_color_themes.h b/common/settings/builtin_color_themes.h index b83e54e306..6ef0ae90a8 100644 --- a/common/settings/builtin_color_themes.h +++ b/common/settings/builtin_color_themes.h @@ -37,6 +37,7 @@ static const std::map s_defaultTheme = { LAYER_DEVICE_BACKGROUND, CSS_COLOR( 255, 255, 194, 1 ) }, { LAYER_DEVICE, CSS_COLOR( 132, 0, 0, 1 ) }, { LAYER_SCHEMATIC_CURSOR, CSS_COLOR( 15, 15, 15, 1 ) }, + { LAYER_DNP_MARKER, CSS_COLOR( 220, 9, 13, 0.7 ) }, { LAYER_ERC_ERR, CSS_COLOR( 230, 9, 13, 0.8 ) }, { LAYER_ERC_WARN, CSS_COLOR( 209, 146, 0, 0.8 ) }, { LAYER_ERC_EXCLUSION, CSS_COLOR( 94, 194, 194, 0.8 ) }, @@ -254,6 +255,7 @@ static const std::map s_classicTheme = { LAYER_DEVICE_BACKGROUND, COLOR4D( LIGHTYELLOW ) }, { LAYER_DEVICE, COLOR4D( RED ) }, { LAYER_SCHEMATIC_CURSOR, COLOR4D( BLACK ) }, + { LAYER_DNP_MARKER, COLOR4D( PURERED ).WithAlpha( 0.7 ) }, { LAYER_ERC_ERR, COLOR4D( PURERED ).WithAlpha( 0.8 ) }, { LAYER_ERC_WARN, COLOR4D( PUREGREEN ).WithAlpha( 0.8 ) }, { LAYER_ERC_EXCLUSION, COLOR4D( LIGHTGRAY ) }, diff --git a/common/settings/color_settings.cpp b/common/settings/color_settings.cpp index e9bda09789..fc94ebf829 100644 --- a/common/settings/color_settings.cpp +++ b/common/settings/color_settings.cpp @@ -65,6 +65,7 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath ) CLR( "schematic.component_body", LAYER_DEVICE_BACKGROUND ); CLR( "schematic.component_outline", LAYER_DEVICE ); CLR( "schematic.cursor", LAYER_SCHEMATIC_CURSOR ); + CLR( "schematic.dnp_marker", LAYER_DNP_MARKER ); CLR( "schematic.erc_error", LAYER_ERC_ERR ); CLR( "schematic.erc_warning", LAYER_ERC_WARN ); CLR( "schematic.erc_exclusion", LAYER_ERC_EXCLUSION ); diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index c1b862a630..790ffdf54a 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -2507,8 +2507,8 @@ void SCH_PAINTER::draw( const SCH_SYMBOL* aSymbol, int aLayer ) m_gal->AdvanceDepth(); m_gal->SetIsStroke( true ); m_gal->SetIsFill( true ); - m_gal->SetStrokeColor( m_schSettings.GetLayerColor( LAYER_ERC_ERR ) ); - m_gal->SetFillColor( m_schSettings.GetLayerColor( LAYER_ERC_ERR ) ); + m_gal->SetStrokeColor( m_schSettings.GetLayerColor( LAYER_DNP_MARKER ) ); + m_gal->SetFillColor( m_schSettings.GetLayerColor( LAYER_DNP_MARKER ) ); m_gal->DrawSegment( pt1, pt2, 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) ); std::swap( pt1.x, pt2.x ); diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 24eb033e6a..8785c994f2 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -482,7 +482,7 @@ void SCH_SYMBOL::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffse { BOX2I bbox = GetBodyAndPinsBoundingBox(); wxDC* DC = aSettings->GetPrintDC(); - COLOR4D dnp_color = aSettings->GetLayerColor( LAYER_ERC_ERR ); + COLOR4D dnp_color = aSettings->GetLayerColor( LAYER_DNP_MARKER ); GRFilledSegment( DC, bbox.GetOrigin(), bbox.GetEnd(), 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), @@ -2302,7 +2302,7 @@ void SCH_SYMBOL::PlotDNP( PLOTTER* aPlotter ) const COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings(); - aPlotter->SetColor( colors->GetColor( LAYER_ERC_ERR ) ); + aPlotter->SetColor( colors->GetColor( LAYER_DNP_MARKER ) ); aPlotter->ThickSegment( bbox.GetOrigin(), bbox.GetEnd(), 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ), diff --git a/include/layer_ids.h b/include/layer_ids.h index 3752dd8d5f..dab72e5b78 100644 --- a/include/layer_ids.h +++ b/include/layer_ids.h @@ -370,6 +370,7 @@ enum SCH_LAYER_ID: int LAYER_SHEETLABEL, LAYER_NOCONNECT, LAYER_DANGLING, + LAYER_DNP_MARKER, LAYER_ERC_WARN, LAYER_ERC_ERR, LAYER_ERC_EXCLUSION,