Loading eeschema/component_references_lister.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,25 @@ bool SCH_REFERENCE_LIST::sortByRefAndValue( const SCH_REFERENCE& item1, return ii < 0; } bool SCH_REFERENCE_LIST::sortByValueAndRef( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ) { int ii = item1.CompareValue( item2 ); if( ii == 0 ) ii = RefDesStringCompare( item1.GetRef(), item2.GetRef() ); if( ii == 0 ) ii = item1.m_Unit - item2.m_Unit; if( ii == 0 ) ii = item1.m_SheetNum - item2.m_SheetNum; if( ii == 0 ) ii = item1.m_CmpPos.x - item2.m_CmpPos.x; if( ii == 0 ) ii = item1.m_CmpPos.y - item2.m_CmpPos.y; if( ii == 0 ) ii = item1.m_TimeStamp - item2.m_TimeStamp; return ii < 0; } static bool engStrToDouble( wxString aStr, double* aDouble ) { Loading eeschema/dialogs/dialog_build_BOM.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ void DIALOG_BUILD_BOM::CreatePartsList( const wxString& aFullFileName, bool aInc cmplist.RemoveSubComponentsFromList(); // sort component list by value cmplist.SortByValueOnly( ); cmplist.SortByRefAndValue( ); PrintComponentsListByPart( f, cmplist, aIncludeSubComponents ); fclose( f ); Loading eeschema/netlist.h +22 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,26 @@ public: sort( componentFlatList.begin(), componentFlatList.end(), sortByRefAndValue ); } /** * Function SortByValueAndRef * sorts the list of references by value. * <p> * Components are sorted in the following order: * <ul> * <li>Value of component.</li> * <li>Numeric value of reference designator.</li> * <li>Unit number when component has multiple parts.</li> * <li>Sheet number.</li> * <li>X coordinate position.</li> * <li>Y coordinate position.</li> * </ul> * </p> */ void SortByValueAndRef() { sort( componentFlatList.begin(), componentFlatList.end(), sortByValueAndRef ); } /** * Function SortByReferenceOnly * sorts the list of references by reference. Loading Loading @@ -454,6 +474,8 @@ private: static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); static bool sortByValueAndRef( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); static bool sortByXPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); static bool sortByYPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); Loading Loading
eeschema/component_references_lister.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,25 @@ bool SCH_REFERENCE_LIST::sortByRefAndValue( const SCH_REFERENCE& item1, return ii < 0; } bool SCH_REFERENCE_LIST::sortByValueAndRef( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ) { int ii = item1.CompareValue( item2 ); if( ii == 0 ) ii = RefDesStringCompare( item1.GetRef(), item2.GetRef() ); if( ii == 0 ) ii = item1.m_Unit - item2.m_Unit; if( ii == 0 ) ii = item1.m_SheetNum - item2.m_SheetNum; if( ii == 0 ) ii = item1.m_CmpPos.x - item2.m_CmpPos.x; if( ii == 0 ) ii = item1.m_CmpPos.y - item2.m_CmpPos.y; if( ii == 0 ) ii = item1.m_TimeStamp - item2.m_TimeStamp; return ii < 0; } static bool engStrToDouble( wxString aStr, double* aDouble ) { Loading
eeschema/dialogs/dialog_build_BOM.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ void DIALOG_BUILD_BOM::CreatePartsList( const wxString& aFullFileName, bool aInc cmplist.RemoveSubComponentsFromList(); // sort component list by value cmplist.SortByValueOnly( ); cmplist.SortByRefAndValue( ); PrintComponentsListByPart( f, cmplist, aIncludeSubComponents ); fclose( f ); Loading
eeschema/netlist.h +22 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,26 @@ public: sort( componentFlatList.begin(), componentFlatList.end(), sortByRefAndValue ); } /** * Function SortByValueAndRef * sorts the list of references by value. * <p> * Components are sorted in the following order: * <ul> * <li>Value of component.</li> * <li>Numeric value of reference designator.</li> * <li>Unit number when component has multiple parts.</li> * <li>Sheet number.</li> * <li>X coordinate position.</li> * <li>Y coordinate position.</li> * </ul> * </p> */ void SortByValueAndRef() { sort( componentFlatList.begin(), componentFlatList.end(), sortByValueAndRef ); } /** * Function SortByReferenceOnly * sorts the list of references by reference. Loading Loading @@ -454,6 +474,8 @@ private: static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); static bool sortByValueAndRef( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); static bool sortByXPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); static bool sortByYPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 ); Loading