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) {
362
362
return r ;
363
363
}
364
364
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
+
365
379
function getSelectedBomList ( ) {
366
380
if ( settings . bommode == "netlist" ) {
367
381
return pcbdata . nets . slice ( ) ;
368
382
}
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 ) ;
381
384
382
385
if ( settings . bommode == "ungrouped" ) {
383
386
// expand bom table
Original file line number Diff line number Diff line change @@ -206,10 +206,9 @@ function initUtils() {
206
206
if ( config . fields . includes ( "Value" ) ) {
207
207
var index = config . fields . indexOf ( "Value" ) ;
208
208
pcbdata . bom [ "parsedValues" ] = { } ;
209
- var bomList = getSelectedBomList ( ) . flat ( ) ;
210
209
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 ) ;
213
212
}
214
213
}
215
214
}
You can’t perform that action at this time.
0 commit comments