Annotation: convert annotate unique to use options method

This commit is contained in:
Mike Williams 2022-07-19 13:00:24 -04:00
parent 7c979e6375
commit 8db69c2f0d
2 changed files with 35 additions and 5 deletions

View File

@ -376,7 +376,11 @@ wxString buildFullReference( const SCH_REFERENCE& aItem, int aUnitNumber = -1 )
}
void SCH_REFERENCE_LIST::ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditionalReferences )
void SCH_REFERENCE_LIST::ReannotateByOptions( ANNOTATE_ORDER_T aSortOption,
ANNOTATE_ALGO_T aAlgoOption,
int aStartNumber,
const SCH_REFERENCE_LIST& aAdditionalRefs,
bool aStartAtCurrent )
{
SplitReferences();
@ -397,7 +401,14 @@ void SCH_REFERENCE_LIST::ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditi
lockedSymbols[refstr].AddItem( ref );
}
Annotate( false, 0, 0, lockedSymbols, aAdditionalReferences, true );
AnnotateByOptions( aSortOption, aAlgoOption, aStartNumber, lockedSymbols, aAdditionalRefs,
aStartAtCurrent );
}
void SCH_REFERENCE_LIST::ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditionalReferences )
{
ReannotateByOptions( UNSORTED, INCREMENTAL_BY_REF, 0, aAdditionalReferences, true );
}

View File

@ -337,14 +337,33 @@ public:
}
/**
* Replace any duplicate reference designators with the next available number after the
* present number. Multi-unit symbols are reannotated together.
* @brief Forces reannotation of the provided references. Will also reannotate
* associated multi-unit symbols.
*
* @param aSortOption Define the annotation order. See #ANNOTATE_ORDER_T.
* @param aAlgoOption Define the annotation style. See #ANNOTATE_ALGO_T.
* @param aStartNumber The start number for non-sheet-based annotation styles.
* @param aAdditionalReferences Additional references to check for duplicates
* @param aStartAtCurrent Use m_numRef for each reference as the start number (overrides
* aStartNumber)
*/
void ReannotateByOptions( ANNOTATE_ORDER_T aSortOption,
ANNOTATE_ALGO_T aAlgoOption,
int aStartNumber,
const SCH_REFERENCE_LIST& aAdditionalRefs,
bool aStartAtCurrent );
/**
* Convenience function for the Paste Unique functionality. Do not use as a general
* reannotation method.
*
* Replaces any duplicate reference designators with the next available number after the
* present number regardless of configured annotation options.
*
* Multi-unit symbols are reannotated together.
*/
void ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditionalReferences );
/**
* Annotate the references by the provided options.
*