diff --git a/html/index.html b/html/index.html index 79f95f6..27ef213 100644 --- a/html/index.html +++ b/html/index.html @@ -192,7 +192,15 @@

Preload

Components

- + + +   + +  |  + +
+
+ Current: -- / --  |  -- -- -- --  |  Height: -- @@ -205,7 +213,9 @@

Components

Footprint Offset - Value Reference + Value + Quantity
(pre PCB) Quantity
(total) + Reference X Y R diff --git a/html/pos_list.js b/html/pos_list.js index 1dc0ad9..0bf3f47 100644 --- a/html/pos_list.js +++ b/html/pos_list.js @@ -77,9 +77,14 @@ function search_comp_parents(comp, set_color=false, color='') for (let elm of value_list) { if (elm.contains(comp_elm)) { let sub0 = elm.querySelector('td'); + let quantity_list = elm.querySelectorAll('.list_quantity'); parents[1] = sub0.innerText; - if (set_color) + if (set_color) { sub0.style.backgroundColor = color; + for (let quan_elm of quantity_list) { + quan_elm.style.backgroundColor = color; + } + } break; } } @@ -246,9 +251,23 @@ function pos_to_page(pos) { ${readable_float(comp[3])} `; } + let list_quantity_pre_pcb_html = ''; + if (document.getElementById('quantity_pre_pcb').checked) { + list_quantity_pre_pcb_html = ` + ${pos[footprint][value].length} + `; + } + let list_quantity_total_html = ''; + if (document.getElementById('quantity_total').checked) { + list_quantity_total_html = ` + ${csa.fiducial_cam.length * pos[footprint][value].length} + `; + } html_value += ` ${value} + ${list_quantity_pre_pcb_html} + ${list_quantity_total_html} @@ -258,11 +277,14 @@ function pos_to_page(pos) { `; } + let colspan_counter = 5 + colspan_counter += document.getElementById('quantity_pre_pcb').checked ? 1 : 0 + colspan_counter += document.getElementById('quantity_total').checked ? 1 : 0 let html = ` -
${footprint} -- + ${html_value} @@ -443,6 +465,17 @@ window.btn_select_board = async function (idx) { await select_comp(search_current_comp()); }; +async function update_pos(id="", column="") { + if (id != '' && column != '') { + let checkBox = document.getElementById(id); + let elm = document.getElementById(column); + elm.style.display = checkBox.checked ? '' : 'none'; + } + let pos = await db.get('tmp', 'list'); + if (pos) + pos_to_page(pos); +}; +window.update_pos = update_pos; export { search_comp_parents, search_next_comp, search_current_comp, search_first_comp, select_comp, move_to_comp,