W3C home > Mailing lists > Public > public-dap-commits@w3.org > January 2010

2009/dap/system-info Overview.html,1.51,1.52

From: Max Froumentin via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 04 Jan 2010 16:40:06 +0000
To: public-dap-commits@w3.org
Message-Id: <E1NRpyQ-0004Q6-UY@lionel-hutz.w3.org>
Update of /sources/public/2009/dap/system-info
In directory hutz:/tmp/cvs-serv16960

Modified Files:
	Overview.html 
Log Message:
Editorial:
- fixed wrong image name in link
- typos

Substantial:
- fixed set()
- removed active flags in input/outputDevices. As the new note
explains we need a better way of expressing active devices
- battery: renamed PowerState to Power and use charge instead of level
- CPU: renamed interface CPUState to Processing
- CoolingSystem: renamed to Cooling, and status to state. Also new example


Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/system-info/Overview.html,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- Overview.html	30 Dec 2009 15:39:13 -0000	1.51
+++ Overview.html	4 Jan 2010 16:40:04 -0000	1.52
@@ -159,7 +159,7 @@
         <h2>System Properties</h2>
 
         <p>A <dfn>property</dfn> is defined as a set of related device
-        characteristics. For instance, the <a>PowerState</a> property
+        characteristics. For instance, the <a>Power</a> property
         contains all the characteristics that relate to the device's
         electrical power supply. Properties are accessible using the
         functions defined by the <a>SystemInfo</a> interface below. A
@@ -190,7 +190,7 @@
         relationship of all the properties defined in the following
         sections.</p>
 
-        <p><a href="sysinfo.png"><img src="properties.png" alt="graphical representation of the property structure" width="1000"/></a></p>
+        <p><a href="properties.png"><img src="properties.png" alt="graphical representation of the property structure" width="1000"/></a></p>
 
 
       </section>
@@ -299,12 +299,12 @@
             <dl class="parameters">
               <dt>DOMString propertyId</dt>
               <dd>The URI or name of the property to retrieve.</dd>
+              <dt>optional Object value</dt>
+              <dd>An object containing the values to modify, as well as the <a>id</a> to designate which instance to modify</dd>
               <dt>SuccessCB successCallback</dt>
               <dd>function called when the property have been successfully modified</dd>
               <dt>optional ErrorCB? errorCallback</dt>
               <dd>function called when an error occurred while modifying the property</dd>
-              <dt>optional Options options</dt>
-              <dd>An object containing the various options for fetching the properties requested</dd>
             </dl>
           </dd>
         </dl>
@@ -411,7 +411,7 @@
             <dd>A free-form string describing this device, e.g. the name of its manufacturer.</dd>
             
             <dt>readonly attribute DOMString id</dt>
-            <dd>A free-form string identifying this device. The value of this element MUST be unique within the list reported in the object enumerating this device, e.g. the PowerState object.</dd>
+            <dd>A free-form string identifying this device. The value of this element MUST be unique within the list reported in the object enumerating this device, e.g. the Power object.</dd>
           </dl>
       </section>
 
@@ -426,7 +426,7 @@
         <section>
           <h4>ECMAScript Example</h4>
           <pre class="sh_javascript example">// Alert the user when the power level is below 20%
-navigator.system.watch("PowerState",success,null,{lowThreshold:0.2});
+navigator.system.watch("Power",success,null,{lowThreshold:0.2});
 
 function success(power) {
   alert("Low battery level: "+power.level);
@@ -434,13 +434,13 @@
         </section>
 
         <section>
-          <h4>The <a>PowerState</a> Property</h4>
-          <p>This property reflects the state of general state of the system's power sources</p>
+          <h4>The <a>Power</a> Property</h4>
+          <p>This property reflects the general state of the system's power sources</p>
 
           <p class="issue">Find the corresponding DCO properties everywhere</p>
 
           
-          <dl title="[NoInterfaceObject] interface PowerState" class="idl">
+          <dl title="[NoInterfaceObject] interface Power" class="idl">
             <dt>readonly attribute float? level</dt>
             <dd>
               Specifies how much the internal power source remains,
@@ -477,7 +477,7 @@
           <h4>The <a>PowerSource</a> Property</h4>
           <p>This property describes the state of a single power source connected to the system. It is <a>enumerable</a>.</p>
 
-          <p class="issue">Many interfaces below uses inheritance (even multiple). Should we use <a href="http://dev.w3.org/2006/webapi/WebIDL/#PrototypeRoot">PrototypeRoot</a> and/or <a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-implements-statements">implements</a> instead?</p>
+          <p class="issue">Many interfaces below use inheritance (even multiple). Should we use <a href="http://dev.w3.org/2006/webapi/WebIDL/#PrototypeRoot">PrototypeRoot</a> and/or <a href="http://dev.w3.org/2006/webapi/WebIDL/#idl-implements-statements">implements</a> instead?</p>
               
 
 
@@ -497,11 +497,11 @@
             <dt>readonly attribute boolean? charging</dt>
             <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>. Otherwise if this source is charging, this value MUST be <code>true</code>, otherwise <code>false</code>.</dd>
             
-            <dt>readonly attribute float? level</dt>
-            <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, otherwise it MUST indicate how much of the battery capacity is left, on a range of 0 to 1.</dd>
+            <dt>readonly attribute float? charge</dt>
+            <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, otherwise it MUST indicate how much of the battery capacity is left, on a range of 0 to this battery's <a>capacity</a> value, in ampere-hours.</dd>
             
             <dt>readonly attribute unsigned int? timeRemaining</dt>
-            <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, otherwise if this source is charging, this value MUST reflect the estimated time in milliseconds until the battery's <code>level</code> value reaches 1. If this source is not charging then this value MUST reflect the estimated time in milliseconds until the battery's <code>level</code> value reaches 0.</dd>
+            <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, otherwise if this source is charging, this value MUST reflect the estimated time in milliseconds until the battery's <code>charge</code> reaches its <a>capacity</a>. If this source is not charging then this value MUST reflect the estimated time in milliseconds until the battery's <code>charge</code> reaches 0.</dd>
             
             <dt>readonly attribute float? capacity</dt>
             <dd>If this source has <code>type</code> set to <code>EXTERNAL</code> then this value MUST be <code>null</code>, otherwise it MUST reflect this battery's capacity, expressed in ampere-hours</dd>
@@ -509,17 +509,20 @@
         </section>
       </section>
       
+      <!--******************** /Power **********************************-->
+
       <!--******************* CPU *******************************************-->
 
       <section>
         <h2>CPU</h2>
-        <p>This section defines a set of APIs that expose the system's CPU information, including type, specifications, current system load
-        information.</p>
+        <p>This section defines interfaces that expose the system's
+        CPU information, including type, specifications, current
+        system load information.</p>
         
         <section>
           <h4>ECMAScript Example</h4>
-          <pre class="sh_javascript example">//Monitor and display the CPU load, and each CPU's frequency
-navigator.device.system.watch("CpuState",success);
+          <pre class="sh_javascript example">//Monitor and display the CPU load, and show the frequency of each CPU
+navigator.device.system.watch("Processing",success);
 
 function success(cpu) {
   var s="CPU Status. Overall load: "+cpu.load+" - ";
@@ -531,10 +534,10 @@
         </section>
         
         <section>
-          <h4>The <a>CpuState</a> Property</h4>
-          <p>This property reflects the state of a single CPU available on the system</p>
+          <h4>The <a>Processing</a> Property</h4>
+          <p>This property reflects the state of all the CPUs available to this system.</p>
 
-          <dl title="[NoInterfaceObject] interface CpuState" class="idl">
+          <dl title="[NoInterfaceObject] interface Processing" class="idl">
             <dt>readonly attribute float load</dt>
             <dd>
               This attribute indicates the current CPU load, as a
@@ -556,7 +559,7 @@
             <dt>attribute float currentFrequency</dt>
             <dd>
               This attribute indicates the current frequency of this
-              CPU (in MHz). Although this property can be modified, not
+              CPU, in MHz. Although this property can be modified, not
               all CPUs allow their speed to be throttled
               directly. User agents SHOULD implement setting this
               attribute so that the resulting CPU frequency is as
@@ -576,9 +579,9 @@
       </section>
       <!--******************** /CPU **********************************-->
 
-      <!--******************* Temperature ****************************-->
+      <!--******************* Thermal ****************************-->
       <section>
-        <h2>Internal Temperature</h2>
+        <h2>Thermal</h2>
         <p>The properties described in this section expose the
         system's temperature, as reported to the various internal
         thermometers.</p>
@@ -586,7 +589,7 @@
         <section>
           <h4>ECMAScript Example</h4>
           <pre class="sh_javascript example">// Display the temperature of the first thermometer
-navigator.device.system.get("ThermalState",success);
+navigator.device.system.get("Thermal",success);
 
 function success(thermal) {
   document.getElementById("tempIndicator").innerHTML="Thermometer #1: "+thermal.thermometers[0].temperature;
@@ -594,12 +597,12 @@
         </section>
         
         <section>
-          <h4>The <a>ThermalState</a> property</h4>
+          <h4>The <a>Thermal</a> property</h4>
           
           <p>This property provides information on the global temperature state of the system</p>
 
-          <dl title="[NoInterfaceObject] interface ThermalState" class="idl">
-            <dt>readonly attribute float status</dt>
+          <dl title="[NoInterfaceObject] interface Thermal" class="idl">
+            <dt>readonly attribute float state</dt>
             <dd>
               This attribute indicates the current thermal status, as a
               number between 0 and 1 representing the minimum and
@@ -627,25 +630,46 @@
           </dl>
         </section>
         
-        <section>
-          <h4>The <a>CoolingSystem</a> property</h4>
-          <p>This property exposes the overall state of the system's active cooling devices (e.g. fans or pumps)</p>
+      <!--******************* /Thermal ****************************-->
 
-          <dl title="[NoInterfaceObject] interface CoolingSystem" class="idl">
-            <dt>readonly attribute float value</dt>
-            <dd>
-              This attribute indicates the current state of the cooling
-              system scaled to a 0 to 1 floating point range. A value of
-              0 means that the system is not running, and a value of 1
-              means that the system running at its maximum capacity.  On
-              devices that have multiple cooling devices, this value
-              should be an implementation-defined combination of the
-              state of each device.
-            </dd>
-            <dt>readonly attribute sequence &lt;CoolingDevice&gt; devices</dt>
-            <dd>The list of all the system's cooling devices.</dd>
-          </dl>
+      <!--******************* Cooling ****************************-->
+
+      <section>
+        <h4>The <a>Cooling</a> property</h4>
+
+        <p>This property exposes the overall state of the system's active cooling devices (e.g. fans or pumps)</p>
+
+        <section>
+          <h4>ECMAScript Example</h4>
+          <pre class="sh_javascript example">// If the temperature gets near the top, set all cooling devices to 1500 RPM
+navigator.system.watch("Thermal", 
+                       function() {
+                         alert("Cooling system at more than 90% capacity. Engaging Fans");
+                         navigator.system.get("Cooling",function(cooling) {
+                           for (var i in cooling.devices)
+                             navigator.system.set("CoolingDevice",{id: cooling.devices[i], speed: 1500},null,null);
+                         })
+                       },
+                       null,
+                       {highThreshold:0.9});</pre>
         </section>
+
+        <dl title="[NoInterfaceObject] interface Cooling" class="idl">
+          <dt>readonly attribute float state</dt>
+          <dd>
+            This attribute indicates the current state of the cooling
+            system scaled to a 0 to 1 floating point range. A value of
+            0 means that the system is not running, and a value of 1
+            means that the system running at its maximum capacity.  On
+            devices that have multiple cooling devices, this value
+            should be an implementation-defined combination of the
+            state of each device.
+          </dd>
+          <dt>readonly attribute sequence &lt;CoolingDevice&gt; devices</dt>
+          <dd>The list of all the system's cooling devices.</dd>
+        </dl>
+      </section>
+
         <section>
           <h4>The <a>CoolingDevice</a> property</h4>
 
@@ -675,7 +699,7 @@
         </section>
       </section>
 
-      <!--******************** /Temperature **********************************-->
+      <!--******************** /Cooling **********************************-->
 
       <!--******************** Network **********************************-->
 
@@ -1229,10 +1253,6 @@
             <dd><code>type</code> is set to this value when this device is a set of headphones</dd>
             <dt>readonly attribute unsigned short type</dt>
             <dd>The type of audio output device. The value is one of the constants defined for this type.</dd>
-            <dt>attribute boolean active</dt>
-            <dd>Indicates if the device is currently active, i.e. if
-            any sound recording will be made using this device</dd>
-            
             <dt>readonly attribute unsigned int freqRangeLow</dt>
             <dd>Frequency range, low value, in Hz</dd>
             
@@ -1250,6 +1270,8 @@
 
           <p>The properties defines below expose the input devices connected to the system (e.g. mouse, keyboard, camera).</p>
           
+          <p class="issue">Should we have a notion of active or selected device, e.g. which camera is currently used, or which display is the one currently drawn on. We could use current* like with Power, but that restricts to one active device at a time. Alternatively, there could be an active flag in each device. But that would make watch() messy, since we would have to extend the definition of watched events to sub-sub-field modifications</p>
+
           <section>
             <h3>The <a>InputDevices</a> Property</h3>
             
@@ -1339,9 +1361,6 @@
               <dt>readonly attribute unsigned short type</dt>
               <dd>The type of audio input device. The value is one of
               the constants defined for this type.</dd>
-              <dt>attribute boolean active</dt>
-              <dd>Indicates if the device is currently active, i.e. if
-              any sound recording will be made using this device</dd>
               <dt>readonly attribute unsigned int freqRangeLow</dt>
               <dd>Frequency range, low value, in Hz</dd>
               <dt>readonly attribute unsigned int freqRangeHigh</dt>
Received on Monday, 4 January 2010 16:40:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 4 January 2010 16:40:08 GMT