diff options
Diffstat (limited to 'src/bmweb/indexsection.js')
-rw-r--r-- | src/bmweb/indexsection.js | 126 |
1 files changed, 96 insertions, 30 deletions
diff --git a/src/bmweb/indexsection.js b/src/bmweb/indexsection.js index 6267edc..f808964 100644 --- a/src/bmweb/indexsection.js +++ b/src/bmweb/indexsection.js @@ -74,9 +74,13 @@ function updateComputeIndexLink(defaultBaseTime, defaultMedianWinSize) if (document.getElementById("ixDQStatsEnabled").checked) { // Add parameters for data quality statistics ... + + stabTol = getPositiveIntFromText(document.getElementById("ixDQStatsStabTol").value, 2); + document.getElementById("ixDQStatsStabTol").value = stabTol; + url += " -dataqualitystats" + " -dqstatsdifftol " + document.getElementById("ixDQStatsDiffTol").value - + " -dqstatsstabtol " + selectedOptions("ixDQStatsStabTol")[0]; + + " -dqstatsstabtol " + stabTol; } @@ -112,7 +116,7 @@ function updateComputeASFStatsLink(defaultMedianWinSize) url += " -fromtime " + document.getElementById("ixASFStatsFromTime").value + " -totime " + document.getElementById("ixASFStatsToTime").value + " -difftol " + document.getElementById("ixASFStatsDiffTol").value - + " -stabtol " + selectedOptions("ixASFStatsStabTol")[0] + + " -stabtol " + document.getElementById("ixASFStatsStabTol").value + " -sftol " + document.getElementById("ixASFStatsSFTol").value + " -lftol " + document.getElementById("ixASFStatsLFTol").value + " -maxldtol " + document.getElementById("ixASFStatsMaxLDTol").value; @@ -632,7 +636,7 @@ function IndexSection() input = td.appendChild(document.createElement("input")); input.setAttribute("type", "text"); input.setAttribute("id", "ixDQStatsDiffTol"); - input.setAttribute("Value", "10"); + input.setAttribute("Value", "2"); tr = table.insertRow(table.rows.length); td = tr.insertCell(0); @@ -640,14 +644,10 @@ function IndexSection() td.innerHTML = "Stability tolerance: "; td = tr.insertCell(1); td.setAttribute("style", "text-align:left"); - select = td.appendChild(document.createElement("select")); - select.setAttribute("id", "ixDQStatsStabTol"); - select.options[0] = new Option("2", "2"); - select.options[1] = new Option("3", "3"); - select.options[2] = new Option("4", "4"); - select.options[3] = new Option("5", "5"); - select.options[4] = new Option("6", "6"); - select.options[2].selected = true; + input = td.appendChild(document.createElement("input")); + input.setAttribute("type", "text"); + input.setAttribute("id", "ixDQStatsStabTol"); + input.setAttribute("Value", "3"); // ... ASF scorecard stats fieldset ... td = topRow.insertCell(topRow.cells.length); @@ -743,7 +743,7 @@ function IndexSection() input = td.appendChild(document.createElement("input")); input.setAttribute("type", "text"); input.setAttribute("id", "ixASFStatsDiffTol"); - input.setAttribute("Value", "10"); + input.setAttribute("Value", "2"); td = tr.insertCell(2); td.innerHTML = "The maximum allowed relative difference between two values for them to be " @@ -757,14 +757,10 @@ function IndexSection() td.innerHTML = "Stability tolerance: "; td = tr.insertCell(1); td.setAttribute("style", "text-align:left"); - select = td.appendChild(document.createElement("select")); - select.setAttribute("id", "ixASFStatsStabTol"); - select.options[0] = new Option("2", "2"); - select.options[1] = new Option("3", "3"); - select.options[2] = new Option("4", "4"); - select.options[3] = new Option("5", "5"); - select.options[4] = new Option("6", "6"); - select.options[2].selected = true; + input = td.appendChild(document.createElement("input")); + input.setAttribute("type", "text"); + input.setAttribute("id", "ixASFStatsStabTol"); + input.setAttribute("Value", "3"); td = tr.insertCell(2); td.innerHTML = "The minimum length a MaxESS must have for it to be considered stable."; td.setAttribute("style", "background-color:#eeeeee"); @@ -779,7 +775,7 @@ function IndexSection() input = td.appendChild(document.createElement("input")); input.setAttribute("type", "text"); input.setAttribute("id", "ixASFStatsSFTol"); - input.setAttribute("Value", "10"); + input.setAttribute("Value", "50"); td = tr.insertCell(2); td.innerHTML = "The minimum SF (stability fraction) of a result history must have for it to be " @@ -796,7 +792,7 @@ function IndexSection() input = td.appendChild(document.createElement("input")); input.setAttribute("type", "text"); input.setAttribute("id", "ixASFStatsLFTol"); - input.setAttribute("Value", "10"); + input.setAttribute("Value", "50"); td = tr.insertCell(2); td.innerHTML = "The minimum ULF (unique level fraction) a result history must have for it to be " @@ -813,7 +809,7 @@ function IndexSection() input = td.appendChild(document.createElement("input")); input.setAttribute("type", "text"); input.setAttribute("id", "ixASFStatsMaxLDTol"); - input.setAttribute("Value", "10"); + input.setAttribute("Value", "200"); td = tr.insertCell(2); td.innerHTML = "The percentage of subsequence levels that are unique."; td.innerHTML = @@ -1025,21 +1021,91 @@ function IndexSection() this.state = function() { var state_ = []; - // 2 B DONE! + // Data Quality Stats parameters ... + + // ... difference tolerance ... + state_["ixDQStatsDiffTol"] = document.getElementById("ixDQStatsDiffTol").value; + + // ... stability tolerance ... + state_["ixDQStatsStabTol"] = document.getElementById("ixDQStatsStabTol").value; + + + // ASF Scorecard Stats parameters ... + + // ... 'from' timestamp ... + state_["ixASFStatsFromTime"] = document.getElementById("ixASFStatsFromTime").value; + + // ... 'to' timestamp ... + state_["ixASFStatsToTime"] = document.getElementById("ixASFStatsToTime").value; + + // ... difference tolerance ... + state_["ixASFStatsDiffTol"] = document.getElementById("ixASFStatsDiffTol").value; + + // ... stability tolerance ... + state_["ixASFStatsStabTol"] = document.getElementById("ixASFStatsStabTol").value; -// state_["ixTestState"] = document.getElementById("ixTestState").value; + // ... stability fraction tolerance ... + state_["ixASFStatsSFTol"] = document.getElementById("ixASFStatsSFTol").value; + + // ... unique level fraction tolerance ... + state_["ixASFStatsLFTol"] = document.getElementById("ixASFStatsLFTol").value; + + // ... max level difference tolerance ... + state_["ixASFStatsMaxLDTol"] = document.getElementById("ixASFStatsMaxLDTol").value; return state_; } this.setState = function(state_, handleDone) { - // 2 B DONE! + // Data Quality Stats parameters ... + + // ... difference tolerance ... + document.getElementById("ixDQStatsDiffTol").value = + getIntFromText(state_["ixDQStatsDiffTol"], 2); + + // ... stability tolerance ... + document.getElementById("ixDQStatsStabTol").value = + getIntFromText(state_["ixDQStatsStabTol"], 3); + + + // ASF Scorecard Stats parameters ... + + // ... 'from' timestamp ... + document.getElementById("ixASFStatsFromTime").value = + getIntFromText(state_["ixASFStatsFromTime"], -1); + + // ... 'to' timestamp ... + document.getElementById("ixASFStatsToTime").value = + getIntFromText(state_["ixASFStatsToTime"], -1); + + // ... difference tolerance ... + document.getElementById("ixASFStatsDiffTol").value = + getIntFromText(state_["ixASFStatsDiffTol"], 2); + + // ... stability tolerance ... + document.getElementById("ixASFStatsStabTol").value = + getIntFromText(state_["ixASFStatsStabTol"], 3); + + // ... stability fraction tolerance ... + document.getElementById("ixASFStatsSFTol").value = + getIntFromText(state_["ixASFStatsSFTol"], 50); + + // ... unique level fraction tolerance ... + document.getElementById("ixASFStatsLFTol").value = + getIntFromText(state_["ixASFStatsLFTol"], 50); + + // ... max level level difference tolerance ... + document.getElementById("ixASFStatsMaxLDTol").value = + getIntFromText(state_["ixASFStatsMaxLDTol"], 200); + + + // complete this ... + // also convert the stab tol in the data quality stats section to a regular text input + // (rather than a select input) ... + +// 2 B DONE! - // name = "ixTestState"; - // value = parseInt(state_[name]); - // if (!isNaN(value)) - // document.getElementById(name).value = value; handleDone(); } |