Add Assign Netclass... to context menu.

ADDED Assign Netclass feature to EEschema.

Netclass assignments also now shown in status bar.

Fixes https://gitlab.com/kicad/code/kicad/issues/4581
This commit is contained in:
Jeff Young 2020-07-07 11:17:30 +01:00
parent 1872d05f72
commit e66523586b
24 changed files with 508 additions and 841 deletions

View File

@ -169,7 +169,6 @@ set( COMMON_DLG_SRCS
dialogs/dialog_hotkey_list.cpp
dialogs/dialog_image_editor.cpp
dialogs/dialog_image_editor_base.cpp
dialogs/dialog_list_selector_base.cpp
dialogs/dialog_migrate_settings.cpp
dialogs/dialog_migrate_settings_base.cpp
dialogs/dialog_page_settings_base.cpp
@ -177,6 +176,8 @@ set( COMMON_DLG_SRCS
dialogs/dialog_print_generic.cpp
dialogs/dialog_print_generic_base.cpp
dialogs/dialog_text_entry.cpp
dialogs/eda_list_dialog.cpp
dialogs/eda_list_dialog_base.cpp
dialogs/panel_color_settings_base.cpp
dialogs/panel_color_settings.cpp
dialogs/panel_common_settings.cpp
@ -283,7 +284,6 @@ set( COMMON_SRCS
confirm.cpp
cursor_store.cpp
dialog_shim.cpp
displlst.cpp
gr_text.cpp
dsnlexer.cpp
eagle_parser.cpp

View File

@ -1,640 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="14" />
<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_list_selector_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_list_selector_base</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_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">decl_pure_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"></property>
<property name="name">EDA_LIST_DIALOG_BASE</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiPaneActivated"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMaximize"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnMove"></event>
<event name="OnMoveEnd"></event>
<event name="OnMoveStart"></event>
<event name="OnMoving"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnShow"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></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|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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">Items:</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_listLabel</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>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">3</property>
<object class="wxListCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,200</property>
<property name="moveable">1</property>
<property name="name">m_listBox</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">wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES</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">wxALWAYS_SHOW_SB|wxBORDER_SIMPLE|wxVSCROLL</property>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnListBeginDrag"></event>
<event name="OnListBeginLabelEdit"></event>
<event name="OnListBeginRDrag"></event>
<event name="OnListCacheHint"></event>
<event name="OnListColBeginDrag"></event>
<event name="OnListColClick"></event>
<event name="OnListColDragging"></event>
<event name="OnListColEndDrag"></event>
<event name="OnListColRightClick"></event>
<event name="OnListDeleteAllItems"></event>
<event name="OnListDeleteItem"></event>
<event name="OnListEndLabelEdit"></event>
<event name="OnListInsertItem"></event>
<event name="OnListItemActivated">onListItemActivated</event>
<event name="OnListItemDeselected"></event>
<event name="OnListItemFocused"></event>
<event name="OnListItemMiddleClick"></event>
<event name="OnListItemRightClick"></event>
<event name="OnListItemSelected">onListItemSelected</event>
<event name="OnListKeyDown"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</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="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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"></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_filterBox</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="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText">textChangeInFilterBox</event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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">Messages:</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_staticTextMsg</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>
<event name="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,80</property>
<property name="moveable">1</property>
<property name="name">m_messages</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">wxTE_MULTILINE|wxTE_READONLY</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="OnAux1DClick"></event>
<event name="OnAux1Down"></event>
<event name="OnAux1Up"></event>
<event name="OnAux2DClick"></event>
<event name="OnAux2Down"></event>
<event name="OnAux2Up"></event>
<event name="OnChar"></event>
<event name="OnCharHook"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|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">1</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>
<event name="OnApplyButtonClick"></event>
<event name="OnCancelButtonClick"></event>
<event name="OnContextHelpButtonClick"></event>
<event name="OnHelpButtonClick"></event>
<event name="OnNoButtonClick"></event>
<event name="OnOKButtonClick"></event>
<event name="OnSaveButtonClick"></event>
<event name="OnYesButtonClick"></event>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -40,14 +40,10 @@ static int DEFAULT_COL_WIDTHS[] = { 200, 600 };
EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
const wxArrayString& aItemHeaders,
const std::vector<wxArrayString>& aItemList,
const wxString& aSelection,
void( *aCallBackFunction )( wxString&, void* ),
void* aCallBackFunctionData ) :
const wxString& aSelection ) :
EDA_LIST_DIALOG_BASE( aParent, wxID_ANY, aTitle )
{
m_cb_func = aCallBackFunction;
m_cb_data = aCallBackFunctionData;
m_itemsListCp = &aItemList;
m_itemsList = &aItemList;
m_filterBox->SetHint( _( "Filter" ) );
@ -68,35 +64,28 @@ EDA_LIST_DIALOG::EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitl
}
void EDA_LIST_DIALOG::initDialog( const wxArrayString& aItemHeaders, const wxString& aSelection)
void EDA_LIST_DIALOG::initDialog( const wxArrayString& aItemHeaders, const wxString& aSelection )
{
for( unsigned i = 0; i < aItemHeaders.Count(); i++ )
{
m_listBox->InsertColumn( i, aItemHeaders.Item( i ),
wxLIST_FORMAT_LEFT, DEFAULT_COL_WIDTHS[ i ] );
InsertItems( *m_itemsListCp, 0 );
if( m_cb_func == NULL )
{
m_messages->Show( false );
m_staticTextMsg->Show( false );
}
InsertItems( *m_itemsList, 0 );
if( !aSelection.IsEmpty() )
{
for( unsigned row = 0; row < m_itemsListCp->size(); ++row )
long sel = m_listBox->FindItem( -1, aSelection );
if( sel != wxNOT_FOUND )
{
if( (*m_itemsListCp)[row][0] == aSelection )
{
m_listBox->SetItemState( row, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
m_listBox->SetItemState( sel, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
// Set to a small size so EnsureVisible() won't be foiled by later additions.
// ListBox will expand to fit later.
m_listBox->SetSize( m_listBox->GetSize().GetX(), 100 );
m_listBox->EnsureVisible( row );
break;
}
m_listBox->EnsureVisible( sel );
}
}
}
@ -124,14 +113,12 @@ void EDA_LIST_DIALOG::textChangeInFilterBox( wxCommandEvent& event )
m_listBox->DeleteAllItems();
for( unsigned i = 0; i < m_itemsListCp->size(); i++ )
for( const wxArrayString& row : *m_itemsList )
{
itemName = (*m_itemsListCp)[i].Item( 0 );
itemName = row.Item( 0 );
if( itemName.MakeLower().Matches( filter ) )
{
Append( (*m_itemsListCp)[i] );
}
Append( row );
}
sortList();
@ -169,9 +156,7 @@ void EDA_LIST_DIALOG::Append( const wxArrayString& itemList )
// Adding the next columns content
for( unsigned i = 1; i < itemList.size(); i++ )
{
m_listBox->SetItem( itemIndex, i, itemList[i] );
}
}
@ -208,18 +193,6 @@ void EDA_LIST_DIALOG::InsertItems( const std::vector< wxArrayString >& itemList,
}
void EDA_LIST_DIALOG::onListItemSelected( wxListEvent& event )
{
if( m_cb_func )
{
m_messages->Clear();
wxString text = GetTextSelection();
m_cb_func( text, m_cb_data );
m_messages->WriteText( text );
}
}
void EDA_LIST_DIALOG::onListItemActivated( wxListEvent& event )
{
EndModal( wxID_OK );

View File

@ -1,11 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 2 2018)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_list_selector_base.h"
#include "eda_list_dialog_base.h"
///////////////////////////////////////////////////////////////////////////
@ -31,15 +31,6 @@ EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, con
m_filterBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bMargins->Add( m_filterBox, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticTextMsg = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMsg->Wrap( -1 );
bMargins->Add( m_staticTextMsg, 0, wxRIGHT|wxLEFT, 5 );
m_messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_messages->SetMinSize( wxSize( -1,80 ) );
bMargins->Add( m_messages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerMain->Add( bMargins, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
@ -61,7 +52,6 @@ EDA_LIST_DIALOG_BASE::EDA_LIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, con
// Connect Events
m_listBox->Connect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemActivated ), NULL, this );
m_listBox->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemSelected ), NULL, this );
m_filterBox->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::textChangeInFilterBox ), NULL, this );
}
@ -69,7 +59,6 @@ EDA_LIST_DIALOG_BASE::~EDA_LIST_DIALOG_BASE()
{
// Disconnect Events
m_listBox->Disconnect( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemActivated ), NULL, this );
m_listBox->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( EDA_LIST_DIALOG_BASE::onListItemSelected ), NULL, this );
m_filterBox->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( EDA_LIST_DIALOG_BASE::textChangeInFilterBox ), NULL, this );
}

View File

@ -0,0 +1,282 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="15" />
<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">eda_list_dialog_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">eda_list_dialog_base</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_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">decl_pure_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"></property>
<property name="name">EDA_LIST_DIALOG_BASE</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMargins</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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">Items:</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_listLabel</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="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">3</property>
<object class="wxListCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,200</property>
<property name="moveable">1</property>
<property name="name">m_listBox</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">wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES</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">wxALWAYS_SHOW_SB|wxBORDER_SIMPLE|wxVSCROLL</property>
<event name="OnListItemActivated">onListItemActivated</event>
</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="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="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"></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_filterBox</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">textChangeInFilterBox</event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|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">1</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>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 2 2018)
// C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_LIST_SELECTOR_BASE_H__
#define __DIALOG_LIST_SELECTOR_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
@ -38,15 +37,12 @@ class EDA_LIST_DIALOG_BASE : public DIALOG_SHIM
wxStaticText* m_listLabel;
wxListCtrl* m_listBox;
wxTextCtrl* m_filterBox;
wxStaticText* m_staticTextMsg;
wxTextCtrl* m_messages;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void onListItemActivated( wxListEvent& event ) = 0;
virtual void onListItemSelected( wxListEvent& event ) = 0;
virtual void textChangeInFilterBox( wxCommandEvent& event ) = 0;
@ -57,4 +53,3 @@ class EDA_LIST_DIALOG_BASE : public DIALOG_SHIM
};
#endif //__DIALOG_LIST_SELECTOR_BASE_H__

View File

@ -47,6 +47,7 @@ enum {
GRID_DIFF_PAIR_VIA_GAP
};
#define NO_NETCLASS_ASSIGNMENT _( "<unassigned>" )
PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSES* aNetclasses,
const std::vector<wxString>& aCandidateNetNames ) :
@ -153,7 +154,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
std::map<wxString, wxString> staleNetMap;
for( const wxString& candidate : m_candidateNetNames )
netToNetclassMap[ candidate ] = "Default";
netToNetclassMap[ candidate ] = wxEmptyString;
if( m_netclassGrid->GetNumberRows() )
m_netclassGrid->DeleteRows( 0, m_netclassGrid->GetNumberRows() );
@ -232,6 +233,8 @@ void PANEL_SETUP_NETCLASSES::rebuildNetclassDropdowns()
wxArrayString netclassNames;
netclassNames.emplace_back( NO_NETCLASS_ASSIGNMENT );
for( int ii = 0; ii < m_netclassGrid->GetNumberRows(); ii++ )
{
wxString netclassName = m_netclassGrid->GetCellValue( ii, GRID_NAME );
@ -294,7 +297,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
const wxString& netname = m_membershipGrid->GetCellValue( row, 0 );
const wxString& classname = m_membershipGrid->GetCellValue( row, 1 );
if( classname != "Default" )
if( classname != NO_NETCLASS_ASSIGNMENT )
{
const NETCLASSPTR& nc = m_netclasses->Find( classname );

View File

@ -31,14 +31,12 @@
#include <dialogs/panel_libedit_settings.h>
#include <eeschema_config.h>
#include <fctsys.h>
#include <gestfich.h>
#include <gr_text.h>
#include <kiface_i.h>
#include <lib_edit_frame.h>
#include <panel_gal_display_options.h>
#include <panel_hotkeys_editor.h>
#include <pgm_base.h>
#include <project/project_file.h>
#include <project/net_settings.h>
#include <sch_edit_frame.h>
#include <sch_junction.h>
#include <sch_painter.h>
@ -47,13 +45,10 @@
#include <settings/settings_manager.h>
#include <symbol_lib_table.h>
#include <widgets/paged_dialog.h>
#include <widgets/symbol_tree_pane.h>
#include <wildcards_and_files_ext.h>
#include <ws_data_model.h>
#include <widgets/ui_common.h>
#include <dialogs/dialog_schematic_setup.h>
#include "erc.h"
#include <default_values.h> // For some default values
#define FieldNameTemplatesKey wxT( "FieldNameTemplates" )
@ -274,6 +269,7 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
if( dlg.ShowQuasiModal() == wxID_OK )
{
Prj().GetProjectFile().NetSettings().ResolveNetClassAssignments();
SaveProjectSettings();
GetCanvas()->Refresh();

View File

@ -1491,7 +1491,7 @@ void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITE
auto conn = aComponent->GetConnectionForPin( this, frame->GetCurrentSheet() );
if( conn )
conn->AppendDebugInfoToMsgPanel( aList );
conn->AppendInfoToMsgPanel( aList );
#endif
}

View File

@ -90,7 +90,7 @@ wxString LIB_EDIT_FRAME::SelectLibraryFromList()
std::vector< wxString > libNicknames = prj.SchSymbolLibTable()->GetLogicalLibs();
// Conversion from wxArrayString to vector of ArrayString
for( const auto& name : libNicknames )
for( const wxString& name : libNicknames )
{
wxArrayString item;

View File

@ -23,15 +23,8 @@
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <macros.h>
#include <sch_draw_panel.h>
#include <trigo.h>
#include <common.h>
#include <richio.h>
#include <bitmaps.h>
#include <eeschema_config.h>
#include <general.h>
#include <schematic.h>
#include <sch_bus_entry.h>
#include <sch_edit_frame.h>
@ -39,7 +32,6 @@
#include <sch_text.h>
#include <settings/color_settings.h>
#include "sch_painter.h"
#include <default_values.h> // For some default values
SCH_BUS_ENTRY_BASE::SCH_BUS_ENTRY_BASE( KICAD_T aType, const wxPoint& pos, bool aFlipY ) :
@ -398,13 +390,7 @@ void SCH_BUS_ENTRY_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEM
return;
if( auto conn = Connection( frame->GetCurrentSheet() ) )
{
#if defined(DEBUG)
conn->AppendDebugInfoToMsgPanel( aList );
#else
conn->AppendInfoToMsgPanel( aList );
#endif
}
}

View File

@ -327,9 +327,6 @@ void SCH_CONNECTION::SetSuffix( const wxString& aSuffix )
void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const
{
if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
return;
wxString msg, group_name;
std::vector<wxString> group_members;
@ -374,19 +371,13 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const
}
}
}
}
#if defined(DEBUG)
// These messages are not flagged as translatable, because they are only debug messages
void SCH_CONNECTION::AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const
{
if( !ADVANCED_CFG::GetCfg().m_realTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )
return;
// These messages are not flagged as translatable, because they are only debug messages
wxString msg;
AppendInfoToMsgPanel( aList );
if( IsBus() )
{
msg.Printf( "%d", m_bus_code );
@ -401,6 +392,7 @@ void SCH_CONNECTION::AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const
msg.Printf( "%s at %p", driver->GetSelectMenuText( EDA_UNITS::MILLIMETRES ), driver );
aList.push_back( MSG_PANEL_ITEM( "Connection Source", msg, RED ) );
}
#endif
}

View File

@ -280,11 +280,6 @@ public:
*/
void AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const;
/**
* Adds extended debug information about the connection object to aList
*/
void AppendDebugInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const;
/**
* Test if \a aLabel has a bus notation.
*

View File

@ -22,26 +22,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file sch_line.cpp
* @brief Class SCH_LINE implementation
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <macros.h>
#include <sch_draw_panel.h>
//#include <gr_basic.h>
//#include <macros.h>
//#include <sch_draw_panel.h>
#include <sch_painter.h>
#include <plotter.h>
#include <base_units.h>
#include <eeschema_config.h>
#include <general.h>
//#include <base_units.h>
//#include <general.h>
#include <sch_line.h>
#include <sch_edit_frame.h>
#include <settings/color_settings.h>
#include <netlist_object.h>
#include <sch_view.h>
#include <schematic.h>
#include <project/project_file.h>
#include <project/net_settings.h>
SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) :
@ -778,19 +773,21 @@ void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
if( !frame )
return;
if( auto conn = Connection( frame->GetCurrentSheet() ) )
if( frame )
{
if( SCH_CONNECTION* conn = Connection( frame->GetCurrentSheet() ) )
{
#if defined(DEBUG)
conn->AppendDebugInfoToMsgPanel( aList );
msg.Printf( "%zu", m_connected_items.size() );
aList.push_back( MSG_PANEL_ITEM( _( "Connections" ), msg, BROWN ) );
#else
conn->AppendInfoToMsgPanel( aList );
#endif
NET_SETTINGS& netSettings = Schematic()->Prj().GetProjectFile().NetSettings();
const wxString& netname = conn->Name( true );
if( netSettings.m_NetClassAssignments.count( netname ) )
{
const wxString& netclassName = netSettings.m_NetClassAssignments[ netname ];
aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName, DARKRED ) );
}
}
}
}

View File

@ -29,17 +29,12 @@
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <macros.h>
#include <trigo.h>
#include <sch_component.h>
#include <sch_edit_frame.h>
#include <plotter.h>
#include <msgpanel.h>
#include <gal/stroke_font.h>
#include <bitmaps.h>
#include <math/util.h> // for KiROUND
#include <kiway.h>
#include <sch_text.h>
#include <schematic.h>
#include <netlist_object.h>
@ -48,6 +43,8 @@
#include <default_values.h>
#include <wx/debug.h>
#include <html_messagebox.h>
#include <project/project_file.h>
#include <project/net_settings.h>
using KIGFX::SCH_RENDER_SETTINGS;
@ -716,19 +713,24 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList )
msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth(), true );
aList.push_back( MSG_PANEL_ITEM( _( "Size" ), msg, RED ) );
#if defined(DEBUG)
SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
SCH_EDIT_FRAME* frame = dynamic_cast<SCH_EDIT_FRAME*>( aFrame );
if( schframe )
if( frame )
{
if( auto conn = Connection( schframe->GetCurrentSheet() ) )
conn->AppendDebugInfoToMsgPanel( aList );
if( SCH_CONNECTION* conn = Connection( frame->GetCurrentSheet() ) )
{
conn->AppendInfoToMsgPanel( aList );
NET_SETTINGS& netSettings = Schematic()->Prj().GetProjectFile().NetSettings();
const wxString& netname = conn->Name( true );
if( netSettings.m_NetClassAssignments.count( netname ) )
{
const wxString& netclassName = netSettings.m_NetClassAssignments[ netname ];
aList.push_back( MSG_PANEL_ITEM( _( "Assigned Netclass" ), netclassName, DARKRED ) );
}
}
}
msg.Printf( "%p", this );
aList.push_back( MSG_PANEL_ITEM( "Object Address", msg, RED ) );
#endif
}
#if defined(DEBUG)

View File

@ -198,10 +198,13 @@ std::vector<wxString> SCHEMATIC::GetNetClassAssignmentCandidates()
if( NET_SETTINGS::ParseBusVector( unescaped, nullptr, nullptr ) )
{
// Allow netclass assignment to an entire vector.
names.emplace_back( unescaped );
names.emplace_back( EscapeString( unescaped, CTX_NETNAME ) );
}
else if( NET_SETTINGS::ParseBusGroup( unescaped, &busPrefix, &busMembers ) )
{
// Allow netclass assignment to an entire group.
names.emplace_back( EscapeString( unescaped, CTX_NETNAME ) );
// Named bus groups generate a net prefix, unnamed ones don't
if( !busPrefix.IsEmpty() )
busPrefix += wxT( "." );

View File

@ -396,6 +396,11 @@ TOOL_ACTION EE_ACTIONS::updateFieldsFromLibrary( "eeschema.InteractiveEdit.updat
_( "Update Fields from Library..." ), _( "Sets symbol fields to original library values" ),
update_fields_xpm );
TOOL_ACTION EE_ACTIONS::assignNetclass( "eeschema.InteractiveEdit.assignNetclass",
AS_GLOBAL, 0, "",
_( "Assign Netclass..." ), _( "Assign a netclass to the net of the selected wire" ),
list_nets_xpm );
TOOL_ACTION EE_ACTIONS::toggleDeMorgan( "eeschema.InteractiveEdit.toggleDeMorgan",
AS_GLOBAL, 0, "",
_( "DeMorgan Conversion" ), _( "Switch between DeMorgan representations" ),

View File

@ -145,6 +145,7 @@ public:
static TOOL_ACTION pinTable;
static TOOL_ACTION updateFieldsFromLibrary;
static TOOL_ACTION assignFootprints;
static TOOL_ACTION assignNetclass;
static TOOL_ACTION showBusManager;
static TOOL_ACTION schematicSetup;
@ -157,7 +158,6 @@ public:
static TOOL_ACTION importFPAssignments;
static TOOL_ACTION exportNetlist;
static TOOL_ACTION generateBOM;
static TOOL_ACTION runSimulation;
static TOOL_ACTION addSymbolToSchematic;
// Library management
@ -176,9 +176,11 @@ public:
static TOOL_ACTION leaveSheet;
static TOOL_ACTION navigateHierarchy;
// Miscellaneous
// Global edit tools
static TOOL_ACTION cleanupSheetPins;
static TOOL_ACTION editTextAndGraphics;
// Miscellaneous
static TOOL_ACTION toggleHiddenPins;
static TOOL_ACTION toggleHiddenFields;
static TOOL_ACTION toggleSyncedPinsMode;
@ -195,6 +197,7 @@ public:
static TOOL_ACTION exportSymbolAsSVG;
// SPICE
static TOOL_ACTION runSimulation;
static TOOL_ACTION simProbe;
static TOOL_ACTION simTune;

View File

@ -156,14 +156,23 @@ bool EE_SELECTION_TOOL::Init()
static KICAD_T wireOrBusTypes[] = { SCH_LINE_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T, EOT };
static KICAD_T connectedTypes[] = { SCH_LINE_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T,
SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T,
SCH_SHEET_PIN_T, SCH_PIN_T, EOT };
auto wireSelection = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_WIRE_T );
auto busSelection = E_C::MoreThan( 0 ) && E_C::OnlyType( SCH_LINE_LOCATE_BUS_T );
auto wireOrBusSelection = E_C::MoreThan( 0 ) && E_C::OnlyTypes( wireOrBusTypes );
auto connectedSelection = E_C::MoreThan( 0 ) && E_C::OnlyTypes( connectedTypes );
auto sheetSelection = E_C::Count( 1 ) && E_C::OnlyType( SCH_SHEET_T );
auto schEditCondition = [this] ( const SELECTION& aSel ) {
auto schEditCondition =
[this] ( const SELECTION& aSel )
{
return !m_isLibEdit && !m_isLibView;
};
auto belowRootSheetCondition =
[&]( const SELECTION& aSel )
{
@ -205,6 +214,7 @@ bool EE_SELECTION_TOOL::Init()
menu.AddItem( EE_ACTIONS::breakWire, wireSelection && EE_CONDITIONS::Idle, 250 );
menu.AddItem( EE_ACTIONS::breakBus, busSelection && EE_CONDITIONS::Idle, 250 );
menu.AddItem( EE_ACTIONS::importSheetPin, sheetSelection && EE_CONDITIONS::Idle, 250 );
menu.AddItem( EE_ACTIONS::assignNetclass, connectedSelection && EE_CONDITIONS::Idle, 250 );
menu.AddSeparator( 400 );
menu.AddItem( EE_ACTIONS::symbolProperties, havePartCondition && EE_CONDITIONS::Empty, 400 );

View File

@ -36,6 +36,8 @@
#include <invoke_sch_dialog.h>
#include <kiway.h>
#include <netlist_exporters/netlist_exporter_pspice.h>
#include <project/project_file.h>
#include <project/net_settings.h>
#include <netlist_object.h>
#include <sch_edit_frame.h>
#include <sch_sexpr_plugin.h>
@ -56,9 +58,8 @@
#include <tools/ee_selection_tool.h>
#include <tools/sch_editor_control.h>
#include <ws_proxy_undo_item.h>
#include <math/util.h> // for KiROUND
#include <dialog_update_from_pcb.h>
#include <dialog_helpers.h>
int SCH_EDITOR_CONTROL::New( const TOOL_EVENT& aEvent )
{
@ -900,6 +901,83 @@ int SCH_EDITOR_CONTROL::ClearHighlight( const TOOL_EVENT& aEvent )
}
int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
{
EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
KIGFX::VIEW_CONTROLS* controls = getViewControls();
VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
// Remove selection in favour of highlighting so the whole net is highlighted
selectionTool->ClearSelection();
highlightNet( m_toolMgr, cursorPos );
const SCH_CONNECTION* conn = m_frame->GetHighlightedConnection();
if( conn )
{
wxString netName = conn->Name( true );
if( conn->Name( true ).IsEmpty() )
{
DisplayError( m_frame, _( "Net must be labelled to assign a netclass." ) );
highlightNet( m_toolMgr, CLEAR );
return 0;
}
NET_SETTINGS& netSettings = m_frame->Schematic().Prj().GetProjectFile().NetSettings();
wxString netclassName = netSettings.m_NetClassAssignments[ netName ];
wxArrayString headers;
std::vector<wxArrayString> items;
headers.Add( _( "Netclasses" ) );
wxArrayString defaultItem;
defaultItem.Add( _( "Default" ) );
items.emplace_back( defaultItem );
for( const auto& ii : netSettings.m_NetClasses )
{
wxArrayString item;
item.Add( ii.first );
items.emplace_back( item );
}
EDA_LIST_DIALOG dlg( m_frame, _( "Assign Netclass" ), headers, items, netclassName );
dlg.SetListLabel( _( "Select netclass:" ) );
if( dlg.ShowModal() == wxID_OK )
{
netclassName = dlg.GetTextSelection();
// Remove from old netclass membership list
if( netSettings.m_NetClassAssignments.count( netName ) )
{
const wxString oldNetclassName = netSettings.m_NetClassAssignments[ netName ];
NETCLASSPTR oldNetclass = netSettings.m_NetClasses.Find( oldNetclassName );
if( oldNetclass )
oldNetclass->Remove( netName );
}
// Add to new netclass membership list
NETCLASSPTR newNetclass = netSettings.m_NetClasses.Find( netclassName );
if( newNetclass )
{
newNetclass->Add( netName );
}
netSettings.m_NetClassAssignments[ netName ] = netclassName;
netSettings.ResolveNetClassAssignments();
}
}
highlightNet( m_toolMgr, CLEAR );
return 0;
}
int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
{
SCH_SCREEN* screen = m_frame->GetCurrentSheet().LastScreen();
@ -1676,6 +1754,8 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::UpdateNetHighlighting, EE_ACTIONS::updateNetHighlighting.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ClearHighlight, ACTIONS::cancelInteractive.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::AssignNetclass, EE_ACTIONS::assignNetclass.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Undo, ACTIONS::undo.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Redo, ACTIONS::redo.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::Cut, ACTIONS::cut.MakeEvent() );

View File

@ -104,6 +104,8 @@ public:
///> Launches a tool to highlight nets.
int HighlightNetCursor( const TOOL_EVENT& aEvent );
int AssignNetclass( const TOOL_EVENT& aEvent );
int Undo( const TOOL_EVENT& aEvent );
int Redo( const TOOL_EVENT& aEvent );

View File

@ -32,7 +32,7 @@
#define DIALOG_HELPERS_H_
#include <../common/dialogs/dialog_list_selector_base.h>
#include <../common/dialogs/eda_list_dialog_base.h>
#include <common.h> // EDA_UNITS
void ConvertMarkdown2Html( const wxString& aMarkdownInput, wxString& aHtmlOutput );
@ -59,15 +59,11 @@ public:
* @param aItemHeaders an optional array containing the column header names for the dialog.
* @param aItemList = A wxArrayString of the list of elements.
* @param aRefText = An item name if an item must be preselected.
* @param aCallBackFunction = callback function to display comments
* @param aCallBackFunctionData = a pointer to pass to @a aCallBackFunction
*/
EDA_LIST_DIALOG( EDA_DRAW_FRAME* aParent, const wxString& aTitle,
const wxArrayString& aItemHeaders,
const std::vector<wxArrayString>& aItemList,
const wxString& aRefText,
void (* aCallBackFunction)( wxString& text, void* data ) = NULL,
void* aCallBackFunctionData = NULL );
const wxString& aRefText );
// ~EDA_LIST_DIALOG() {}
@ -87,16 +83,14 @@ public:
wxString GetTextSelection( int aColumn = 0 );
private:
void onListItemSelected( wxListEvent& event ) override;
void onListItemActivated( wxListEvent& event ) override;
void textChangeInFilterBox(wxCommandEvent& event) override;
void initDialog( const wxArrayString& aItemHeaders,
const wxString& aSelection);
void initDialog( const wxArrayString& aItemHeaders, const wxString& aSelection);
void sortList();
void (* m_cb_func)( wxString& text, void* data );
void* m_cb_data;
const std::vector<wxArrayString>* m_itemsListCp;
private:
const std::vector<wxArrayString>* m_itemsList;
};

View File

@ -23,13 +23,11 @@
#include <fctsys.h>
#include <kiface_i.h>
#include <pgm_base.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <3d_viewer/eda_3d_viewer.h>
#include <fp_lib_table.h>
#include <bitmaps.h>
#include <trace_helpers.h>
#include <pcbnew.h>
#include <pcbnew_id.h>
#include <drc/drc.h>
#include <pcbnew_settings.h>
@ -49,10 +47,10 @@
#include <ws_proxy_view_item.h>
#include <connectivity/connectivity_data.h>
#include <wildcards_and_files_ext.h>
#include <kicad_string.h>
#include <pcb_draw_panel_gal.h>
#include <functional>
#include <project/project_file.h>
#include <project/net_settings.h>
#include <settings/settings_manager.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
@ -650,6 +648,8 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage, const w
if( dlg.ShowQuasiModal() == wxID_OK )
{
Prj().GetProjectFile().NetSettings().ResolveNetClassAssignments();
GetBoard()->SynchronizeNetsAndNetClasses();
GetBoard()->GetDesignSettings().SetCurrentNetClass( NETCLASS::Default );
SaveProjectSettings();