You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

647 lines
24 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 1992-2011 jean-pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
  5. * Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
  6. * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. #ifndef _SCH_REFERENCE_LIST_H_
  26. #define _SCH_REFERENCE_LIST_H_
  27. #include <map>
  28. #include <lib_symbol.h>
  29. #include <macros.h>
  30. #include <sch_sheet_path.h>
  31. #include <sch_symbol.h>
  32. #include <sch_text.h>
  33. #include <erc_settings.h>
  34. /** Schematic annotation scope options. */
  35. enum ANNOTATE_SCOPE_T
  36. {
  37. ANNOTATE_ALL, ///< Annotate the full schematic
  38. ANNOTATE_CURRENT_SHEET, ///< Annotate the current sheet
  39. ANNOTATE_SELECTION ///< Annotate the selection
  40. };
  41. /** Schematic annotation order options. */
  42. enum ANNOTATE_ORDER_T
  43. {
  44. SORT_BY_X_POSITION, ///< Annotate by X position from left to right.
  45. SORT_BY_Y_POSITION, ///< Annotate by Y position from top to bottom.
  46. UNSORTED, ///< Annotate by position of symbol in the schematic sheet
  47. ///< object list.
  48. };
  49. /** Schematic annotation type options. */
  50. enum ANNOTATE_ALGO_T
  51. {
  52. INCREMENTAL_BY_REF, ///< Annotate incrementally using the first free reference number.
  53. SHEET_NUMBER_X_100, ///< Annotate using the first free reference number starting at
  54. ///< the sheet number * 100.
  55. SHEET_NUMBER_X_1000, ///< Annotate using the first free reference number starting at
  56. ///< the sheet number * 1000.
  57. };
  58. /**
  59. * A helper to define a symbol's reference designator in a schematic.
  60. *
  61. * This helper is required in a complex hierarchy because a symbol can be used more than once
  62. * and its reference depends on the sheet path. This class is used to flatten the schematic
  63. * hierarchy for annotation, net list generation, and bill of material generation.
  64. */
  65. class SCH_REFERENCE
  66. {
  67. public:
  68. SCH_REFERENCE() :
  69. m_sheetPath()
  70. {
  71. m_rootSymbol = nullptr;
  72. m_libPart = nullptr;
  73. m_unit = 0;
  74. m_isNew = false;
  75. m_numRef = 0;
  76. m_flag = 0;
  77. m_sheetNum = 0;
  78. }
  79. SCH_REFERENCE( SCH_SYMBOL* aSymbol, LIB_SYMBOL* aLibSymbol, const SCH_SHEET_PATH& aSheetPath );
  80. SCH_SYMBOL* GetSymbol() const { return m_rootSymbol; }
  81. LIB_SYMBOL* GetLibPart() const { return m_libPart; }
  82. const SCH_SHEET_PATH& GetSheetPath() const { return m_sheetPath; }
  83. SCH_SHEET_PATH& GetSheetPath() { return m_sheetPath; }
  84. int GetUnit() const { return m_unit; }
  85. void SetUnit( int aUnit ) { m_unit = aUnit; }
  86. bool IsMultiUnit() const { return GetLibPart()->GetUnitCount() > 1; }
  87. const wxString GetValue() const { return m_value; }
  88. void SetValue( const wxString& aValue ) { m_value = aValue; }
  89. const wxString GetFootprint() const { return m_footprint; }
  90. void SetFootprint( const wxString& aFP ) { m_footprint = aFP; }
  91. void SetSheetNumber( int aSheetNumber ) { m_sheetNum = aSheetNumber; }
  92. /**
  93. * @return the sheet path containing the symbol item
  94. */
  95. const wxString GetPath() const
  96. {
  97. return m_sheetPath.PathAsString();
  98. }
  99. /**
  100. * @return the full patb of the symbol item
  101. */
  102. const wxString GetFullPath() const
  103. {
  104. return m_sheetPath.PathAsString() + m_symbolUuid.AsString();
  105. }
  106. /*
  107. * Compares by full path to make std::set work
  108. */
  109. bool operator<( const SCH_REFERENCE& aRef ) const { return GetFullPath() < aRef.GetFullPath(); }
  110. /**
  111. * Update the annotation of the symbol according the current object state.
  112. */
  113. void Annotate();
  114. /**
  115. * Verify the reference should always be automatically annotated.
  116. *
  117. * @return true if the symbol reference should always be automatically annotated otherwise
  118. * false.
  119. */
  120. bool AlwaysAnnotate() const;
  121. /**
  122. * Attempt to split the reference designator into a name (U) and number (1).
  123. *
  124. * If the last character is '?' or not a digit, the reference is tagged as not annotated.
  125. * For symbols with multiple parts per package that are not already annotated, keeps the unit
  126. * number the same. E.g. U?A or U?B
  127. */
  128. void Split();
  129. /**
  130. * Determine if this reference needs to be split or if it likely already has been
  131. *
  132. * @return true if this reference hasn't been split yet
  133. */
  134. bool IsSplitNeeded();
  135. void SetRef( const wxString& aReference ) { m_ref = aReference; }
  136. wxString GetRef() const { return m_ref; }
  137. void SetRefStr( const std::string& aReference ) { m_ref = aReference; }
  138. const char* GetRefStr() const { return m_ref.c_str(); }
  139. ///< Return reference name with unit altogether
  140. wxString GetFullRef() const
  141. {
  142. if( GetSymbol()->GetUnitCount() > 1 )
  143. return GetRef() + GetRefNumber() + LIB_SYMBOL::SubReference( GetUnit() );
  144. else
  145. return GetRef() + GetRefNumber();
  146. }
  147. wxString GetRefNumber() const
  148. {
  149. wxString ref;
  150. if( m_numRef < 0 )
  151. return wxT( "?" );
  152. // To avoid a risk of duplicate, for power symbols the ref number is 0nnn instead of nnn.
  153. // Just because sometimes only power symbols are annotated
  154. if( GetLibPart() && GetLibPart()->IsPower() )
  155. ref = wxT( "0" );
  156. return ref << m_numRef;
  157. }
  158. int CompareValue( const SCH_REFERENCE& item ) const
  159. {
  160. return m_value.Cmp( item.m_value );
  161. }
  162. int CompareRef( const SCH_REFERENCE& item ) const
  163. {
  164. return m_ref.CmpNoCase( item.m_ref );
  165. }
  166. int CompareLibName( const SCH_REFERENCE& item ) const
  167. {
  168. return m_rootSymbol->GetLibId().GetLibItemName().compare(
  169. item.m_rootSymbol->GetLibId().GetLibItemName() );
  170. }
  171. /**
  172. * Return whether this reference refers to the same symbol instance (symbol and sheet) as
  173. * another.
  174. */
  175. bool IsSameInstance( const SCH_REFERENCE& other ) const
  176. {
  177. // Only compare symbol and path.
  178. // We may have changed the unit number or the designator but
  179. // can still be referencing the same instance.
  180. return GetSymbol() == other.GetSymbol()
  181. && GetSheetPath().Path() == other.GetSheetPath().Path();
  182. }
  183. bool IsUnitsLocked()
  184. {
  185. if( m_libPart )
  186. return m_libPart->UnitsLocked();
  187. else
  188. return true; // Assume units locked when we don't have a library
  189. }
  190. private:
  191. friend class SCH_REFERENCE_LIST;
  192. /// Symbol reference prefix, without number (for IC1, this is IC) )
  193. wxString m_ref; // it's private, use the accessors please
  194. SCH_SYMBOL* m_rootSymbol; ///< The symbol associated the reference object.
  195. LIB_SYMBOL* m_libPart; ///< The source symbol from a library.
  196. VECTOR2I m_symbolPos; ///< The physical position of the symbol in schematic
  197. ///< used to annotate by X or Y position
  198. int m_unit; ///< The unit number for symbol with multiple parts
  199. ///< per package.
  200. wxString m_value; ///< The symbol value.
  201. wxString m_footprint; ///< The footprint assigned.
  202. SCH_SHEET_PATH m_sheetPath; ///< The sheet path for this reference.
  203. bool m_isNew; ///< True if not yet annotated.
  204. int m_sheetNum; ///< The sheet number for the reference.
  205. KIID m_symbolUuid; ///< UUID of the symbol.
  206. int m_numRef; ///< The numeric part of the reference designator.
  207. int m_flag;
  208. };
  209. /**
  210. * Define a standard error handler for annotation errors.
  211. */
  212. typedef std::function<void( ERCE_T aType, const wxString& aMsg, SCH_REFERENCE* aItemA,
  213. SCH_REFERENCE* aItemB )> ANNOTATION_ERROR_HANDLER;
  214. /**
  215. * Container to create a flattened list of symbols because in a complex hierarchy, a symbol
  216. * can be used more than once and its reference designator is dependent on the sheet path for
  217. * the same symbol.
  218. *
  219. * This flattened list is used for netlist generation, BOM generation, and schematic annotation.
  220. */
  221. class SCH_REFERENCE_LIST
  222. {
  223. public:
  224. SCH_REFERENCE_LIST()
  225. {
  226. }
  227. SCH_REFERENCE& operator[]( int aIndex )
  228. {
  229. return m_flatList[ aIndex ];
  230. }
  231. const SCH_REFERENCE& operator[]( int aIndex ) const
  232. {
  233. return m_flatList[ aIndex ];
  234. }
  235. void Clear()
  236. {
  237. m_flatList.clear();
  238. }
  239. size_t GetCount() const { return m_flatList.size(); }
  240. SCH_REFERENCE& GetItem( int aIdx ) { return m_flatList[aIdx]; }
  241. const SCH_REFERENCE& GetItem( int aIdx ) const { return m_flatList[aIdx]; }
  242. void AddItem( const SCH_REFERENCE& aItem ) { m_flatList.push_back( aItem ); }
  243. /**
  244. * Remove an item from the list of references.
  245. *
  246. * @param aIndex is the index of the item to be removed.
  247. */
  248. void RemoveItem( unsigned int aIndex );
  249. /**
  250. * Return true if aItem exists in this list
  251. * @param aItem Reference to check
  252. * @return true if aItem exists in this list
  253. */
  254. bool Contains( const SCH_REFERENCE& aItem ) const;
  255. /* Sort functions:
  256. * Sort functions are used to sort symbols for annotation or BOM generation. Because
  257. * sorting depends on what we want to do, there are many sort functions.
  258. * Note:
  259. * When creating BOM, symbols are fully annotated. References are something like U3,
  260. * U5 or R4, R8. When annotating, some or all symbols are not annotated, i.e. ref is
  261. * only U or R, with no number.
  262. */
  263. /**
  264. * Attempt to split all reference designators into a name (U) and number (1).
  265. *
  266. * If the last character is '?' or not a digit, the reference is tagged as not annotated.
  267. * For symbols with multiple parts, keeps the unit number intact
  268. * @see SCH_REFERENCE::Split()
  269. */
  270. void SplitReferences()
  271. {
  272. for( unsigned ii = 0; ii < GetCount(); ii++ )
  273. m_flatList[ii].Split();
  274. }
  275. /**
  276. * Treat all symbols in this list as non-annotated. Does not update annotation state of the
  277. * symbols.
  278. * @see SCH_REFERENCE_LIST::UpdateAnnotation
  279. */
  280. void RemoveAnnotation()
  281. {
  282. for( unsigned ii = 0; ii < GetCount(); ii++ )
  283. m_flatList[ii].m_isNew = true;
  284. }
  285. /**
  286. * Update the symbol references for the schematic project (or the current sheet).
  287. *
  288. * @note This function does not calculate the reference numbers stored in m_numRef so it
  289. * must be called after calculation of new reference numbers.
  290. *
  291. * @see SCH_REFERENCE::Annotate()
  292. */
  293. void UpdateAnnotation()
  294. {
  295. /* update the reference numbers */
  296. for( unsigned ii = 0; ii < GetCount(); ii++ )
  297. m_flatList[ii].Annotate();
  298. }
  299. /**
  300. * @brief Forces reannotation of the provided references. Will also reannotate
  301. * associated multi-unit symbols.
  302. *
  303. * @param aSortOption Define the annotation order. See #ANNOTATE_ORDER_T.
  304. * @param aAlgoOption Define the annotation style. See #ANNOTATE_ALGO_T.
  305. * @param aStartNumber The start number for non-sheet-based annotation styles.
  306. * @param aAdditionalReferences Additional references to check for duplicates
  307. * @param aStartAtCurrent Use m_numRef for each reference as the start number (overrides
  308. * aStartNumber)
  309. * @param aHierarchy Optional sheet path hierarchy for resetting the references'
  310. * sheet numbers based on their sheet's place in the hierarchy. Set
  311. * nullptr if not desired.
  312. */
  313. void ReannotateByOptions( ANNOTATE_ORDER_T aSortOption,
  314. ANNOTATE_ALGO_T aAlgoOption,
  315. int aStartNumber,
  316. const SCH_REFERENCE_LIST& aAdditionalRefs,
  317. bool aStartAtCurrent,
  318. SCH_SHEET_LIST* aHierarchy );
  319. /**
  320. * Convenience function for the Paste Unique functionality. Do not use as a general
  321. * reannotation method.
  322. *
  323. * Replaces any duplicate reference designators with the next available number after the
  324. * present number regardless of configured annotation options.
  325. *
  326. * Multi-unit symbols are reannotated together.
  327. */
  328. void ReannotateDuplicates( const SCH_REFERENCE_LIST& aAdditionalReferences );
  329. /**
  330. * Annotate the references by the provided options.
  331. *
  332. * @param aSortOption Define the annotation order. See #ANNOTATE_ORDER_T.
  333. * @param aAlgoOption Define the annotation style. See #ANNOTATE_ALGO_T.
  334. * @param aStartNumber The start number for non-sheet-based annotation styles.
  335. * @param appendUndo True if the annotation operation should be added to an existing undo,
  336. * false if it should be separately undo-able.
  337. * @param aLockedUnitMap A SCH_MULTI_UNIT_REFERENCE_MAP of reference designator wxStrings
  338. * to SCH_REFERENCE_LISTs. May be an empty map. If not empty, any multi-unit parts
  339. * found in this map will be annotated as a group rather than individually.
  340. * @param aAdditionalReferences Additional references to check for duplicates
  341. * @param aStartAtCurrent Use m_numRef for each reference as the start number (overrides
  342. * aStartNumber)
  343. */
  344. void AnnotateByOptions( enum ANNOTATE_ORDER_T aSortOption,
  345. enum ANNOTATE_ALGO_T aAlgoOption,
  346. int aStartNumber,
  347. SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap,
  348. const SCH_REFERENCE_LIST& aAdditionalRefs,
  349. bool aStartAtCurrent );
  350. /**
  351. * Set the reference designators in the list that have not been annotated.
  352. *
  353. * If a the sheet number is 2 and \a aSheetIntervalId is 100, then the first reference
  354. * designator would be 201 and the last reference designator would be 299 when no overlap
  355. * occurs with sheet number 3. If there are 150 items in sheet number 2, then items are
  356. * referenced U201 to U351, and items in sheet 3 start from U352
  357. *
  358. * @param aUseSheetNum Set to true to start annotation for each sheet at the sheet number
  359. * times \a aSheetIntervalId. Otherwise annotate incrementally.
  360. * @param aSheetIntervalId The per sheet reference designator multiplier.
  361. * @param aStartNumber The number to start with if NOT numbering based on sheet number.
  362. * @param aLockedUnitMap A SCH_MULTI_UNIT_REFERENCE_MAP of reference designator wxStrings
  363. * to SCH_REFERENCE_LISTs. May be an empty map. If not empty, any multi-unit parts
  364. * found in this map will be annotated as a group rather than individually.
  365. * @param aAdditionalRefs Additional references to use for checking that there a reference
  366. * designator doesn't already exist. The caller must ensure that none of the references
  367. * in aAdditionalRefs exist in this list.
  368. * @param aStartAtCurrent Use m_numRef for each reference as the start number (overrides
  369. aStartNumber)
  370. */
  371. void Annotate( bool aUseSheetNum, int aSheetIntervalId, int aStartNumber,
  372. SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap,
  373. const SCH_REFERENCE_LIST& aAdditionalRefs, bool aStartAtCurrent = false );
  374. /**
  375. * Check for annotations errors.
  376. *
  377. * The following annotation error conditions are tested:
  378. * - Symbols not annotated.
  379. * - Symbols having the same reference designator (duplicates).
  380. * - Symbols with multiple parts per package having different reference designators.
  381. * - Symbols with multiple parts per package with invalid part count.
  382. *
  383. * @param aErrorHandler A handler for errors.
  384. * @return The number of errors found.
  385. */
  386. int CheckAnnotation( ANNOTATION_ERROR_HANDLER aErrorHandler );
  387. /**
  388. * Sort the list of references by X position.
  389. *
  390. * Symbols are sorted as follows:
  391. * - Numeric value of reference designator.
  392. * - Sheet number.
  393. * - X coordinate position.
  394. * - Y coordinate position.
  395. * - Time stamp.
  396. */
  397. void SortByXCoordinate()
  398. {
  399. sort( m_flatList.begin(), m_flatList.end(), sortByXPosition );
  400. }
  401. /**
  402. * Sort the list of references by Y position.
  403. *
  404. * Symbols are sorted as follows:
  405. * - Numeric value of reference designator.
  406. * - Sheet number.
  407. * - Y coordinate position.
  408. * - X coordinate position.
  409. * - Time stamp.
  410. */
  411. void SortByYCoordinate()
  412. {
  413. sort( m_flatList.begin(), m_flatList.end(), sortByYPosition );
  414. }
  415. /**
  416. * Sort the flat list by Time Stamp (sheet path + timestamp).
  417. *
  418. * Useful to detect duplicate Time Stamps
  419. */
  420. void SortByTimeStamp()
  421. {
  422. sort( m_flatList.begin(), m_flatList.end(), sortByTimeStamp );
  423. }
  424. /**
  425. * Sort the list of references by value.
  426. *
  427. * Symbols are sorted in the following order:
  428. * - Numeric value of reference designator.
  429. * - Value of symbol.
  430. * - Unit number when symbol has multiple parts.
  431. * - Sheet number.
  432. * - X coordinate position.
  433. * - Y coordinate position.
  434. */
  435. void SortByRefAndValue()
  436. {
  437. sort( m_flatList.begin(), m_flatList.end(), sortByRefAndValue );
  438. }
  439. /**
  440. * Sort the list of references by reference.
  441. *
  442. * Symbols are sorted in the following order:
  443. * - Numeric value of reference designator.
  444. * - Unit number when symbol has multiple parts.
  445. */
  446. void SortByReferenceOnly()
  447. {
  448. sort( m_flatList.begin(), m_flatList.end(), sortByReferenceOnly );
  449. }
  450. /**
  451. * Search the list for a symbol with a given reference.
  452. */
  453. int FindRef( const wxString& aPath ) const;
  454. /**
  455. * Search the sorted list of symbols for a another symbol with the same reference and a
  456. * given part unit. Use this method to manage symbols with multiple parts per package.
  457. *
  458. * @param aIndex is the index in aSymbolsList for of given #SCH_REFERENCE item to test.
  459. * @param aUnit is the given unit number to search.
  460. * @param aIncludeNew true to include references with the "new" flag in the search.
  461. * @return index in aSymbolsList if found or -1 if not found.
  462. */
  463. int FindUnit( size_t aIndex, int aUnit, bool aIncludeNew = false ) const;
  464. /**
  465. * Search the list for a symbol with the given KIID path (as string).
  466. *
  467. * @param aFullPath is the path of the symbol item to search.
  468. * @return an index in m_flatList if found or -1 if not found.
  469. */
  470. int FindRefByFullPath( const wxString& aFullPath ) const;
  471. /**
  472. * Add all the reference designator numbers greater than \a aMinRefId to \a aIdList
  473. * skipping the reference at \a aIndex.
  474. *
  475. * @param aIndex is the current symbol's index to use for reference prefix filtering.
  476. * @param aIdList is the buffer to fill.
  477. * @param aMinRefId is the minimum ID value to store. All values < aMinRefId are ignored.
  478. */
  479. void GetRefsInUse( int aIndex, std::vector<int>& aIdList, int aMinRefId ) const;
  480. /**
  481. * Return all the unit numbers for a given reference, comparing library reference, value,
  482. * reference number and reference prefix.
  483. *
  484. * @param aRef is the index of a symbol to use for reference prefix and number filtering.
  485. */
  486. std::vector<int> GetUnitsMatchingRef( const SCH_REFERENCE& aRef ) const;
  487. /**
  488. * Return the first unused reference number from the properties given in aRef, ensuring
  489. * all of the units in aRequiredUnits are also unused.
  490. *
  491. * @param aIndex The index of the reference item used for the search pattern.
  492. * @param aMinValue The minimum value for the current search.
  493. * @param aRequiredUnits List of units to ensure are free
  494. */
  495. int FindFirstUnusedReference( const SCH_REFERENCE& aRef, int aMinValue,
  496. const std::vector<int>& aRequiredUnits ) const;
  497. std::vector<SCH_SYMBOL_INSTANCE> GetSymbolInstances() const;
  498. #if defined(DEBUG)
  499. void Show( const char* aPrefix = "" )
  500. {
  501. printf( "%s\n", aPrefix );
  502. for( unsigned i=0; i < m_flatList.size(); ++i )
  503. {
  504. SCH_REFERENCE& schref = m_flatList[i];
  505. printf( " [%-2d] ref:%-8s num:%-3d lib_part:%s\n",
  506. i,
  507. schref.m_ref.ToStdString().c_str(),
  508. schref.m_numRef,
  509. TO_UTF8( schref.GetLibPart()->GetName() ) );
  510. }
  511. }
  512. #endif
  513. /**
  514. * Return a shorthand string representing all the references in the list. For instance,
  515. * "R1, R2, R4 - R7, U1"
  516. * @param spaced Add spaces between references
  517. */
  518. static wxString Shorthand( std::vector<SCH_REFERENCE> aList, const wxString& refDelimiter,
  519. const wxString& refRangeDelimiter );
  520. friend class BACK_ANNOTATION;
  521. typedef std::vector<SCH_REFERENCE>::iterator iterator;
  522. typedef std::vector<SCH_REFERENCE>::const_iterator const_iterator;
  523. iterator begin() { return m_flatList.begin(); }
  524. iterator end() { return m_flatList.end(); }
  525. const_iterator begin() const { return m_flatList.begin(); }
  526. const_iterator end() const { return m_flatList.end(); }
  527. iterator erase( iterator position ) { return m_flatList.erase( position ); }
  528. iterator erase( iterator first, iterator last ) { return m_flatList.erase( first, last ); }
  529. private:
  530. static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
  531. static bool sortByXPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
  532. static bool sortByYPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
  533. static bool sortByTimeStamp( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
  534. static bool sortByReferenceOnly( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
  535. /**
  536. * Search for the first free reference number in \a aListId of reference numbers in use.
  537. *
  538. * This function just searches for a hole in a list of incremented numbers, this list must
  539. * be sorted by increasing values and each value can be stored only once. The new value
  540. * is added to the list.
  541. *
  542. * @see BuildRefIdInUseList to prepare this list
  543. * @param aIdList The buffer that contains the reference numbers in use.
  544. * @param aFirstValue The first expected free value
  545. * @return The first free (not yet used) value.
  546. */
  547. static int createFirstFreeRefId( std::vector<int>& aIdList, int aFirstValue );
  548. // Used for sorting static sortByTimeStamp function
  549. friend class BACK_ANNOTATE;
  550. std::vector<SCH_REFERENCE> m_flatList;
  551. };
  552. #endif // _SCH_REFERENCE_LIST_H_