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
<ul id="navlist">
<li id="navPos" onclick="switchModule('Pos');">Position</li>
<li id="navGrav" onclick="switchModule('Grav');">Gravity</li>
-<li id="navAcou" onclick="switchModule('Acou');">Acoustics</li>
+<li id="navOther" onclick="switchModule('Other');">Other</li>
</ul>
</div>
</p>
<div id="posavail" style="display:none">
<table>
-<tr><td>Latitude:</td><td id="posLat">...</td></tr>
-<tr><td>Longitude:</td><td id="posLong">...</td></tr>
-<tr><td>Accuracy:</td><td id="posAcc">...</td></tr>
-<tr><td>Altitude:</td><td id="posAlt">...</td></tr>
-<tr><td>Alt. Accuracy:</td><td id="posAltAcc">...</td></tr>
-<tr><td>Heading:</td><td id="posHead">...</td></tr>
-<tr><td>Speed:</td><td id="posSpd">...</td></tr>
-<tr><td>Timestamp:</td><td id="posTime">...</td></tr>
+<tr><td>Latitude:</td><td id="posLat" class="posVal">...</td></tr>
+<tr><td>Longitude:</td><td id="posLong" class="posVal">...</td></tr>
+<tr><td>Accuracy:</td><td id="posAcc" class="posVal">...</td></tr>
+<tr><td>Altitude:</td><td id="posAlt" class="posVal">...</td></tr>
+<tr><td>Alt. Accuracy:</td><td id="posAltAcc" class="posVal">...</td></tr>
+<tr><td>Heading:</td><td id="posHead" class="posVal">...</td></tr>
+<tr><td>Speed:</td><td id="posSpd" class="posVal">...</td></tr>
+<tr><td>Timestamp:</td><td id="posTime" class="posVal">...</td></tr>
</table>
+<p class="note">
+All coordinates use the WGS84 coordinate system.
+</p>
</div>
</section>
</p>
<div id="gravavail" style="display:none">
<table>
+<tr><td>Total:</td><td id="gravTotal" class="gravVal">...</td></tr>
<tr><td>X:</td><td id="gravX" class="gravVal">...</td></tr>
<tr><td>Y:</td><td id="gravY" class="gravVal">...</td></tr>
<tr><td>Z:</td><td id="gravZ" class="gravVal">...</td></tr>
</div>
</section>
-<section id="sectAcou">
-<p>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.</p>
+<section id="sectOther">
+<p>This tricorder model doesn't have other sensors yet, please contact
+the <a href="http://www.kairo.at/apps">Starfleet science department</a>
+if you want to help developing this for future models.</p>
</section>
</div>
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();
},
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 = "...";
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²";
},
}
-var gModAcou = {
+var gModOther = {
activate: function() {
//gSounds.scan.play();
},
border-radius: 0px 0px 0px 15px;
}
#sideSepBottom {
- background-color: #008484;
+ background-color: #6080F0;
width: 90px;
height: 50px;
margin-bottom: 3px;
background-color: #C09070;
color: #000000;
}
-#navAcou {
+#navOther {
background-color: #6000CF;
color: #000000;
}
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;