diff --git a/server/templates/logger.html b/server/templates/logger.html index 330fe61..e89b614 100644 --- a/server/templates/logger.html +++ b/server/templates/logger.html @@ -17,16 +17,19 @@ function dataRefresh() { // scarico i dati aggioranti $.ajax({url: "/api/v1/channels/all", success: function(result){ + + var divWidth = document.getElementById("divChA").offsetWidth + // compilo i dati scaricati $("#SelChannelA").html(result.ChA); $("#OutputA").html(result.Outs[result.ChA]); - setGaugeA(result.Outs[result.ChA],result.Outmin[result.ChA],result.Outmax[result.ChA]); + setGaugeA(divWidth,result.Outs[result.ChA],result.Outmin[result.ChA],result.Outmax[result.ChA]); $("#SelChannelB").html(result.ChB); $("#OutputB").html(result.Outs[result.ChB]); - setGaugeB(result.Outs[result.ChB],result.Outmin[result.ChB],result.Outmax[result.ChB]); + setGaugeB(divWidth,result.Outs[result.ChB],result.Outmin[result.ChB],result.Outmax[result.ChB]); $("#LogFrequency").html(result.LogFreq); $("#WriteFrequency").html(result.WriteFreq); @@ -75,6 +78,7 @@ $("#UniMisuA").html(result.UniMeasure[result.ChA]); $("#UniMisuB").html(result.UniMeasure[result.ChB]); }}); + // A ogni giro di data refresh fix di tabella cartelle e tabella file fixFolderTable(); fixFileTable(); @@ -82,38 +86,43 @@ timeout = setTimeout(dataRefresh, intTime); }; - function setGaugeA(chValA,outMinA,outMaxA){ + function setGaugeA(divWidth,chValA,outMinA,outMaxA){ // Create knob elements - const knob0 = pureknob.createKnob(200, 200); + const knob0 = pureknob.createKnob(divWidth, divWidth); // Set properties knob0 - knob0.setProperty('angleStart', -0.8 * Math.PI); - knob0.setProperty('angleEnd', 0.8 * Math.PI); + knob0.setProperty('angleStart', -0.85 * Math.PI); + knob0.setProperty('angleEnd', 0.85 * Math.PI); knob0.setProperty('colorFG', '#07adec'); knob0.setProperty('trackWidth', 0.3); - knob0.setProperty('valMin', parseInt(outMinA)); - knob0.setProperty('valMax', parseInt(outMaxA)); + knob0.setProperty('valMin', parseInt(outMinA)*1000); + knob0.setProperty('valMax', parseInt(outMaxA)*1000); knob0.setProperty('readonly', 'true'); + // nascondo numero + knob0.setProperty('textScale', '0'); + knob0.resize(); // Set initial value0 - knob0.setValue(chValA); + knob0.setValue(chValA*1000); // Create element node0 const node0 = knob0.node(); // Add it to the DOM. $("#divChA").html(node0); } - function setGaugeB(chValB,outMinB,outMaxB){ + function setGaugeB(divWidth,chValB,outMinB,outMaxB){ // Create knob elements - const knob1 = pureknob.createKnob(200, 200); + const knob1 = pureknob.createKnob(divWidth, divWidth); // Set properties knob1 - knob1.setProperty('angleStart', -0.8 * Math.PI); - knob1.setProperty('angleEnd', 0.8 * Math.PI); + knob1.setProperty('angleStart', -0.85 * Math.PI); + knob1.setProperty('angleEnd', 0.85 * Math.PI); knob1.setProperty('colorFG', '#07adec'); knob1.setProperty('trackWidth', 0.3); - knob1.setProperty('valMin', parseInt(outMinB)); - knob1.setProperty('valMax', parseInt(outMaxB)); + knob1.setProperty('valMin', parseInt(outMinB)*1000); + knob1.setProperty('valMax', parseInt(outMaxB)*1000); knob1.setProperty('readonly', 'true'); - // Set initial value1 - knob1.setValue(chValB); + // nascondo numero + knob1.setProperty('textScale', '0'); + // Set valore + knob1.setValue(chValB*1000); // Create element node1 const node1 = knob1.node(); // Add it to the DOM. @@ -284,8 +293,8 @@