File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -362,22 +362,25 @@ function highlightFilter(s) {
362362 return r ;
363363}
364364
365+ function findBomRefRowById ( id ) {
366+ var allList = getBomListByLayer ( 'FB' ) . flat ( ) ;
367+ return allList . find ( item => item [ 1 ] == Number ( id ) ) || [ ] ;
368+ }
369+
370+ function getBomListByLayer ( layer ) {
371+ switch ( layer ) {
372+ case 'F' : return pcbdata . bom . F . slice ( ) ;
373+ case 'B' : return pcbdata . bom . B . slice ( ) ;
374+ case 'FB' : return pcbdata . bom . both . slice ( ) ;
375+ }
376+ return [ ] ;
377+ }
378+
365379function getSelectedBomList ( ) {
366380 if ( settings . bommode == "netlist" ) {
367381 return pcbdata . nets . slice ( ) ;
368382 }
369- var out = [ ] ;
370- switch ( settings . canvaslayout ) {
371- case 'F' :
372- out = pcbdata . bom . F . slice ( ) ;
373- break ;
374- case 'FB' :
375- out = pcbdata . bom . both . slice ( ) ;
376- break ;
377- case 'B' :
378- out = pcbdata . bom . B . slice ( ) ;
379- break ;
380- }
383+ var out = getBomListByLayer ( settings . canvaslayout ) ;
381384
382385 if ( settings . bommode == "ungrouped" ) {
383386 // expand bom table
Original file line number Diff line number Diff line change @@ -206,10 +206,9 @@ function initUtils() {
206206 if ( config . fields . includes ( "Value" ) ) {
207207 var index = config . fields . indexOf ( "Value" ) ;
208208 pcbdata . bom [ "parsedValues" ] = { } ;
209- var bomList = getSelectedBomList ( ) . flat ( ) ;
210209 for ( var id in pcbdata . bom . fields ) {
211- var ref_row = bomList . find ( item => item [ 1 ] == Number ( id ) ) || [ ] ;
212- pcbdata . bom . parsedValues [ id ] = parseValue ( pcbdata . bom . fields [ id ] [ index ] , ref_row [ 0 ] || '' ) ;
210+ var ref_key = findBomRefRowById ( id ) [ 0 ] || '' ;
211+ pcbdata . bom . parsedValues [ id ] = parseValue ( pcbdata . bom . fields [ id ] [ index ] , ref_key ) ;
213212 }
214213 }
215214}
You can’t perform that action at this time.
0 commit comments