Merge branch 'master' of linz:/srv/git/tricorder
authorRobert Kaiser <kairo@kairo.at>
Mon, 10 Dec 2012 03:37:51 +0000 (04:37 +0100)
committerRobert Kaiser <kairo@kairo.at>
Mon, 10 Dec 2012 03:37:51 +0000 (04:37 +0100)
TODO
index.html
js/tricorder.js
style/tricorder.css

diff --git a/TODO b/TODO
index b8320302884be2c40fe8f60c110d86d93019e3d6..79fe413c4ef20604f71070949964dcdb8de86f56 100644 (file)
--- 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
index 4a30d0e04345f4916010e9d3b7758bb68e1e9857..8a6580dc31c17c53540566087955ae14b1cec6ca 100644 (file)
@@ -34,7 +34,7 @@
 <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>
 
@@ -64,15 +64,18 @@ a better device.
 </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>
 
@@ -84,6 +87,7 @@ a better device.
 </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>
@@ -94,10 +98,10 @@ a better device.
 </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>
 
index 4d5e69bb66cda667f6429ff11d192adb065915a6..2debeec9964f1d1d2c0acd9cab1a0f9895f8b33b 100644 (file)
@@ -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();
   },
index f62348df95b88c57ab2a1b0a9aa576887979a74a..843d225b3cd2a90ca86806d690504c49d782e391 100644 (file)
@@ -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;