Browse Source
Move Net Inspector dialog to a widget panel in pcbnew
Move Net Inspector dialog to a widget panel in pcbnew
Introduces some updates to the inspector, and a number of bug fixes: - Correctly handles changes in board stackup - Correctly handles unit change events - Correctly handles language change events - All layout / panel settings are stored to the project settings - Retains ability to create net report - Simple filter searches on net name and net class name (stored in settings) - Allows hide / show of columns (stored in settings) - Grouping by netclass (stored in settings) - Optional filtering by net name (stored in settings) - Optional filtering by net class (stored in settings) - Custom grouping by net name matchnewinvert
committed by
Jon Evans
31 changed files with 3524 additions and 3738 deletions
-
8common/eda_draw_frame.cpp
-
30common/project/project_local_settings.cpp
-
1common/settings/parameters.cpp
-
44include/eda_draw_frame.h
-
35include/project/board_project_settings.h
-
3include/project/project_local_settings.h
-
4pcbnew/CMakeLists.txt
-
2361pcbnew/dialogs/dialog_net_inspector.cpp
-
125pcbnew/dialogs/dialog_net_inspector.h
-
141pcbnew/dialogs/dialog_net_inspector_base.cpp
-
869pcbnew/dialogs/dialog_net_inspector_base.fbp
-
77pcbnew/dialogs/dialog_net_inspector_base.h
-
2pcbnew/menubar_pcb_editor.cpp
-
87pcbnew/pcb_edit_frame.cpp
-
13pcbnew/pcb_edit_frame.h
-
31pcbnew/pcbnew_settings.cpp
-
43pcbnew/pcbnew_settings.h
-
26pcbnew/toolbars_pcb_editor.cpp
-
8pcbnew/tools/board_editor_control.cpp
-
1pcbnew/tools/board_editor_control.h
-
16pcbnew/tools/board_inspection_tool.cpp
-
3pcbnew/tools/board_inspection_tool.h
-
14pcbnew/tools/pcb_actions.cpp
-
2pcbnew/tools/pcb_actions.h
-
3pcbnew/widgets/appearance_controls.cpp
-
101pcbnew/widgets/net_inspector_panel.cpp
-
85pcbnew/widgets/net_inspector_panel.h
-
1908pcbnew/widgets/pcb_net_inspector_panel.cpp
-
355pcbnew/widgets/pcb_net_inspector_panel.h
-
865pcbnew/widgets/pcb_net_inspector_panel_data_model.h
-
1pcbnew/widgets/pcb_properties_panel.cpp
2361
pcbnew/dialogs/dialog_net_inspector.cpp
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,125 +0,0 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2020 Oleg Endo <olegendo@gcc.gnu.org> |
|||
* Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr |
|||
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#pragma once |
|||
|
|||
#include <board.h> |
|||
#include <optional> |
|||
#include <dialog_net_inspector_base.h> |
|||
|
|||
class PCB_EDIT_FRAME; |
|||
class NETINFO_ITEM; |
|||
class BOARD; |
|||
class BOARD_ITEM; |
|||
class CN_ITEM; |
|||
class EDA_PATTERN_MATCH; |
|||
class PCB_TRACK; |
|||
|
|||
/** |
|||
* Event sent to parent when dialog is mode-less. |
|||
*/ |
|||
wxDECLARE_EVENT( EDA_EVT_CLOSE_NET_INSPECTOR_DIALOG, wxCommandEvent ); |
|||
|
|||
class DIALOG_NET_INSPECTOR : public DIALOG_NET_INSPECTOR_BASE, public BOARD_LISTENER |
|||
{ |
|||
public: |
|||
DIALOG_NET_INSPECTOR( PCB_EDIT_FRAME* aParent ); |
|||
~DIALOG_NET_INSPECTOR(); |
|||
|
|||
virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsRemoved( BOARD& aBoard, |
|||
std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) override; |
|||
virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsChanged( BOARD& aBoard, |
|||
std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) override; |
|||
|
|||
protected: |
|||
virtual void onClose( wxCloseEvent& aEvent ) override; |
|||
|
|||
private: |
|||
struct COLUMN_DESC; |
|||
class LIST_ITEM; |
|||
struct LIST_ITEM_NETCODE_CMP_LESS; |
|||
|
|||
using LIST_ITEM_ITER = std::vector<std::unique_ptr<LIST_ITEM>>::iterator; |
|||
using LIST_ITEM_CONST_ITER = std::vector<std::unique_ptr<LIST_ITEM>>::const_iterator; |
|||
|
|||
wxString formatNetCode( const NETINFO_ITEM* aNet ) const; |
|||
wxString formatNetName( const NETINFO_ITEM* aNet ) const; |
|||
wxString formatCount( unsigned int aValue ) const; |
|||
wxString formatLength( int64_t aValue ) const; |
|||
|
|||
std::vector<CN_ITEM*> relevantConnectivityItems() const; |
|||
bool netFilterMatches( NETINFO_ITEM* aNet ) const; |
|||
void updateNet( NETINFO_ITEM* aNet ); |
|||
unsigned int calculateViaLength( const PCB_TRACK* ) const; |
|||
|
|||
void onSelChanged( wxDataViewEvent& event ) override; |
|||
void onSelChanged(); |
|||
void onSortingChanged( wxDataViewEvent& event ) override; |
|||
void onFilterChange( wxCommandEvent& event ) override; |
|||
void onAddNet( wxCommandEvent& event ) override; |
|||
void onRenameNet( wxCommandEvent& event ) override; |
|||
void onDeleteNet( wxCommandEvent& event ) override; |
|||
void onReport( wxCommandEvent& event ) override; |
|||
|
|||
std::unique_ptr<LIST_ITEM> buildNewItem( NETINFO_ITEM* aNet, unsigned int aPadCount, |
|||
const std::vector<CN_ITEM*>& aCNItems ); |
|||
|
|||
void buildNetsList(); |
|||
void setColumnWidths(); |
|||
void adjustListColumns(); |
|||
|
|||
void onUnitsChanged( wxCommandEvent& event ); |
|||
void onBoardChanged( wxCommandEvent& event ); |
|||
|
|||
void updateDisplayedRowValues( const std::optional<LIST_ITEM_ITER>& aRow ); |
|||
|
|||
// special zero-netcode item. unconnected pads etc might use different |
|||
// (dummy) NETINFO_ITEM. redirect all of them to this item, which we get |
|||
// from the board object in buildNetsList. |
|||
NETINFO_ITEM* m_zero_netitem; |
|||
|
|||
std::vector<std::unique_ptr<EDA_PATTERN_MATCH>> m_netFilter; |
|||
std::vector<std::unique_ptr<EDA_PATTERN_MATCH>> m_groupFilter; |
|||
|
|||
BOARD* m_brd; |
|||
PCB_EDIT_FRAME* m_frame; |
|||
bool m_in_reporting = false; |
|||
bool m_in_build_nets_list = false; |
|||
bool m_filter_change_no_rebuild = false; |
|||
wxSize m_size; |
|||
|
|||
std::vector<COLUMN_DESC> m_columns; |
|||
|
|||
class DATA_MODEL; |
|||
wxObjectDataPtr<DATA_MODEL> m_data_model; |
|||
|
|||
friend DATA_MODEL; |
|||
}; |
@ -1,141 +0,0 @@ |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO *NOT* EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "widgets/std_bitmap_button.h"
|
|||
|
|||
#include "dialog_net_inspector_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
DIALOG_NET_INSPECTOR_BASE::DIALOG_NET_INSPECTOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) |
|||
{ |
|||
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); |
|||
|
|||
wxBoxSizer* bSizerMain; |
|||
bSizerMain = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxBoxSizer* bTopSizer; |
|||
bTopSizer = new wxBoxSizer( wxHORIZONTAL ); |
|||
|
|||
wxFlexGridSizer* fgSizer1; |
|||
fgSizer1 = new wxFlexGridSizer( 0, 3, 5, 5 ); |
|||
fgSizer1->AddGrowableCol( 1 ); |
|||
fgSizer1->SetFlexibleDirection( wxBOTH ); |
|||
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_staticTextFilter = new wxStaticText( this, wxID_ANY, _("Net name filter:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticTextFilter->Wrap( -1 ); |
|||
fgSizer1->Add( m_staticTextFilter, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); |
|||
|
|||
m_textCtrlFilter = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer1->Add( m_textCtrlFilter, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); |
|||
|
|||
m_cbShowZeroPad = new wxCheckBox( this, wxID_ANY, _("Show zero pad nets"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_cbShowZeroPad->SetValue(true); |
|||
fgSizer1->Add( m_cbShowZeroPad, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); |
|||
|
|||
m_groupBy = new wxCheckBox( this, wxID_ANY, _("Group by:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer1->Add( m_groupBy, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); |
|||
|
|||
m_groupByText = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
fgSizer1->Add( m_groupByText, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); |
|||
|
|||
m_groupByKind = new wxComboBox( this, wxID_ANY, _("Wildcard"), wxDefaultPosition, wxSize( -1,-1 ), 0, NULL, wxCB_DROPDOWN|wxCB_READONLY ); |
|||
m_groupByKind->Append( _("Wildcard") ); |
|||
m_groupByKind->Append( _("RegEx") ); |
|||
m_groupByKind->Append( _("Wildcard Substr") ); |
|||
m_groupByKind->Append( _("RegEx Substr") ); |
|||
m_groupByKind->SetSelection( 0 ); |
|||
fgSizer1->Add( m_groupByKind, 0, wxALIGN_CENTER|wxLEFT, 5 ); |
|||
|
|||
|
|||
bTopSizer->Add( fgSizer1, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
bSizerMain->Add( bTopSizer, 0, wxEXPAND|wxALL, 5 ); |
|||
|
|||
wxBoxSizer* bMidSizer; |
|||
bMidSizer = new wxBoxSizer( wxHORIZONTAL ); |
|||
|
|||
|
|||
bSizerMain->Add( bMidSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_netsList = new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxDV_HORIZ_RULES|wxDV_MULTIPLE|wxDV_VERT_RULES ); |
|||
m_netsList->SetMinSize( wxSize( 480,200 ) ); |
|||
|
|||
bSizerMain->Add( m_netsList, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 ); |
|||
|
|||
wxBoxSizer* bSizerListButtons; |
|||
bSizerListButtons = new wxBoxSizer( wxHORIZONTAL ); |
|||
|
|||
m_addNet = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); |
|||
bSizerListButtons->Add( m_addNet, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); |
|||
|
|||
m_renameNet = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); |
|||
bSizerListButtons->Add( m_renameNet, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); |
|||
|
|||
|
|||
bSizerListButtons->Add( 20, 0, 0, wxEXPAND, 5 ); |
|||
|
|||
m_deleteNet = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); |
|||
bSizerListButtons->Add( m_deleteNet, 0, wxALIGN_CENTER_VERTICAL, 5 ); |
|||
|
|||
|
|||
bSizerListButtons->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
m_sdbSizer = new wxStdDialogButtonSizer(); |
|||
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); |
|||
m_sdbSizer->AddButton( m_sdbSizerCancel ); |
|||
m_sdbSizer->Realize(); |
|||
|
|||
bSizerListButtons->Add( m_sdbSizer, 0, wxEXPAND, 5 ); |
|||
|
|||
m_ReportButt = new wxButton( this, wxID_ANY, _("Create Report..."), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bSizerListButtons->Add( m_ReportButt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
|||
|
|||
|
|||
bSizerMain->Add( bSizerListButtons, 0, wxEXPAND|wxALL, 5 ); |
|||
|
|||
|
|||
this->SetSizer( bSizerMain ); |
|||
this->Layout(); |
|||
bSizerMain->Fit( this ); |
|||
|
|||
this->Centre( wxBOTH ); |
|||
|
|||
// Connect Events
|
|||
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_NET_INSPECTOR_BASE::onClose ) ); |
|||
m_textCtrlFilter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_cbShowZeroPad->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_groupBy->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_groupByText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_groupByKind->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_netsList->Connect( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, wxDataViewEventHandler( DIALOG_NET_INSPECTOR_BASE::onSortingChanged ), NULL, this ); |
|||
m_netsList->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_NET_INSPECTOR_BASE::onSelChanged ), NULL, this ); |
|||
m_addNet->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onAddNet ), NULL, this ); |
|||
m_renameNet->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onRenameNet ), NULL, this ); |
|||
m_deleteNet->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onDeleteNet ), NULL, this ); |
|||
m_ReportButt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onReport ), NULL, this ); |
|||
} |
|||
|
|||
DIALOG_NET_INSPECTOR_BASE::~DIALOG_NET_INSPECTOR_BASE() |
|||
{ |
|||
// Disconnect Events
|
|||
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_NET_INSPECTOR_BASE::onClose ) ); |
|||
m_textCtrlFilter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_cbShowZeroPad->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_groupBy->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_groupByText->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_groupByKind->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onFilterChange ), NULL, this ); |
|||
m_netsList->Disconnect( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, wxDataViewEventHandler( DIALOG_NET_INSPECTOR_BASE::onSortingChanged ), NULL, this ); |
|||
m_netsList->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_NET_INSPECTOR_BASE::onSelChanged ), NULL, this ); |
|||
m_addNet->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onAddNet ), NULL, this ); |
|||
m_renameNet->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onRenameNet ), NULL, this ); |
|||
m_deleteNet->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onDeleteNet ), NULL, this ); |
|||
m_ReportButt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_NET_INSPECTOR_BASE::onReport ), NULL, this ); |
|||
|
|||
} |
@ -1,869 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
|||
<wxFormBuilder_Project> |
|||
<FileVersion major="1" minor="16" /> |
|||
<object class="Project" expanded="1"> |
|||
<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="embedded_files_path">res</property> |
|||
<property name="encoding">UTF-8</property> |
|||
<property name="event_generation">connect</property> |
|||
<property name="file">dialog_net_inspector_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="name">dialog_net_inspector</property> |
|||
<property name="namespace"></property> |
|||
<property name="path">.</property> |
|||
<property name="precompiled_header"></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">0</property> |
|||
<property name="use_microsoft_bom">0</property> |
|||
<object class="Dialog" expanded="1"> |
|||
<property name="aui_managed">0</property> |
|||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property> |
|||
<property name="bg"></property> |
|||
<property name="center">wxBOTH</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="enabled">1</property> |
|||
<property name="event_handler">impl_virtual</property> |
|||
<property name="extra_style"></property> |
|||
<property name="fg"></property> |
|||
<property name="font"></property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="minimum_size">-1,-1</property> |
|||
<property name="name">DIALOG_NET_INSPECTOR_BASE</property> |
|||
<property name="pos"></property> |
|||
<property name="size">-1,-1</property> |
|||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> |
|||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property> |
|||
<property name="title">Net Inspector</property> |
|||
<property name="tooltip"></property> |
|||
<property name="two_step_creation">0</property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnClose">onClose</event> |
|||
<object class="wxBoxSizer" expanded="1"> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">bSizerMain</property> |
|||
<property name="orient">wxVERTICAL</property> |
|||
<property name="permission">none</property> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND|wxALL</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxBoxSizer" expanded="1"> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">bTopSizer</property> |
|||
<property name="orient">wxHORIZONTAL</property> |
|||
<property name="permission">none</property> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND</property> |
|||
<property name="proportion">1</property> |
|||
<object class="wxFlexGridSizer" expanded="1"> |
|||
<property name="cols">3</property> |
|||
<property name="flexible_direction">wxBOTH</property> |
|||
<property name="growablecols">1</property> |
|||
<property name="growablerows"></property> |
|||
<property name="hgap">5</property> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">fgSizer1</property> |
|||
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property> |
|||
<property name="permission">none</property> |
|||
<property name="rows">0</property> |
|||
<property name="vgap">5</property> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxStaticText" expanded="0"> |
|||
<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="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">Net name filter:</property> |
|||
<property name="markup">0</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_staticTextFilter</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"></property> |
|||
<property name="toolbar_pane">0</property> |
|||
<property name="tooltip"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<property name="wrap">-1</property> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxTextCtrl" expanded="0"> |
|||
<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="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="max_size"></property> |
|||
<property name="maximize_button">0</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="maxlength">0</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_textCtrlFilter</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"></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="value"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnText">onFilterChange</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxCheckBox" expanded="0"> |
|||
<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">1</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 zero pad nets</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_cbShowZeroPad</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"></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> |
|||
<event name="OnCheckBox">onFilterChange</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxCheckBox" expanded="0"> |
|||
<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">Group by:</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_groupBy</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> |
|||
<event name="OnCheckBox">onFilterChange</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property> |
|||
<property name="proportion">1</property> |
|||
<object class="wxTextCtrl" expanded="0"> |
|||
<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="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="max_size"></property> |
|||
<property name="maximize_button">0</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="maxlength">0</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_groupByText</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"></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="value"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnText">onFilterChange</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER|wxLEFT</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxComboBox" expanded="0"> |
|||
<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="choices">"Wildcard" "RegEx" "Wildcard Substr" "RegEx Substr"</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">0</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="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_groupByKind</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="selection">0</property> |
|||
<property name="show">1</property> |
|||
<property name="size">-1,-1</property> |
|||
<property name="style">wxCB_DROPDOWN|wxCB_READONLY</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="value">Wildcard</property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnCombobox">onFilterChange</event> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxBoxSizer" expanded="1"> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">bMidSizer</property> |
|||
<property name="orient">wxHORIZONTAL</property> |
|||
<property name="permission">none</property> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT</property> |
|||
<property name="proportion">1</property> |
|||
<object class="wxDataViewCtrl" expanded="0"> |
|||
<property name="bg"></property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">0</property> |
|||
<property name="enabled">1</property> |
|||
<property name="fg"></property> |
|||
<property name="font"></property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="minimum_size">480,200</property> |
|||
<property name="name">m_netsList</property> |
|||
<property name="permission">protected</property> |
|||
<property name="pos"></property> |
|||
<property name="size">-1,-1</property> |
|||
<property name="style">wxDV_HORIZ_RULES|wxDV_MULTIPLE|wxDV_VERT_RULES</property> |
|||
<property name="subclass"></property> |
|||
<property name="tooltip"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnDataViewCtrlColumnSorted">onSortingChanged</event> |
|||
<event name="OnDataViewCtrlSelectionChanged">onSelChanged</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND|wxALL</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxBoxSizer" expanded="1"> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">bSizerListButtons</property> |
|||
<property name="orient">wxHORIZONTAL</property> |
|||
<property name="permission">none</property> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxBitmapButton" expanded="0"> |
|||
<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="auth_needed">0</property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="bitmap"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="current"></property> |
|||
<property name="default">0</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="disabled"></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="focus"></property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="label">Add Net</property> |
|||
<property name="margins"></property> |
|||
<property name="markup">0</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_addNet</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="position"></property> |
|||
<property name="pressed"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style"></property> |
|||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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> |
|||
<event name="OnButtonClick">onAddNet</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxBitmapButton" expanded="0"> |
|||
<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="auth_needed">0</property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="bitmap"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="current"></property> |
|||
<property name="default">0</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="disabled"></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="focus"></property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="label">Rename Net</property> |
|||
<property name="margins"></property> |
|||
<property name="markup">0</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_renameNet</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="position"></property> |
|||
<property name="pressed"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style"></property> |
|||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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> |
|||
<event name="OnButtonClick">onRenameNet</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND</property> |
|||
<property name="proportion">0</property> |
|||
<object class="spacer" expanded="0"> |
|||
<property name="height">0</property> |
|||
<property name="permission">protected</property> |
|||
<property name="width">20</property> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALIGN_CENTER_VERTICAL</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxBitmapButton" expanded="0"> |
|||
<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="auth_needed">0</property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="bitmap"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="current"></property> |
|||
<property name="default">0</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="disabled"></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="focus"></property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="label">Delete Net</property> |
|||
<property name="margins"></property> |
|||
<property name="markup">0</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_deleteNet</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="position"></property> |
|||
<property name="pressed"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style"></property> |
|||
<property name="subclass">STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; 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> |
|||
<event name="OnButtonClick">onDeleteNet</event> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND</property> |
|||
<property name="proportion">1</property> |
|||
<object class="spacer" expanded="0"> |
|||
<property name="height">0</property> |
|||
<property name="permission">protected</property> |
|||
<property name="width">0</property> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxEXPAND</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxStdDialogButtonSizer" expanded="1"> |
|||
<property name="Apply">0</property> |
|||
<property name="Cancel">1</property> |
|||
<property name="ContextHelp">0</property> |
|||
<property name="Help">0</property> |
|||
<property name="No">0</property> |
|||
<property name="OK">0</property> |
|||
<property name="Save">0</property> |
|||
<property name="Yes">0</property> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">m_sdbSizer</property> |
|||
<property name="permission">protected</property> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="0"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxButton" expanded="0"> |
|||
<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="auth_needed">0</property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="bitmap"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="current"></property> |
|||
<property name="default">0</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="disabled"></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="focus"></property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="label">Create Report...</property> |
|||
<property name="margins"></property> |
|||
<property name="markup">0</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_ReportButt</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="position"></property> |
|||
<property name="pressed"></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> |
|||
<event name="OnButtonClick">onReport</event> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</wxFormBuilder_Project> |
@ -1,77 +0,0 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO *NOT* EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#pragma once |
|||
|
|||
#include <wx/artprov.h> |
|||
#include <wx/xrc/xmlres.h> |
|||
#include <wx/intl.h> |
|||
class STD_BITMAP_BUTTON; |
|||
|
|||
#include "dialog_shim.h" |
|||
#include <wx/string.h> |
|||
#include <wx/stattext.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/textctrl.h> |
|||
#include <wx/checkbox.h> |
|||
#include <wx/combobox.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/dataview.h> |
|||
#include <wx/bmpbuttn.h> |
|||
#include <wx/bitmap.h> |
|||
#include <wx/image.h> |
|||
#include <wx/icon.h> |
|||
#include <wx/button.h> |
|||
#include <wx/dialog.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_NET_INSPECTOR_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_NET_INSPECTOR_BASE : public DIALOG_SHIM |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
wxStaticText* m_staticTextFilter; |
|||
wxTextCtrl* m_textCtrlFilter; |
|||
wxCheckBox* m_cbShowZeroPad; |
|||
wxCheckBox* m_groupBy; |
|||
wxTextCtrl* m_groupByText; |
|||
wxComboBox* m_groupByKind; |
|||
wxDataViewCtrl* m_netsList; |
|||
STD_BITMAP_BUTTON* m_addNet; |
|||
STD_BITMAP_BUTTON* m_renameNet; |
|||
STD_BITMAP_BUTTON* m_deleteNet; |
|||
wxStdDialogButtonSizer* m_sdbSizer; |
|||
wxButton* m_sdbSizerCancel; |
|||
wxButton* m_ReportButt; |
|||
|
|||
// Virtual event handlers, override them in your derived class |
|||
virtual void onClose( wxCloseEvent& event ) { event.Skip(); } |
|||
virtual void onFilterChange( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void onSortingChanged( wxDataViewEvent& event ) { event.Skip(); } |
|||
virtual void onSelChanged( wxDataViewEvent& event ) { event.Skip(); } |
|||
virtual void onAddNet( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void onRenameNet( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void onDeleteNet( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void onReport( wxCommandEvent& event ) { event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
|
|||
DIALOG_NET_INSPECTOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Net Inspector"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); |
|||
|
|||
~DIALOG_NET_INSPECTOR_BASE(); |
|||
|
|||
}; |
|||
|
@ -0,0 +1,101 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <widgets/net_inspector_panel.h>
|
|||
|
|||
#include <eda_base_frame.h>
|
|||
|
|||
#include <widgets/ui_common.h>
|
|||
|
|||
NET_INSPECTOR_PANEL::NET_INSPECTOR_PANEL( wxWindow* parent, EDA_BASE_FRAME* aFrame, wxWindowID id, |
|||
const wxPoint& pos, const wxSize& size, long style, |
|||
const wxString& name ) : |
|||
wxPanel( parent, id, pos, size, style, name ), |
|||
m_frame( aFrame ) |
|||
{ |
|||
m_sizerOuter = new wxGridBagSizer( 0, 0 ); |
|||
m_sizerOuter->SetFlexibleDirection( wxBOTH ); |
|||
m_sizerOuter->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
m_searchCtrl = |
|||
new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
#ifndef __WXMAC__
|
|||
m_searchCtrl->ShowSearchButton( true ); |
|||
#endif
|
|||
m_searchCtrl->ShowCancelButton( false ); |
|||
m_searchCtrl->SetDescriptiveText( _( "Filter" ) ); |
|||
m_sizerOuter->Add( m_searchCtrl, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 ); |
|||
|
|||
m_configureBtn = new BITMAP_BUTTON( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_configureBtn->SetToolTip( _( "Configure netlist inspector" ) ); |
|||
m_configureBtn->SetBitmap( KiBitmapBundle( BITMAPS::options_generic_16 ) ); |
|||
m_configureBtn->SetPadding( 2 ); |
|||
m_sizerOuter->Add( m_configureBtn, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), 0, 5 ); |
|||
|
|||
m_netsList = |
|||
new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE ); |
|||
m_netsList->SetFont( KIUI::GetDockedPaneFont( this ) ); |
|||
m_sizerOuter->Add( m_netsList, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxEXPAND, 5 ); |
|||
|
|||
m_sizerOuter->AddGrowableCol( 0 ); |
|||
m_sizerOuter->AddGrowableRow( 1 ); |
|||
|
|||
SetFont( KIUI::GetDockedPaneFont( this ) ); |
|||
SetSizer( m_sizerOuter ); |
|||
Layout(); |
|||
|
|||
m_sizerOuter->Fit( this ); |
|||
|
|||
// Connect Events
|
|||
m_frame->Bind( EDA_LANG_CHANGED, &NET_INSPECTOR_PANEL::OnLanguageChanged, this ); |
|||
|
|||
Bind( wxEVT_SET_FOCUS, &NET_INSPECTOR_PANEL::OnSetFocus, this ); |
|||
Bind( wxEVT_SIZE, &NET_INSPECTOR_PANEL::OnSize, this ); |
|||
|
|||
m_searchCtrl->Bind( wxEVT_COMMAND_TEXT_UPDATED, &NET_INSPECTOR_PANEL::OnSearchTextChanged, |
|||
this ); |
|||
m_netsList->Bind( wxEVT_SET_FOCUS, &NET_INSPECTOR_PANEL::OnSetFocus, this ); |
|||
m_configureBtn->Bind( wxEVT_BUTTON, &NET_INSPECTOR_PANEL::OnConfigButton, this ); |
|||
} |
|||
|
|||
|
|||
NET_INSPECTOR_PANEL::~NET_INSPECTOR_PANEL() |
|||
{ |
|||
// Disconnect Events
|
|||
m_frame->Unbind( EDA_LANG_CHANGED, &NET_INSPECTOR_PANEL::OnLanguageChanged, this ); |
|||
|
|||
Unbind( wxEVT_SET_FOCUS, &NET_INSPECTOR_PANEL::OnSetFocus, this ); |
|||
Unbind( wxEVT_SIZE, &NET_INSPECTOR_PANEL::OnSize, this ); |
|||
|
|||
m_searchCtrl->Unbind( wxEVT_COMMAND_TEXT_UPDATED, &NET_INSPECTOR_PANEL::OnSearchTextChanged, |
|||
this ); |
|||
m_netsList->Unbind( wxEVT_SET_FOCUS, &NET_INSPECTOR_PANEL::OnSetFocus, this ); |
|||
m_configureBtn->Unbind( wxEVT_BUTTON, &NET_INSPECTOR_PANEL::OnConfigButton, this ); |
|||
} |
|||
|
|||
|
|||
void NET_INSPECTOR_PANEL::OnLanguageChanged( wxCommandEvent& event ) |
|||
{ |
|||
m_searchCtrl->SetDescriptiveText( _( "Filter" ) ); |
|||
m_configureBtn->SetToolTip( _( "Configure netlist inspector" ) ); |
|||
|
|||
OnLanguageChangedImpl(); |
|||
|
|||
event.Skip(); |
|||
} |
@ -0,0 +1,85 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef NET_INSPECTOR_PANEL_BASE_H |
|||
#define NET_INSPECTOR_PANEL_BASE_H |
|||
|
|||
#include <bitmaps.h> |
|||
#include <widgets/bitmap_button.h> |
|||
|
|||
#include <wx/dataview.h> |
|||
#include <wx/gbsizer.h> |
|||
#include <wx/panel.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/srchctrl.h> |
|||
#include <wx/string.h> |
|||
|
|||
class EDA_BASE_FRAME; |
|||
|
|||
/** |
|||
* A base class used to implement docking net inspector panels. |
|||
* |
|||
* Provides a filter control, a settings button, and a data-driven wxDataViewCtrl |
|||
*/ |
|||
class NET_INSPECTOR_PANEL : public wxPanel |
|||
{ |
|||
public: |
|||
NET_INSPECTOR_PANEL( wxWindow* parent, EDA_BASE_FRAME* aFrame, wxWindowID id = wxID_ANY, |
|||
const wxPoint& pos = wxDefaultPosition, |
|||
const wxSize& size = wxSize( -1, -1 ), long style = wxTAB_TRAVERSAL, |
|||
const wxString& name = wxEmptyString ); |
|||
|
|||
~NET_INSPECTOR_PANEL(); |
|||
|
|||
/** |
|||
* Rebuild inspector data if project settings updated |
|||
* |
|||
* Called by the parent EDA_EDIT_FRAME on change of settings (e.g. stackup, netclass |
|||
* definitions) |
|||
*/ |
|||
virtual void OnParentSetupChanged(){}; |
|||
|
|||
/** |
|||
* Save the net inspector settings - called from EDA_EDIT_FRAME when hiding the panel |
|||
*/ |
|||
virtual void SaveSettings(){}; |
|||
|
|||
protected: |
|||
// User-driven UI events (override in derrived classes as required) |
|||
virtual void OnSetFocus( wxFocusEvent& event ) { event.Skip(); } |
|||
virtual void OnSize( wxSizeEvent& event ) { event.Skip(); } |
|||
virtual void OnSearchTextChanged( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void OnConfigButton( wxCommandEvent& event ) { event.Skip(); } |
|||
virtual void OnLanguageChanged( wxCommandEvent& event ); |
|||
|
|||
/** |
|||
* Implementation-specific implementation of language update handling |
|||
*/ |
|||
virtual void OnLanguageChangedImpl(){}; |
|||
|
|||
protected: |
|||
EDA_BASE_FRAME* m_frame; |
|||
|
|||
wxGridBagSizer* m_sizerOuter; |
|||
wxSearchCtrl* m_searchCtrl; |
|||
BITMAP_BUTTON* m_configureBtn; |
|||
wxDataViewCtrl* m_netsList; |
|||
}; |
|||
|
|||
#endif |
1908
pcbnew/widgets/pcb_net_inspector_panel.cpp
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,355 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef PCB_NET_INSPECTOR_H |
|||
#define PCB_NET_INSPECTOR_H |
|||
|
|||
#include <board.h> |
|||
#include <id.h> |
|||
#include <project/project_local_settings.h> |
|||
#include <widgets/net_inspector_panel.h> |
|||
|
|||
#include <optional> |
|||
#include <vector> |
|||
|
|||
class PCB_EDIT_FRAME; |
|||
class NETINFO_ITEM; |
|||
class BOARD; |
|||
class BOARD_ITEM; |
|||
class CN_ITEM; |
|||
class PCB_TRACK; |
|||
|
|||
/** |
|||
* Net inspection panel for pcbnew |
|||
* |
|||
* Provides a read-only view of net information, such as routed lengths. Data is updated after |
|||
* every change of board items. Note that there is not always a 1:1 relationship between Nets and |
|||
* displayed items in the inspector.. This can be the case where there is a constraint which |
|||
* selects sub-sections of nets, for example consider a netclass used for a fly-by-routing |
|||
* adddress bus. There could be two constraints, e.g.: |
|||
* <p> |
|||
* FROM/TO=IC1-IC2, Netclass=DDR_ADDR, Net=ADDR_0 |
|||
* FROM/TO=IC2-IC3, Netclass=DDR_ADDR, Net=ADDR_0 |
|||
* <p> |
|||
* In this instance, a single address net within the DDR_ADDR netclass could have three entries in |
|||
* the inspector, each tracking a different set of net statistics: |
|||
* <p> |
|||
* 1. The whole net |
|||
* 2. IC1-IC2 |
|||
* 3. IC2-IC3 |
|||
* <p> |
|||
* In this instance, all sub-nets as a result of a constraint will be grouped by the constraint. |
|||
*/ |
|||
class PCB_NET_INSPECTOR_PANEL : public NET_INSPECTOR_PANEL, public BOARD_LISTENER |
|||
{ |
|||
public: |
|||
PCB_NET_INSPECTOR_PANEL( wxWindow* parent, PCB_EDIT_FRAME* aFrame ); |
|||
virtual ~PCB_NET_INSPECTOR_PANEL(); |
|||
|
|||
/** |
|||
* Updates the netlist based on global board changes (e.g. stackup definition) |
|||
* |
|||
* Called by PCB_EDIT_FRAME after displaying the Board Setup dialog |
|||
*/ |
|||
virtual void OnParentSetupChanged() override; |
|||
|
|||
/* |
|||
* BOARD_LISTENER implementation |
|||
*/ |
|||
virtual void OnBoardItemAdded( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsAdded( BOARD& aBoard, std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardItemRemoved( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsRemoved( BOARD& aBoard, |
|||
std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardNetSettingsChanged( BOARD& aBoard ) override; |
|||
virtual void OnBoardItemChanged( BOARD& aBoard, BOARD_ITEM* aBoardItem ) override; |
|||
virtual void OnBoardItemsChanged( BOARD& aBoard, |
|||
std::vector<BOARD_ITEM*>& aBoardItems ) override; |
|||
virtual void OnBoardHighlightNetChanged( BOARD& aBoard ) override; |
|||
|
|||
/** |
|||
* Persist the net inspector configuration to project / global settings |
|||
*/ |
|||
virtual void SaveSettings() override; |
|||
|
|||
protected: |
|||
/** |
|||
* Reloads strings on an application language change |
|||
*/ |
|||
virtual void OnLanguageChangedImpl() override; |
|||
|
|||
/* |
|||
* UI events |
|||
*/ |
|||
virtual void OnSearchTextChanged( wxCommandEvent& event ) override; |
|||
virtual void OnConfigButton( wxCommandEvent& event ) override; |
|||
void OnExpandCollapseRow( wxCommandEvent& event ); |
|||
void OnHeaderContextMenu( wxCommandEvent& event ); |
|||
void OnNetsListContextMenu( wxDataViewEvent& event ); |
|||
void OnNetsListItemActivated( wxDataViewEvent& event ); |
|||
|
|||
private: |
|||
/* |
|||
* Helper methods for returning fornatted data |
|||
*/ |
|||
wxString formatNetCode( const NETINFO_ITEM* aNet ) const; |
|||
wxString formatNetName( const NETINFO_ITEM* aNet ) const; |
|||
wxString formatCount( unsigned int aValue ) const; |
|||
wxString formatLength( int64_t aValue ) const; |
|||
|
|||
/** |
|||
* Generates a sub-menu for the show / hide columns submenu |
|||
*/ |
|||
void generateShowHideColumnMenu( wxMenu* target ); |
|||
|
|||
/** |
|||
* Filters connectivity items from a board update to remove those not related to |
|||
* net / track metrics |
|||
*/ |
|||
std::vector<CN_ITEM*> relevantConnectivityItems() const; |
|||
|
|||
/** |
|||
* Filter to determine whether a board net should be included in the net inspector |
|||
*/ |
|||
bool netFilterMatches( NETINFO_ITEM* aNet, PANEL_NET_INSPECTOR_SETTINGS* cfg = nullptr ) const; |
|||
|
|||
/** |
|||
* Updates the stored LIST_ITEMs for a given updated board net item |
|||
*/ |
|||
void updateNet( NETINFO_ITEM* aNet ); |
|||
|
|||
/** |
|||
* Calculates the length of a via from the board stackup |
|||
*/ |
|||
unsigned int calculateViaLength( const PCB_TRACK* ) const; |
|||
|
|||
void buildNetsList( bool rebuildColumns = false ); |
|||
void buildColumns(); |
|||
void setColumnWidths(); |
|||
|
|||
/** |
|||
* Adjust the sizing of list columns |
|||
* |
|||
* @param cfg the PANEL_NET_INSPECTOR_SETTINGS from which to read column widths |
|||
*/ |
|||
void adjustListColumnSizes( PANEL_NET_INSPECTOR_SETTINGS* cfg ); |
|||
|
|||
/** |
|||
* Sets the sort column in the grid to that showing the given model ID column |
|||
* |
|||
* @param sortingColumnId The model ID of the column to sort by |
|||
* @param sortOrderAsc True for ascending sort, False for descending sort |
|||
* @returns true if the column was found |
|||
*/ |
|||
bool restoreSortColumn( int sortingColumnId, bool sortOrderAsc ); |
|||
|
|||
/** |
|||
* Fetches the displayed grid view column for the given model column ID |
|||
* |
|||
* @param columnId The ID (from column static IDs enum) to find |
|||
* @returns Pointer to the wxDataViewColumn, or nullptr if not found |
|||
*/ |
|||
wxDataViewColumn* getDisplayedColumnForModelField( int columnId ); |
|||
|
|||
/** |
|||
* Generates a CSV report from currently disaplyed data |
|||
*/ |
|||
void generateReport(); |
|||
|
|||
/** |
|||
* Highlight the currently selected net |
|||
*/ |
|||
void highlightSelectedNets(); |
|||
|
|||
void onUnitsChanged( wxCommandEvent& event ); |
|||
void onBoardChanged( wxCommandEvent& event ); |
|||
void onSettingsMenu( wxCommandEvent& event ); |
|||
void onItemContextMenu( wxCommandEvent& event ); |
|||
void onAddNet(); |
|||
void onRenameSelectedNet(); |
|||
void onDeleteSelectedNet(); |
|||
void onRemoveSelectedGroup(); |
|||
void onAddGroup(); |
|||
void onClearHighlighting(); |
|||
|
|||
/** |
|||
* Container class for a set of net data |
|||
*/ |
|||
class LIST_ITEM; |
|||
|
|||
/** |
|||
* Ordered comparison of LIST_ITEMs by net code |
|||
*/ |
|||
struct LIST_ITEM_NETCODE_CMP_LESS; |
|||
|
|||
/** |
|||
* Ordered comparison of LIST_ITEMs by group number |
|||
*/ |
|||
struct LIST_ITEM_GROUP_NUMBER_CMP_LESS; |
|||
|
|||
using LIST_ITEM_ITER = std::vector<std::unique_ptr<LIST_ITEM>>::iterator; |
|||
using LIST_ITEM_CONST_ITER = std::vector<std::unique_ptr<LIST_ITEM>>::const_iterator; |
|||
|
|||
/** |
|||
* Constructs a LIST_ITEM for storage in the data model from a board net item |
|||
*/ |
|||
std::unique_ptr<LIST_ITEM> buildNewItem( NETINFO_ITEM* aNet, unsigned int aPadCount, |
|||
const std::vector<CN_ITEM*>& aCNItems ); |
|||
|
|||
void updateDisplayedRowValues( const std::optional<LIST_ITEM_ITER>& aRow ); |
|||
|
|||
// special zero-netcode item. Unconnected pads etc might use different |
|||
// (dummy) NETINFO_ITEM. Redirect all of them to this item, which we get |
|||
// from the board object in buildNetsList. |
|||
NETINFO_ITEM* m_zero_netitem; |
|||
|
|||
/* |
|||
* Current board and parent edit frame |
|||
*/ |
|||
BOARD* m_brd = nullptr; |
|||
PCB_EDIT_FRAME* m_frame = nullptr; |
|||
|
|||
/** |
|||
* Data model which holds LIST_ITEMs |
|||
*/ |
|||
class DATA_MODEL; |
|||
|
|||
/* |
|||
* The bound data model to display |
|||
*/ |
|||
wxObjectDataPtr<DATA_MODEL> m_data_model; |
|||
friend DATA_MODEL; |
|||
|
|||
/* |
|||
* Status flags set during reporting and net rebuild operations |
|||
*/ |
|||
bool m_in_reporting = false; |
|||
bool m_in_build_nets_list = false; |
|||
|
|||
/* |
|||
* Status flags to indicate whether a board has been loaded in this control's |
|||
* lifetime. Required as on PCB_EDIT_FRAME construction, there are multiple events |
|||
* triggered which would usually result in saving settings and re-loading the board. |
|||
* However, before the board loads the frame is in an inconsistent state: The project |
|||
* settings are available, but the board is not yet loaded. This results in overwriting |
|||
* settings calculated from an empty board. We do not save settings until the first |
|||
* board load operation has occured. |
|||
*/ |
|||
bool m_board_loaded = false; |
|||
bool m_board_loading = false; |
|||
|
|||
/* |
|||
* Flags to indicate whether certain events should be disabled during programmatic updates |
|||
*/ |
|||
bool m_row_expanding = false; |
|||
bool m_highlighting_nets = false; |
|||
|
|||
/* |
|||
* Configuration flags - these are all persisted to the project storage |
|||
*/ |
|||
bool m_filter_by_net_name = true; |
|||
bool m_filter_by_netclass = true; |
|||
bool m_show_zero_pad_nets = false; |
|||
bool m_show_unconnected_nets = false; |
|||
bool m_group_by_netclass = false; |
|||
bool m_group_by_constraint = false; |
|||
|
|||
int m_num_copper_layers = 0; |
|||
|
|||
std::vector<wxString> m_custom_group_rules; |
|||
|
|||
/** |
|||
* CSV output control |
|||
*/ |
|||
enum class CSV_COLUMN_DESC : int |
|||
{ |
|||
CSV_NONE = 0, |
|||
CSV_QUOTE = 1 << 0 |
|||
}; |
|||
|
|||
/** |
|||
* Column metadata |
|||
*/ |
|||
struct COLUMN_DESC |
|||
{ |
|||
COLUMN_DESC( unsigned aNum, PCB_LAYER_ID aLayer, const wxString& aDisp, |
|||
const wxString& aCsv, CSV_COLUMN_DESC aFlags, bool aHasUnits ) : |
|||
num( aNum ), |
|||
layer( aLayer ), display_name( aDisp ), csv_name( aCsv ), csv_flags( aFlags ), |
|||
has_units( aHasUnits ) |
|||
{ |
|||
} |
|||
|
|||
unsigned int num; |
|||
PCB_LAYER_ID layer; |
|||
wxString display_name; |
|||
wxString csv_name; |
|||
CSV_COLUMN_DESC csv_flags; |
|||
bool has_units; |
|||
|
|||
operator unsigned int() const { return num; } |
|||
}; |
|||
|
|||
/** |
|||
* All displayed (or hidden) columns |
|||
*/ |
|||
std::vector<COLUMN_DESC> m_columns; |
|||
|
|||
/* |
|||
* Column static IDs. Used to refer to columns as use re-ordering can occur. |
|||
*/ |
|||
enum |
|||
{ |
|||
COLUMN_NAME = 0, |
|||
COLUMN_NETCLASS, |
|||
COLUMN_TOTAL_LENGTH, |
|||
COLUMN_VIA_COUNT, |
|||
COLUMN_VIA_LENGTH, |
|||
COLUMN_BOARD_LENGTH, |
|||
COLUMN_PAD_DIE_LENGTH, |
|||
COLUMN_PAD_COUNT, |
|||
COLUMN_LAST_STATIC_COL = COLUMN_PAD_COUNT |
|||
}; |
|||
|
|||
/* |
|||
* Popup menu item IDs |
|||
*/ |
|||
enum POPUP_MENU_OPTIONS |
|||
{ |
|||
ID_ADD_NET = ID_POPUP_MENU_START, |
|||
ID_RENAME_NET, |
|||
ID_DELETE_NET, |
|||
ID_ADD_GROUP, |
|||
ID_GROUP_BY_CONSTRAINT, |
|||
ID_GROUP_BY_NETCLASS, |
|||
ID_FILTER_BY_NET_NAME, |
|||
ID_FILTER_BY_NETCLASS, |
|||
ID_REMOVE_SELECTED_GROUP, |
|||
ID_REMOVE_GROUPS, |
|||
ID_SHOW_ZERO_NET_PADS, |
|||
ID_SHOW_UNCONNECTED_NETS, |
|||
ID_GENERATE_REPORT, |
|||
ID_HIGHLIGHT_SELECTED_NETS, |
|||
ID_CLEAR_HIGHLIGHTING, |
|||
ID_LAST_STATIC_MENU = ID_CLEAR_HIGHLIGHTING, |
|||
ID_HIDE_COLUMN, |
|||
}; |
|||
}; |
|||
|
|||
#endif |
@ -0,0 +1,865 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef PCB_NET_INSPECTOR_PANEL_DATA_MODEL |
|||
#define PCB_NET_INSPECTOR_PANEL_DATA_MODEL |
|||
|
|||
/** |
|||
* Primary data item for entries in the Net Inspector list. |
|||
* |
|||
* This class tracks all data for a given net entry in the net inspector list. |
|||
*/ |
|||
class PCB_NET_INSPECTOR_PANEL::LIST_ITEM |
|||
{ |
|||
public: |
|||
enum class GROUP_TYPE |
|||
{ |
|||
NONE, |
|||
USER_DEFINED, |
|||
NETCLASS |
|||
}; |
|||
|
|||
LIST_ITEM( unsigned int aGroupNumber, const wxString& aGroupName, GROUP_TYPE aGroupType ) : |
|||
m_group_type( aGroupType ), m_group_number( aGroupNumber ), m_net_name( aGroupName ) |
|||
{ |
|||
m_group_name = aGroupName; |
|||
m_column_changed.resize( COLUMN_LAST_STATIC_COL + 1 + MAX_CU_LAYERS, 0 ); |
|||
} |
|||
|
|||
LIST_ITEM( NETINFO_ITEM* aNet ) : m_group_type( GROUP_TYPE::NONE ), m_net( aNet ) |
|||
{ |
|||
wxASSERT( aNet ); |
|||
m_net_name = UnescapeString( aNet->GetNetname() ); |
|||
m_net_class = UnescapeString( aNet->GetNetClass()->GetName() ); |
|||
m_column_changed.resize( COLUMN_LAST_STATIC_COL + 1 + MAX_CU_LAYERS, 0 ); |
|||
} |
|||
|
|||
LIST_ITEM() { m_column_changed.resize( COLUMN_LAST_STATIC_COL + 1 + MAX_CU_LAYERS, 0 ); } |
|||
|
|||
LIST_ITEM& operator=( const LIST_ITEM& ) = delete; |
|||
|
|||
bool GetIsGroup() const { return m_group_type != GROUP_TYPE::NONE; } |
|||
const wxString& GetGroupName() const { return m_group_name; } |
|||
GROUP_TYPE GetGroupType() const { return m_group_type; } |
|||
int GetGroupNumber() const { return m_group_number; } |
|||
|
|||
auto ChildrenBegin() const { return m_children.begin(); } |
|||
auto ChildrenEnd() const { return m_children.end(); } |
|||
unsigned int ChildrenCount() const { return m_children.size(); } |
|||
|
|||
NETINFO_ITEM* GetNet() const { return m_net; } |
|||
|
|||
int GetNetCode() const |
|||
{ |
|||
return GetIsGroup() ? ( 0 - int( m_group_number ) - 1 ) : m_net->GetNetCode(); |
|||
} |
|||
|
|||
const wxString& GetNetName() const { return m_net_name; } |
|||
const wxString& GetNetclassName() const { return m_net_class; } |
|||
|
|||
void ResetColumnChangedBits() |
|||
{ |
|||
std::fill( m_column_changed.begin(), m_column_changed.end(), 0 ); |
|||
} |
|||
|
|||
unsigned int GetPadCount() const { return m_pad_count; } |
|||
|
|||
bool PadCountChanged() const { return m_column_changed[COLUMN_PAD_COUNT]; } |
|||
|
|||
void SetPadCount( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SetPadCount( m_parent->GetPadCount() - m_pad_count + aValue ); |
|||
|
|||
m_column_changed[COLUMN_PAD_COUNT] |= ( m_pad_count != aValue ); |
|||
m_pad_count = aValue; |
|||
} |
|||
|
|||
void AddPadCount( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->AddPadCount( aValue ); |
|||
|
|||
m_column_changed[COLUMN_PAD_COUNT] |= ( aValue != 0 ); |
|||
m_pad_count += aValue; |
|||
} |
|||
|
|||
void SubPadCount( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SubPadCount( aValue ); |
|||
|
|||
m_column_changed[COLUMN_PAD_COUNT] |= ( aValue != 0 ); |
|||
m_pad_count -= aValue; |
|||
} |
|||
|
|||
unsigned GetViaCount() const { return m_via_count; } |
|||
|
|||
bool ViaCountChanged() const { return m_column_changed[COLUMN_VIA_COUNT]; } |
|||
|
|||
void SetViaCount( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SetViaCount( m_parent->GetViaCount() - m_via_count + aValue ); |
|||
|
|||
m_column_changed[COLUMN_VIA_COUNT] |= ( m_via_count != aValue ); |
|||
m_via_count = aValue; |
|||
} |
|||
|
|||
void AddViaCount( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->AddViaCount( aValue ); |
|||
|
|||
m_column_changed[COLUMN_VIA_COUNT] |= ( aValue != 0 ); |
|||
m_via_count += aValue; |
|||
} |
|||
|
|||
void SubViaCount( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SubViaCount( aValue ); |
|||
|
|||
m_column_changed[COLUMN_VIA_COUNT] |= ( aValue != 0 ); |
|||
m_via_count -= aValue; |
|||
} |
|||
|
|||
uint64_t GetViaLength() const { return m_via_length; } |
|||
|
|||
bool ViaLengthChanged() const { return m_column_changed[COLUMN_VIA_LENGTH]; } |
|||
|
|||
void SetViaLength( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SetViaLength( m_parent->GetViaLength() - m_via_length + aValue ); |
|||
|
|||
m_column_changed[COLUMN_VIA_LENGTH] |= ( m_via_length != aValue ); |
|||
m_via_length = aValue; |
|||
} |
|||
|
|||
void AddViaLength( unsigned int aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->AddViaLength( aValue ); |
|||
|
|||
m_column_changed[COLUMN_VIA_LENGTH] |= ( aValue != 0 ); |
|||
m_via_length += aValue; |
|||
} |
|||
|
|||
void SubViaLength( uint64_t aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SubViaLength( aValue ); |
|||
|
|||
m_column_changed[COLUMN_VIA_LENGTH] |= ( aValue != 0 ); |
|||
m_via_length -= aValue; |
|||
} |
|||
|
|||
uint64_t GetBoardWireLength() const |
|||
{ |
|||
uint64_t retval = 0; |
|||
|
|||
for( uint64_t val : m_layer_wire_length ) |
|||
retval += val; |
|||
|
|||
return retval; |
|||
} |
|||
|
|||
uint64_t GetLayerWireLength( size_t aLayer ) const |
|||
{ |
|||
wxCHECK_MSG( aLayer < m_layer_wire_length.size(), 0, wxT( "Invalid layer specified" ) ); |
|||
|
|||
return m_layer_wire_length[aLayer]; |
|||
} |
|||
|
|||
bool BoardWireLengthChanged() const { return m_column_changed[COLUMN_BOARD_LENGTH]; } |
|||
|
|||
void SetLayerWireLength( const uint64_t aValue, size_t aLayer ) |
|||
{ |
|||
wxCHECK_RET( aLayer < m_layer_wire_length.size(), wxT( "Invalid layer specified" ) ); |
|||
|
|||
if( m_parent ) |
|||
m_parent->SetLayerWireLength( |
|||
m_parent->GetBoardWireLength() - m_layer_wire_length[aLayer] + aValue, aLayer ); |
|||
|
|||
m_column_changed[COLUMN_BOARD_LENGTH] |= ( m_layer_wire_length[aLayer] != aValue ); |
|||
m_layer_wire_length[aLayer] = aValue; |
|||
} |
|||
|
|||
void AddLayerWireLength( const uint64_t aValue, size_t aLayer ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->AddLayerWireLength( aValue, aLayer ); |
|||
|
|||
m_column_changed[COLUMN_BOARD_LENGTH] |= ( m_layer_wire_length[aLayer] != 0 ); |
|||
m_layer_wire_length[aLayer] += aValue; |
|||
} |
|||
|
|||
void SubLayerWireLength( const uint64_t aValue, size_t aLayer ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SubLayerWireLength( aValue, aLayer ); |
|||
|
|||
m_column_changed[COLUMN_BOARD_LENGTH] |= ( m_layer_wire_length[aLayer] != 0 ); |
|||
m_layer_wire_length[aLayer] -= aValue; |
|||
} |
|||
|
|||
uint64_t GetPadDieLength() const { return m_pad_die_length; } |
|||
|
|||
bool PadDieLengthChanged() const { return m_column_changed[COLUMN_PAD_DIE_LENGTH]; } |
|||
|
|||
void SetPadDieLength( uint64_t aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SetPadDieLength( m_parent->GetPadDieLength() - m_pad_die_length + aValue ); |
|||
|
|||
m_column_changed[COLUMN_PAD_DIE_LENGTH] |= ( m_pad_die_length != aValue ); |
|||
m_pad_die_length = aValue; |
|||
} |
|||
|
|||
void AddPadDieLength( uint64_t aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->AddPadDieLength( aValue ); |
|||
|
|||
m_column_changed[COLUMN_PAD_DIE_LENGTH] |= ( aValue != 0 ); |
|||
m_pad_die_length += aValue; |
|||
} |
|||
|
|||
void SubPadDieLength( uint64_t aValue ) |
|||
{ |
|||
if( m_parent ) |
|||
m_parent->SubPadDieLength( aValue ); |
|||
|
|||
m_column_changed[COLUMN_PAD_DIE_LENGTH] |= ( aValue != 0 ); |
|||
m_pad_die_length -= aValue; |
|||
} |
|||
|
|||
// the total length column is always computed, never stored. |
|||
unsigned long long int GetTotalLength() const |
|||
{ |
|||
return GetBoardWireLength() + GetViaLength() + GetPadDieLength(); |
|||
} |
|||
|
|||
bool TotalLengthChanged() const |
|||
{ |
|||
return BoardWireLengthChanged() || ViaLengthChanged() || PadDieLengthChanged(); |
|||
} |
|||
|
|||
LIST_ITEM* Parent() const { return m_parent; } |
|||
|
|||
void SetParent( LIST_ITEM* aParent ) |
|||
{ |
|||
if( m_parent == aParent ) |
|||
return; |
|||
|
|||
if( m_parent != nullptr ) |
|||
{ |
|||
m_parent->SubPadCount( GetPadCount() ); |
|||
m_parent->SubViaCount( GetViaCount() ); |
|||
m_parent->SubViaLength( GetViaLength() ); |
|||
|
|||
for( size_t ii = 0; ii < m_layer_wire_length.size(); ++ii ) |
|||
m_parent->SubLayerWireLength( m_layer_wire_length[ii], ii ); |
|||
|
|||
m_parent->SubPadDieLength( GetPadDieLength() ); |
|||
|
|||
m_parent->m_children.erase( |
|||
std::find( m_parent->m_children.begin(), m_parent->m_children.end(), this ) ); |
|||
} |
|||
|
|||
m_parent = aParent; |
|||
|
|||
if( m_parent != nullptr ) |
|||
{ |
|||
m_parent->AddPadCount( GetPadCount() ); |
|||
m_parent->AddViaCount( GetViaCount() ); |
|||
m_parent->AddViaLength( GetViaLength() ); |
|||
|
|||
for( size_t ii = 0; ii < m_layer_wire_length.size(); ++ii ) |
|||
m_parent->AddLayerWireLength( m_layer_wire_length[ii], ii ); |
|||
|
|||
m_parent->AddPadDieLength( GetPadDieLength() ); |
|||
|
|||
m_parent->m_children.push_back( this ); |
|||
} |
|||
} |
|||
|
|||
private: |
|||
LIST_ITEM* m_parent = nullptr; |
|||
std::vector<LIST_ITEM*> m_children; |
|||
|
|||
GROUP_TYPE m_group_type = GROUP_TYPE::NONE; |
|||
unsigned int m_group_number = 0; |
|||
NETINFO_ITEM* m_net = nullptr; |
|||
unsigned int m_pad_count = 0; |
|||
unsigned int m_via_count = 0; |
|||
uint64_t m_via_length = 0; |
|||
uint64_t m_pad_die_length = 0; |
|||
|
|||
std::array<uint64_t, MAX_CU_LAYERS> m_layer_wire_length{}; |
|||
|
|||
// Dirty bits to record when some attribute has changed, in order to avoid unnecessary sort |
|||
// operations. |
|||
// The values are semantically bools, but STL auto-promotes a std::vector<bool> to a bitset, |
|||
// and then operator|= doesn't work. |
|||
std::vector<int> m_column_changed; |
|||
|
|||
// cached formatted names for faster display sorting |
|||
wxString m_net_name; |
|||
wxString m_net_class; |
|||
wxString m_group_name; |
|||
}; |
|||
|
|||
|
|||
struct PCB_NET_INSPECTOR_PANEL::LIST_ITEM_NETCODE_CMP_LESS |
|||
{ |
|||
template <typename T> |
|||
bool operator()( const T& a, const T& b ) const |
|||
{ |
|||
return a->GetNetCode() < b->GetNetCode(); |
|||
} |
|||
|
|||
template <typename T> |
|||
bool operator()( const T& a, int b ) const |
|||
{ |
|||
return a->GetNetCode() < b; |
|||
} |
|||
|
|||
template <typename T> |
|||
bool operator()( int a, const T& b ) const |
|||
{ |
|||
return a < b->GetNetCode(); |
|||
} |
|||
}; |
|||
|
|||
|
|||
struct PCB_NET_INSPECTOR_PANEL::LIST_ITEM_GROUP_NUMBER_CMP_LESS |
|||
{ |
|||
template <typename T> |
|||
bool operator()( const T& a, const T& b ) const |
|||
{ |
|||
return a->GetGroupNumber() < b->GetGroupNumber(); |
|||
} |
|||
|
|||
template <typename T> |
|||
bool operator()( const T& a, int b ) const |
|||
{ |
|||
return a->GetGroupNumber() < b; |
|||
} |
|||
|
|||
template <typename T> |
|||
bool operator()( int a, const T& b ) const |
|||
{ |
|||
return a < b->GetGroupNumber(); |
|||
} |
|||
}; |
|||
|
|||
|
|||
/** |
|||
* Data model for display in the Net Inspector panel. |
|||
*/ |
|||
class PCB_NET_INSPECTOR_PANEL::DATA_MODEL : public wxDataViewModel |
|||
{ |
|||
public: |
|||
DATA_MODEL( PCB_NET_INSPECTOR_PANEL& parent ) : m_parent( parent ) {} |
|||
|
|||
unsigned int columnCount() const { return m_parent.m_columns.size(); } |
|||
|
|||
unsigned int itemCount() const { return m_items.size(); } |
|||
|
|||
wxVariant valueAt( unsigned int aCol, unsigned int aRow ) const |
|||
{ |
|||
wxVariant r; |
|||
GetValue( r, wxDataViewItem( const_cast<LIST_ITEM*>( &*( m_items[aRow] ) ) ), aCol ); |
|||
return r; |
|||
} |
|||
|
|||
const LIST_ITEM& itemAt( unsigned int aRow ) const { return *m_items.at( aRow ); } |
|||
|
|||
std::vector<std::pair<wxString, wxDataViewItem>> getGroupDataViewItems() |
|||
{ |
|||
std::vector<std::pair<wxString, wxDataViewItem>> ret; |
|||
|
|||
for( std::unique_ptr<LIST_ITEM>& item : m_items ) |
|||
{ |
|||
if( item->GetIsGroup() ) |
|||
ret.push_back( |
|||
std::make_pair( item->GetGroupName(), wxDataViewItem( item.get() ) ) ); |
|||
} |
|||
|
|||
return ret; |
|||
} |
|||
|
|||
|
|||
std::optional<LIST_ITEM_ITER> findItem( int aNetCode ) |
|||
{ |
|||
auto i = std::lower_bound( m_items.begin(), m_items.end(), aNetCode, |
|||
LIST_ITEM_NETCODE_CMP_LESS() ); |
|||
|
|||
if( i == m_items.end() || ( *i )->GetNetCode() != aNetCode ) |
|||
return std::nullopt; |
|||
|
|||
return { i }; |
|||
} |
|||
|
|||
|
|||
std::optional<LIST_ITEM_ITER> findItem( NETINFO_ITEM* aNet ) |
|||
{ |
|||
if( aNet != nullptr ) |
|||
return findItem( aNet->GetNetCode() ); |
|||
else |
|||
return std::nullopt; |
|||
} |
|||
|
|||
|
|||
std::optional<LIST_ITEM_ITER> findGroupItem( int aGroupNumber ) |
|||
{ |
|||
auto i = std::lower_bound( m_items.begin(), m_items.end(), aGroupNumber, |
|||
LIST_ITEM_GROUP_NUMBER_CMP_LESS() ); |
|||
|
|||
if( i == m_items.end() || ( *i )->GetGroupNumber() != aGroupNumber ) |
|||
return std::nullopt; |
|||
|
|||
return { i }; |
|||
} |
|||
|
|||
|
|||
LIST_ITEM_ITER addGroup( LIST_ITEM_ITER groupsBegin, LIST_ITEM_ITER groupsEnd, |
|||
wxString groupName, LIST_ITEM::GROUP_TYPE groupType ) |
|||
{ |
|||
LIST_ITEM_ITER group = std::find_if( groupsBegin, groupsEnd, |
|||
[&]( const std::unique_ptr<LIST_ITEM>& x ) |
|||
{ |
|||
return x->GetGroupName() == groupName |
|||
&& x->GetGroupType() == groupType; |
|||
} ); |
|||
|
|||
if( group == groupsEnd ) |
|||
{ |
|||
int dist = std::distance( groupsBegin, groupsEnd ); |
|||
std::unique_ptr<LIST_ITEM> groupItem = |
|||
std::make_unique<LIST_ITEM>( dist, groupName, groupType ); |
|||
group = m_items.insert( groupsEnd, std::move( groupItem ) ); |
|||
ItemAdded( wxDataViewItem( ( *group )->Parent() ), wxDataViewItem( &**group ) ); |
|||
} |
|||
|
|||
return group; |
|||
} |
|||
|
|||
|
|||
std::optional<LIST_ITEM_ITER> addItem( std::unique_ptr<LIST_ITEM> aItem ) |
|||
{ |
|||
if( aItem == nullptr ) |
|||
return {}; |
|||
|
|||
bool groupMatched = false; |
|||
|
|||
// First see if item matches a group-by rule |
|||
if( m_parent.m_custom_group_rules.size() > 0 ) |
|||
{ |
|||
wxString searchName = aItem->GetNetName().Upper(); |
|||
|
|||
for( const wxString& groupName : m_parent.m_custom_group_rules ) |
|||
{ |
|||
if( searchName.Find( groupName.Upper() ) != wxNOT_FOUND ) |
|||
{ |
|||
aItem->SetParent( m_custom_group_map[groupName] ); |
|||
groupMatched = true; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Then add any netclass groups required by this item |
|||
if( m_parent.m_group_by_netclass && !groupMatched ) |
|||
{ |
|||
LIST_ITEM_ITER groups_begin = m_items.begin(); |
|||
LIST_ITEM_ITER groups_end = std::find_if_not( m_items.begin(), m_items.end(), |
|||
[]( const std::unique_ptr<LIST_ITEM>& x ) |
|||
{ |
|||
return x->GetIsGroup(); |
|||
} ); |
|||
|
|||
wxString match_str = aItem->GetNetclassName(); |
|||
LIST_ITEM_ITER group = addGroup( groups_begin, groups_end, match_str, |
|||
LIST_ITEM::GROUP_TYPE::NETCLASS ); |
|||
aItem->SetParent( &**group ); |
|||
} |
|||
|
|||
// Now add the item itself. Usually when new nets are added, |
|||
// they always get a higher netcode number than the already existing ones. |
|||
// however, if we've got filtering enabled, we might not have all the nets in |
|||
// our list, so do a sorted insertion. |
|||
auto new_iter = std::lower_bound( m_items.begin(), m_items.end(), aItem->GetNetCode(), |
|||
LIST_ITEM_NETCODE_CMP_LESS() ); |
|||
|
|||
new_iter = m_items.insert( new_iter, std::move( aItem ) ); |
|||
const std::unique_ptr<LIST_ITEM>& new_item = *new_iter; |
|||
|
|||
ItemAdded( wxDataViewItem( new_item->Parent() ), wxDataViewItem( new_item.get() ) ); |
|||
|
|||
return { new_iter }; |
|||
} |
|||
|
|||
void addItems( std::vector<std::unique_ptr<LIST_ITEM>> aItems ) |
|||
{ |
|||
m_items.reserve( m_items.size() + aItems.size() ); |
|||
|
|||
for( std::unique_ptr<LIST_ITEM>& i : aItems ) |
|||
addItem( std::move( i ) ); |
|||
} |
|||
|
|||
std::unique_ptr<LIST_ITEM> deleteItem( const std::optional<LIST_ITEM_ITER>& aRow ) |
|||
{ |
|||
if( !aRow ) |
|||
return {}; |
|||
|
|||
std::unique_ptr<LIST_ITEM> i = std::move( **aRow ); |
|||
|
|||
LIST_ITEM* parent = i->Parent(); |
|||
i->SetParent( nullptr ); |
|||
|
|||
m_items.erase( *aRow ); |
|||
ItemDeleted( wxDataViewItem( parent ), wxDataViewItem( &*i ) ); |
|||
|
|||
if( parent ) |
|||
{ |
|||
ItemChanged( wxDataViewItem( parent ) ); |
|||
|
|||
if( m_parent.m_group_by_netclass && parent != nullptr && parent->ChildrenCount() == 0 ) |
|||
{ |
|||
auto p = std::find_if( m_items.begin(), m_items.end(), |
|||
[&]( std::unique_ptr<LIST_ITEM>& x ) |
|||
{ |
|||
return x.get() == parent; |
|||
} ); |
|||
|
|||
wxASSERT( p != m_items.end() ); |
|||
m_items.erase( p ); |
|||
|
|||
ItemDeleted( wxDataViewItem( parent->Parent() ), wxDataViewItem( parent ) ); |
|||
} |
|||
} |
|||
|
|||
Resort(); |
|||
return i; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* Adds all custom group-by entries to the items table |
|||
* |
|||
* Note this assumes that m_items is empty prior to adding these groups |
|||
*/ |
|||
void addCustomGroups() |
|||
{ |
|||
m_custom_group_map.clear(); |
|||
int groupId = 0; |
|||
|
|||
for( const wxString& groupName : m_parent.m_custom_group_rules ) |
|||
{ |
|||
std::unique_ptr<LIST_ITEM>& group = m_items.emplace_back( std::make_unique<LIST_ITEM>( |
|||
groupId, groupName, LIST_ITEM::GROUP_TYPE::USER_DEFINED ) ); |
|||
m_custom_group_map[groupName] = group.get(); |
|||
ItemAdded( wxDataViewItem( group->Parent() ), wxDataViewItem( group.get() ) ); |
|||
++groupId; |
|||
} |
|||
} |
|||
|
|||
|
|||
void deleteAllItems() |
|||
{ |
|||
BeforeReset(); |
|||
m_items.clear(); |
|||
AfterReset(); |
|||
} |
|||
|
|||
void updateItem( const std::optional<LIST_ITEM_ITER>& aRow ) |
|||
{ |
|||
if( aRow ) |
|||
{ |
|||
const std::unique_ptr<LIST_ITEM>& listItem = *aRow.value(); |
|||
|
|||
if( listItem->Parent() ) |
|||
ItemChanged( wxDataViewItem( listItem->Parent() ) ); |
|||
|
|||
ItemChanged( wxDataViewItem( listItem.get() ) ); |
|||
resortIfChanged( listItem.get() ); |
|||
} |
|||
} |
|||
|
|||
void updateAllItems() |
|||
{ |
|||
for( std::unique_ptr<LIST_ITEM>& i : m_items ) |
|||
ItemChanged( wxDataViewItem( i.get() ) ); |
|||
} |
|||
|
|||
void resortIfChanged( LIST_ITEM* aItem ) |
|||
{ |
|||
if( wxDataViewColumn* column = m_parent.m_netsList->GetSortingColumn() ) |
|||
{ |
|||
bool changed = false; |
|||
|
|||
for( const LIST_ITEM* i = aItem; i != nullptr; i = i->Parent() ) |
|||
changed |= itemColumnChanged( i, column->GetModelColumn() ); |
|||
|
|||
for( LIST_ITEM* i = aItem; i != nullptr; i = i->Parent() ) |
|||
i->ResetColumnChangedBits(); |
|||
|
|||
if( changed ) |
|||
Resort(); |
|||
} |
|||
} |
|||
|
|||
bool itemColumnChanged( const LIST_ITEM* aItem, unsigned int aCol ) const |
|||
{ |
|||
if( aItem == nullptr || aCol >= m_parent.m_columns.size() ) |
|||
return false; |
|||
|
|||
if( aCol == COLUMN_PAD_COUNT ) |
|||
return aItem->PadCountChanged(); |
|||
|
|||
else if( aCol == COLUMN_VIA_COUNT ) |
|||
return aItem->ViaCountChanged(); |
|||
|
|||
else if( aCol == COLUMN_VIA_LENGTH ) |
|||
return aItem->ViaLengthChanged(); |
|||
|
|||
else if( aCol == COLUMN_BOARD_LENGTH ) |
|||
return aItem->BoardWireLengthChanged(); |
|||
|
|||
else if( aCol == COLUMN_PAD_DIE_LENGTH ) |
|||
return aItem->PadDieLengthChanged(); |
|||
|
|||
else if( aCol == COLUMN_TOTAL_LENGTH ) |
|||
return aItem->TotalLengthChanged(); |
|||
|
|||
else if( aCol > COLUMN_LAST_STATIC_COL ) |
|||
return aItem->BoardWireLengthChanged(); |
|||
|
|||
|
|||
return false; |
|||
} |
|||
|
|||
// implementation of wxDataViewModel interface |
|||
// these are used to query the data model by the GUI view implementation. |
|||
// these are not supposed to be used to modify the data model. for that |
|||
// use the public functions above. |
|||
|
|||
protected: |
|||
unsigned int GetColumnCount() const override { return columnCount(); } |
|||
|
|||
void GetValue( wxVariant& aOutValue, const wxDataViewItem& aItem, |
|||
unsigned int aCol ) const override |
|||
{ |
|||
if( LIST_ITEM* i = static_cast<LIST_ITEM*>( aItem.GetID() ) ) |
|||
{ |
|||
if( i->GetIsGroup() ) |
|||
{ |
|||
if( aCol == COLUMN_NAME ) |
|||
switch( i->GetGroupType() ) |
|||
{ |
|||
case LIST_ITEM::GROUP_TYPE::NETCLASS: |
|||
aOutValue = _( "Netclass" ) + ": " + i->GetGroupName(); |
|||
break; |
|||
case LIST_ITEM::GROUP_TYPE::USER_DEFINED: |
|||
aOutValue = _( "Custom" ) + ": " + i->GetGroupName(); |
|||
break; |
|||
default: aOutValue = i->GetGroupName(); break; |
|||
} |
|||
|
|||
else |
|||
aOutValue = ""; |
|||
} |
|||
|
|||
else if( aCol == COLUMN_NAME ) |
|||
aOutValue = i->GetNetName(); |
|||
|
|||
else if( aCol == COLUMN_NETCLASS ) |
|||
aOutValue = i->GetNetclassName(); |
|||
|
|||
else if( aCol == COLUMN_PAD_COUNT ) |
|||
aOutValue = m_parent.formatCount( i->GetPadCount() ); |
|||
|
|||
else if( aCol == COLUMN_VIA_COUNT ) |
|||
aOutValue = m_parent.formatCount( i->GetViaCount() ); |
|||
|
|||
else if( aCol == COLUMN_VIA_LENGTH ) |
|||
aOutValue = m_parent.formatLength( i->GetViaLength() ); |
|||
|
|||
else if( aCol == COLUMN_BOARD_LENGTH ) |
|||
aOutValue = m_parent.formatLength( i->GetBoardWireLength() ); |
|||
|
|||
else if( aCol == COLUMN_PAD_DIE_LENGTH ) |
|||
aOutValue = m_parent.formatLength( i->GetPadDieLength() ); |
|||
|
|||
else if( aCol == COLUMN_TOTAL_LENGTH ) |
|||
aOutValue = m_parent.formatLength( i->GetTotalLength() ); |
|||
|
|||
else if( aCol > COLUMN_LAST_STATIC_COL && aCol <= m_parent.m_columns.size() ) |
|||
aOutValue = m_parent.formatLength( |
|||
i->GetLayerWireLength( m_parent.m_columns[aCol].layer ) ); |
|||
|
|||
else |
|||
aOutValue = ""; |
|||
} |
|||
} |
|||
|
|||
static int compareUInt( uint64_t aValue1, uint64_t aValue2, bool aAsc ) |
|||
{ |
|||
if( aAsc ) |
|||
return aValue1 < aValue2 ? -1 : 1; |
|||
else |
|||
return aValue2 < aValue1 ? -1 : 1; |
|||
} |
|||
|
|||
int Compare( const wxDataViewItem& aItem1, const wxDataViewItem& aItem2, unsigned int aCol, |
|||
bool aAsc ) const override |
|||
{ |
|||
const LIST_ITEM& i1 = *static_cast<const LIST_ITEM*>( aItem1.GetID() ); |
|||
const LIST_ITEM& i2 = *static_cast<const LIST_ITEM*>( aItem2.GetID() ); |
|||
|
|||
if( i1.GetIsGroup() && !i2.GetIsGroup() ) |
|||
return -1; |
|||
|
|||
if( i2.GetIsGroup() && !i1.GetIsGroup() ) |
|||
return 1; |
|||
|
|||
if( aCol == COLUMN_NAME ) |
|||
{ |
|||
const wxString& s1 = i1.GetNetName(); |
|||
const wxString& s2 = i2.GetNetName(); |
|||
|
|||
int res = aAsc ? ValueStringCompare( s1, s2 ) : ValueStringCompare( s2, s1 ); |
|||
|
|||
if( res != 0 ) |
|||
return res; |
|||
} |
|||
|
|||
else if( aCol == COLUMN_PAD_COUNT && i1.GetPadCount() != i2.GetPadCount() ) |
|||
return compareUInt( i1.GetPadCount(), i2.GetPadCount(), aAsc ); |
|||
|
|||
else if( aCol == COLUMN_VIA_COUNT && i1.GetViaCount() != i2.GetViaCount() ) |
|||
return compareUInt( i1.GetViaCount(), i2.GetViaCount(), aAsc ); |
|||
|
|||
else if( aCol == COLUMN_VIA_LENGTH && i1.GetViaLength() != i2.GetViaLength() ) |
|||
return compareUInt( i1.GetViaLength(), i2.GetViaLength(), aAsc ); |
|||
|
|||
else if( aCol == COLUMN_BOARD_LENGTH && i1.GetBoardWireLength() != i2.GetBoardWireLength() ) |
|||
return compareUInt( i1.GetBoardWireLength(), i2.GetBoardWireLength(), aAsc ); |
|||
|
|||
else if( aCol == COLUMN_PAD_DIE_LENGTH && i1.GetPadDieLength() != i2.GetPadDieLength() ) |
|||
return compareUInt( i1.GetPadDieLength(), i2.GetPadDieLength(), aAsc ); |
|||
|
|||
else if( aCol == COLUMN_TOTAL_LENGTH && i1.GetTotalLength() != i2.GetTotalLength() ) |
|||
return compareUInt( i1.GetTotalLength(), i2.GetTotalLength(), aAsc ); |
|||
|
|||
else if( aCol > COLUMN_LAST_STATIC_COL && aCol < m_parent.m_columns.size() |
|||
&& i1.GetLayerWireLength( m_parent.m_columns[aCol].layer ) |
|||
!= i2.GetLayerWireLength( m_parent.m_columns[aCol].layer ) ) |
|||
{ |
|||
return compareUInt( i1.GetLayerWireLength( m_parent.m_columns[aCol].layer ), |
|||
i2.GetLayerWireLength( m_parent.m_columns[aCol].layer ), aAsc ); |
|||
} |
|||
|
|||
// when the item values compare equal resort to pointer comparison. |
|||
wxUIntPtr id1 = wxPtrToUInt( aItem1.GetID() ); |
|||
wxUIntPtr id2 = wxPtrToUInt( aItem2.GetID() ); |
|||
|
|||
return aAsc ? id1 - id2 : id2 - id1; |
|||
} |
|||
|
|||
bool SetValue( const wxVariant& aInValue, const wxDataViewItem& aItem, |
|||
unsigned int aCol ) override |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
wxDataViewItem GetParent( const wxDataViewItem& aItem ) const override |
|||
{ |
|||
if( !aItem.IsOk() ) |
|||
return wxDataViewItem(); |
|||
|
|||
return wxDataViewItem( static_cast<const LIST_ITEM*>( aItem.GetID() )->Parent() ); |
|||
} |
|||
|
|||
bool IsContainer( const wxDataViewItem& aItem ) const override |
|||
{ |
|||
if( !aItem.IsOk() ) |
|||
return true; |
|||
|
|||
return static_cast<const LIST_ITEM*>( aItem.GetID() )->GetIsGroup(); |
|||
} |
|||
|
|||
bool HasContainerColumns( const wxDataViewItem& aItem ) const override |
|||
{ |
|||
return IsContainer( aItem ); |
|||
} |
|||
|
|||
unsigned int GetChildren( const wxDataViewItem& aParent, |
|||
wxDataViewItemArray& aChildren ) const override |
|||
{ |
|||
const LIST_ITEM* p = static_cast<const LIST_ITEM*>( aParent.GetID() ); |
|||
|
|||
if( !aParent.IsOk() ) |
|||
{ |
|||
aChildren.Alloc( m_items.size() ); |
|||
|
|||
for( const std::unique_ptr<LIST_ITEM>& i : m_items ) |
|||
{ |
|||
if( i->Parent() == nullptr ) |
|||
aChildren.Add( wxDataViewItem( &*i ) ); |
|||
} |
|||
|
|||
return aChildren.GetCount(); |
|||
} |
|||
else if( p->GetIsGroup() ) |
|||
{ |
|||
const int count = p->ChildrenCount(); |
|||
|
|||
if( count == 0 ) |
|||
return 0; |
|||
|
|||
aChildren.Alloc( count ); |
|||
|
|||
for( auto i = p->ChildrenBegin(), end = p->ChildrenEnd(); i != end; ++i ) |
|||
aChildren.Add( wxDataViewItem( *i ) ); |
|||
|
|||
return aChildren.GetCount(); |
|||
} |
|||
|
|||
return 0; |
|||
} |
|||
|
|||
wxString GetColumnType( unsigned int /* aCol */ ) const override { return wxS( "string" ); } |
|||
|
|||
private: |
|||
PCB_NET_INSPECTOR_PANEL& m_parent; |
|||
|
|||
// primary container, sorted by netcode number. |
|||
// groups have netcode < 0, so they always come first, in the order |
|||
// of the filter strings as input by the user |
|||
std::vector<std::unique_ptr<LIST_ITEM>> m_items; |
|||
|
|||
/// Map of custom group names to their representative list item |
|||
std::map<wxString, LIST_ITEM*> m_custom_group_map; |
|||
}; |
|||
|
|||
#endif |
Write
Preview
Loading…
Cancel
Save
Reference in new issue