Loading eeschema/dialogs/dialog_build_BOM.cpp +20 −8 Original line number Original line Diff line number Diff line Loading @@ -468,7 +468,7 @@ void DIALOG_BUILD_BOM::CreatePartsList( ) cmplist.RemoveSubComponentsFromList(); cmplist.RemoveSubComponentsFromList(); // sort component list by value // sort component list by value cmplist.SortByValueAndRef( ); cmplist.SortByValueOnly( ); PrintComponentsListByPart( f, cmplist, false ); PrintComponentsListByPart( f, cmplist, false ); fclose( f ); fclose( f ); Loading Loading @@ -872,14 +872,14 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* aFile, SCH_REFERENCE_LIST while( index < aList.GetCount() ) while( index < aList.GetCount() ) { { SCH_COMPONENT *component = aList[index].GetComponent(); SCH_COMPONENT *component = aList[index].GetComponent(); wxString referenceListStr; wxArrayString referenceStrList; int qty = 1; int qty = 1; referenceListStr.append( aList[index].GetRef() ); referenceStrList.Add( aList[index].GetRef() ); for( unsigned int i = index+1; i < aList.GetCount(); ) for( unsigned int i = index+1; i < aList.GetCount(); ) { { if( *(aList[i].GetComponent()) == *component ) if( *(aList[i].GetComponent()) == *component ) { { referenceListStr.append( wxT( " " ) + aList[i].GetRef() ); referenceStrList.Add( aList[i].GetRef() ); aList.RemoveItem( i ); aList.RemoveItem( i ); qty++; qty++; } } Loading @@ -887,10 +887,22 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* aFile, SCH_REFERENCE_LIST i++; // Increment index only when current item is not removed from the list i++; // Increment index only when current item is not removed from the list } } // Write value, quantity and list of references referenceStrList.Sort( RefDesStringCompare ); // Sort references for this component fprintf( aFile, "%15s%c%3d%c\"%s\"", TO_UTF8( component->GetField( VALUE )->GetText() ), s_ExportSeparatorSymbol, qty, // Write value, quantity s_ExportSeparatorSymbol, TO_UTF8( referenceListStr ) ); fprintf( aFile, "%15s%c%3d", TO_UTF8( component->GetField( VALUE )->GetText() ), s_ExportSeparatorSymbol, qty ); // Write list of references for( int i = 0; i < referenceStrList.Count(); i++ ) { if( i == 0 ) fprintf( aFile, "%c\"%s", s_ExportSeparatorSymbol, TO_UTF8( referenceStrList[i] ) ); else fprintf( aFile, " %s", TO_UTF8( referenceStrList[i] ) ); } if( referenceStrList.Count() ) fprintf( aFile, "\"" ); // Write the rest of the fields if required // Write the rest of the fields if required #if defined( KICAD_GOST ) #if defined( KICAD_GOST ) Loading Loading
eeschema/dialogs/dialog_build_BOM.cpp +20 −8 Original line number Original line Diff line number Diff line Loading @@ -468,7 +468,7 @@ void DIALOG_BUILD_BOM::CreatePartsList( ) cmplist.RemoveSubComponentsFromList(); cmplist.RemoveSubComponentsFromList(); // sort component list by value // sort component list by value cmplist.SortByValueAndRef( ); cmplist.SortByValueOnly( ); PrintComponentsListByPart( f, cmplist, false ); PrintComponentsListByPart( f, cmplist, false ); fclose( f ); fclose( f ); Loading Loading @@ -872,14 +872,14 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* aFile, SCH_REFERENCE_LIST while( index < aList.GetCount() ) while( index < aList.GetCount() ) { { SCH_COMPONENT *component = aList[index].GetComponent(); SCH_COMPONENT *component = aList[index].GetComponent(); wxString referenceListStr; wxArrayString referenceStrList; int qty = 1; int qty = 1; referenceListStr.append( aList[index].GetRef() ); referenceStrList.Add( aList[index].GetRef() ); for( unsigned int i = index+1; i < aList.GetCount(); ) for( unsigned int i = index+1; i < aList.GetCount(); ) { { if( *(aList[i].GetComponent()) == *component ) if( *(aList[i].GetComponent()) == *component ) { { referenceListStr.append( wxT( " " ) + aList[i].GetRef() ); referenceStrList.Add( aList[i].GetRef() ); aList.RemoveItem( i ); aList.RemoveItem( i ); qty++; qty++; } } Loading @@ -887,10 +887,22 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* aFile, SCH_REFERENCE_LIST i++; // Increment index only when current item is not removed from the list i++; // Increment index only when current item is not removed from the list } } // Write value, quantity and list of references referenceStrList.Sort( RefDesStringCompare ); // Sort references for this component fprintf( aFile, "%15s%c%3d%c\"%s\"", TO_UTF8( component->GetField( VALUE )->GetText() ), s_ExportSeparatorSymbol, qty, // Write value, quantity s_ExportSeparatorSymbol, TO_UTF8( referenceListStr ) ); fprintf( aFile, "%15s%c%3d", TO_UTF8( component->GetField( VALUE )->GetText() ), s_ExportSeparatorSymbol, qty ); // Write list of references for( int i = 0; i < referenceStrList.Count(); i++ ) { if( i == 0 ) fprintf( aFile, "%c\"%s", s_ExportSeparatorSymbol, TO_UTF8( referenceStrList[i] ) ); else fprintf( aFile, " %s", TO_UTF8( referenceStrList[i] ) ); } if( referenceStrList.Count() ) fprintf( aFile, "\"" ); // Write the rest of the fields if required // Write the rest of the fields if required #if defined( KICAD_GOST ) #if defined( KICAD_GOST ) Loading