| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>Set PreValue</title>
- <meta charset="utf-8">
-
- <style>
- h1 {font-size: 2em;}
- h2 {font-size: 1.5em;}
- h3 {font-size: 1.2em;}
- p {font-size: 1em;}
- div {
- width: 200px;
- padding: 10px 5px;
- display: inline-block;
- border: 1px solid #ccc;
- font-size: 16px;
- max-height: 35px;
- }
- input[type=number] {
- width: 125px;
- padding: 10px 5px;
- display: inline-block;
- border: 1px solid #ccc;
- font-size: 16px;
- }
- .button {
- padding: 10px 20px;
- width: 211px;
- font-size: 16px;
- }
- </style>
-
- </head>
- <body style="font-family: arial; padding: 0px 10px;">
- <h3>Set the previous value for consistency check and substitution for NaN</h3>
- <class id="Numbers_text" style="font-size: 120%; color:black;"><b>Choose Number: </b>
- <select id="Numbers_value1" onchange="numberChanged()">
- <option value="0" selected>default</option>
- <option value="1" >NT</option>
- <option value="2" >HT</option>
- </select>
- </class>
- <table style="width:100%">
- <tr>
- <h3>Current Value:</h3><p>
- <div id="prevalue"></div>
- <h3>Set Value:</h3><p>
- Input (Format = 123.456):<p>
- PreValue:
- <input type="number" id="myInput" name="myInput"
- pattern="[0-9]+([\.,][0-9]+)?" step="0.001"
- title="This should be a number with up to 4 decimal places.">
- <p></p>
- <button class="button" type="button" onclick="setprevalue()">Set PreValue</button>
- </tr>
- <tr>
- <h3>Result:</h3><p>
- <div id="result" readonly></div>
- </tr>
- </table>
- </body></html>
- <script type="text/javascript" src="./gethost.js"></script>
- <script type="text/javascript" src="./readconfigcommon.js"></script>
- <script type="text/javascript" src="./readconfigparam.js"></script>
- <script type="text/javascript">
- var basepath = "http://192.168.178.22";
- var NUMBERS;
- function setprevalue() {
- var inputVal = document.getElementById("myInput").value;
- var sel = document.getElementById("Numbers_value1");
- var _number = sel.options[sel.selectedIndex].text;
- inputVal = inputVal.replace(",", ".");
- var xhttp = new XMLHttpRequest();
- try {
- url = basepath + "/setPreValue.html?value=" + inputVal + "&numbers=" + _number;
- xhttp.open("GET", url, false);
- xhttp.send();
- response = xhttp.responseText;
- document.getElementById("result").innerHTML=response;
- }
- catch (error)
- {
- // alert("Deleting Config.ini failed");
- }
- }
- function loadPrevalue(_basepath) {
- var sel = document.getElementById("Numbers_value1");
- var _number = sel.options[sel.selectedIndex].text;
- var xhttp = new XMLHttpRequest();
- try {
- url = _basepath + '/setPreValue.html?numbers=' + _number;
- xhttp.open("GET", url, false);
- xhttp.send();
- response = xhttp.responseText;
- document.getElementById("prevalue").innerHTML=response;
- }
- catch (error)
- {
- // alert("Deleting Config.ini failed");
- }
- return true;
- }
- function numberChanged(){
- loadPrevalue(basepath);
- }
- function UpdateNUMBERS(_sel){
- zw = getNUMBERInfo();
- index = 0;
- var _index = document.getElementById("Numbers_value1");
- while (_index.length){
- _index.remove(0);
- }
- for (var i = 0; i < zw.length; ++i){
- var option = document.createElement("option");
- option.text = zw[i]["name"];
- option.value = i;
- _index.add(option);
- if (typeof _sel !== 'undefined') {
- if (zw[i]["name"] == _sel)
- index = i
- }
- }
- _index.selectedIndex = index;
- loadPrevalue(basepath);
- }
- function init(){
- basepath = getbasepath();
- loadConfig(basepath);
- ParseConfig();
- UpdateNUMBERS();
- loadPrevalue(basepath);
- }
- init();
- </script>
|