Force recursing annotation when set to auto

Automatic annotation should always annotate new elements regardless of
where in the hierarchy they are

Fixes https://gitlab.com/kicad/code/kicad/issues/13378
This commit is contained in:
Seth Hillbrand 2023-01-05 13:33:19 -08:00
parent 7dfa100ff0
commit c29dfe026e
6 changed files with 14 additions and 75 deletions

View File

@ -43,7 +43,6 @@ PANEL_EESCHEMA_ANNOTATION_OPTIONS::PANEL_EESCHEMA_ANNOTATION_OPTIONS(
void PANEL_EESCHEMA_ANNOTATION_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* aCfg ) void PANEL_EESCHEMA_ANNOTATION_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* aCfg )
{ {
m_checkAutoAnnotate->SetValue( aCfg->m_AnnotatePanel.automatic ); m_checkAutoAnnotate->SetValue( aCfg->m_AnnotatePanel.automatic );
m_checkRecursive->SetValue( aCfg->m_AnnotatePanel.recursive );
switch( aCfg->m_AnnotatePanel.sort_order ) switch( aCfg->m_AnnotatePanel.sort_order )
{ {
@ -96,7 +95,6 @@ bool PANEL_EESCHEMA_ANNOTATION_OPTIONS::TransferDataFromWindow()
EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>(); EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
cfg->m_AnnotatePanel.automatic = m_checkAutoAnnotate->GetValue(); cfg->m_AnnotatePanel.automatic = m_checkAutoAnnotate->GetValue();
cfg->m_AnnotatePanel.recursive = m_checkRecursive->GetValue();
cfg->m_AnnotatePanel.sort_order = m_rbSortBy_Y_Position->GetValue() cfg->m_AnnotatePanel.sort_order = m_rbSortBy_Y_Position->GetValue()
? ANNOTATE_ORDER_T::SORT_BY_Y_POSITION ? ANNOTATE_ORDER_T::SORT_BY_Y_POSITION

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -24,10 +24,6 @@ PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE::PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE(
m_checkAutoAnnotate->SetValue(true); m_checkAutoAnnotate->SetValue(true);
sbSizerAutomatic->Add( m_checkAutoAnnotate, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5 ); sbSizerAutomatic->Add( m_checkAutoAnnotate, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5 );
m_checkRecursive = new wxCheckBox( sbSizerAutomatic->GetStaticBox(), wxID_ANY, _("Recursively annotate subsheets"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkRecursive->SetValue(true);
sbSizerAutomatic->Add( m_checkRecursive, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5 );
bLeftColumn->Add( sbSizerAutomatic, 0, wxALL|wxEXPAND, 5 ); bLeftColumn->Add( sbSizerAutomatic, 0, wxALL|wxEXPAND, 5 );

View File

@ -35,6 +35,7 @@
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="event_handler">impl_virtual</property> <property name="event_handler">impl_virtual</property>
<property name="fg"></property> <property name="fg"></property>
@ -104,6 +105,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -142,70 +144,6 @@
<property name="window_style"></property> <property name="window_style"></property>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxLEFT|wxRIGHT|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">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">Recursively annotate subsheets</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_checkRecursive</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
@ -254,6 +192,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -320,6 +259,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -388,6 +328,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -454,6 +395,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -561,6 +503,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -629,6 +572,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -697,6 +641,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
@ -765,6 +710,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -45,7 +45,6 @@ class PANEL_EESCHEMA_ANNOTATION_OPTIONS_BASE : public RESETTABLE_PANEL
protected: protected:
wxCheckBox* m_checkAutoAnnotate; wxCheckBox* m_checkAutoAnnotate;
wxCheckBox* m_checkRecursive;
wxRadioButton* m_rbSortBy_X_Position; wxRadioButton* m_rbSortBy_X_Position;
wxStaticBitmap* annotate_down_right_bitmap; wxStaticBitmap* annotate_down_right_bitmap;
wxRadioButton* m_rbSortBy_Y_Position; wxRadioButton* m_rbSortBy_Y_Position;

View File

@ -1117,7 +1117,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent )
NULL_REPORTER reporter; NULL_REPORTER reporter;
m_frame->AnnotateSymbols( ANNOTATE_SELECTION, m_frame->AnnotateSymbols( ANNOTATE_SELECTION,
(ANNOTATE_ORDER_T) annotate.sort_order, (ANNOTATE_ORDER_T) annotate.sort_order,
(ANNOTATE_ALGO_T) annotate.method, annotate.recursive, (ANNOTATE_ALGO_T) annotate.method, true /* recursive */,
annotateStartNum, false, false, reporter, appendUndo ); annotateStartNum, false, false, reporter, appendUndo );
} }

View File

@ -2043,7 +2043,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
for( SCH_SHEET_PATH& instance : pasteInstances ) for( SCH_SHEET_PATH& instance : pasteInstances )
{ {
SCH_SHEET_PATH sheetPath = updatePastedSheet( instance, clipPath, sheet, SCH_SHEET_PATH sheetPath = updatePastedSheet( instance, clipPath, sheet,
( forceKeepAnnotations && annotate.recursive ), ( forceKeepAnnotations && annotate.automatic ),
&pastedSheets[instance], &pastedSheets[instance],
&pastedSymbols[instance] ); &pastedSymbols[instance] );