mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 14:50:11 +00:00
Implement highlighting style for netclass colors
This commit is contained in:
parent
d95901d981
commit
6371b15aa4
@ -178,6 +178,7 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA
|
||||
}
|
||||
else
|
||||
{
|
||||
m_highlightNetColors->Hide();
|
||||
m_colorDefaultHelpText->SetLabel(
|
||||
_( "Set color to transparent to use layer default color." ) );
|
||||
m_colorDefaultHelpText->GetParent()->Layout();
|
||||
@ -447,6 +448,8 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
|
||||
loadNetclasses();
|
||||
AdjustAssignmentGridColumns( GetSize().x * 3 / 5 );
|
||||
|
||||
m_highlightNetColors->SetValue( m_netSettings->GetHighlightNetclassColors() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -549,6 +552,8 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
|
||||
m_netSettings->SetNetclassPatternAssignment( pattern, netclass );
|
||||
}
|
||||
|
||||
m_netSettings->SetHighlightNetclassColors( m_highlightNetColors->GetValue() );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.1.0-3-g43bf300c)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -102,6 +102,12 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi
|
||||
buttonBoxSizer->Add( m_moveDownButton, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
|
||||
buttonBoxSizer->Add( 60, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_highlightNetColors = new wxCheckBox( m_netclassesPane, wxID_ANY, _("Highlight net colors"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
buttonBoxSizer->Add( m_highlightNetColors, 0, wxALL, 5 );
|
||||
|
||||
|
||||
buttonBoxSizer->Add( 60, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_colorDefaultHelpText = new wxStaticText( m_netclassesPane, wxID_ANY, _("Set color to transparent to use KiCad default color."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
@ -1,34 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="17"/>
|
||||
<FileVersion major="1" minor="18"/>
|
||||
<object class="Project" expanded="true">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="cpp_class_decoration"></property>
|
||||
<property name="cpp_disconnect_events">1</property>
|
||||
<property name="cpp_event_generation">connect</property>
|
||||
<property name="cpp_help_provider">none</property>
|
||||
<property name="cpp_namespace"></property>
|
||||
<property name="cpp_precompiled_header"></property>
|
||||
<property name="cpp_use_array_enum">0</property>
|
||||
<property name="cpp_use_enum">1</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">panel_setup_netclasses_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="image_path_wrapper_function_name"></property>
|
||||
<property name="indent_with_spaces"></property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="lua_skip_events">1</property>
|
||||
<property name="lua_ui_table">UI</property>
|
||||
<property name="name">panel_setup_netclasses_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="php_disconnect_events">0</property>
|
||||
<property name="php_disconnect_mode">source_name</property>
|
||||
<property name="php_skip_events">1</property>
|
||||
<property name="python_disconnect_events">0</property>
|
||||
<property name="python_disconnect_mode">source_name</property>
|
||||
<property name="python_image_path_wrapper_function_name"></property>
|
||||
<property name="python_indent_with_spaces"></property>
|
||||
<property name="python_skip_events">1</property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_array_enum">0</property>
|
||||
<property name="use_enum">1</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<property name="use_native_eol">0</property>
|
||||
<object class="Panel" expanded="true">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
@ -77,10 +79,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -136,10 +138,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -197,10 +199,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -269,10 +271,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
@ -368,10 +370,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -453,10 +455,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -538,10 +540,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -623,10 +625,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -699,6 +701,81 @@
|
||||
<property name="width">60</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="true">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</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="drag_accept_files">0</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">Highlight net colors</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_highlightNetColors</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="true">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="true">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">60</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="true">
|
||||
<property name="border">10</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
|
||||
@ -708,10 +785,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -770,10 +847,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -847,10 +924,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -919,10 +996,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -999,10 +1076,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="autosize_cols">0</property>
|
||||
<property name="autosize_rows">0</property>
|
||||
<property name="best_size"></property>
|
||||
@ -1092,10 +1169,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
@ -1162,10 +1239,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
@ -1247,10 +1324,10 @@
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_layer">0</property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="aui_position">0</property>
|
||||
<property name="aui_row">0</property>
|
||||
<property name="auth_needed">0</property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 4.1.0-3-g43bf300c)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -27,6 +27,7 @@ class WX_PANEL;
|
||||
#include <wx/image.h>
|
||||
#include <wx/icon.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/html/htmlwin.h>
|
||||
@ -50,6 +51,7 @@ class PANEL_SETUP_NETCLASSES_BASE : public wxPanel
|
||||
STD_BITMAP_BUTTON* m_removeButton;
|
||||
STD_BITMAP_BUTTON* m_moveUpButton;
|
||||
STD_BITMAP_BUTTON* m_moveDownButton;
|
||||
wxCheckBox* m_highlightNetColors;
|
||||
wxStaticText* m_colorDefaultHelpText;
|
||||
wxButton* m_importColorsButton;
|
||||
WX_PANEL* m_membershipPane;
|
||||
|
@ -151,6 +151,7 @@ wxString LayerName( int aLayer )
|
||||
case LAYER_BRIGHTENED: return _( "Highlighted items" );
|
||||
case LAYER_HIDDEN: return _( "Hidden items" );
|
||||
case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
|
||||
case LAYER_NET_COLOR_HIGHLIGHT: return _( "Wire highlight" );
|
||||
case LAYER_SCHEMATIC_DRAWINGSHEET: return _( "Drawing sheet" );
|
||||
case LAYER_SCHEMATIC_PAGE_LIMITS: return _( "Page limits" );
|
||||
case LAYER_OP_VOLTAGES: return _( "Operating point voltages" );
|
||||
|
@ -35,7 +35,8 @@
|
||||
// const int netSettingsSchemaVersion = 1; // new overbar syntax
|
||||
// const int netSettingsSchemaVersion = 2; // exclude buses from netclass members
|
||||
// const int netSettingsSchemaVersion = 3; // netclass assignment patterns
|
||||
const int netSettingsSchemaVersion = 4; // netclass ordering
|
||||
// const int netSettingsSchemaVersion = 4; // netclass ordering
|
||||
const int netSettingsSchemaVersion = 5; // net color highlighting
|
||||
|
||||
|
||||
static std::optional<int> getInPcbUnits( const nlohmann::json& aObj, const std::string& aKey,
|
||||
@ -64,6 +65,8 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) :
|
||||
m_defaultNetClass = std::make_shared<NETCLASS>( NETCLASS::Default, true );
|
||||
m_defaultNetClass->SetDescription( _( "This is the default net class." ) );
|
||||
|
||||
m_highlightNetclassColors = false;
|
||||
|
||||
auto saveNetclass =
|
||||
[]( nlohmann::json& json_array, const std::shared_ptr<NETCLASS>& nc )
|
||||
{
|
||||
@ -321,11 +324,28 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) :
|
||||
}
|
||||
},
|
||||
{} ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "highlight_net_colors",
|
||||
[&]() -> nlohmann::json
|
||||
{
|
||||
nlohmann::json ret = {};
|
||||
ret["value"] = m_highlightNetclassColors;
|
||||
return ret;
|
||||
},
|
||||
[&]( const nlohmann::json& aJson )
|
||||
{
|
||||
if( !aJson.is_object() )
|
||||
return;
|
||||
|
||||
m_highlightNetclassColors = aJson["value"];
|
||||
},
|
||||
{} ) );
|
||||
|
||||
registerMigration( 0, 1, std::bind( &NET_SETTINGS::migrateSchema0to1, this ) );
|
||||
registerMigration( 1, 2, std::bind( &NET_SETTINGS::migrateSchema1to2, this ) );
|
||||
registerMigration( 2, 3, std::bind( &NET_SETTINGS::migrateSchema2to3, this ) );
|
||||
registerMigration( 3, 4, std::bind( &NET_SETTINGS::migrateSchema3to4, this ) );
|
||||
registerMigration( 4, 5, std::bind( &NET_SETTINGS::migrateSchema4to5, this ) );
|
||||
}
|
||||
|
||||
|
||||
@ -464,6 +484,11 @@ bool NET_SETTINGS::migrateSchema3to4()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NET_SETTINGS::migrateSchema4to5()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void NET_SETTINGS::SetDefaultNetclass( std::shared_ptr<NETCLASS> netclass )
|
||||
{
|
||||
|
@ -153,10 +153,11 @@ void SCH_BUS_ENTRY_BASE::SwapData( SCH_ITEM* aItem )
|
||||
|
||||
void SCH_BUS_ENTRY_BASE::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
aCount = 3;
|
||||
aCount = 4;
|
||||
aLayers[0] = LAYER_DANGLING;
|
||||
aLayers[1] = Type() == SCH_BUS_BUS_ENTRY_T ? LAYER_BUS : LAYER_WIRE;
|
||||
aLayers[2] = LAYER_SELECTION_SHADOWS;
|
||||
aLayers[2] = LAYER_NET_COLOR_HIGHLIGHT;
|
||||
aLayers[3] = LAYER_SELECTION_SHADOWS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,4 +108,5 @@
|
||||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20240417 // Rule areas
|
||||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20240602 // Sheet attributes
|
||||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20240620 // Embedded Files
|
||||
#define SEXPR_SCHEMATIC_FILE_VERSION 20240716 // Multiple netclass assignments
|
||||
//#define SEXPR_SCHEMATIC_FILE_VERSION 20240716 // Multiple netclass assignments
|
||||
#define SEXPR_SCHEMATIC_FILE_VERSION 20240812 // Netclass color highlighting
|
||||
|
@ -190,11 +190,12 @@ void SCH_LINE::Show( int nestLevel, std::ostream& os ) const
|
||||
|
||||
void SCH_LINE::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
aCount = 4;
|
||||
aCount = 5;
|
||||
aLayers[0] = LAYER_DANGLING;
|
||||
aLayers[1] = m_layer;
|
||||
aLayers[2] = LAYER_SELECTION_SHADOWS;
|
||||
aLayers[3] = LAYER_OP_VOLTAGES;
|
||||
aLayers[3] = LAYER_NET_COLOR_HIGHLIGHT;
|
||||
aLayers[4] = LAYER_OP_VOLTAGES;
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include <sch_pin.h>
|
||||
#include <math/util.h>
|
||||
#include <pgm_base.h>
|
||||
#include <project/net_settings.h>
|
||||
#include <project/project_file.h>
|
||||
#include <sch_bitmap.h>
|
||||
#include <sch_bus_entry.h>
|
||||
#include <sch_symbol.h>
|
||||
@ -471,7 +473,8 @@ COLOR4D SCH_PAINTER::getRenderColor( const SCH_ITEM* aItem, int aLayer, bool aDr
|
||||
}
|
||||
|
||||
|
||||
float SCH_PAINTER::getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) const
|
||||
float SCH_PAINTER::getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows,
|
||||
bool aDrawingWireColorHighlights ) const
|
||||
{
|
||||
wxCHECK( aItem, static_cast<float>( schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) ) );
|
||||
|
||||
@ -484,6 +487,9 @@ float SCH_PAINTER::getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) c
|
||||
width += getShadowWidth( aItem->IsBrightened() );
|
||||
}
|
||||
|
||||
if( aDrawingWireColorHighlights )
|
||||
width *= 4;
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
@ -1302,6 +1308,8 @@ void SCH_PAINTER::drawDanglingIndicator( const VECTOR2I& aPos, const COLOR4D& aC
|
||||
|
||||
void SCH_PAINTER::draw( const SCH_JUNCTION* aJct, int aLayer )
|
||||
{
|
||||
NET_SETTINGS* netSettings = m_schematic->Prj().GetProjectFile().NetSettings().get();
|
||||
|
||||
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
|
||||
|
||||
if( m_schSettings.IsPrinting() && drawingShadows )
|
||||
@ -1310,7 +1318,12 @@ void SCH_PAINTER::draw( const SCH_JUNCTION* aJct, int aLayer )
|
||||
if( drawingShadows && !( aJct->IsBrightened() || aJct->IsSelected() ) )
|
||||
return;
|
||||
|
||||
COLOR4D color = getRenderColor( aJct, aJct->GetLayer(), drawingShadows );
|
||||
COLOR4D color;
|
||||
|
||||
if( netSettings->GetHighlightNetclassColors() && aLayer == aJct->GetLayer() )
|
||||
color = m_schSettings.GetLayerColor( aJct->GetLayer() );
|
||||
else
|
||||
color = getRenderColor( aJct, aJct->GetLayer(), drawingShadows );
|
||||
|
||||
int junctionSize = aJct->GetEffectiveDiameter() / 2;
|
||||
|
||||
@ -1329,13 +1342,20 @@ void SCH_PAINTER::draw( const SCH_JUNCTION* aJct, int aLayer )
|
||||
void SCH_PAINTER::draw( const SCH_LINE* aLine, int aLayer )
|
||||
{
|
||||
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
|
||||
bool drawingNetColorHighlights = aLayer == LAYER_NET_COLOR_HIGHLIGHT;
|
||||
bool drawingWires = aLayer == LAYER_WIRE;
|
||||
bool drawingBusses = aLayer == LAYER_BUS;
|
||||
bool drawingDangling = aLayer == LAYER_DANGLING;
|
||||
bool drawingOP = aLayer == LAYER_OP_VOLTAGES;
|
||||
|
||||
NET_SETTINGS* netSettings = m_schematic->Prj().GetProjectFile().NetSettings().get();
|
||||
|
||||
if( !netSettings->GetHighlightNetclassColors() && drawingNetColorHighlights )
|
||||
return;
|
||||
|
||||
if( m_schSettings.IsPrinting() && drawingShadows )
|
||||
return;
|
||||
|
||||
bool drawingDangling = aLayer == LAYER_DANGLING;
|
||||
bool drawingOP = aLayer == LAYER_OP_VOLTAGES;
|
||||
|
||||
if( drawingShadows && !( aLine->IsBrightened() || aLine->IsSelected() ) )
|
||||
return;
|
||||
|
||||
@ -1345,9 +1365,30 @@ void SCH_PAINTER::draw( const SCH_LINE* aLine, int aLayer )
|
||||
return;
|
||||
|
||||
COLOR4D color = getRenderColor( aLine, aLine->GetLayer(), drawingShadows );
|
||||
float width = getLineWidth( aLine, drawingShadows );
|
||||
float width = getLineWidth( aLine, drawingShadows, drawingNetColorHighlights );
|
||||
LINE_STYLE lineStyle = aLine->GetEffectiveLineStyle();
|
||||
|
||||
if( netSettings->GetHighlightNetclassColors() )
|
||||
{
|
||||
// Force default color for nets we are going to highlight
|
||||
if( drawingWires )
|
||||
color = m_schSettings.GetLayerColor( LAYER_WIRE );
|
||||
else if( drawingBusses )
|
||||
color = m_schSettings.GetLayerColor( LAYER_BUS );
|
||||
}
|
||||
|
||||
if( drawingNetColorHighlights )
|
||||
{
|
||||
// Don't draw highlights for default-colored nets
|
||||
if( ( aLine->IsWire() && color == m_schSettings.GetLayerColor( LAYER_WIRE ) )
|
||||
|| ( aLine->IsBus() && color == m_schSettings.GetLayerColor( LAYER_BUS ) ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
color = color.WithAlpha( color.a * 0.6 );
|
||||
}
|
||||
|
||||
if( ( drawingDangling || drawingShadows ) && !aLine->IsNew() )
|
||||
{
|
||||
if( ( aLine->IsWire() && aLine->IsStartDangling() )
|
||||
@ -2784,11 +2825,18 @@ void SCH_PAINTER::draw( const SCH_BUS_ENTRY_BASE *aEntry, int aLayer )
|
||||
SCH_LAYER_ID layer = aEntry->Type() == SCH_BUS_WIRE_ENTRY_T ? LAYER_WIRE : LAYER_BUS;
|
||||
SCH_LINE line( VECTOR2I(), layer );
|
||||
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
|
||||
bool drawingNetColorHighlights = aLayer == LAYER_NET_COLOR_HIGHLIGHT;
|
||||
bool drawingDangling = aLayer == LAYER_DANGLING;
|
||||
bool drawingWires = aLayer == LAYER_WIRE;
|
||||
bool drawingBusses = aLayer == LAYER_BUS;
|
||||
|
||||
if( m_schSettings.IsPrinting() && drawingShadows )
|
||||
return;
|
||||
|
||||
NET_SETTINGS* netSettings = m_schematic->Prj().GetProjectFile().NetSettings().get();
|
||||
|
||||
bool drawingDangling = aLayer == LAYER_DANGLING;
|
||||
if( !netSettings->GetHighlightNetclassColors() && drawingNetColorHighlights )
|
||||
return;
|
||||
|
||||
if( drawingShadows && !( aEntry->IsBrightened() || aEntry->IsSelected() ) )
|
||||
return;
|
||||
@ -2812,6 +2860,27 @@ void SCH_PAINTER::draw( const SCH_BUS_ENTRY_BASE *aEntry, int aLayer )
|
||||
if( aEntry->Type() == SCH_BUS_BUS_ENTRY_T )
|
||||
color = getRenderColor( aEntry, LAYER_BUS, drawingShadows );
|
||||
|
||||
if( netSettings->GetHighlightNetclassColors() )
|
||||
{
|
||||
// Force default color for nets we are going to highlight
|
||||
if( drawingWires )
|
||||
color = m_schSettings.GetLayerColor( LAYER_WIRE );
|
||||
else if( drawingBusses )
|
||||
color = m_schSettings.GetLayerColor( LAYER_BUS );
|
||||
}
|
||||
|
||||
if( drawingNetColorHighlights )
|
||||
{
|
||||
// Don't draw highlights for default-colored nets
|
||||
if( ( aEntry->Type() == SCH_BUS_WIRE_ENTRY_T
|
||||
&& color == m_schSettings.GetLayerColor( LAYER_WIRE ) )
|
||||
|| ( aEntry->Type() == SCH_BUS_BUS_ENTRY_T
|
||||
&& color == m_schSettings.GetLayerColor( LAYER_BUS ) ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if( drawingDangling )
|
||||
{
|
||||
m_gal->SetIsFill( false );
|
||||
|
@ -119,7 +119,8 @@ private:
|
||||
COLOR4D getRenderColor( const SCH_ITEM* aItem, int aLayer, bool aDrawingShadows,
|
||||
bool aDimmed = false ) const;
|
||||
KIFONT::FONT* getFont( const EDA_TEXT* aText ) const;
|
||||
float getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows ) const;
|
||||
float getLineWidth( const SCH_ITEM* aItem, bool aDrawingShadows,
|
||||
bool aDrawingWireColorHighlights = false ) const;
|
||||
float getTextThickness( const SCH_ITEM* aItem ) const;
|
||||
|
||||
int getOperatingPointTextSize() const;
|
||||
|
@ -350,7 +350,7 @@ public:
|
||||
};
|
||||
|
||||
/// Eeschema drawing layers
|
||||
enum SCH_LAYER_ID: int
|
||||
enum SCH_LAYER_ID : int
|
||||
{
|
||||
SCH_LAYER_ID_START = GAL_LAYER_ID_END,
|
||||
|
||||
@ -394,6 +394,7 @@ enum SCH_LAYER_ID: int
|
||||
LAYER_HOVERED,
|
||||
LAYER_BRIGHTENED,
|
||||
LAYER_HIDDEN,
|
||||
LAYER_NET_COLOR_HIGHLIGHT,
|
||||
LAYER_SELECTION_SHADOWS,
|
||||
LAYER_SCHEMATIC_DRAWINGSHEET,
|
||||
LAYER_SCHEMATIC_PAGE_LIMITS,
|
||||
|
@ -170,11 +170,18 @@ public:
|
||||
static bool ParseBusGroup( const wxString& aGroup, wxString* name,
|
||||
std::vector<wxString>* aMemberList );
|
||||
|
||||
/// Sets the net color highlighting mode
|
||||
void SetHighlightNetclassColors( bool aFlag ) { m_highlightNetclassColors = aFlag; }
|
||||
|
||||
/// Gets the net color highlighting mode
|
||||
bool GetHighlightNetclassColors() const { return m_highlightNetclassColors; }
|
||||
|
||||
private:
|
||||
bool migrateSchema0to1();
|
||||
bool migrateSchema1to2();
|
||||
bool migrateSchema2to3();
|
||||
bool migrateSchema3to4();
|
||||
bool migrateSchema4to5();
|
||||
|
||||
/**
|
||||
* @brief Creates an effective aggregate netclass from the given constituent netclasses
|
||||
@ -228,6 +235,10 @@ private:
|
||||
*/
|
||||
std::map<wxString, KIGFX::COLOR4D> m_netColorAssignments;
|
||||
|
||||
/// Sets the display mode for eeschema netclass colors. If true, uses a highlighter style.
|
||||
/// If false, uses the color for the wire / objects themselves.
|
||||
bool m_highlightNetclassColors;
|
||||
|
||||
// TODO: Add diff pairs, bus information, etc.
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user