2009/dap/system-info Overview.html,1.75,1.76

Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv32660

Modified Files:
	Overview.html 
Log Message:
Use SVG, for a change


Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/Overview.html,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- Overview.html	2 Feb 2010 16:21:14 -0000	1.75
+++ Overview.html	15 Feb 2010 13:50:03 -0000	1.76
@@ -546,13 +546,12 @@
         
         <section>
           <h4>ECMAScript Example</h4>
-          <pre class="sh_javascript example">// Check the thermal state and display a warning if it is above a certain level
+          <pre class="sh_javascript example">// Show the thermal status as an SVG analog dial
 
-navigator.system.get("Thermal",success);
+navigator.system.watch("Thermal",success);
 
 function success(thermal) {
-  if (thermal.state > 0.9)
-    document.getElementById("tempIndicator").style.background-color = "red";
+  document.getElementById("GaugeHand").setAttribute("transform","rotate("+thermal.state*360+")");
 };</pre>
         </section>
         
@@ -732,6 +731,30 @@
 }</pre>
         </section>
 
+        <section>
+          <h4>The SensorReading interface</h4>
+          <p>The <a>SensorReading</a> interface is used as a general interface for sensor values. All the success callbacks for the properties defined in this section return an instance of this interface, with attribute values corresponding to the measurement leading to the callback being invoked.</p>
+
+          <dl title="[NoInterfaceObject] interface SensorReading" class="idl">
+            <dt>readonly attribute float? value</dt>
+            <dd>The numerical value of this sensor, at the time of sampling. Details on the meaning of the number and reported as well as its unit are given for each sensor property defined below.</dd>
+              <dt>readonly attribute float? min</dt>
+              <dd>The minimum value that the sensors measuring the property are able to report</dd>
+              <dt>readonly attribute float? max</dt>
+              <dd>The maximum value that the sensors measuring the property are able to report</dd>
+            <dt>readonly attribute float? normalizedValue</dt>
+            <dd>The numerical value of this sensor, at the time of sampling, normalized on a 0 to 1 scale, where 0 represents the minimum value that the sensor can report and 1 the maximum value..</dd>
+          </dl>
+
+
+          <p>For an instance of <a>SensorReading</a> returned by a callback function, either <a>value</a> or <a>normalizedValue</a> can be <code>null</code>, but at least one MUST be non-<code>null</code>. <a>normalizedValue</a> is meant to be used when the API is not able to report a sensor value in the unit specified in this document. In that case, <a>value</a> stays <code>null</code> and <a>normalizedValue</a> is assigned a value which represents a unit-less measurement, between the minimum and maximum values that the device supports.</p>
+          
+          <p>Some sensors may only be able to report two values, e.g. corresponding to "near" or "far" in the case of a proximity sensor. In that case, the <a>normalizedValue</a> is set to 0 for the lowest of the two values and to 1 for the greatest.</p>
+
+        </section>
+         
+        
+
         <!-- ==== Ambient Light ==== -->
         <section>
           <h4>Ambient Light</h4>
@@ -739,11 +762,12 @@
             <h5>The <a>AmbientLight</a> Property</h5>
 
             <p>This property provides information about the global level of ambient light around the device.</p>
-
-            <dl title="[NoInterfaceObject] interface AmbientLight" class="idl">
-              <dt>readonly attribute float intensity</dt>
-              <dd>A normalized value representing the overall ambient light around the device. The way this value is determined should be an implementation-defined combination of the values reported by each ambient light sensor available.</dd>
-            </dl>
+            <ul>
+              <li><a>value</a> represents the measured ambient light around the device, i.e. the illuminance, in lux.</li>
+              <li><a>min</a> represents the minimum illuminance that the device's ambient lightsensors can report, in lux.</li>
+              <li><a>max</a> represents the maximum illuminance that the device's ambient lightsensors can report, in lux.</li>
+              <li><a>normalizedValue</a> represents the measured illuminance normalized to a 0 to 1 range</li>
+            </ul>
           </section>
         </section>
 
@@ -756,14 +780,12 @@
 
             <p>This property provides information about the global level of ambient noise around the device.</p>
 
-            <dl title="[NoInterfaceObject] interface AmbientNoise" class="idl">
-              <dt>readonly attribute float value</dt>
-              <dd>The ambient noise intensity around the device, computed by this system's sensors, in decibels (dB)</dd>
-              <dt>readonly attribute float min</dt>
-              <dd>The minimum ambient noise intensity that this system's sensors are able to report, in decibels (dB)</dd>
-              <dt>readonly attribute float max</dt>
-              <dd>The maximum ambient noise intensity that this system's sensors are able to report, in decibels (dB)</dd>
-            </dl>
+            <ul>
+              <li><a>value</a> represents the measured ambient noise around the device, in decibels.</li>
+              <li><a>min</a> represents the minimum ambient noise level that this device's sensors can report, in decibels.</li>
+              <li><a>max</a> represents the maximum ambient noise level that this device's sensors can report, in decibels.</li>
+              <li><a>normalizedValue</a> represents the measured ambient noise level, normalized to a 0 to 1 range</li>
+            </ul>
           </section>
         </section>
 
@@ -776,14 +798,12 @@
 
             <p>This property provides information about the temperature around the device.</p>
 
-            <dl title="[NoInterfaceObject] interface AmbientTemperature" class="idl">
-              <dt>readonly attribute float value</dt>
-              <dd>This current temperature around the device, in degrees Celsius (°C)</dd>
-              <dt>readonly attribute float min</dt>
-              <dd>The minimum ambient temperature that this system's sensors are able to report,  in degrees Celsius (°C)</dd>
-              <dt>readonly attribute float max</dt>
-              <dd>The maximum ambient temperature that this system's sensors are able to report,  in degrees Celsius (°C)</dd>
-            </dl>
+            <ul>
+              <li><a>value</a> represents the measured ambient temperature around the device, in degrees Celsius.</li>
+              <li><a>min</a> represents the minimum ambient temperature that this device's sensors can report, in degrees Celsius.</li>
+              <li><a>max</a> represents the maximum ambient temperature that this device's sensors can report, in degrees Celsius.</li>
+              <li><a>normalizedValue</a> represents the measured ambient temperature, normalized to a 0 to 1 range</li>
+            </ul>
           </section>
         </section>
 
@@ -796,16 +816,13 @@
 
             <p>This property provides information about the atmospheric pressure around the device.</p>
 
-            <dl title="[NoInterfaceObject] interface AmbientAtmosphericPressure" class="idl">
-              <dt>readonly attribute float pressure</dt>
-              <dd>The estimated atmospheric pressure around this device, in kiloPascals (kPa)</dd>
-              <dt>readonly attribute float min</dt>
-              <dd>The minimum ambient atmospheric pressure that this system's sensors are able to report, in kiloPascals (kPa)</dd>
-              <dt>readonly attribute float max</dt>
-              <dd>The maximum ambient atmospheric pressure that this system's sensors are able to report, in kiloPascals (kPa)</dd>
-            </dl>
+            <ul>
+              <li><a>value</a> represents the measured atmospheric pressure around the device, in kiloPascals.</li>
+              <li><a>min</a> represents the minimum atmospheric pressure that this device's sensors can report, in kiloPascals.</li>
+              <li><a>max</a> represents the maximum atmospheric pressure that this device's sensors can report, in kiloPascals.</li>
+              <li><a>normalizedValue</a> represents the measured ambient temperature, normalized to a 0 to 1 range.</li>
+            </ul>
           </section>
-
         </section>
 
         <!-- ==== Proximity ==== -->
@@ -815,14 +832,14 @@
           <section>
             <h5>The <a>Proximity</a> Property</h5>
             <p>This property provides information about the distance of objects around the device.</p>
-            <dl title="[NoInterfaceObject] interface Proximity" class="idl">
-              <dt>readonly attribute float distance</dt>
-              <dd>The distance from the device to the nearest object, as determined by this device's proximity sensors, in meters (m)</dd>
-              <dt>readonly attribute float min</dt>
-              <dd>The minimum distance that this system's sensors are able to report, in meters (m)</dd>
-              <dt>readonly attribute float max</dt>
-              <dd>The maximum distance that this system's sensors are able to report, in meters (m)</dd>
-            </dl>
+
+
+            <ul>
+              <li><a>value</a> represents the measured distance between the device and a nearby object, in meters.</li>
+              <li><a>min</a> represents the minimum distance that this device's sensors can report, in meters.</li>
+              <li><a>max</a> represents the maximum distance that this device's sensors can report, in meters.</li>
+              <li><a>normalizedValue</a> represents the measured distance between the device and a nearby object, normalized to a 0 to 1 range.</li>
+            </ul>
           </section>
         </section>
       </section>

Received on Monday, 15 February 2010 13:50:06 UTC