Add show/hide controls for ERC markers.

ADDED show/hide controls for ERC warnings, ERC errors and ERC exclusions.

Fixes https://gitlab.com/kicad/code/kicad/issues/7270
This commit is contained in:
Jeff Young 2021-11-05 21:16:26 +00:00
parent a6dd1bf09b
commit af13533b42
17 changed files with 370 additions and 36 deletions

View File

@ -130,6 +130,7 @@ wxString LayerName( int aLayer )
case LAYER_NOCONNECT: return _( "No-connect symbols" );
case LAYER_ERC_WARN: return _( "ERC warnings" );
case LAYER_ERC_ERR: return _( "ERC errors" );
case LAYER_ERC_EXCLUSION: return _( "ERC exclusions" );
case LAYER_SCHEMATIC_ANCHOR: return _( "Anchors" );
case LAYER_SCHEMATIC_AUX_ITEMS: return _( "Helper items" );
case LAYER_SCHEMATIC_GRID: return _( "Grid" );

View File

@ -38,6 +38,7 @@ static const std::map<int, COLOR4D> s_defaultTheme =
{ LAYER_SCHEMATIC_CURSOR, CSS_COLOR( 15, 15, 15, 1 ) },
{ 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 ) },
{ LAYER_FIELDS, CSS_COLOR( 132, 0, 132, 1 ) },
{ LAYER_SCHEMATIC_GRID, CSS_COLOR( 181, 181, 181, 1 ) },
{ LAYER_SCHEMATIC_GRID_AXES, CSS_COLOR( 0, 0, 132, 1 ) },
@ -185,6 +186,7 @@ static const std::map<int, COLOR4D> s_classicTheme =
{ LAYER_SCHEMATIC_CURSOR, COLOR4D( BLACK ) },
{ LAYER_ERC_ERR, COLOR4D( PURERED ).WithAlpha( 0.8 ) },
{ LAYER_ERC_WARN, COLOR4D( PUREGREEN ).WithAlpha( 0.8 ) },
{ LAYER_DRC_EXCLUSION, COLOR4D( LIGHTGRAY ) },
{ LAYER_FIELDS, COLOR4D( MAGENTA ) },
{ LAYER_SCHEMATIC_GRID, COLOR4D( DARKGRAY ) },
{ LAYER_SCHEMATIC_GRID_AXES, COLOR4D( BLUE ) },

View File

@ -45,6 +45,9 @@ void PANEL_EESCHEMA_DISPLAY_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* cf
{
m_checkShowHiddenPins->SetValue( cfg->m_Appearance.show_hidden_pins );
m_checkShowHiddenFields->SetValue( cfg->m_Appearance.show_hidden_fields );
m_checkShowERCErrors->SetValue( cfg->m_Appearance.show_erc_errors );
m_checkShowERCWarnings->SetValue( cfg->m_Appearance.show_erc_warnings );
m_checkShowERCExclusions->SetValue( cfg->m_Appearance.show_erc_exclusions );
m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits );
m_checkSelTextBox->SetValue( cfg->m_Selection.text_as_box );
@ -79,6 +82,9 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
cfg->m_Appearance.show_hidden_pins = m_checkShowHiddenPins->GetValue();
cfg->m_Appearance.show_hidden_fields = m_checkShowHiddenFields->GetValue();
cfg->m_Appearance.show_erc_warnings = m_checkShowERCWarnings->GetValue();
cfg->m_Appearance.show_erc_errors = m_checkShowERCErrors->GetValue();
cfg->m_Appearance.show_erc_exclusions = m_checkShowERCExclusions->GetValue();
cfg->m_Appearance.show_page_limits = m_checkPageLimits->GetValue();
cfg->m_Selection.text_as_box = m_checkSelTextBox->GetValue();

View File

@ -31,6 +31,15 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
m_checkShowHiddenFields = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show hidden fields"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkShowHiddenFields, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_checkShowERCErrors = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show ERC errors"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkShowERCErrors, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkShowERCWarnings = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show ERC warnings"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkShowERCWarnings, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkShowERCExclusions = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show ERC exclusions"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_checkShowERCExclusions, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkPageLimits = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkPageLimits->SetValue(true);
sbSizer1->Add( m_checkPageLimits, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -214,6 +214,198 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show ERC errors</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkShowERCErrors</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show ERC warnings</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkShowERCWarnings</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show ERC exclusions</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkShowERCExclusions</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>

View File

@ -37,6 +37,9 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL
wxBoxSizer* m_galOptionsSizer;
wxCheckBox* m_checkShowHiddenPins;
wxCheckBox* m_checkShowHiddenFields;
wxCheckBox* m_checkShowERCErrors;
wxCheckBox* m_checkShowERCWarnings;
wxCheckBox* m_checkShowERCExclusions;
wxCheckBox* m_checkPageLimits;
wxCheckBox* m_checkSelTextBox;
wxCheckBox* m_checkSelDrawChildItems;

View File

@ -100,6 +100,15 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "appearance.show_hidden_fields",
&m_Appearance.show_hidden_fields, false ) );
m_params.emplace_back( new PARAM<bool>( "appearance.show_erc_warnings",
&m_Appearance.show_erc_warnings, true ) );
m_params.emplace_back( new PARAM<bool>( "appearance.show_erc_errors",
&m_Appearance.show_erc_errors, true ) );
m_params.emplace_back( new PARAM<bool>( "appearance.show_erc_exclusions",
&m_Appearance.show_erc_exclusions, false ) );
m_params.emplace_back( new PARAM<bool>( "appearance.show_illegal_symbol_lib_dialog",
&m_Appearance.show_illegal_symbol_lib_dialog, true ) );

View File

@ -44,6 +44,9 @@ public:
bool print_sheet_reference;
bool show_hidden_pins;
bool show_hidden_fields;
bool show_erc_warnings;
bool show_erc_errors;
bool show_erc_exclusions;
bool show_illegal_symbol_lib_dialog;
bool show_page_limits;
bool show_sexpr_file_convert_warning;

View File

@ -174,22 +174,26 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
viewMenu->Add( ACTIONS::zoomRedraw );
viewMenu->AppendSeparator();
viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK );
viewMenu->Add( ACTIONS::toggleGrid, ACTION_MENU::CHECK );
viewMenu->Add( ACTIONS::gridProperties );
// Units submenu
ACTION_MENU* unitsSubMenu = new ACTION_MENU( false, selTool );
unitsSubMenu->SetTitle( _( "&Units" ) );
unitsSubMenu->SetIcon( BITMAPS::unit_mm );
unitsSubMenu->Add( ACTIONS::inchesUnits, ACTION_MENU::CHECK );
unitsSubMenu->Add( ACTIONS::milsUnits, ACTION_MENU::CHECK );
unitsSubMenu->Add( ACTIONS::millimetersUnits, ACTION_MENU::CHECK );
unitsSubMenu->Add( ACTIONS::inchesUnits, ACTION_MENU::CHECK );
unitsSubMenu->Add( ACTIONS::milsUnits, ACTION_MENU::CHECK );
unitsSubMenu->Add( ACTIONS::millimetersUnits, ACTION_MENU::CHECK );
viewMenu->Add( unitsSubMenu );
viewMenu->Add( ACTIONS::toggleCursorStyle, ACTION_MENU::CHECK );
viewMenu->Add( ACTIONS::toggleCursorStyle, ACTION_MENU::CHECK );
viewMenu->AppendSeparator();
viewMenu->Add( EE_ACTIONS::toggleHiddenPins, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleHiddenPins, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleHiddenFields, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleERCErrors, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleERCWarnings, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleERCExclusions, ACTION_MENU::CHECK );
#ifdef __APPLE__
viewMenu->AppendSeparator();

View File

@ -430,41 +430,75 @@ void SCH_EDIT_FRAME::setupUIConditions()
CHECK( cond.CurrentTool( ACTIONS::selectionTool ) ) );
if( SCRIPTING::IsWxAvailable() )
{
mgr->SetConditions( EE_ACTIONS::showPythonConsole,
CHECK( cond.ScriptingConsoleVisible() ) );
}
auto showHiddenPinsCond =
[this] ( const SELECTION& )
{
return GetShowAllPins();
};
[this]( const SELECTION& )
{
return GetShowAllPins();
};
auto showHiddenFieldsCond =
[this]( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Appearance.show_hidden_fields;
};
auto showERCErrorsCond =
[this]( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Appearance.show_erc_errors;
};
auto showERCWarningsCond =
[this]( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Appearance.show_erc_warnings;
};
auto showERCExclusionsCond =
[this]( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Appearance.show_erc_exclusions;
};
auto forceHVCond =
[this] ( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Drawing.hv_lines_only;
};
[this]( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Drawing.hv_lines_only;
};
auto remapSymbolsCondition =
[&]( const SELECTION& aSel )
{
SCH_SCREENS schematic( Schematic().Root() );
[&]( const SELECTION& aSel )
{
SCH_SCREENS schematic( Schematic().Root() );
// The remapping can only be performed on legacy projects.
return schematic.HasNoFullyDefinedLibIds();
};
// The remapping can only be performed on legacy projects.
return schematic.HasNoFullyDefinedLibIds();
};
auto belowRootSheetCondition =
[this]( const SELECTION& aSel )
{
return GetCurrentSheet().Last() != &Schematic().Root();
};
[this]( const SELECTION& aSel )
{
return GetCurrentSheet().Last() != &Schematic().Root();
};
mgr->SetConditions( EE_ACTIONS::leaveSheet, ENABLE( belowRootSheetCondition ) );
mgr->SetConditions( EE_ACTIONS::remapSymbols, ENABLE( remapSymbolsCondition ) );
mgr->SetConditions( EE_ACTIONS::toggleHiddenPins, CHECK( showHiddenPinsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleForceHV, CHECK( forceHVCond ) );
mgr->SetConditions( EE_ACTIONS::leaveSheet, ENABLE( belowRootSheetCondition ) );
mgr->SetConditions( EE_ACTIONS::remapSymbols, ENABLE( remapSymbolsCondition ) );
mgr->SetConditions( EE_ACTIONS::toggleHiddenPins, CHECK( showHiddenPinsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleHiddenFields, CHECK( showHiddenFieldsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleERCErrors, CHECK( showERCErrorsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleERCWarnings, CHECK( showERCWarningsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleERCExclusions, CHECK( showERCExclusionsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleForceHV, CHECK( forceHVCond ) );
#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) )
@ -1467,9 +1501,14 @@ void SCH_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
ShowAllIntersheetRefs( settings.m_IntersheetRefsShow );
auto cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings<EESCHEMA_SETTINGS>();
GetGalDisplayOptions().ReadWindowSettings( cfg->m_Window );
KIGFX::VIEW* view = GetCanvas()->GetView();
view->SetLayerVisible( LAYER_ERC_ERR, cfg->m_Appearance.show_erc_errors );
view->SetLayerVisible( LAYER_ERC_WARN, cfg->m_Appearance.show_erc_warnings );
view->SetLayerVisible( LAYER_ERC_EXCLUSION, cfg->m_Appearance.show_erc_exclusions );
GetCanvas()->ForceRefresh();
RecreateToolbars();

View File

@ -108,11 +108,18 @@ void SCH_MARKER::ViewGetLayers( int aLayers[], int& aCount ) const
wxCHECK_RET( Schematic(), "No SCHEMATIC set for SCH_MARKER!" );
switch( Schematic()->ErcSettings().GetSeverity( m_rcItem->GetErrorCode() ) )
if( IsExcluded() )
{
default:
case SEVERITY::RPT_SEVERITY_ERROR: aLayers[0] = LAYER_ERC_ERR; break;
case SEVERITY::RPT_SEVERITY_WARNING: aLayers[0] = LAYER_ERC_WARN; break;
aLayers[0] = LAYER_ERC_EXCLUSION;
}
else
{
switch( Schematic()->ErcSettings().GetSeverity( m_rcItem->GetErrorCode() ) )
{
default:
case SEVERITY::RPT_SEVERITY_ERROR: aLayers[0] = LAYER_ERC_ERR; break;
case SEVERITY::RPT_SEVERITY_WARNING: aLayers[0] = LAYER_ERC_WARN; break;
}
}
aLayers[1] = LAYER_SELECTION_SHADOWS;
@ -122,7 +129,7 @@ void SCH_MARKER::ViewGetLayers( int aLayers[], int& aCount ) const
SCH_LAYER_ID SCH_MARKER::GetColorLayer() const
{
if( IsExcluded() )
return LAYER_HIDDEN;
return LAYER_ERC_EXCLUSION;
wxCHECK_MSG( Schematic(), LAYER_ERC_ERR, "No SCHEMATIC set for SCH_MARKER!" );

View File

@ -45,7 +45,7 @@ constexpr double SCH_WORLD_UNIT ( 1e-7 / 0.0254 );
static const int SCH_LAYER_ORDER[] =
{
LAYER_GP_OVERLAY, LAYER_SELECT_OVERLAY,
LAYER_ERC_ERR, LAYER_ERC_WARN, LAYER_DANGLING,
LAYER_ERC_ERR, LAYER_ERC_WARN, LAYER_ERC_EXCLUSION, LAYER_DANGLING,
LAYER_REFERENCEPART, LAYER_VALUEPART, LAYER_FIELDS,
LAYER_INTERSHEET_REFS, LAYER_NETCLASS_REFS,
LAYER_BUS_JUNCTION, LAYER_JUNCTION, LAYER_NOCONNECT,

View File

@ -655,6 +655,19 @@ TOOL_ACTION EE_ACTIONS::toggleHiddenFields( "eeschema.EditorControl.showHiddenFi
AS_GLOBAL, 0, "",
_( "Show Hidden Fields" ), _( "Toggle display of hidden text fields" ) );
TOOL_ACTION EE_ACTIONS::toggleERCWarnings( "eeschema.EditorControl.showERCWarnings",
AS_GLOBAL, 0, "",
_( "Show ERC Warnings" ), _( "Show markers for electrical rules checker warnings" ) );
TOOL_ACTION EE_ACTIONS::toggleERCErrors( "eeschema.EditorControl.showERCErrors",
AS_GLOBAL, 0, "",
_( "Show ERC Errors" ), _( "Show markers for electrical rules checker errors" ) );
TOOL_ACTION EE_ACTIONS::toggleERCExclusions( "eeschema.EditorControl.showERCExclusions",
AS_GLOBAL, 0, "",
_( "Show ERC Exclusions" ),
_( "Show markers for excluded electrical rules checker violations" ) );
TOOL_ACTION EE_ACTIONS::toggleForceHV( "eeschema.EditorControl.forceHVLines",
AS_GLOBAL, 0, "",
_( "Force H/V Wires and Buses" ), _( "Switch H & V only mode for new wires and buses" ),

View File

@ -196,6 +196,9 @@ public:
// Miscellaneous
static TOOL_ACTION toggleHiddenPins;
static TOOL_ACTION toggleHiddenFields;
static TOOL_ACTION toggleERCWarnings;
static TOOL_ACTION toggleERCErrors;
static TOOL_ACTION toggleERCExclusions;
static TOOL_ACTION toggleSyncedPinsMode;
static TOOL_ACTION restartMove;
static TOOL_ACTION explicitCrossProbe;

View File

@ -2149,6 +2149,42 @@ int SCH_EDITOR_CONTROL::ToggleHiddenFields( const TOOL_EVENT& aEvent )
}
int SCH_EDITOR_CONTROL::ToggleERCWarnings( const TOOL_EVENT& aEvent )
{
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
cfg->m_Appearance.show_erc_warnings = !cfg->m_Appearance.show_erc_warnings;
getView()->SetLayerVisible( LAYER_ERC_WARN, cfg->m_Appearance.show_erc_warnings );
m_frame->GetCanvas()->Refresh();
return 0;
}
int SCH_EDITOR_CONTROL::ToggleERCErrors( const TOOL_EVENT& aEvent )
{
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
cfg->m_Appearance.show_erc_errors = !cfg->m_Appearance.show_erc_errors;
getView()->SetLayerVisible( LAYER_ERC_ERR, cfg->m_Appearance.show_erc_errors );
m_frame->GetCanvas()->Refresh();
return 0;
}
int SCH_EDITOR_CONTROL::ToggleERCExclusions( const TOOL_EVENT& aEvent )
{
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
cfg->m_Appearance.show_erc_exclusions = !cfg->m_Appearance.show_erc_exclusions;
getView()->SetLayerVisible( LAYER_ERC_EXCLUSION, cfg->m_Appearance.show_erc_exclusions );
m_frame->GetCanvas()->Refresh();
return 0;
}
int SCH_EDITOR_CONTROL::ToggleForceHV( const TOOL_EVENT& aEvent )
{
m_frame->eeconfig()->m_Drawing.hv_lines_only = !m_frame->eeconfig()->m_Drawing.hv_lines_only;
@ -2327,6 +2363,9 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::ToggleHiddenPins, EE_ACTIONS::toggleHiddenPins.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleHiddenFields, EE_ACTIONS::toggleHiddenFields.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleERCWarnings, EE_ACTIONS::toggleERCWarnings.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleERCErrors, EE_ACTIONS::toggleERCErrors.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleERCExclusions, EE_ACTIONS::toggleERCExclusions.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleForceHV, EE_ACTIONS::toggleForceHV.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::TogglePythonConsole, EE_ACTIONS::showPythonConsole.MakeEvent() );

View File

@ -137,6 +137,9 @@ public:
int ToggleHiddenPins( const TOOL_EVENT& aEvent );
int ToggleHiddenFields( const TOOL_EVENT& aEvent );
int ToggleERCWarnings( const TOOL_EVENT& aEvent );
int ToggleERCErrors( const TOOL_EVENT& aEvent );
int ToggleERCExclusions( const TOOL_EVENT& aEvent );
int ToggleForceHV( const TOOL_EVENT& aEvent );
int TogglePythonConsole( const TOOL_EVENT& aEvent );

View File

@ -344,6 +344,7 @@ enum SCH_LAYER_ID: int
LAYER_DANGLING,
LAYER_ERC_WARN,
LAYER_ERC_ERR,
LAYER_ERC_EXCLUSION,
LAYER_DEVICE_BACKGROUND,
LAYER_SHEET_BACKGROUND,
LAYER_SCHEMATIC_GRID,