|
152 | 152 | width: 15%; |
153 | 153 | } |
154 | 154 |
|
155 | | - .bom .Quantity-Per-PCB { |
| 155 | + .bom .Quantity { |
156 | 156 | width: 65px; |
157 | 157 | } |
158 | 158 |
|
|
604 | 604 | return r; |
605 | 605 | } |
606 | 606 |
|
607 | | - function populateBomTable() { |
| 607 | + function populateBomTable(layout) { |
| 608 | + console.log('populate bom called with ' + layout); |
608 | 609 | while (bom.firstChild) { |
609 | 610 | bom.removeChild(bom.firstChild); |
610 | 611 | } |
611 | 612 | var first = true; |
612 | | - for (i in pcbdata.bom.both) { |
613 | | - var bomentry = pcbdata.bom.both[i]; |
| 613 | + switch (layout) { |
| 614 | + case 'F': |
| 615 | + bomtable = pcbdata.bom.F; |
| 616 | + break; |
| 617 | + case 'FB': |
| 618 | + bomtable = pcbdata.bom.both; |
| 619 | + break; |
| 620 | + case 'B': |
| 621 | + bomtable = pcbdata.bom.B; |
| 622 | + break; |
| 623 | + } |
| 624 | + for (i in bomtable) { |
| 625 | + var bomentry = bomtable[i]; |
614 | 626 | if (filter && !entryMatches(bomentry)) { |
615 | 627 | continue; |
616 | 628 | } |
|
654 | 666 |
|
655 | 667 | function updateFilter(input) { |
656 | 668 | filter = input.toLowerCase(); |
657 | | - populateBomTable(); |
| 669 | + populateBomTable(canvaslayout); |
658 | 670 | } |
659 | 671 |
|
660 | 672 | function silkscreenVisible(visible) { |
|
692 | 704 | } |
693 | 705 | canvaslayout = layout; |
694 | 706 | resizeCanvas(); |
| 707 | + populateBomTable(layout); |
695 | 708 | } |
696 | 709 |
|
697 | 710 | function populateMetadata() { |
|
804 | 817 | dbgdiv = document.getElementById("dbg"); |
805 | 818 | bom = document.getElementById("bombody"); |
806 | 819 | bomlayout = "none"; |
807 | | - changeBomLayout('LR'); |
808 | | - changeCanvasLayout("FB"); |
809 | | - console.log("document.onload", e, Date.now()); |
810 | | - resizeCanvas(); |
| 820 | + canvaslayout = "FB"; |
811 | 821 | filter = ""; |
812 | 822 | populateMetadata(); |
813 | | - populateBomTable(); |
| 823 | + resizeCanvas(); |
| 824 | + changeBomLayout('LR'); |
| 825 | + console.log("document.onload", e, Date.now()); |
814 | 826 | } |
815 | 827 |
|
816 | 828 | window.onresize = resizeCanvas; |
|
886 | 898 | <th class="References">References</th> |
887 | 899 | <th class="Value">Value</th> |
888 | 900 | <th class="Footprint">Footprint</th> |
889 | | - <th class="Quantity-Per-PCB">Quantity Per PCB</th> |
| 901 | + <th class="Quantity">Quantity</th> |
890 | 902 | </tr> |
891 | 903 | </thead> |
892 | 904 | <tbody id="bombody"> |
|
0 commit comments