From 72585460847d8eca07b5db41d82e5673dfa893f2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 11 Jun 2025 17:41:55 +0100 Subject: [PATCH 1/6] Use KiCad terminology and fix broken logic around locked footprints. (And don't show users UUIDs.) (Also fix broken logic around skipped numbers.) (Also removes nag dialog.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/19977 --- pcbnew/dialogs/dialog_board_reannotate.cpp | 322 +++++++-------------- pcbnew/dialogs/dialog_board_reannotate.h | 34 +-- 2 files changed, 119 insertions(+), 237 deletions(-) diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index f5e2fd914e..8eb65f0997 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -42,9 +42,9 @@ #include -bool SortYFirst; -bool DescendingFirst; -bool DescendingSecond; +bool g_SortYFirst; +bool g_DescendingFirst; +bool g_DescendingSecond; // // This converts the index into a sort code. Note that Back sort code will have left and @@ -77,10 +77,10 @@ int BackDirectionsArray[] = { }; #define SetSortCodes( DirArray, Code ) \ - { \ - SortYFirst = ( ( DirArray[Code] & SORTYFIRST ) != 0 ); \ - DescendingFirst = ( ( DirArray[Code] & DESCENDINGFIRST ) != 0 ); \ - DescendingSecond = ( ( DirArray[Code] & DESCENDINGSECOND ) != 0 ); \ + { \ + g_SortYFirst = ( ( DirArray[Code] & SORTYFIRST ) != 0 ); \ + g_DescendingFirst = ( ( DirArray[Code] & DESCENDINGFIRST ) != 0 ); \ + g_DescendingSecond = ( ( DirArray[Code] & DESCENDINGSECOND ) != 0 ); \ } @@ -187,21 +187,21 @@ DIALOG_BOARD_REANNOTATE::~DIALOG_BOARD_REANNOTATE() if( cfg ) { cfg->m_Reannotate.sort_on_fp_location = m_locationChoice->GetSelection() == 0; - cfg->m_Reannotate.remove_front_prefix = m_RemoveFrontPrefix->GetValue(); - cfg->m_Reannotate.remove_back_prefix = m_RemoveBackPrefix->GetValue(); - cfg->m_Reannotate.exclude_locked = m_ExcludeLocked->GetValue(); + cfg->m_Reannotate.remove_front_prefix = m_RemoveFrontPrefix->GetValue(); + cfg->m_Reannotate.remove_back_prefix = m_RemoveBackPrefix->GetValue(); + cfg->m_Reannotate.exclude_locked = m_ExcludeLocked->GetValue(); - cfg->m_Reannotate.grid_index = m_gridIndex; - cfg->m_Reannotate.sort_code = m_sortCode; - cfg->m_Reannotate.annotation_choice = m_annotationScope; - cfg->m_Reannotate.report_severity = m_severity; + cfg->m_Reannotate.grid_index = m_gridIndex; + cfg->m_Reannotate.sort_code = m_sortCode; + cfg->m_Reannotate.annotation_choice = m_annotationScope; + cfg->m_Reannotate.report_severity = m_severity; - cfg->m_Reannotate.front_refdes_start = m_FrontRefDesStart->GetValue(); - cfg->m_Reannotate.back_refdes_start = m_BackRefDesStart->GetValue(); - cfg->m_Reannotate.front_prefix = m_FrontPrefix->GetValue(); - cfg->m_Reannotate.back_prefix = m_BackPrefix->GetValue(); - cfg->m_Reannotate.exclude_list = m_ExcludeList->GetValue(); - cfg->m_Reannotate.report_file_name = m_MessageWindow->GetFileName(); + cfg->m_Reannotate.front_refdes_start = m_FrontRefDesStart->GetValue(); + cfg->m_Reannotate.back_refdes_start = m_BackRefDesStart->GetValue(); + cfg->m_Reannotate.front_prefix = m_FrontPrefix->GetValue(); + cfg->m_Reannotate.back_prefix = m_BackPrefix->GetValue(); + cfg->m_Reannotate.exclude_list = m_ExcludeList->GetValue(); + cfg->m_Reannotate.report_file_name = m_MessageWindow->GetFileName(); } } @@ -256,29 +256,22 @@ void DIALOG_BOARD_REANNOTATE::FilterPrefix( wxTextCtrl* aPrefix ) } -REFDES_TYPE_STR* DIALOG_BOARD_REANNOTATE::GetOrBuildRefDesInfo( const wxString& aRefDesPrefix, - unsigned int aStartRefDes ) +REFDES_PREFIX_INFO* DIALOG_BOARD_REANNOTATE::GetOrBuildRefDesInfo( const wxString& aRefDesPrefix, + int aStartRefDes ) { - unsigned int requiredLastRef = ( aStartRefDes == 0 ? 1 : aStartRefDes ) - 1; - - for( size_t i = 0; i < m_refDesTypes.size(); i++ ) // See if it is in the types array + for( size_t i = 0; i < m_refDesPrefixInfos.size(); i++ ) // See if it is in the info array { - if( m_refDesTypes[i].RefDesType == aRefDesPrefix ) // Found it! - { - m_refDesTypes[i].LastUsedRefDes = std::max( m_refDesTypes[i].LastUsedRefDes, - requiredLastRef ); - - return &m_refDesTypes[i]; - } + if( m_refDesPrefixInfos[i].RefDesPrefix == aRefDesPrefix ) // Found it! + return &m_refDesPrefixInfos[i]; } - // Wasn't in the types array so add it - REFDES_TYPE_STR newtype; - newtype.RefDesType = aRefDesPrefix; - newtype.LastUsedRefDes = requiredLastRef; - m_refDesTypes.push_back( newtype ); + // Wasn't in the info array so add it + REFDES_PREFIX_INFO newtype; + newtype.RefDesPrefix = aRefDesPrefix; + newtype.LastUsedRefDes = aStartRefDes - 1; + m_refDesPrefixInfos.push_back( newtype ); - return &m_refDesTypes.back(); + return &m_refDesPrefixInfos.back(); } @@ -296,8 +289,6 @@ void DIALOG_BOARD_REANNOTATE::FilterBackPrefix( wxCommandEvent& event ) void DIALOG_BOARD_REANNOTATE::OnApplyClick( wxCommandEvent& event ) { - wxString warning; - if( m_frame->GetBoard()->IsEmpty() ) { ShowReport( _( "No PCB to reannotate!" ), RPT_SEVERITY_ERROR ); @@ -305,10 +296,6 @@ void DIALOG_BOARD_REANNOTATE::OnApplyClick( wxCommandEvent& event ) } GetParameters(); // Figure out how this is to be done - MakeSampleText( warning ); - - if( !IsOK( m_frame, warning ) ) - return; if( ReannotateBoard() ) { @@ -324,81 +311,6 @@ void DIALOG_BOARD_REANNOTATE::OnApplyClick( wxCommandEvent& event ) } -void DIALOG_BOARD_REANNOTATE::MakeSampleText( wxString& aMessage ) -{ - aMessage.Printf( _( "\n%s footprints will be reannotated." ), - wxGetTranslation( AnnotateString[m_annotationScope] ) ); - - if( !m_ExcludeList->GetValue().empty() ) - { - aMessage += wxString::Format( _( "\nAny reference types %s will not be annotated." ), - m_ExcludeList->GetValue() ); - } - - if( m_ExcludeLocked->GetValue() ) - aMessage += wxString::Format( _( "\nLocked footprints will not be annotated" ) ); - - if( !m_AnnotateBack->GetValue() ) - { - aMessage += wxString::Format( _( "\nFront footprints will start at %s" ), - m_FrontRefDesStart->GetValue() ); - } - - if( !m_AnnotateFront->GetValue() ) - { - bool frontPlusOne = ( 0 == wxAtoi( m_BackRefDesStart->GetValue() ) ) - && !m_AnnotateBack->GetValue(); - - aMessage += wxString::Format( _( "\nBack footprints will start at %s." ), - frontPlusOne ? _( "the last front footprint + 1" ) : - m_BackRefDesStart->GetValue() ); - } - - if( !m_FrontPrefix->GetValue().empty() ) - { - if( m_RemoveFrontPrefix->GetValue() ) - { - aMessage += wxString::Format( _( "\nFront footprints starting with '%s' will have " - "the prefix removed." ), - m_FrontPrefix->GetValue() ); - } - else - { - aMessage += wxString::Format( _( "\nFront footprints will have '%s' inserted as a " - "prefix." ), - m_FrontPrefix->GetValue() ); - } - } - - if( !m_BackPrefix->GetValue().empty() ) - { - if( m_RemoveBackPrefix->GetValue() ) - { - aMessage += wxString::Format( _( "\nBack footprints starting with '%s' will have the " - "prefix removed." ), - m_BackPrefix->GetValue() ); - } - else - { - aMessage += wxString::Format( _( "\nBack footprints will have '%s' inserted as a " - "prefix." ), - m_BackPrefix->GetValue() ); - } - } - - bool fpLocation = m_locationChoice->GetSelection() == 0; - - aMessage += wxString::Format( _( "\nPrior to sorting by %s, the coordinates of which will be " - "rounded to a %s, %s grid." ), - fpLocation ? _( "footprint location" ) - : _( "reference designator location" ), - m_frame->MessageTextFromValue( m_sortGridx ), - m_frame->MessageTextFromValue( m_sortGridy ) ); - - ShowReport( aMessage, RPT_SEVERITY_INFO ); -} - - void DIALOG_BOARD_REANNOTATE::GetParameters() { m_sortCode = 0; // Convert radio button to sort direction code @@ -420,10 +332,10 @@ void DIALOG_BOARD_REANNOTATE::GetParameters() // Get the chosen sort grid for rounding m_gridIndex = m_GridChoice->GetSelection(); - m_sortGridx = EDA_UNIT_UTILS::UI::DoubleValueFromString( - pcbIUScale, EDA_UNITS::MILS, m_settings->m_Window.grid.grids[m_gridIndex].x ); - m_sortGridy = EDA_UNIT_UTILS::UI::DoubleValueFromString( - pcbIUScale, EDA_UNITS::MILS, m_settings->m_Window.grid.grids[m_gridIndex].y ); + m_sortGridx = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::MILS, + m_settings->m_Window.grid.grids[m_gridIndex].x ); + m_sortGridy = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::MILS, + m_settings->m_Window.grid.grids[m_gridIndex].y ); m_annotationScope = ANNOTATE_ALL; @@ -469,21 +381,21 @@ static bool ChangeArrayCompare( const REFDES_CHANGE& aA, const REFDES_CHANGE& aB /// Compare function to sort footprints. /// @return true if the first coordinate should be before the second coordinate -static bool ModuleCompare( const REFDES_INFO& aA, const REFDES_INFO& aB ) +static bool FootprintCompare( const REFDES_INFO& aA, const REFDES_INFO& aB ) { int X0 = aA.roundedx, X1 = aB.roundedx, Y0 = aA.roundedy, Y1 = aB.roundedy; - if( SortYFirst ) //If sorting by Y then X, swap X and Y + if( g_SortYFirst ) //If sorting by Y then X, swap X and Y { std::swap( X0, Y0 ); std::swap( X1, Y1 ); } // If descending, same compare just swap directions - if( DescendingFirst ) + if( g_DescendingFirst ) std::swap( X0, X1 ); - if( DescendingSecond ) + if( g_DescendingSecond ) std::swap( Y0, Y1 ); if( X0 < X1 ) @@ -512,9 +424,7 @@ void DIALOG_BOARD_REANNOTATE::ShowReport( const wxString& aMessage, SEVERITY aSe wxStringTokenizer msgs( aMessage, wxT( "\n" ) ); while( msgs.HasMoreTokens() ) - { m_MessageWindow->Report( msgs.GetNextToken(), aSeverity ); - } } @@ -523,12 +433,14 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan() int i = 1; wxString message; - message.Printf( _( "\n\nThere are %i types of reference designations\n" - "**********************************************************\n" ), - (int) m_refDesTypes.size() ); + message.Printf( _( "
There are %i reference designator prefixes in use
" + "**********************************************************
" ), + (int) m_refDesPrefixInfos.size() ); - for( REFDES_TYPE_STR Type : m_refDesTypes ) // Show all the types of refdes - message += Type.RefDesType + ( 0 == ( i++ % 16 ) ? wxT( "\n" ) : wxS( " " ) ); + for( const REFDES_PREFIX_INFO& info : m_refDesPrefixInfos ) // Show all the types of refdes + message += info.RefDesPrefix + ( ( i++ % 16 ) == 0 ? wxT( "
" ) : wxS( " " ) ); + + message += wxT( "
" ); if( !m_excludeArray.empty() ) { @@ -537,10 +449,10 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan() for( wxString& exclude : m_excludeArray ) // Show the refdes we are excluding excludes += exclude + wxS( " " ); - message += wxString::Format( _( "\nExcluding: %s from reannotation\n\n" ), excludes ); + message += wxString::Format( _( "Excluding: %s from reannotation
" ), excludes ); } - message += _( "\n Change Array\n***********************\n" ); + message += _( "
Change Array\n***********************
" ); for( const REFDES_CHANGE& change : m_changeArray ) { @@ -548,8 +460,7 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan() change.OldRefDesString, change.NewRefDes, ActionMessage[change.Action], - UPDATE_REFDES != change.Action ? _( " will be ignored" ) - : wxString( wxT( "" ) ) ); + change.Action != UPDATE_REFDES ? _( "(will be ignored)" ) : wxString( "" ) ); } ShowReport( message, RPT_SEVERITY_INFO ); @@ -562,26 +473,23 @@ void DIALOG_BOARD_REANNOTATE::LogFootprints( const wxString& aMessage, wxString message = aMessage; if( aFootprints.empty() ) - message += _( "\nNo footprints" ); + message += _( "
No footprints" ); else { int i = 1; - bool fpLocations = m_locationChoice->GetSelection() == 0; - message += wxString::Format( _( "\n*********** Sort on %s ***********" ), - fpLocations ? _( "Footprint Coordinates" ) - : _( "Reference Designator Coordinates" ) ); + if( m_locationChoice->GetSelection() == 0 ) + message += _( "
*********** Sort on Footprint Coordinates ***********" ); + else + message += _( "
*********** Sort on Reference Coordinates ***********" ); - message += wxString::Format( _( "\nSort Code %d" ), m_sortCode ); - - for( const REFDES_INFO& mod : aFootprints ) + for( const REFDES_INFO& fp : aFootprints ) { - message += wxString::Format( _( "\n%d %s UUID: [%s], X, Y: %s, Rounded X, Y, %s" ), + message += wxString::Format( _( "
%d %s X, Y: %s; rounded X, Y: %s" ), i++, - mod.RefDesString, - mod.Uuid.AsString(), - CoordTowxString( mod.x, mod.y ), - CoordTowxString( mod.roundedx, mod.roundedy ) ); + fp.RefDesString, + CoordTowxString( fp.x, fp.y ), + CoordTowxString( fp.roundedx, fp.roundedy ) ); } } @@ -592,10 +500,10 @@ void DIALOG_BOARD_REANNOTATE::LogFootprints( const wxString& aMessage, bool DIALOG_BOARD_REANNOTATE::ReannotateBoard() { std::vector BadRefDes; - wxString message, badrefdes; - STRING_FORMATTER stringformatter; + wxString message, badrefdes; + STRING_FORMATTER stringformatter; REFDES_CHANGE* newref; - NETLIST netlist; + NETLIST netlist; if( !BuildFootprintList( BadRefDes ) ) { @@ -606,14 +514,13 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard() if( !BadRefDes.empty() ) { - message.Printf( _( "\nPCB has %d empty or invalid reference designations." - "\nRecommend running DRC with 'Test for parity between PCB and " - "schematic' checked.\n" ), + message.Printf( _( "
PCB has %d empty or invalid reference designations." + "
Recommend running DRC with 'Test for parity between PCB and schematic' checked.\n" ), (int) BadRefDes.size() ); for( const REFDES_INFO& mod : BadRefDes ) { - badrefdes += wxString::Format( _( "\nRefDes: %s Footprint: %s:%s at %s on PCB." ), + badrefdes += wxString::Format( _( "
RefDes: %s Footprint: %s:%s at %s on PCB." ), mod.RefDesString, mod.FPID.GetLibNickname().wx_str(), mod.FPID.GetLibItemName().wx_str(), @@ -649,9 +556,9 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard() bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBadRefDes ) { bool annotateSelected = m_AnnotateSelection->GetValue(); - bool annotateFront = m_AnnotateFront->GetValue(); // Unless only doing back - bool annotateBack = m_AnnotateBack->GetValue(); // Unless only doing front - bool skipLocked = m_ExcludeLocked->GetValue(); + bool annotateFront = m_AnnotateFront->GetValue(); + bool annotateBack = m_AnnotateBack->GetValue(); + bool skipLocked = m_ExcludeLocked->GetValue(); int errorcount = 0; size_t firstnum = 0; @@ -661,47 +568,37 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBad m_excludeArray.clear(); m_footprints = m_frame->GetBoard()->Footprints(); - std::vector selected; - - if( annotateSelected ) - { - for( EDA_ITEM* item : m_selection ) - { - // Get the timestamps of selected footprints - if( item->Type() == PCB_FOOTPRINT_T ) - selected.push_back( item->m_Uuid ); - } - } - wxString exclude; // Break exclude list into words. for( auto thischar : m_ExcludeList->GetValue() ) { - if( ( ' ' == thischar ) || ( ',' == thischar ) ) + if( thischar == ' ' || thischar == ',' ) { m_excludeArray.push_back( exclude ); exclude.clear(); } else + { exclude += thischar; + } } if( !exclude.empty() ) // last item to exclude m_excludeArray.push_back( exclude ); REFDES_INFO fpData; - bool useModuleLocation = m_locationChoice->GetSelection() == 0; + bool useFPLocation = m_locationChoice->GetSelection() == 0; for( FOOTPRINT* footprint : m_footprints ) { fpData.Uuid = footprint->m_Uuid; fpData.RefDesString = footprint->GetReference(); fpData.FPID = footprint->GetFPID(); - fpData.x = useModuleLocation ? footprint->GetPosition().x - : footprint->Reference().GetPosition().x; - fpData.y = useModuleLocation ? footprint->GetPosition().y - : footprint->Reference().GetPosition().y; + fpData.x = useFPLocation ? footprint->GetPosition().x + : footprint->Reference().GetPosition().x; + fpData.y = useFPLocation ? footprint->GetPosition().y + : footprint->Reference().GetPosition().y; fpData.roundedx = RoundToGrid( fpData.x, m_sortGridx ); // Round to sort fpData.roundedy = RoundToGrid( fpData.y, m_sortGridy ); fpData.Front = footprint->GetLayer() == F_Cu; @@ -720,37 +617,25 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBad } // Get the type (R, C, etc) - fpData.RefDesType = fpData.RefDesString.substr( 0, firstnum ); + fpData.RefDesPrefix = fpData.RefDesString.substr( 0, firstnum ); for( const wxString& excluded : m_excludeArray ) { - if( excluded == fpData.RefDesType ) // Am I supposed to exclude this type? + if( excluded == fpData.RefDesPrefix ) // Am I supposed to exclude this type? { fpData.Action = EXCLUDE_REFDES; // Yes break; } } - if(( fpData.Front && annotateBack ) || // If a front fp and doing backs only - ( !fpData.Front && annotateFront ) || // If a back fp and doing front only - ( footprint->IsLocked() && skipLocked ) ) // If excluding locked and it is locked - { + if( footprint->IsLocked() && skipLocked ) fpData.Action = EXCLUDE_REFDES; - } - - if( annotateSelected ) - { // If only annotating selected c - fpData.Action = EXCLUDE_REFDES; // Assume it isn't selected - - for( const KIID& sel : selected ) - { - if( fpData.Uuid == sel ) - { // Found in selected footprints - fpData.Action = UPDATE_REFDES; // Update it - break; - } - } - } + else if( annotateSelected ) + fpData.Action = footprint->IsSelected() ? UPDATE_REFDES : EXCLUDE_REFDES; + else if( annotateFront ) + fpData.Action = fpData.Front ? UPDATE_REFDES : EXCLUDE_REFDES; + else if( annotateBack ) + fpData.Action = fpData.Front ? EXCLUDE_REFDES : UPDATE_REFDES; if( fpData.Front ) m_frontFootprints.push_back( fpData ); @@ -762,15 +647,15 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBad SetSortCodes( FrontDirectionsArray, m_sortCode ); // Sort the front footprints. - sort( m_frontFootprints.begin(), m_frontFootprints.end(), ModuleCompare ); + sort( m_frontFootprints.begin(), m_frontFootprints.end(), FootprintCompare ); // Determine the sort order for the back. SetSortCodes( BackDirectionsArray, m_sortCode ); // Sort the back footprints. - sort( m_backFootprints.begin(), m_backFootprints.end(), ModuleCompare ); + sort( m_backFootprints.begin(), m_backFootprints.end(), FootprintCompare ); - m_refDesTypes.clear(); + m_refDesPrefixInfos.clear(); m_changeArray.clear(); BuildUnavailableRefsList(); @@ -796,15 +681,13 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBad for( size_t i = 0; i < changearraysize; i++ ) // Scan through for duplicates if update or skip { - if( ( m_changeArray[i].Action != EMPTY_REFDES ) - && ( m_changeArray[i].Action != INVALID_REFDES ) ) + if( m_changeArray[i].Action != EMPTY_REFDES && m_changeArray[i].Action != INVALID_REFDES ) { for( size_t j = i + 1; j < changearraysize; j++ ) { if( m_changeArray[i].NewRefDes == m_changeArray[j].NewRefDes ) { - ShowReport( wxString::Format( _( "Duplicate instances of %s" ), - m_changeArray[j].NewRefDes ), + ShowReport( wxString::Format( _( "Duplicate instances of %s" ), m_changeArray[j].NewRefDes ), RPT_SEVERITY_ERROR ); if( errorcount++ > MAXERROR ) @@ -820,7 +703,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBad break; } - return ( 0 == errorcount ); + return ( errorcount == 0 ); } void DIALOG_BOARD_REANNOTATE::BuildUnavailableRefsList() @@ -843,7 +726,7 @@ void DIALOG_BOARD_REANNOTATE::BuildUnavailableRefsList() { if( fpData.Action == EXCLUDE_REFDES ) { - REFDES_TYPE_STR* refDesInfo = GetOrBuildRefDesInfo( fpData.RefDesType ); + REFDES_PREFIX_INFO* refDesInfo = GetOrBuildRefDesInfo( fpData.RefDesPrefix ); refDesInfo->UnavailableRefs.insert( UTIL::GetRefDesNumber( fpData.RefDesString ) ); } } @@ -863,17 +746,16 @@ void DIALOG_BOARD_REANNOTATE::BuildChangeArray( std::vector& aFootp bool prefixpresent; // Prefix found - wxString logstring = ( aFootprints.front().Front ) ? _( "\n\nFront Footprints" ) - : _( "\n\nBack Footprints" ); + wxString logstring = ( aFootprints.front().Front ) ? _( "

Front Footprints" ) + : _( "

Back Footprints" ); LogFootprints( logstring, aFootprints ); - if( 0 != aStartRefDes ) // Initialize the change array if present + if( aStartRefDes != 0 ) // Initialize the change array if present { - for( size_t i = 0; i < m_refDesTypes.size(); i++ ) - m_refDesTypes[i].LastUsedRefDes = aStartRefDes; + for( size_t i = 0; i < m_refDesPrefixInfos.size(); i++ ) + m_refDesPrefixInfos[i].LastUsedRefDes = aStartRefDes - 1; } - for( REFDES_INFO fpData : aFootprints ) { REFDES_CHANGE change; @@ -896,21 +778,21 @@ void DIALOG_BOARD_REANNOTATE::BuildChangeArray( std::vector& aFootp if( change.Action == UPDATE_REFDES ) { - prefixpresent = ( fpData.RefDesType.find( aPrefix ) == 0 ); + prefixpresent = ( fpData.RefDesPrefix.find( aPrefix ) == 0 ); if( addprefix && !prefixpresent ) - fpData.RefDesType.insert( 0, aPrefix ); // Add prefix once only + fpData.RefDesPrefix.insert( 0, aPrefix ); // Add prefix once only if( aRemovePrefix && prefixpresent ) // If there is a prefix remove it - fpData.RefDesType.erase( 0, prefixsize ); + fpData.RefDesPrefix.erase( 0, prefixsize ); - REFDES_TYPE_STR* refDesInfo = GetOrBuildRefDesInfo( fpData.RefDesType, aStartRefDes ); + REFDES_PREFIX_INFO* refDesInfo = GetOrBuildRefDesInfo( fpData.RefDesPrefix, aStartRefDes ); unsigned int newRefDesNumber = refDesInfo->LastUsedRefDes + 1; while( refDesInfo->UnavailableRefs.count( newRefDesNumber ) ) newRefDesNumber++; - change.NewRefDes = refDesInfo->RefDesType + std::to_string( newRefDesNumber ); + change.NewRefDes = refDesInfo->RefDesPrefix + std::to_string( newRefDesNumber ); refDesInfo->LastUsedRefDes = newRefDesNumber; } diff --git a/pcbnew/dialogs/dialog_board_reannotate.h b/pcbnew/dialogs/dialog_board_reannotate.h index abe42cabdd..f0ef61d7d3 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.h +++ b/pcbnew/dialogs/dialog_board_reannotate.h @@ -80,17 +80,17 @@ struct REFDES_INFO KIID Uuid; bool Front; // True if on the front of the board wxString RefDesString; // What its refdes is R1, C2 - wxString RefDesType; // ie R, C, etc + wxString RefDesPrefix; // ie R, C, etc int x, y; // The coordinates int roundedx, roundedy; // The coordinates after rounding. - ACTION_CODE Action; // Used to skip (if #, etc) + ACTION_CODE Action; // Used to skip (if #, etc) LIB_ID FPID; }; -struct REFDES_TYPE_STR +struct REFDES_PREFIX_INFO { - wxString RefDesType; - unsigned int LastUsedRefDes; + wxString RefDesPrefix; + unsigned int LastUsedRefDes; std::set UnavailableRefs; }; @@ -184,25 +184,25 @@ private: /// Get the structure representing the information currently held for aRefDesPrefix or create one /// if it doesn't exist - REFDES_TYPE_STR* GetOrBuildRefDesInfo( const wxString& aRefDesPrefix, unsigned int aStartRefDes = 0 ); + REFDES_PREFIX_INFO* GetOrBuildRefDesInfo( const wxString& aRefDesPrefix, int aStartRefDes = 1 ); PCB_EDIT_FRAME* m_frame; FOOTPRINTS m_footprints; PCB_SELECTION m_selection; - std::vector m_changeArray; - std::vector m_frontFootprints; - std::vector m_backFootprints; - std::vector m_refDesTypes; - std::vector m_excludeArray; + std::vector m_changeArray; + std::vector m_frontFootprints; + std::vector m_backFootprints; + std::vector m_refDesPrefixInfos; + std::vector m_excludeArray; - int m_sortCode; - int m_gridIndex; - int m_annotationScope; - int m_severity; + int m_sortCode; + int m_gridIndex; + int m_annotationScope; + int m_severity; - double m_sortGridx; - double m_sortGridy; + double m_sortGridx; + double m_sortGridy; wxString m_frontPrefixString; wxString m_backPrefixString; From de4f2dd3cbe793858301f50f166e0fac69eaa3e5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 11 Jun 2025 18:19:44 +0100 Subject: [PATCH 2/6] Remove annoying tabs in dialog. (It just makes it harder to see what's happening.) --- pcbnew/dialogs/dialog_board_reannotate.cpp | 14 +- .../dialogs/dialog_board_reannotate_base.cpp | 210 +- .../dialogs/dialog_board_reannotate_base.fbp | 5645 ++++++++--------- pcbnew/dialogs/dialog_board_reannotate_base.h | 16 +- 4 files changed, 2907 insertions(+), 2978 deletions(-) diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 8eb65f0997..cf4515925e 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -76,22 +76,14 @@ int BackDirectionsArray[] = { SORTXFIRST + ASCENDINGFIRST + DESCENDINGSECOND // "Right to left, bottom to top", // 001 }; -#define SetSortCodes( DirArray, Code ) \ - { \ - g_SortYFirst = ( ( DirArray[Code] & SORTYFIRST ) != 0 ); \ +#define SetSortCodes( DirArray, Code ) \ + { \ + g_SortYFirst = ( ( DirArray[Code] & SORTYFIRST ) != 0 ); \ g_DescendingFirst = ( ( DirArray[Code] & DESCENDINGFIRST ) != 0 ); \ g_DescendingSecond = ( ( DirArray[Code] & DESCENDINGSECOND ) != 0 ); \ } -wxString AnnotateString[] = { - _( "All" ), // ANNOTATE_ALL - _( "Only front" ), // AnnotateFront - _( "Only back" ), // AnnotateBack - _( "Only selected" ) // ANNOTATE_SELECTED -}; - - wxString ActionMessage[] = { "", // UPDATE_REFDES _( "Empty" ), // EMPTY_REFDES diff --git a/pcbnew/dialogs/dialog_board_reannotate_base.cpp b/pcbnew/dialogs/dialog_board_reannotate_base.cpp index 5b4bf49f5b..eac65a678d 100644 --- a/pcbnew/dialogs/dialog_board_reannotate_base.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate_base.cpp @@ -18,292 +18,286 @@ DIALOG_BOARD_REANNOTATE_BASE::DIALOG_BOARD_REANNOTATE_BASE( wxWindow* parent, wx wxBoxSizer* bmainSizer; bmainSizer = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bupperSizer; - bupperSizer = new wxBoxSizer( wxVERTICAL ); - - m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_StandardOptions = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxTAB_TRAVERSAL ); wxBoxSizer* bSizerOpts; bSizerOpts = new wxBoxSizer( wxVERTICAL ); wxStaticText* stOrderLabel; - stOrderLabel = new wxStaticText( m_StandardOptions, wxID_ANY, _("Footprint Order"), wxDefaultPosition, wxDefaultSize, 0 ); + stOrderLabel = new wxStaticText( this, wxID_ANY, _("Footprint Order"), wxDefaultPosition, wxDefaultSize, 0 ); stOrderLabel->Wrap( -1 ); - bSizerOpts->Add( stOrderLabel, 0, wxRIGHT|wxLEFT, 5 ); + bSizerOpts->Add( stOrderLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); - m_staticline1 = new wxStaticLine( m_StandardOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerOpts->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 8 ); + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerOpts->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); wxFlexGridSizer* fgSizerButtons; - fgSizerButtons = new wxFlexGridSizer( 2, 11, 0, 0 ); + fgSizerButtons = new wxFlexGridSizer( 2, 23, 0, 0 ); fgSizerButtons->AddGrowableCol( 2 ); fgSizerButtons->AddGrowableCol( 5 ); fgSizerButtons->AddGrowableCol( 8 ); + fgSizerButtons->AddGrowableCol( 11 ); + fgSizerButtons->AddGrowableCol( 14 ); + fgSizerButtons->AddGrowableCol( 17 ); + fgSizerButtons->AddGrowableCol( 20 ); fgSizerButtons->SetFlexibleDirection( wxBOTH ); fgSizerButtons->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_Down_Right = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_Down_Right = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_Down_Right->SetValue( true ); - fgSizerButtons->Add( m_Down_Right, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + fgSizerButtons->Add( m_Down_Right, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); - reannotate_down_right_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + reannotate_down_right_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_down_right_bitmap->SetToolTip( _("Horizontally: top left to bottom right") ); fgSizerButtons->Add( reannotate_down_right_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizerButtons->Add( 20, 0, 1, wxEXPAND, 5 ); + fgSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); - m_Right_Down = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerButtons->Add( m_Right_Down, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_Right_Down = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerButtons->Add( m_Right_Down, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - reannotate_right_down_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + reannotate_right_down_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_right_down_bitmap->SetToolTip( _("Horizontally: top right to bottom left") ); fgSizerButtons->Add( reannotate_right_down_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizerButtons->Add( 20, 0, 1, wxEXPAND, 5 ); + fgSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); - m_Down_Left = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerButtons->Add( m_Down_Left, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_Down_Left = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerButtons->Add( m_Down_Left, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - reannotate_down_left_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + reannotate_down_left_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_down_left_bitmap->SetToolTip( _("Horizontally: bottom left to top right") ); fgSizerButtons->Add( reannotate_down_left_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizerButtons->Add( 20, 0, 1, wxEXPAND, 5 ); + fgSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); - m_Left_Down = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerButtons->Add( m_Left_Down, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_Left_Down = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerButtons->Add( m_Left_Down, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - reannotate_left_down_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + reannotate_left_down_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_left_down_bitmap->SetToolTip( _("Horizontally:: bottom right to top left") ); fgSizerButtons->Add( reannotate_left_down_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_Up_Right = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerButtons->Add( m_Up_Right, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - reannotate_up_right_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + fgSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); + + m_Up_Right = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerButtons->Add( m_Up_Right, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + reannotate_up_right_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_up_right_bitmap->SetToolTip( _("Vertically: top left to bottom right") ); fgSizerButtons->Add( reannotate_up_right_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizerButtons->Add( 20, 0, 1, wxEXPAND, 5 ); + fgSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); - m_Right_Up = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerButtons->Add( m_Right_Up, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_Right_Up = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerButtons->Add( m_Right_Up, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - reannotate_right_up_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + reannotate_right_up_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_right_up_bitmap->SetToolTip( _("Vertically: bottom left to top right") ); fgSizerButtons->Add( reannotate_right_up_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizerButtons->Add( 20, 0, 1, wxEXPAND, 5 ); + fgSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); - m_Up_Left = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerButtons->Add( m_Up_Left, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_Up_Left = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerButtons->Add( m_Up_Left, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - reannotate_up_left_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + reannotate_up_left_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_up_left_bitmap->SetToolTip( _("Vertically: top right to bottom left") ); fgSizerButtons->Add( reannotate_up_left_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizerButtons->Add( 20, 0, 1, wxEXPAND, 5 ); + fgSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); - m_Left_Up = new wxRadioButton( m_StandardOptions, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizerButtons->Add( m_Left_Up, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_Left_Up = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerButtons->Add( m_Left_Up, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - reannotate_left_up_bitmap = new wxStaticBitmap( m_StandardOptions, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + reannotate_left_up_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); reannotate_left_up_bitmap->SetToolTip( _("Vertically: bottom right to top left") ); fgSizerButtons->Add( reannotate_left_up_bitmap, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizerOpts->Add( fgSizerButtons, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 ); + bSizerOpts->Add( fgSizerButtons, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 ); wxFlexGridSizer* fgSizerLocations; - fgSizerLocations = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizerLocations->AddGrowableCol( 1 ); + fgSizerLocations = new wxFlexGridSizer( 0, 4, 0, 0 ); fgSizerLocations->SetFlexibleDirection( wxBOTH ); fgSizerLocations->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticText9 = new wxStaticText( m_StandardOptions, wxID_ANY, _("Based on location of:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9 = new wxStaticText( this, wxID_ANY, _("Based on location of:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText9->Wrap( -1 ); - fgSizerLocations->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + fgSizerLocations->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxString m_locationChoiceChoices[] = { _("Footprint"), _("Reference Designator") }; + wxString m_locationChoiceChoices[] = { _("Footprint"), _("Reference") }; int m_locationChoiceNChoices = sizeof( m_locationChoiceChoices ) / sizeof( wxString ); - m_locationChoice = new wxChoice( m_StandardOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_locationChoiceNChoices, m_locationChoiceChoices, 0 ); + m_locationChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_locationChoiceNChoices, m_locationChoiceChoices, 0 ); m_locationChoice->SetSelection( 0 ); - fgSizerLocations->Add( m_locationChoice, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + fgSizerLocations->Add( m_locationChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - m_SortGridText = new wxStaticText( m_StandardOptions, wxID_ANY, _("Round locations to:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SortGridText = new wxStaticText( this, wxID_ANY, _("Round locations to:"), wxDefaultPosition, wxDefaultSize, 0 ); m_SortGridText->Wrap( -1 ); m_SortGridText->SetToolTip( _("Component position will be rounded\nto this grid before sorting.\nThis helps with misaligned parts.") ); - fgSizerLocations->Add( m_SortGridText, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + fgSizerLocations->Add( m_SortGridText, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 25 ); wxArrayString m_GridChoiceChoices; - m_GridChoice = new wxChoice( m_StandardOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_GridChoiceChoices, 0 ); + m_GridChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_GridChoiceChoices, 0 ); m_GridChoice->SetSelection( 0 ); m_GridChoice->SetToolTip( _("Component position will be rounded\nto this grid before sorting.\nThis helps with misaligned parts.") ); - m_GridChoice->SetMinSize( wxSize( 150,-1 ) ); - fgSizerLocations->Add( m_GridChoice, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 ); + fgSizerLocations->Add( m_GridChoice, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); bSizerOpts->Add( fgSizerLocations, 0, wxEXPAND|wxALL, 10 ); wxStaticText* stScopeLabel; - stScopeLabel = new wxStaticText( m_StandardOptions, wxID_ANY, _("Reannotation Scope"), wxDefaultPosition, wxDefaultSize, 0 ); + stScopeLabel = new wxStaticText( this, wxID_ANY, _("Reannotation Scope"), wxDefaultPosition, wxDefaultSize, 0 ); stScopeLabel->Wrap( -1 ); - bSizerOpts->Add( stScopeLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizerOpts->Add( stScopeLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); - m_staticline2 = new wxStaticLine( m_StandardOptions, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerOpts->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 8 ); + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerOpts->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); wxFlexGridSizer* fgSizer6111; fgSizer6111 = new wxFlexGridSizer( 0, 5, 0, 0 ); fgSizer6111->SetFlexibleDirection( wxVERTICAL ); fgSizer6111->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_NONE ); - m_AnnotateAll = new wxRadioButton( m_StandardOptions, wxID_ANY, _("All"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_AnnotateAll = new wxRadioButton( this, wxID_ANY, _("All"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_AnnotateAll->SetValue( true ); fgSizer6111->Add( m_AnnotateAll, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_AnnotateFront = new wxRadioButton( m_StandardOptions, wxID_ANY, _("Front"), wxDefaultPosition, wxDefaultSize, 0 ); + m_AnnotateFront = new wxRadioButton( this, wxID_ANY, _("Front"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer6111->Add( m_AnnotateFront, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_AnnotateBack = new wxRadioButton( m_StandardOptions, wxID_ANY, _("Back"), wxDefaultPosition, wxDefaultSize, 0 ); + m_AnnotateBack = new wxRadioButton( this, wxID_ANY, _("Back"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer6111->Add( m_AnnotateBack, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_AnnotateSelection = new wxRadioButton( m_StandardOptions, wxID_ANY, _("Selection"), wxDefaultPosition, wxDefaultSize, 0 ); + m_AnnotateSelection = new wxRadioButton( this, wxID_ANY, _("Selection"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer6111->Add( m_AnnotateSelection, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - bSizerOpts->Add( fgSizer6111, 0, wxBOTTOM|wxLEFT|wxEXPAND, 10 ); + bSizerOpts->Add( fgSizer6111, 0, wxBOTTOM|wxLEFT, 5 ); + + m_ExcludeLocked = new wxCheckBox( this, wxID_ANY, _("Exclude locked footprints"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ExcludeLocked->SetToolTip( _("Locked footprints will not be reannotated") ); + + bSizerOpts->Add( m_ExcludeLocked, 0, wxTOP|wxRIGHT|wxLEFT, 10 ); + + wxBoxSizer* bSizerExclusions; + bSizerExclusions = new wxBoxSizer( wxHORIZONTAL ); + + m_ExcludeListText = new wxStaticText( this, wxID_ANY, _("Exclude references:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ExcludeListText->Wrap( -1 ); + m_ExcludeListText->SetToolTip( _("Do not re-annotate this type \nof reference (R means R*)") ); + + bSizerExclusions->Add( m_ExcludeListText, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_ExcludeList = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerExclusions->Add( m_ExcludeList, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_StandardOptions->SetSizer( bSizerOpts ); - m_StandardOptions->Layout(); - bSizerOpts->Fit( m_StandardOptions ); - m_notebook->AddPage( m_StandardOptions, _("Options"), true ); - m_Advanced = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizerDesignatorOpts; - bSizerDesignatorOpts = new wxBoxSizer( wxHORIZONTAL ); + bSizerOpts->Add( bSizerExclusions, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_staticText10 = new wxStaticText( this, wxID_ANY, _("Reference Designators"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText10->Wrap( -1 ); + bSizerOpts->Add( m_staticText10, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerOpts->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 2 ); wxGridBagSizer* gbSizer1; gbSizer1 = new wxGridBagSizer( 0, 0 ); gbSizer1->SetFlexibleDirection( wxBOTH ); gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - gbSizer1->SetEmptyCellSize( wxSize( 20,10 ) ); + gbSizer1->SetEmptyCellSize( wxSize( 40,10 ) ); - m_FrontRefDesStartText = new wxStaticText( m_Advanced, wxID_ANY, _("Front reference start:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_FrontRefDesStartText = new wxStaticText( this, wxID_ANY, _("Front reference start:"), wxDefaultPosition, wxDefaultSize, 0 ); m_FrontRefDesStartText->Wrap( -1 ); m_FrontRefDesStartText->SetToolTip( _("Starting reference designation for front.") ); gbSizer1->Add( m_FrontRefDesStartText, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_FrontRefDesStart = new wxTextCtrl( m_Advanced, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); + m_FrontRefDesStart = new wxTextCtrl( this, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 ); m_FrontRefDesStart->SetToolTip( _("Default is 1") ); m_FrontRefDesStart->SetMinSize( wxSize( 100,-1 ) ); gbSizer1->Add( m_FrontRefDesStart, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 ); - m_BottomRefDesStartText = new wxStaticText( m_Advanced, wxID_ANY, _("Back reference start:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_BottomRefDesStartText = new wxStaticText( this, wxID_ANY, _("Back reference start:"), wxDefaultPosition, wxDefaultSize, 0 ); m_BottomRefDesStartText->Wrap( -1 ); m_BottomRefDesStartText->SetToolTip( _("Blank continues from front or enter a number greater than the highest reference designation on the front.") ); gbSizer1->Add( m_BottomRefDesStartText, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_BackRefDesStart = new wxTextCtrl( m_Advanced, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_BackRefDesStart = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_BackRefDesStart->SetToolTip( _("Leave blank or zero, or enter a number greater than the highest reference designation on the front.") ); m_BackRefDesStart->SetMinSize( wxSize( 100,-1 ) ); gbSizer1->Add( m_BackRefDesStart, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 ); - m_FrontPrefixText = new wxStaticText( m_Advanced, wxID_ANY, _("Front prefix:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_FrontPrefixText = new wxStaticText( this, wxID_ANY, _("Front prefix:"), wxDefaultPosition, wxDefaultSize, 0 ); m_FrontPrefixText->Wrap( -1 ); m_FrontPrefixText->SetToolTip( _("Optional prefix for component side reference designations (e.g. F_)") ); gbSizer1->Add( m_FrontPrefixText, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - m_FrontPrefix = new wxTextCtrl( m_Advanced, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_FrontPrefix = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_FrontPrefix->SetToolTip( _("Optional prefix for component side reference designations (e.g. F_)") ); gbSizer1->Add( m_FrontPrefix, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_BackPrefixText = new wxStaticText( m_Advanced, wxID_ANY, _("Back prefix:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_BackPrefixText = new wxStaticText( this, wxID_ANY, _("Back prefix:"), wxDefaultPosition, wxDefaultSize, 0 ); m_BackPrefixText->Wrap( -1 ); m_BackPrefixText->SetToolTip( _("Optional prefix for solder side reference designations (e.g. B_)") ); gbSizer1->Add( m_BackPrefixText, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - m_BackPrefix = new wxTextCtrl( m_Advanced, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_BackPrefix = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_BackPrefix->SetToolTip( _("Optional prefix for solder side reference designations (e.g. B_)") ); gbSizer1->Add( m_BackPrefix, wxGBPosition( 1, 4 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_RemoveFrontPrefix = new wxCheckBox( m_Advanced, wxID_ANY, _("Remove front prefix"), wxDefaultPosition, wxDefaultSize, 0 ); + m_RemoveFrontPrefix = new wxCheckBox( this, wxID_ANY, _("Remove front prefix"), wxDefaultPosition, wxDefaultSize, 0 ); m_RemoveFrontPrefix->SetToolTip( _("If checked will remove the front side prefix\nin the front prefix box if present") ); gbSizer1->Add( m_RemoveFrontPrefix, wxGBPosition( 2, 0 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_RemoveBackPrefix = new wxCheckBox( m_Advanced, wxID_ANY, _("Remove back prefix"), wxDefaultPosition, wxDefaultSize, 0 ); + m_RemoveBackPrefix = new wxCheckBox( this, wxID_ANY, _("Remove back prefix"), wxDefaultPosition, wxDefaultSize, 0 ); m_RemoveBackPrefix->SetToolTip( _("If checked will remove the Back side prefix\nin the back prefix box if present") ); gbSizer1->Add( m_RemoveBackPrefix, wxGBPosition( 2, 3 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_ExcludeLocked = new wxCheckBox( m_Advanced, wxID_ANY, _("Exclude locked footprints"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ExcludeLocked->SetToolTip( _("Locked footprints will not be reannotated") ); - - gbSizer1->Add( m_ExcludeLocked, wxGBPosition( 5, 0 ), wxGBSpan( 1, 5 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); - - m_ExcludeListText = new wxStaticText( m_Advanced, wxID_ANY, _("Exclude references:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ExcludeListText->Wrap( -1 ); - m_ExcludeListText->SetToolTip( _("Do not re-annotate this type \nof reference (R means R*)") ); - - gbSizer1->Add( m_ExcludeListText, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_ExcludeList = new wxTextCtrl( m_Advanced, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_ExcludeList, wxGBPosition( 6, 1 ), wxGBSpan( 1, 4 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - gbSizer1->AddGrowableCol( 1 ); - gbSizer1->AddGrowableCol( 2 ); - gbSizer1->AddGrowableCol( 3 ); gbSizer1->AddGrowableCol( 4 ); - bSizerDesignatorOpts->Add( gbSizer1, 1, wxALL|wxEXPAND, 5 ); + bSizerOpts->Add( gbSizer1, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_Advanced->SetSizer( bSizerDesignatorOpts ); - m_Advanced->Layout(); - bSizerDesignatorOpts->Fit( m_Advanced ); - m_notebook->AddPage( m_Advanced, _("Reference Designators"), false ); - - bupperSizer->Add( m_notebook, 0, wxALL|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + bmainSizer->Add( bSizerOpts, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizerMessages; bSizerMessages = new wxBoxSizer( wxVERTICAL ); m_MessageWindow = new WX_HTML_REPORT_PANEL( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_MessageWindow->SetMinSize( wxSize( -1,150 ) ); + m_MessageWindow->SetMinSize( wxSize( -1,300 ) ); bSizerMessages->Add( m_MessageWindow, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 ); - bupperSizer->Add( bSizerMessages, 1, wxEXPAND|wxTOP, 15 ); - - - bmainSizer->Add( bupperSizer, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 6 ); + bmainSizer->Add( bSizerMessages, 1, wxEXPAND|wxTOP, 15 ); wxBoxSizer* m_buttonsSizer; m_buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); diff --git a/pcbnew/dialogs/dialog_board_reannotate_base.fbp b/pcbnew/dialogs/dialog_board_reannotate_base.fbp index 2aeed17dab..24305074b5 100644 --- a/pcbnew/dialogs/dialog_board_reannotate_base.fbp +++ b/pcbnew/dialogs/dialog_board_reannotate_base.fbp @@ -66,19 +66,81 @@ wxVERTICAL none - 6 - wxEXPAND|wxTOP|wxRIGHT|wxLEFT - 1 + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 - bupperSizer + bSizerOpts wxVERTICAL none - 5 - wxALL|wxEXPAND|wxLEFT|wxRIGHT + 13 + wxTOP|wxRIGHT|wxLEFT 0 - + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Footprint Order + 0 + + 0 + + + 0 + + 1 + stOrderLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 2 + wxEXPAND|wxTOP|wxBOTTOM + 0 + 1 1 1 @@ -89,7 +151,6 @@ 0 - 1 0 @@ -115,7 +176,7 @@ 0 1 - m_notebook + m_staticline1 1 @@ -125,1944 +186,36 @@ Resizable 1 - + wxLI_HORIZONTAL ; ; forward_declare 0 - - - Options - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - - 0 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - -1,-1 - - 0 - -1,-1 - 1 - m_StandardOptions - 1 - - - protected - 0 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - - - - wxTAB_TRAVERSAL - - - bSizerOpts - wxVERTICAL - none - - 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Footprint Order - 0 - - 0 - - - 0 - - 1 - stOrderLabel - 1 - - - none - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 8 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 10 - wxEXPAND|wxRIGHT|wxLEFT - 1 - - 11 - wxBOTH - 2,5,8 - - 0 - - fgSizerButtons - wxFLEX_GROWMODE_SPECIFIED - none - 2 - 0 - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Down_Right - 1 - - - protected - 1 - - Resizable - 1 - - wxRB_GROUP - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_down_right_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Horizontally: top left to bottom right - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 20 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Right_Down - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_right_down_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Horizontally: top right to bottom left - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 20 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Down_Left - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_down_left_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Horizontally: bottom left to top right - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 20 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Left_Down - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_left_down_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Horizontally:: bottom right to top left - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Up_Right - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_up_right_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Vertically: top left to bottom right - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 20 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Right_Up - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_right_up_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Vertically: bottom left to top right - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 20 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Up_Left - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_up_left_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Vertically: top right to bottom left - - - - - - - 5 - wxEXPAND - 1 - - 0 - protected - 20 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - m_Left_Up - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - reannotate_left_up_bitmap - 1 - - - protected - 1 - - Resizable - 1 - -1,-1 - ; ; forward_declare - 0 - Vertically: bottom right to top left - - - - - - - - - 10 - wxEXPAND|wxALL - 0 - - 2 - wxBOTH - 1 - - 0 - - fgSizerLocations - wxFLEX_GROWMODE_SPECIFIED - none - 0 - 0 - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Based on location of: - 0 - - 0 - - - 0 - - 1 - m_staticText9 - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 5 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - "Footprint" "Reference Designator" - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_locationChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Round locations to: - 0 - - 0 - - - 0 - - 1 - m_SortGridText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Component position will be rounded to this grid before sorting. This helps with misaligned parts. - - - - -1 - - - - 5 - wxEXPAND|wxBOTTOM|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - 150,-1 - 1 - m_GridChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - ; ; forward_declare - 0 - Component position will be rounded to this grid before sorting. This helps with misaligned parts. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Reannotation Scope - 0 - - 0 - - - 0 - - 1 - stScopeLabel - 1 - - - none - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - - - -1 - - - - 8 - wxEXPAND|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline2 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_HORIZONTAL - ; ; forward_declare - 0 - - - - - - - - 10 - wxBOTTOM|wxLEFT|wxEXPAND - 0 - - 5 - wxVERTICAL - - - 0 - -1,-1 - fgSizer6111 - wxFLEX_GROWMODE_NONE - none - 0 - 0 - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - All - - 0 - - - 0 - - 1 - m_AnnotateAll - 1 - - - protected - 1 - - Resizable - 1 - - wxRB_GROUP - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 1 - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Front - - 0 - - - 0 - - 1 - m_AnnotateFront - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Back - - 0 - - - 0 - - 1 - m_AnnotateBack - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Selection - - 0 - - - 0 - - 1 - m_AnnotateSelection - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - 0 - - - - - - - - - - - - - Reference Designators - 0 - + + + + 10 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 23 + wxBOTH + 2,5,8,11,14,17,20 + + 0 + + fgSizerButtons + wxFLEX_GROWMODE_SPECIFIED + none + 2 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM + 0 + 1 1 1 @@ -2078,7 +231,73 @@ 0 1 - 0 + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Down_Right + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 0 Dock 0 @@ -2098,7 +317,76 @@ 0 1 - m_Advanced + reannotate_down_right_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Horizontally: top left to bottom right + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Right_Down 1 @@ -2108,924 +396,1697 @@ Resizable 1 + ; ; forward_declare 0 + + wxFILTER_NONE + wxDefaultValidator + + 0 - wxTAB_TRAVERSAL - - - bSizerDesignatorOpts - wxHORIZONTAL - none - - 5 - wxALL|wxEXPAND - 1 - - 20,10 - wxBOTH - 1,2,3,4 - - 0 - - gbSizer1 - wxFLEX_GROWMODE_SPECIFIED - none - 0 - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT - 0 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Front reference start: - 0 - - 0 - - - 0 - - 1 - m_FrontRefDesStartText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Starting reference designation for front. - - - - -1 - - - - 5 - 1 - 1 - wxALL|wxEXPAND - 0 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - 100,-1 - 1 - m_FrontRefDesStart - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Default is 1 - - wxFILTER_NUMERIC - wxDefaultValidator - - 1 - - - - - - - 5 - 1 - 3 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT - 0 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Back reference start: - 0 - - 0 - - - 0 - - 1 - m_BottomRefDesStartText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Blank continues from front or enter a number greater than the highest reference designation on the front. - - - - -1 - - - - 5 - 1 - 4 - wxALL|wxEXPAND - 0 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - 100,-1 - 1 - m_BackRefDesStart - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Leave blank or zero, or enter a number greater than the highest reference designation on the front. - - wxFILTER_NUMERIC - wxGenericValidator - - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT - 1 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Front prefix: - 0 - - 0 - - - 0 - - 1 - m_FrontPrefixText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Optional prefix for component side reference designations (e.g. F_) - - - - -1 - - - - 5 - 1 - 1 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_FrontPrefix - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Optional prefix for component side reference designations (e.g. F_) - - wxFILTER_ALPHA - wxGenericValidator - - - - - - FilterFrontPrefix - - - - 5 - 1 - 3 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT - 1 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Back prefix: - 0 - - 0 - - - 0 - - 1 - m_BackPrefixText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Optional prefix for solder side reference designations (e.g. B_) - - - - -1 - - - - 5 - 1 - 4 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_BackPrefix - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Optional prefix for solder side reference designations (e.g. B_) - - wxFILTER_ALPHA|wxFILTER_NONE - wxGenericValidator - - - - - - FilterBackPrefix - - - - 5 - 2 - 0 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 2 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Remove front prefix - - 0 - - - 0 - - 1 - m_RemoveFrontPrefix - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - If checked will remove the front side prefix in the front prefix box if present - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 2 - 3 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 2 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Remove back prefix - - 0 - - - 0 - - 1 - m_RemoveBackPrefix - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - If checked will remove the Back side prefix in the back prefix box if present - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 5 - 0 - wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL - 5 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Exclude locked footprints - - 0 - - - 0 - - 1 - m_ExcludeLocked - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Locked footprints will not be reannotated - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - 1 - 0 - wxALIGN_CENTER_VERTICAL|wxALL - 6 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - Exclude references: - 0 - - 0 - - - 0 - -1,-1 - 1 - m_ExcludeListText - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - Do not re-annotate this type of reference (R means R*) - - - - -1 - - - - 5 - 4 - 1 - wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL - 6 - 1 - - 1 - 1 - 1 - 1 - 0 - - 0 - 0 - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 0 - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - -1,-1 - 1 - m_ExcludeList - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_ALPHA - wxDefaultValidator - - - - - - - - - - + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + reannotate_right_down_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Horizontally: top right to bottom left + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Down_Left + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + reannotate_down_left_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Horizontally: bottom left to top right + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Left_Down + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + reannotate_left_down_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Horizontally:: bottom right to top left + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Up_Right + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + reannotate_up_right_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Vertically: top left to bottom right + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Right_Up + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + reannotate_right_up_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Vertically: bottom left to top right + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Up_Left + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + reannotate_up_left_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Vertically: top right to bottom left + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 10 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + + 0 + + + 0 + + 1 + m_Left_Up + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + reannotate_left_up_bitmap + 1 + + + protected + 1 + + Resizable + 1 + -1,-1 + ; ; forward_declare + 0 + Vertically: bottom right to top left + + + - 15 - wxEXPAND|wxTOP - 1 - + 10 + wxEXPAND|wxALL + 0 + + 4 + wxBOTH + + + 0 - bSizerMessages - wxVERTICAL + fgSizerLocations + wxFLEX_GROWMODE_SPECIFIED none + 0 + 0 5 - wxEXPAND|wxLEFT|wxRIGHT + wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Based on location of: + 0 + + 0 + + + 0 + + 1 + m_staticText9 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + "Footprint" "Reference" + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_locationChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 25 + wxALIGN_CENTER_VERTICAL|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Round locations to: + 0 + + 0 + + + 0 + + 1 + m_SortGridText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Component position will be rounded to this grid before sorting. This helps with misaligned parts. + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,-1 + 1 + m_GridChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + Component position will be rounded to this grid before sorting. This helps with misaligned parts. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + 13 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Reannotation Scope + 0 + + 0 + + + 0 + + 1 + stScopeLabel + 1 + + + none + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 2 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline2 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxBOTTOM|wxLEFT + 0 + + 5 + wxVERTICAL + + + 0 + -1,-1 + fgSizer6111 + wxFLEX_GROWMODE_NONE + none + 0 + 0 + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + All + + 0 + + + 0 + + 1 + m_AnnotateAll + 1 + + + protected + 1 + + Resizable + 1 + + wxRB_GROUP + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 1 + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Front + + 0 + + + 0 + + 1 + m_AnnotateFront + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Back + + 0 + + + 0 + + 1 + m_AnnotateBack + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + 5 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Selection + + 0 + + + 0 + + 1 + m_AnnotateSelection + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + + + + + + + + 10 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Exclude locked footprints + + 0 + + + 0 + + 1 + m_ExcludeLocked + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Locked footprints will not be reannotated + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + + bSizerExclusions + wxHORIZONTAL + none + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Exclude references: + 0 + + 0 + + + 0 + -1,-1 + 1 + m_ExcludeListText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Do not re-annotate this type of reference (R means R*) + + + + -1 + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL 1 - + 1 1 1 @@ -3057,11 +2118,12 @@ 0 + 0 0 - -1,150 + -1,-1 1 - m_MessageWindow + m_ExcludeList 1 @@ -3071,16 +2133,899 @@ Resizable 1 - WX_HTML_REPORT_PANEL; widgets/wx_html_report_panel.h; forward_declare + + ; ; forward_declare 0 + + wxFILTER_ALPHA + wxDefaultValidator + + - wxTAB_TRAVERSAL + + + 13 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Reference Designators + 0 + + 0 + + + 0 + + 1 + m_staticText10 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 2 + wxEXPAND|wxTOP|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline3 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + 40,10 + wxBOTH + 1,4 + + 0 + + gbSizer1 + wxFLEX_GROWMODE_SPECIFIED + none + 0 + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Front reference start: + 0 + + 0 + + + 0 + + 1 + m_FrontRefDesStartText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Starting reference designation for front. + + + + -1 + + + + 5 + 1 + 1 + wxALL|wxEXPAND + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 100,-1 + 1 + m_FrontRefDesStart + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Default is 1 + + wxFILTER_NUMERIC + wxDefaultValidator + + 1 + + + + + + + 5 + 1 + 3 + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Back reference start: + 0 + + 0 + + + 0 + + 1 + m_BottomRefDesStartText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Blank continues from front or enter a number greater than the highest reference designation on the front. + + + + -1 + + + + 5 + 1 + 4 + wxALL|wxEXPAND + 0 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + 100,-1 + 1 + m_BackRefDesStart + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Leave blank or zero, or enter a number greater than the highest reference designation on the front. + + wxFILTER_NUMERIC + wxGenericValidator + + + + + + + + + 5 + 1 + 0 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 1 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Front prefix: + 0 + + 0 + + + 0 + + 1 + m_FrontPrefixText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Optional prefix for component side reference designations (e.g. F_) + + + + -1 + + + + 5 + 1 + 1 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_FrontPrefix + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Optional prefix for component side reference designations (e.g. F_) + + wxFILTER_ALPHA + wxGenericValidator + + + + + + FilterFrontPrefix + + + + 5 + 1 + 3 + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT + 1 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Back prefix: + 0 + + 0 + + + 0 + + 1 + m_BackPrefixText + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Optional prefix for solder side reference designations (e.g. B_) + + + + -1 + + + + 5 + 1 + 4 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_BackPrefix + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Optional prefix for solder side reference designations (e.g. B_) + + wxFILTER_ALPHA|wxFILTER_NONE + wxGenericValidator + + + + + + FilterBackPrefix + + + + 5 + 2 + 0 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Remove front prefix + + 0 + + + 0 + + 1 + m_RemoveFrontPrefix + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + If checked will remove the front side prefix in the front prefix box if present + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + 2 + 3 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 2 + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Remove back prefix + + 0 + + + 0 + + 1 + m_RemoveBackPrefix + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + If checked will remove the Back side prefix in the back prefix box if present + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + 15 + wxEXPAND|wxTOP + 1 + + + bSizerMessages + wxVERTICAL + none + + 5 + wxEXPAND|wxLEFT|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,300 + 1 + m_MessageWindow + 1 + + + protected + 1 + + Resizable + 1 + + WX_HTML_REPORT_PANEL; widgets/wx_html_report_panel.h; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + diff --git a/pcbnew/dialogs/dialog_board_reannotate_base.h b/pcbnew/dialogs/dialog_board_reannotate_base.h index a3a9de73cd..6fd8f4bb4e 100644 --- a/pcbnew/dialogs/dialog_board_reannotate_base.h +++ b/pcbnew/dialogs/dialog_board_reannotate_base.h @@ -27,12 +27,11 @@ class WX_HTML_REPORT_PANEL; #include #include #include -#include +#include #include #include -#include #include -#include +#include #include #include @@ -46,8 +45,6 @@ class DIALOG_BOARD_REANNOTATE_BASE : public DIALOG_SHIM private: protected: - wxNotebook* m_notebook; - wxPanel* m_StandardOptions; wxStaticLine* m_staticline1; wxRadioButton* m_Down_Right; wxStaticBitmap* reannotate_down_right_bitmap; @@ -74,7 +71,11 @@ class DIALOG_BOARD_REANNOTATE_BASE : public DIALOG_SHIM wxRadioButton* m_AnnotateFront; wxRadioButton* m_AnnotateBack; wxRadioButton* m_AnnotateSelection; - wxPanel* m_Advanced; + wxCheckBox* m_ExcludeLocked; + wxStaticText* m_ExcludeListText; + wxTextCtrl* m_ExcludeList; + wxStaticText* m_staticText10; + wxStaticLine* m_staticline3; wxStaticText* m_FrontRefDesStartText; wxTextCtrl* m_FrontRefDesStart; wxStaticText* m_BottomRefDesStartText; @@ -85,9 +86,6 @@ class DIALOG_BOARD_REANNOTATE_BASE : public DIALOG_SHIM wxTextCtrl* m_BackPrefix; wxCheckBox* m_RemoveFrontPrefix; wxCheckBox* m_RemoveBackPrefix; - wxCheckBox* m_ExcludeLocked; - wxStaticText* m_ExcludeListText; - wxTextCtrl* m_ExcludeList; WX_HTML_REPORT_PANEL* m_MessageWindow; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; From c159b06f57964fd58cf57d412bcf1a10dbdb687e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 11 Jun 2025 18:28:10 +0100 Subject: [PATCH 3/6] Cleanup. --- pcbnew/dialogs/dialog_board_reannotate.cpp | 94 +++++++--------------- pcbnew/dialogs/dialog_board_reannotate.h | 18 ++--- pcbnew/pcbnew_settings.cpp | 2 - pcbnew/pcbnew_settings.h | 1 - 4 files changed, 35 insertions(+), 80 deletions(-) diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index cf4515925e..3d97c1e2c0 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -92,12 +92,11 @@ wxString ActionMessage[] = { }; -DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE( PCB_EDIT_FRAME* aParentFrame ) - : DIALOG_BOARD_REANNOTATE_BASE( aParentFrame ), - m_footprints( aParentFrame->GetBoard()->Footprints() ) +DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE( PCB_EDIT_FRAME* aParentFrame ) : + DIALOG_BOARD_REANNOTATE_BASE( aParentFrame ), + m_frame( aParentFrame ), + m_footprints( aParentFrame->GetBoard()->Footprints() ) { - m_frame = aParentFrame; - m_Config = Kiface().KifaceSettings(); InitValues(); // Init bitmaps associated to some wxRadioButton @@ -113,16 +112,14 @@ DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE( PCB_EDIT_FRAME* aParentFrame ) m_FrontRefDesStart->SetValidator( wxTextValidator( wxFILTER_DIGITS ) ); m_BackRefDesStart->SetValidator( wxTextValidator( wxFILTER_DIGITS ) ); - m_sdbSizerOK->SetLabel( _( "Reannotate PCB" ) ); - m_sdbSizerCancel->SetLabel( _( "Close" ) ); - m_sdbSizer->Layout(); + SetupStandardButtons( { { wxID_OK, _( "Reannotate PCB" ) }, + { wxID_CANCEL, _( "Close" ) } } ); - m_settings = aParentFrame->config(); wxArrayString gridslist; - GRID_MENU::BuildChoiceList( &gridslist, m_settings, aParentFrame ); + GRID_MENU::BuildChoiceList( &gridslist, m_frame->config(), aParentFrame ); if( -1 == m_gridIndex ) // If no default loaded - m_gridIndex = m_settings->m_Window.grid.last_size_idx; // Get the current grid size + m_gridIndex = m_frame->config()->m_Window.grid.last_size_idx; // Get the current grid size m_sortGridx = m_frame->GetCanvas()->GetGAL()->GetGridSize().x; m_sortGridy = m_frame->GetCanvas()->GetGAL()->GetGridSize().y; @@ -165,18 +162,7 @@ DIALOG_BOARD_REANNOTATE::~DIALOG_BOARD_REANNOTATE() { GetParameters(); // Get the current menu settings - PCBNEW_SETTINGS* cfg = nullptr; - - try - { - cfg = m_frame->GetPcbNewSettings(); - } - catch( const std::runtime_error& e ) - { - wxFAIL_MSG( e.what() ); - } - - if( cfg ) + if( PCBNEW_SETTINGS* cfg = m_frame->GetPcbNewSettings() ) { cfg->m_Reannotate.sort_on_fp_location = m_locationChoice->GetSelection() == 0; cfg->m_Reannotate.remove_front_prefix = m_RemoveFrontPrefix->GetValue(); @@ -186,7 +172,6 @@ DIALOG_BOARD_REANNOTATE::~DIALOG_BOARD_REANNOTATE() cfg->m_Reannotate.grid_index = m_gridIndex; cfg->m_Reannotate.sort_code = m_sortCode; cfg->m_Reannotate.annotation_choice = m_annotationScope; - cfg->m_Reannotate.report_severity = m_severity; cfg->m_Reannotate.front_refdes_start = m_FrontRefDesStart->GetValue(); cfg->m_Reannotate.back_refdes_start = m_BackRefDesStart->GetValue(); @@ -200,23 +185,24 @@ DIALOG_BOARD_REANNOTATE::~DIALOG_BOARD_REANNOTATE() void DIALOG_BOARD_REANNOTATE::InitValues( void ) { - PCBNEW_SETTINGS* cfg = m_frame->GetPcbNewSettings(); - m_locationChoice->SetSelection( cfg->m_Reannotate.sort_on_fp_location ? 0 : 1 ); - m_RemoveFrontPrefix->SetValue( cfg->m_Reannotate.remove_front_prefix ); - m_RemoveBackPrefix->SetValue( cfg->m_Reannotate.remove_back_prefix ); - m_ExcludeLocked->SetValue( cfg->m_Reannotate.exclude_locked ); + if( PCBNEW_SETTINGS* cfg = m_frame->GetPcbNewSettings() ) + { + m_locationChoice->SetSelection( cfg->m_Reannotate.sort_on_fp_location ? 0 : 1 ); + m_RemoveFrontPrefix->SetValue( cfg->m_Reannotate.remove_front_prefix ); + m_RemoveBackPrefix->SetValue( cfg->m_Reannotate.remove_back_prefix ); + m_ExcludeLocked->SetValue( cfg->m_Reannotate.exclude_locked ); - m_gridIndex = cfg->m_Reannotate.grid_index ; - m_sortCode = cfg->m_Reannotate.sort_code ; - m_annotationScope = cfg->m_Reannotate.annotation_choice ; - m_severity = cfg->m_Reannotate.report_severity; + m_gridIndex = cfg->m_Reannotate.grid_index ; + m_sortCode = cfg->m_Reannotate.sort_code ; + m_annotationScope = cfg->m_Reannotate.annotation_choice ; - m_FrontRefDesStart->SetValue( cfg->m_Reannotate.front_refdes_start ); - m_BackRefDesStart->SetValue( cfg->m_Reannotate.back_refdes_start ); - m_FrontPrefix->SetValue( cfg->m_Reannotate.front_prefix ); - m_BackPrefix->SetValue( cfg->m_Reannotate.back_prefix ); - m_ExcludeList->SetValue( cfg->m_Reannotate.exclude_list ); - m_MessageWindow->SetFileName( cfg->m_Reannotate.report_file_name ); + m_FrontRefDesStart->SetValue( cfg->m_Reannotate.front_refdes_start ); + m_BackRefDesStart->SetValue( cfg->m_Reannotate.back_refdes_start ); + m_FrontPrefix->SetValue( cfg->m_Reannotate.front_prefix ); + m_BackPrefix->SetValue( cfg->m_Reannotate.back_prefix ); + m_ExcludeList->SetValue( cfg->m_Reannotate.exclude_list ); + m_MessageWindow->SetFileName( cfg->m_Reannotate.report_file_name ); + } } @@ -281,12 +267,6 @@ void DIALOG_BOARD_REANNOTATE::FilterBackPrefix( wxCommandEvent& event ) void DIALOG_BOARD_REANNOTATE::OnApplyClick( wxCommandEvent& event ) { - if( m_frame->GetBoard()->IsEmpty() ) - { - ShowReport( _( "No PCB to reannotate!" ), RPT_SEVERITY_ERROR ); - return; - } - GetParameters(); // Figure out how this is to be done if( ReannotateBoard() ) @@ -325,9 +305,9 @@ void DIALOG_BOARD_REANNOTATE::GetParameters() m_gridIndex = m_GridChoice->GetSelection(); m_sortGridx = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::MILS, - m_settings->m_Window.grid.grids[m_gridIndex].x ); + m_frame->config()->m_Window.grid.grids[m_gridIndex].x ); m_sortGridy = EDA_UNIT_UTILS::UI::DoubleValueFromString( pcbIUScale, EDA_UNITS::MILS, - m_settings->m_Window.grid.grids[m_gridIndex].y ); + m_frame->config()->m_Window.grid.grids[m_gridIndex].y ); m_annotationScope = ANNOTATE_ALL; @@ -560,24 +540,10 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBad m_excludeArray.clear(); m_footprints = m_frame->GetBoard()->Footprints(); - wxString exclude; + wxStringTokenizer tokenizer( m_ExcludeList->GetValue(), wxS( " ," ), wxTOKEN_STRTOK ); - // Break exclude list into words. - for( auto thischar : m_ExcludeList->GetValue() ) - { - if( thischar == ' ' || thischar == ',' ) - { - m_excludeArray.push_back( exclude ); - exclude.clear(); - } - else - { - exclude += thischar; - } - } - - if( !exclude.empty() ) // last item to exclude - m_excludeArray.push_back( exclude ); + while( tokenizer.HasMoreTokens() ) + m_excludeArray.push_back( tokenizer.GetNextToken() ); REFDES_INFO fpData; bool useFPLocation = m_locationChoice->GetSelection() == 0; diff --git a/pcbnew/dialogs/dialog_board_reannotate.h b/pcbnew/dialogs/dialog_board_reannotate.h index f0ef61d7d3..ebce433fd0 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.h +++ b/pcbnew/dialogs/dialog_board_reannotate.h @@ -68,11 +68,11 @@ enum ANNOTATION_SCOPE struct REFDES_CHANGE { - KIID Uuid; - wxString NewRefDes; // The new reference designation (F_U21) - wxString OldRefDesString; // What the old refdes preamble + number was - bool Front; // True if on the front of the board - ACTION_CODE Action; // Used to skip (if #, etc) + KIID Uuid; + wxString NewRefDes; // The new reference designation (F_U21) + wxString OldRefDesString; // What the old refdes preamble + number was + bool Front; // True if on the front of the board + ACTION_CODE Action; // Used to skip (if #, etc) }; struct REFDES_INFO @@ -176,9 +176,6 @@ private: /// @return the string wxString CoordTowxString( int aX, int aY ); - /// Make the text to summarize what is about to happen. - void MakeSampleText( wxString& aMessage ); - /// Check to make sure the prefix (if there is one) is properly constructed. void FilterPrefix( wxTextCtrl* aPrefix ); @@ -199,7 +196,6 @@ private: int m_sortCode; int m_gridIndex; int m_annotationScope; - int m_severity; double m_sortGridx; double m_sortGridy; @@ -207,10 +203,6 @@ private: wxString m_frontPrefixString; wxString m_backPrefixString; wxString m_validPrefixes; - - APP_SETTINGS_BASE* m_settings; - - APP_SETTINGS_BASE* m_Config; }; #endif /* DIALOG_BOARD_REANNOTATE_H */ diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 5daf89f6f7..c6529d9865 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -586,8 +586,6 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() &m_Reannotate.sort_code, 0 ) ); m_params.emplace_back( new PARAM( "reannotate_dialog.annotate_choice", &m_Reannotate.annotation_choice, 0 ) ); - m_params.emplace_back( new PARAM( "reannotate_dialog.annotate_report_severity", - &m_Reannotate.report_severity, 0 ) ); m_params.emplace_back( new PARAM( "reannotate_dialog.annotate_front_refdes_start", &m_Reannotate.front_refdes_start, "1" ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 4a30b809cc..a304f4a3dd 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -315,7 +315,6 @@ public: int grid_index; int sort_code; int annotation_choice; - int report_severity; wxString front_refdes_start; wxString back_refdes_start; wxString front_prefix; From 7fbf51b17cbf2ca6eacb87613bb965ae703b3f4f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 12 Jun 2025 11:20:33 +0100 Subject: [PATCH 4/6] Be more pedantic about RECURSE_MODE. Also fixes an invalid iterator bug. Also adds mirroring support for PCB_GROUPs. Fixes https://gitlab.com/kicad/code/kicad/-/issues/21107 --- common/commit.cpp | 2 +- common/dialogs/dialog_group_properties.cpp | 2 +- common/tool/group_tool.cpp | 21 ++++++++++--------- eeschema/sch_item.cpp | 6 +++--- eeschema/tools/assign_footprints.cpp | 2 +- eeschema/tools/backannotate.cpp | 2 +- eeschema/tools/sch_edit_tool.cpp | 2 +- eeschema/tools/sch_editor_control.cpp | 4 ++-- eeschema/tools/sch_find_replace_tool.cpp | 4 ++-- eeschema/tools/sch_group_tool.cpp | 21 ++++++++++++------- eeschema/tools/sch_move_tool.cpp | 4 ++-- eeschema/tools/symbol_editor_move_tool.cpp | 2 +- eeschema/widgets/sch_properties_panel.cpp | 5 ++++- pcbnew/board_item.cpp | 6 +++--- .../netlist_reader/board_netlist_updater.cpp | 8 +++---- pcbnew/pcb_design_block_utils.cpp | 2 +- pcbnew/pcb_edit_frame.cpp | 2 +- pcbnew/pcb_generator.cpp | 2 +- pcbnew/tools/array_tool.cpp | 4 ++-- pcbnew/tools/edit_tool.cpp | 7 ++++++- pcbnew/tools/edit_tool_move_fct.cpp | 16 ++++++-------- pcbnew/tools/pcb_control.cpp | 2 +- pcbnew/tools/pcb_group_tool.cpp | 3 +++ pcbnew/widgets/pcb_properties_panel.cpp | 2 +- 24 files changed, 73 insertions(+), 58 deletions(-) diff --git a/common/commit.cpp b/common/commit.cpp index 0253e4a948..105cad388d 100644 --- a/common/commit.cpp +++ b/common/commit.cpp @@ -63,7 +63,7 @@ COMMIT& COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCREEN* aS makeEntry( aItem, CHT_REMOVE | flag, makeImage( aItem ), aScreen ); if( EDA_GROUP* parentGroup = aItem->GetParentGroup() ) - Modify( parentGroup->AsEdaItem(), aScreen ); + Modify( parentGroup->AsEdaItem(), aScreen, RECURSE_MODE::NO_RECURSE ); break; diff --git a/common/dialogs/dialog_group_properties.cpp b/common/dialogs/dialog_group_properties.cpp index 846d64e03b..166a05113c 100644 --- a/common/dialogs/dialog_group_properties.cpp +++ b/common/dialogs/dialog_group_properties.cpp @@ -95,7 +95,7 @@ bool DIALOG_GROUP_PROPERTIES::TransferDataFromWindow() m_commit->Modify( item, m_frame->GetScreen() ); if( existingGroup ) - m_commit->Modify( existingGroup->AsEdaItem(), m_frame->GetScreen() ); + m_commit->Modify( existingGroup->AsEdaItem(), m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); } } diff --git a/common/tool/group_tool.cpp b/common/tool/group_tool.cpp index b3ea28492d..4f94f4842f 100644 --- a/common/tool/group_tool.cpp +++ b/common/tool/group_tool.cpp @@ -171,7 +171,7 @@ int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent ) for( EDA_ITEM* member : group->GetItems() ) { - m_commit->Modify( member, m_frame->GetScreen() ); + m_commit->Modify( member, m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); toSelect.push_back( member ); } @@ -194,8 +194,8 @@ int GROUP_TOOL::AddToGroup( const TOOL_EVENT& aEvent ) { const SELECTION& selection = m_selectionTool->GetSelection(); - EDA_ITEM* group = nullptr; - EDA_ITEMS toAdd; + EDA_GROUP* group = nullptr; + EDA_ITEMS toAdd; for( EDA_ITEM* item : selection ) { @@ -205,7 +205,7 @@ int GROUP_TOOL::AddToGroup( const TOOL_EVENT& aEvent ) if( group != nullptr ) return 0; - group = item; + group = dynamic_cast( item ); } else if( !item->GetParentGroup() ) { @@ -218,25 +218,26 @@ int GROUP_TOOL::AddToGroup( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( ACTIONS::selectionClear ); - m_commit->Modify( group, m_frame->GetScreen() ); + m_commit->Modify( group->AsEdaItem(), m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); for( EDA_ITEM* item : toAdd ) { EDA_GROUP* existingGroup = item->GetParentGroup(); - KIID existingGroupId = existingGroup ? existingGroup->AsEdaItem()->m_Uuid : niluuid; - if( existingGroupId != group->m_Uuid ) + if( existingGroup != group ) { m_commit->Modify( item, m_frame->GetScreen() ); if( existingGroup ) - m_commit->Modify( existingGroup->AsEdaItem(), m_frame->GetScreen() ); + m_commit->Modify( existingGroup->AsEdaItem(), m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); + + group->AddItem( item ); } } m_commit->Push( _( "Add Items to Group" ) ); - m_selectionTool->AddItemToSel( group ); + m_selectionTool->AddItemToSel( group->AsEdaItem() ); m_toolMgr->PostEvent( EVENTS::SelectedItemsModified ); m_frame->OnModify(); @@ -255,7 +256,7 @@ int GROUP_TOOL::RemoveFromGroup( const TOOL_EVENT& aEvent ) { if( EDA_GROUP* group = item->GetParentGroup() ) { - m_commit->Modify( group->AsEdaItem(), m_frame->GetScreen() ); + m_commit->Modify( group->AsEdaItem(), m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); m_commit->Modify( item, m_frame->GetScreen() ); group->RemoveItem( item ); } diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index f29991bd06..7844236a37 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -182,10 +182,10 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool addToParentGroup, SCH_COMMIT* aCommit, bool { wxCHECK_MSG( aCommit, newItem, "Must supply a commit to update parent group" ); - if( newItem->GetParentGroup() ) + if( EDA_GROUP* group = newItem->GetParentGroup() ) { - aCommit->Modify( newItem->GetParentGroup()->AsEdaItem() ); - newItem->GetParentGroup()->AddItem( newItem ); + aCommit->Modify( group->AsEdaItem(), nullptr, RECURSE_MODE::NO_RECURSE ); + group->AddItem( newItem ); } } diff --git a/eeschema/tools/assign_footprints.cpp b/eeschema/tools/assign_footprints.cpp index 027a5dbc67..9eb85a7a83 100644 --- a/eeschema/tools/assign_footprints.cpp +++ b/eeschema/tools/assign_footprints.cpp @@ -99,7 +99,7 @@ void SCH_EDITOR_CONTROL::AssignFootprints( const std::string& aChangedSetOfRefer isChanged = true; SCH_SCREEN* screen = refs[ii].GetSheetPath().LastScreen(); - commit.Modify( symbol, screen ); + commit.Modify( symbol, screen, RECURSE_MODE::NO_RECURSE ); footprintField->SetText( footprint ); } } diff --git a/eeschema/tools/backannotate.cpp b/eeschema/tools/backannotate.cpp index 16fcb20926..d72694b026 100644 --- a/eeschema/tools/backannotate.cpp +++ b/eeschema/tools/backannotate.cpp @@ -382,7 +382,7 @@ void BACK_ANNOTATE::applyChangelist() return b ? _( "true" ) : _( "false" ); }; if( !m_dryRun ) - commit.Modify( symbol, screen ); + commit.Modify( symbol, screen, RECURSE_MODE::NO_RECURSE ); if( m_processReferences && ref.GetRef() != fpData.m_ref && !skip ) { diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 15153f56b1..31dbe84fec 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -1530,7 +1530,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) { if( newItem->IsGroupableType() ) { - commit.Modify( enteredGroup ); + commit.Modify( enteredGroup, m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); enteredGroup->AddItem( newItem ); } } diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index b2bed1d0f9..7bbb5c5631 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -471,7 +471,7 @@ int SCH_EDITOR_CONTROL::ExportSymbolsToLibrary( const TOOL_EVENT& aEvent ) wxCHECK2( parentScreen, continue ); - commit.Modify( symbol, parentScreen ); + commit.Modify( symbol, parentScreen, RECURSE_MODE::NO_RECURSE ); symbol->SetLibId( id ); append = true; } @@ -2492,7 +2492,7 @@ int SCH_EDITOR_CONTROL::IncrementAnnotations( const TOOL_EVENT& aEvent ) num += dlg.m_Increment->GetValue(); fullRef << num; - commit.Modify( ref.GetSymbol(), sheet.LastScreen() ); + commit.Modify( ref.GetSymbol(), sheet.LastScreen(), RECURSE_MODE::NO_RECURSE ); ref.GetSymbol()->SetRef( &sheet, From_UTF8( fullRef.c_str() ) ); } } diff --git a/eeschema/tools/sch_find_replace_tool.cpp b/eeschema/tools/sch_find_replace_tool.cpp index 7f71b3ab2e..1bdd14a58d 100644 --- a/eeschema/tools/sch_find_replace_tool.cpp +++ b/eeschema/tools/sch_find_replace_tool.cpp @@ -358,7 +358,7 @@ int SCH_FIND_REPLACE_TOOL::ReplaceAndFindNext( const TOOL_EVENT& aEvent ) SCH_COMMIT commit( m_frame ); SCH_ITEM* sch_item = static_cast( item ); - commit.Modify( sch_item, sheet->LastScreen() ); + commit.Modify( sch_item, sheet->LastScreen(), RECURSE_MODE::NO_RECURSE ); if( item->Replace( data, sheet ) ) { @@ -398,7 +398,7 @@ int SCH_FIND_REPLACE_TOOL::ReplaceAll( const TOOL_EVENT& aEvent ) auto doReplace = [&]( SCH_ITEM* aItem, SCH_SHEET_PATH* aSheet, EDA_SEARCH_DATA& aData ) { - commit.Modify( aItem, aSheet->LastScreen() ); + commit.Modify( aItem, aSheet->LastScreen(), RECURSE_MODE::NO_RECURSE ); if( aItem->Replace( aData, aSheet ) ) { diff --git a/eeschema/tools/sch_group_tool.cpp b/eeschema/tools/sch_group_tool.cpp index faeed3398b..19b4f649b8 100644 --- a/eeschema/tools/sch_group_tool.cpp +++ b/eeschema/tools/sch_group_tool.cpp @@ -131,15 +131,19 @@ int SCH_GROUP_TOOL::Group( const TOOL_EVENT& aEvent ) SCH_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); SCH_SELECTION selection = selTool->RequestSelection(); - for( EDA_ITEM* item : selection.GetItems() ) + // Iterate from the back so we don't have to worry about removals. + for( int ii = selection.GetSize() - 1; ii >= 0; --ii ) { - SCH_ITEM* schItem = static_cast( item ); + if( !selection[ii]->IsSCH_ITEM() ) + { + selection.Remove( selection[ii] ); + continue; + } + + SCH_ITEM* schItem = static_cast( selection[ii] ); if( !schItem->IsGroupableType() ) - selection.Remove( item ); - - if( isSymbolEditor && schItem->GetParentSymbol() ) - selection.Remove( item ); + selection.Remove( schItem ); } if( selection.Empty() ) @@ -155,7 +159,10 @@ int SCH_GROUP_TOOL::Group( const TOOL_EVENT& aEvent ) for( EDA_ITEM* eda_item : selection ) { - m_commit->Modify( eda_item, screen ); + if( EDA_GROUP* existingGroup = eda_item->GetParentGroup() ) + m_commit->Modify( existingGroup->AsEdaItem(), screen, RECURSE_MODE::NO_RECURSE ); + + m_commit->Modify( eda_item, screen, RECURSE_MODE::NO_RECURSE ); group->AddItem( eda_item ); } diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index 4ddadb6485..f685854a12 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -637,7 +637,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm { if( schItem->IsGroupableType() && !schItem->GetParentGroup() ) { - aCommit->Modify( enteredGroup ); + aCommit->Modify( enteredGroup, m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); enteredGroup->AddItem( schItem ); } } @@ -648,7 +648,7 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm } else { - aCommit->Modify( schItem, m_frame->GetScreen() ); + aCommit->Modify( schItem, m_frame->GetScreen(), RECURSE_MODE::RECURSE ); } schItem->SetFlags( IS_MOVING ); diff --git a/eeschema/tools/symbol_editor_move_tool.cpp b/eeschema/tools/symbol_editor_move_tool.cpp index 8a885c0eb6..5d049a0bb9 100644 --- a/eeschema/tools/symbol_editor_move_tool.cpp +++ b/eeschema/tools/symbol_editor_move_tool.cpp @@ -244,7 +244,7 @@ bool SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COM { if( schItem->IsGroupableType() && !item->GetParentGroup() ) { - aCommit->Modify( enteredGroup ); + aCommit->Modify( enteredGroup, m_frame->GetScreen(), RECURSE_MODE::NO_RECURSE ); enteredGroup->AddItem( schItem ); } } diff --git a/eeschema/widgets/sch_properties_panel.cpp b/eeschema/widgets/sch_properties_panel.cpp index 776c7647cc..b3da7943bc 100644 --- a/eeschema/widgets/sch_properties_panel.cpp +++ b/eeschema/widgets/sch_properties_panel.cpp @@ -198,8 +198,11 @@ void SCH_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent ) for( EDA_ITEM* edaItem : selection ) { + if( !edaItem->IsSCH_ITEM() ) + continue; + SCH_ITEM* item = static_cast( edaItem ); - changes.Modify( item, screen ); + changes.Modify( item, screen, RECURSE_MODE::NO_RECURSE ); item->Set( property, newValue ); if( SCH_SYMBOL* symbol = dynamic_cast( item ) ) diff --git a/pcbnew/board_item.cpp b/pcbnew/board_item.cpp index 333ec8685a..323c4621ed 100644 --- a/pcbnew/board_item.cpp +++ b/pcbnew/board_item.cpp @@ -277,10 +277,10 @@ BOARD_ITEM* BOARD_ITEM::Duplicate( bool addToParentGroup, BOARD_COMMIT* aCommit { wxCHECK_MSG( aCommit, dupe, "Must supply a commit to update parent group" ); - if( dupe->GetParentGroup() ) + if( EDA_GROUP* group = dupe->GetParentGroup() ) { - aCommit->Modify( dupe->GetParentGroup()->AsEdaItem() ); - dupe->GetParentGroup()->AddItem( dupe ); + aCommit->Modify( group->AsEdaItem(), nullptr, RECURSE_MODE::NO_RECURSE ); + group->AddItem( dupe ); } } diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index 62885e0fa0..eeec387adc 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -878,7 +878,7 @@ bool BOARD_NETLIST_UPDATER::updateFootprintGroup( FOOTPRINT* aPcbFootprint, EscapeHTML( existingGroup->GetName() ) ); changed = true; - m_commit.Modify( existingGroup ); + m_commit.Modify( existingGroup, nullptr, RECURSE_MODE::NO_RECURSE ); existingGroup->RemoveItem( aPcbFootprint ); } @@ -915,7 +915,7 @@ bool BOARD_NETLIST_UPDATER::updateFootprintGroup( FOOTPRINT* aPcbFootprint, } else { - m_commit.Modify( newGroup->AsEdaItem() ); + m_commit.Modify( newGroup->AsEdaItem(), nullptr, RECURSE_MODE::NO_RECURSE ); } newGroup->AddItem( aPcbFootprint ); @@ -1385,7 +1385,7 @@ bool BOARD_NETLIST_UPDATER::updateGroups( NETLIST& aNetlist ) wxString msg; msg.Printf( _( "Changed group name to '%s' to '%s'." ), EscapeHTML( pcbGroup->GetName() ), EscapeHTML( netlistGroup->name ) ); - m_commit.Modify( pcbGroup->AsEdaItem() ); + m_commit.Modify( pcbGroup->AsEdaItem(), nullptr, RECURSE_MODE::NO_RECURSE ); pcbGroup->SetName( netlistGroup->name ); } } @@ -1404,7 +1404,7 @@ bool BOARD_NETLIST_UPDATER::updateGroups( NETLIST& aNetlist ) wxString msg; msg.Printf( _( "Changed group library link to '%s'." ), EscapeHTML( netlistGroup->libId.GetUniStringLibId() ) ); - m_commit.Modify( pcbGroup->AsEdaItem() ); + m_commit.Modify( pcbGroup->AsEdaItem(), nullptr, RECURSE_MODE::NO_RECURSE ); pcbGroup->SetDesignBlockLibId( netlistGroup->libId ); } } diff --git a/pcbnew/pcb_design_block_utils.cpp b/pcbnew/pcb_design_block_utils.cpp index 804fbf1861..b7a3729e63 100644 --- a/pcbnew/pcb_design_block_utils.cpp +++ b/pcbnew/pcb_design_block_utils.cpp @@ -435,7 +435,7 @@ bool PCB_EDIT_FRAME::SaveSelectionToDesignBlock( const LIB_ID& aLibId ) { BOARD_COMMIT commit( m_toolManager ); - commit.Modify( group ); + commit.Modify( group, nullptr, RECURSE_MODE::NO_RECURSE ); group->SetDesignBlockLibId( aLibId ); commit.Push( "Set Group Design Block Link" ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 93ac7b59ef..dda13be9af 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -2311,7 +2311,7 @@ void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew, if( parentGroup ) { - aCommit.Modify( parentGroup->AsEdaItem() ); + aCommit.Modify( parentGroup->AsEdaItem(), nullptr, RECURSE_MODE::NO_RECURSE ); parentGroup->RemoveItem( aExisting ); parentGroup->AddItem( aNew ); } diff --git a/pcbnew/pcb_generator.cpp b/pcbnew/pcb_generator.cpp index 8f2f8afc9d..aecb498e5b 100644 --- a/pcbnew/pcb_generator.cpp +++ b/pcbnew/pcb_generator.cpp @@ -58,7 +58,7 @@ PCB_GENERATOR* PCB_GENERATOR::DeepClone() const void PCB_GENERATOR::EditStart( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_COMMIT* aCommit ) { - aCommit->Modify( this ); + aCommit->Modify( this, nullptr, RECURSE_MODE::NO_RECURSE ); } diff --git a/pcbnew/tools/array_tool.cpp b/pcbnew/tools/array_tool.cpp index c79d72c04f..af095a0115 100644 --- a/pcbnew/tools/array_tool.cpp +++ b/pcbnew/tools/array_tool.cpp @@ -202,7 +202,7 @@ void ARRAY_TOOL::onDialogClosed( wxCloseEvent& aEvent ) if( item == nullptr ) break; - commit.Modify( item ); + commit.Modify( item, nullptr, RECURSE_MODE::RECURSE ); // Transform is a relative move, so when arranging the transform needs to start from // the same point for each item, e.g. the first item's position @@ -263,7 +263,7 @@ void ARRAY_TOOL::onDialogClosed( wxCloseEvent& aEvent ) // we might still modify it (position or label) this_item = item; - commit.Modify( this_item ); + commit.Modify( this_item, nullptr, RECURSE_MODE::RECURSE ); TransformItem( *m_array_opts, arraySize - 1, *this_item ); } diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index b733909f2d..0ebd6ad55a 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -2190,6 +2190,7 @@ const std::vector EDIT_TOOL::MirrorableItems = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, + PCB_GROUP_T, PCB_GENERATOR_T, }; @@ -2251,7 +2252,7 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) continue; if( !item->IsNew() && !item->IsMoving() ) - commit->Modify( item ); + commit->Modify( item, nullptr, RECURSE_MODE::RECURSE ); // modify each object as necessary switch( item->Type() ) @@ -2287,6 +2288,10 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) static_cast( item )->Mirror( mirrorPoint, flipDirection ); break; + case PCB_GROUP_T: + static_cast( item )->Mirror( mirrorPoint, flipDirection ); + break; + case PCB_GENERATOR_T: static_cast( item )->Mirror( mirrorPoint, flipDirection ); break; diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index a1333328a6..26007b0a64 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -194,11 +194,11 @@ int EDIT_TOOL::PackAndMoveFootprints( const TOOL_EVENT& aEvent ) BOX2I footprintsBbox; - for( FOOTPRINT* item : footprintsToPack ) + for( FOOTPRINT* fp : footprintsToPack ) { - commit.Modify( item ); - item->SetFlags( IS_MOVING ); - footprintsBbox.Merge( item->GetBoundingBox( false ) ); + commit.Modify( fp ); + fp->SetFlags( IS_MOVING ); + footprintsBbox.Merge( fp->GetBoundingBox( false ) ); } SpreadFootprints( &footprintsToPack, footprintsBbox.Normalize().GetOrigin(), false ); @@ -582,13 +582,9 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit m_toolMgr->RunSynchronousAction( PCB_ACTIONS::genStartEdit, aCommit, static_cast( item ) ); } - else if( item->Type() == PCB_GROUP_T || item->Type() == PCB_GENERATOR_T ) - { - aCommit->Modify( item, nullptr, RECURSE_MODE::RECURSE ); - } else { - aCommit->Modify( item ); + aCommit->Modify( item, nullptr, RECURSE_MODE::RECURSE ); } item->SetFlags( IS_MOVING ); @@ -762,7 +758,7 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit updateStatusPopup( nextItem, itemIdx + 1, orig_items.size() ); // Pick up new item - aCommit->Modify( nextItem ); + aCommit->Modify( nextItem, nullptr, RECURSE_MODE::RECURSE ); nextItem->Move( controls->GetCursorPosition( true ) - nextItem->GetPosition() ); continue; diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index 3a21b930c5..6ba86c78a9 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -1546,7 +1546,7 @@ bool PCB_CONTROL::placeBoardItems( BOARD_COMMIT* aCommit, std::vectorIsGroupableType() && !item->GetParentGroup() ) { - aCommit->Modify( enteredGroup ); + aCommit->Modify( enteredGroup, nullptr, RECURSE_MODE::NO_RECURSE ); enteredGroup->AddItem( item ); } } diff --git a/pcbnew/tools/pcb_group_tool.cpp b/pcbnew/tools/pcb_group_tool.cpp index 5c4d4fbca7..99fb2a78b6 100644 --- a/pcbnew/tools/pcb_group_tool.cpp +++ b/pcbnew/tools/pcb_group_tool.cpp @@ -176,6 +176,9 @@ int PCB_GROUP_TOOL::Group( const TOOL_EVENT& aEvent ) { if( eda_item->IsBOARD_ITEM() ) { + if( EDA_GROUP* existingGroup = eda_item->GetParentGroup() ) + m_commit->Modify( existingGroup->AsEdaItem(), nullptr, RECURSE_MODE::NO_RECURSE ); + m_commit->Modify( eda_item ); group->AddItem( eda_item ); } diff --git a/pcbnew/widgets/pcb_properties_panel.cpp b/pcbnew/widgets/pcb_properties_panel.cpp index 7a6064e778..5ab60d388d 100644 --- a/pcbnew/widgets/pcb_properties_panel.cpp +++ b/pcbnew/widgets/pcb_properties_panel.cpp @@ -233,7 +233,7 @@ void PCB_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent ) continue; BOARD_ITEM* item = static_cast( edaItem ); - changes.Modify( item ); + changes.Modify( item, nullptr, RECURSE_MODE::NO_RECURSE ); item->Set( property, newValue ); } From ac3a20278b6514332337b67fec70a6382f7cc3d7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 12 Jun 2025 12:51:11 +0100 Subject: [PATCH 5/6] Reset m_drcRun flag when clearning all markers. Fixes https://gitlab.com/kicad/code/kicad/-/issues/21113 --- pcbnew/dialogs/dialog_drc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 68161db70c..7db1ae200c 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -1275,6 +1275,7 @@ void DIALOG_DRC::OnDeleteAllClick( wxCommandEvent& aEvent ) } deleteAllMarkers( s_includeExclusions ); + m_drcRun = false; refreshEditor(); updateDisplayedCounts(); From 28446744491eb77e1978176c598e07656ce31107 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 12 Jun 2025 16:29:20 +0100 Subject: [PATCH 6/6] Use courtyards for DNP cross-out sizes. (And failing that, just pads and edges, no text.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/21115 --- pcbnew/plot_board_layers.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 91255c6f44..b856f7ae03 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -627,7 +627,14 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, const LSET& aLayerMask && ( ( onFrontFab && footprint->GetLayer() == F_Cu ) || ( onBackFab && footprint->GetLayer() == B_Cu ) ) ) { - BOX2I rect = footprint->GetBoundingHull().BBox(); + BOX2I rect; + const SHAPE_POLY_SET& courtyard = footprint->GetCourtyard( footprint->GetLayer() ); + + if( courtyard.IsEmpty() ) + rect = footprint->GetEffectiveShape()->BBox(); + else + rect = courtyard.BBox(); + int width = aBoard->GetDesignSettings().m_LineThickness[ LAYER_CLASS_FAB ]; aPlotter->ThickSegment( rect.GetOrigin(), rect.GetEnd(), width, nullptr );