From 1db950389a3dbae8d710a9ded0210a51293b61ff Mon Sep 17 00:00:00 2001 From: Ewoud Date: Fri, 6 Oct 2023 12:57:28 +0200 Subject: [PATCH] SuperSync button works index.js - extend checkNode function (panel 0, nrofpanels, matrix size) - populateNodes: add panel 0 and dummypanel --- wled00/data/index.js | 83 +- wled00/html_settings.h | 869 ++++++++------- wled00/html_ui.h | 2266 ++++++++++++++++++++-------------------- 3 files changed, 1627 insertions(+), 1591 deletions(-) diff --git a/wled00/data/index.js b/wled00/data/index.js index e79eefee..1b2c5dd9 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -1080,7 +1080,7 @@ function SuperSync(nnodes) { for (i=0; i 2) + gId(`eql${nodeNr}`).innerText = "nrOfP > 2"; + else if (gId(`mrx${nodeNr}`).innerText != lastinfo.leds.matrix.w + "x" + lastinfo.leds.matrix.h) + gId(`eql${nodeNr}`).innerText = "mrx not " + lastinfo.leds.matrix.w + "x" + lastinfo.leds.matrix.h; else - gId(`eql${nodeNr}`).innerText = "no"; - + gId(`eql${nodeNr}`).innerText = "yes"; } function fetchInfoAndCfg(ip, nodeNr, parms, callback) { //add td placeholders urows += ``; - for (let nm of ["ins", "pwr", "type", "vid", "ip", "rel", "ver", "lc", "fx", "mrx", "pnl", "pnlX", "eql"]) + for (let nm of ["ins", "pwr", "type", "vid", "ip", "rel", "ver", "lc", "fx", "mrx", "pnl0", "pnlC", "pnlX", "eql"]) urows += ``; urows += ``; @@ -1159,19 +1163,20 @@ function populateNodes(i,n) // console.log(nodeNr, state, info, effects); //add on/off button - gId(`pwr${nodeNr}`).innerHTML = ""; - gId(`type${nodeNr}`).innerText = info["arch"]; - gId(`vid${nodeNr}`).innerText = info["vid"]; - gId(`ip${nodeNr}`).innerText = info["ip"]; - gId(`rel${nodeNr}`).innerText = info["rel"]; - gId(`ver${nodeNr}`).innerText = info["ver"]; - gId(`lc${nodeNr}`).innerText = info["leds"]["count"] + " (" + info["leds"]["countP"] + ")"; - gId(`fx${nodeNr}`).innerText = effects[state["seg"][0]["fx"]]; - if (info["leds"]["matrix"]) - gId(`mrx${nodeNr}`).innerText = info["leds"]["matrix"]["w"] + "x" + info["leds"]["matrix"]["h"]; + gId(`pwr${nodeNr}`).innerHTML = ""; + gId(`type${nodeNr}`).innerText = info.arch; + gId(`vid${nodeNr}`).innerText = info.vid; + gId(`ip${nodeNr}`).innerText = info.ip; + gId(`rel${nodeNr}`).innerText = info.rel; + gId(`ver${nodeNr}`).innerText = info.ver; + gId(`lc${nodeNr}`).innerText = info.leds.count + " (" + info.leds.countP + ")"; + gId(`fx${nodeNr}`).innerText = effects[state.seg[0].fx]; + if (info.leds.matrix) + gId(`mrx${nodeNr}`).innerText = info.leds.matrix.w + "x" + info.leds.matrix.h; + //used by ddpAll and SuperSync extendedNodes[nodeNr] = {}; - extendedNodes[nodeNr].info = info; //used by ddpAll and SuperSync + extendedNodes[nodeNr].info = info; fetchAndExecute(`http://${ip}/`, "cfg.json", nodeNr, function(nodeNr,text) { let cfg = JSON.parse(text); @@ -1180,28 +1185,49 @@ function populateNodes(i,n) if (ip == lastinfo.ip) { //self color = `style="background-color: red;"`; } - let url = ``; + let url = ``; gId(`ins${nodeNr}`).innerHTML = url; - let matrix = cfg["hw"]["led"]["matrix"]; + let matrix = cfg.hw.led.matrix; // var str = JSON.stringify(matrix, null, 2); // jsonpretty if (matrix) { // console.log(matrix); - gId(`pnl${nodeNr}`).innerText = showPanel(matrix.panels[0]); //show the first panel + gId(`pnl0${nodeNr}`).innerText = showPanel(matrix.panels[0]); //show the first panel + gId(`pnlC${nodeNr}`).innerText = matrix.panels.length; //show nr of panels if (ip == lastinfo.ip) { //self for (let i=0; i`; - for (let nm of ["Instance", "Power", "Type", "Build", "IP", "Release", "Version", "Leds", "Effect", "Matrix", "Panel0", "PanelX", "Equal"]) + for (let nm of ["Instance", "Power", "Type", "Build", "IP", "Release", "Version", "Leds", "Effect", "Matrix", "Panel0", "NrOfP", "PanelX", "Equal"]) urows += `${nm}`; urows += ``; @@ -1244,7 +1270,8 @@ function populateNodes(i,n) //if all done if (nnodesDone == nnodes ) { for (let i=0; i