projects
/
dweather.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9b87b24
)
display speeds in mph rather than m/s
author
Dirk Koopman
<djk@tobit.co.uk>
Wed, 9 Dec 2015 23:44:13 +0000
(23:44 +0000)
committer
Dirk Koopman
<djk@tobit.co.uk>
Wed, 9 Dec 2015 23:44:13 +0000
(23:44 +0000)
templates/index.html.ep
patch
|
blob
|
history
diff --git
a/templates/index.html.ep
b/templates/index.html.ep
index c8ef3b52ad6eafc00a3f5857d8bd49e24d42d5ef..443408d92e71fd8f0df349be51915cbb2afb27b1 100644
(file)
--- a/
templates/index.html.ep
+++ b/
templates/index.html.ep
@@
-30,6
+30,13
@@
var h = new Object();
var h = new Object();
+ var trans = {
+ "Wind" : function (speed) { return (speed * 2.236936).toFixed(1); },
+ "Wind_1m" : function (speed) { return (speed * 2.236936).toFixed(1); },
+ "Wind_Max": function (speed) { return (speed * 2.236936).toFixed(1); }
+ };
+
+
function do_debug(text) {
document.getElementById("do_debug").innerHTML = text;
}
function do_debug(text) {
document.getElementById("do_debug").innerHTML = text;
}
@@
-41,7
+48,12
@@
function fill_html(key,value) {
var d = document.getElementById(key);
if (d !== null) {
function fill_html(key,value) {
var d = document.getElementById(key);
if (d !== null) {
- d.innerHTML = value;
+ var f = trans[key];
+ if (f && typeof(f) === "function") {
+ d.innerHTML = trans[key](value);
+ } else {
+ d.innerHTML = value;
+ }
}
}
}
}
@@
-711,9
+723,9
@@
<th>Humidity:</th><td> <span id="Humidity_Out"> </span> %</td>
<th>Dew Point:</th><td> <span id="Dew_Point"> </span> °C</td>
</tr>
<th>Humidity:</th><td> <span id="Humidity_Out"> </span> %</td>
<th>Dew Point:</th><td> <span id="Dew_Point"> </span> °C</td>
</tr>
- <tr><th>Wind:</th><td><span id="Dir"> </span> ° @ <span id="Wind"> </span> m
/s
</td>
- <th>Wind Minute Avg:</th><td> <span id="Dir_1m"> </span> ° @ <span id="Wind_1m"> </span> m
/s
</td>
- <th>Day Max Speed:</th><td> <span id="Wind_Max"> </span> m
/s
@ <span id="Wind_Max_T"> </span></td>
+ <tr><th>Wind:</th><td><span id="Dir"> </span> ° @ <span id="Wind"> </span> m
ph
</td>
+ <th>Wind Minute Avg:</th><td> <span id="Dir_1m"> </span> ° @ <span id="Wind_1m"> </span> m
ph
</td>
+ <th>Day Max Speed:</th><td> <span id="Wind_Max"> </span> m
ph
@ <span id="Wind_Max_T"> </span></td>
</tr>
<tr>
<th>Rain 30mins:</th><td> <span id="Rain_1h"> </span> mm</td>
</tr>
<tr>
<th>Rain 30mins:</th><td> <span id="Rain_1h"> </span> mm</td>