From: Robert Kaiser
Date: Mon, 10 Dec 2012 03:37:51 +0000 (+0100)
Subject: Merge branch 'master' of linz:/srv/git/tricorder
X-Git-Tag: production~28
X-Git-Url: https://git-public.kairo.at/?p=tricorder.git;a=commitdiff_plain;h=f5b9d67ff7148a1c3eed923f18000781b97f51e9;hp=59878662357b3e4987c518a70923833140f795e4
Merge branch 'master' of linz:/srv/git/tricorder
---
diff --git a/TODO b/TODO
index b832030..79fe413 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,18 @@
Tasks to complete for Web Tricorder:
-* Make more sensors work
+* Make more sensors work - see https://wiki.mozilla.org/WebAPI
+** Networks (probably need ceritified app!)
+*** Current connection: http://dvcs.w3.org/hg/dap/raw-file/tip/network-api/Overview.html
+*** Mobile Networks: https://wiki.mozilla.org/WebAPI/WebMobileConnection
+*** WiFi Networks: http://groups.google.com/group/mozilla.dev.webapi/browse_thread/thread/ed980c42261c5f4a
+*** Nearby Bluetooth devices: https://wiki.mozilla.org/WebAPI/WebBluetooth
+** Device properties:
+*** Battery Status: http://dvcs.w3.org/hg/dap/raw-file/tip/battery/Overview.html
+*** Storage: https://github.com/mozilla-b2g/gaia/blob/master/apps/settings/js/app_storage.js
+** Environment:
+*** Ambient Light: http://www.w3.org/TR/ambient-light/
+*** Proximity: http://www.w3.org/TR/2012/WD-proximity-20120712/
+** Audio / Video analysis
+*** histograms, etc.
+*** via WebRTC: https://wiki.mozilla.org/Platform/Features/VideoConferencing
* Make output more beautiful
diff --git a/index.html b/index.html
index 4a30d0e..8a6580d 100644
--- a/index.html
+++ b/index.html
@@ -34,7 +34,7 @@
- Position
- Gravity
-- Acoustics
+- Other
@@ -64,15 +64,18 @@ a better device.
-Latitude: | ... |
-Longitude: | ... |
-Accuracy: | ... |
-Altitude: | ... |
-Alt. Accuracy: | ... |
-Heading: | ... |
-Speed: | ... |
-Timestamp: | ... |
+Latitude: | ... |
+Longitude: | ... |
+Accuracy: | ... |
+Altitude: | ... |
+Alt. Accuracy: | ... |
+Heading: | ... |
+Speed: | ... |
+Timestamp: | ... |
+
+All coordinates use the WGS84 coordinate system.
+
@@ -84,6 +87,7 @@ a better device.
+Total: | ... |
X: | ... |
Y: | ... |
Z: | ... |
@@ -94,10 +98,10 @@ a better device.
-
-This tricorder model doesn't have an acoustics sensors yet, please contact
-the Starfleet science department if you want to help developing this for future
-models.
+
+This tricorder model doesn't have other sensors yet, please contact
+the Starfleet science department
+if you want to help developing this for future models.
diff --git a/js/tricorder.js b/js/tricorder.js
index 4d5e69b..2debeec 100644
--- a/js/tricorder.js
+++ b/js/tricorder.js
@@ -88,13 +88,20 @@ var gModPos = {
document.getElementById("posavail").style.display = "block";
this.watchID = navigator.geolocation.watchPosition(
function(position) {
- document.getElementById("posLat").textContent = position.coords.latitude;
- document.getElementById("posLong").textContent = position.coords.longitude;
- document.getElementById("posAlt").textContent = position.coords.altitude;
- document.getElementById("posAcc").textContent = position.coords.accuracy;
- document.getElementById("posAltAcc").textContent = position.coords.altitudeAccuracy;
- document.getElementById("posHead").textContent = position.coords.heading || "---";
- document.getElementById("posSpd").textContent = position.coords.speed || "---";
+ document.getElementById("posLat").textContent =
+ position.coords.latitude + "°";
+ document.getElementById("posLong").textContent =
+ position.coords.longitude + "°";
+ document.getElementById("posAlt").textContent =
+ position.coords.altitude.toFixed(0) + " m";
+ document.getElementById("posAcc").textContent =
+ position.coords.accuracy.toFixed(0) + " m";
+ document.getElementById("posAltAcc").textContent =
+ position.coords.altitudeAccuracy.toFixed(0) + " m";
+ document.getElementById("posHead").textContent =
+ position.coords.heading ? position.coords.heading.toFixed(0) + "°" : "---";
+ document.getElementById("posSpd").textContent =
+ position.coords.speed ? position.coords.speed.toFixed(1) + " m/s" : "---";
var locTime = new Date(position.timestamp);
document.getElementById("posTime").textContent = locTime.toISOString();
},
@@ -166,6 +173,7 @@ var gModGrav = {
document.getElementById("gravAlpha").textContent = "...";
document.getElementById("gravBeta").textContent = "...";
document.getElementById("gravGamma").textContent = "...";
+ document.getElementById("gravTotal").textContent = "...";
document.getElementById("gravX").textContent = "...";
document.getElementById("gravY").textContent = "...";
document.getElementById("gravZ").textContent = "...";
@@ -178,6 +186,11 @@ var gModGrav = {
document.getElementById("gravGamma").textContent = orientData.gamma.toFixed(1) + "°";
},
motionEvent: function(event) {
+ var gravTotal =
+ Math.sqrt(Math.pow(event.accelerationIncludingGravity.x, 2) +
+ Math.pow(event.accelerationIncludingGravity.y, 2) +
+ Math.pow(event.accelerationIncludingGravity.z, 2));
+ document.getElementById("gravTotal").textContent = gravTotal.toFixed(2) + " m/s²";
document.getElementById("gravX").textContent = event.accelerationIncludingGravity.x.toFixed(2) + " m/s²";
document.getElementById("gravY").textContent = event.accelerationIncludingGravity.y.toFixed(2) + " m/s²";
document.getElementById("gravZ").textContent = event.accelerationIncludingGravity.z.toFixed(2) + " m/s²";
@@ -185,7 +198,7 @@ var gModGrav = {
},
}
-var gModAcou = {
+var gModOther = {
activate: function() {
//gSounds.scan.play();
},
diff --git a/style/tricorder.css b/style/tricorder.css
index f62348d..843d225 100644
--- a/style/tricorder.css
+++ b/style/tricorder.css
@@ -84,7 +84,7 @@ a:hover, a:active { color: #FFCF00; }
border-radius: 0px 0px 0px 15px;
}
#sideSepBottom {
- background-color: #008484;
+ background-color: #6080F0;
width: 90px;
height: 50px;
margin-bottom: 3px;
@@ -141,7 +141,7 @@ a:hover, a:active { color: #FFCF00; }
background-color: #C09070;
color: #000000;
}
-#navAcou {
+#navOther {
background-color: #6000CF;
color: #000000;
}
@@ -228,10 +228,22 @@ section.active {
display: block;
}
-.gravVal {
+.posVal, .gravVal {
text-align: right;
}
+.posVal {
+ width: 24ch;
+}
+
+.gravVal {
+ width: 10ch;
+}
+
+.note {
+ font-size: .667em;
+}
+
@media screen and (min-width: 500px) {
body {
font-size: 24px;