Skip to content

Commit

Permalink
Rewrite Automation section after w3c/sensors#470
Browse files Browse the repository at this point in the history
The Automation section in the Generic Sensor API specification was rewritten and several terms and concepts have changed.

This commit adapts the Orientation Sensor spec to the changes:
* Remove references to "mock sensor type", "mock sensor reading values" and the "MockSensorType" enum.
* Define an entry in the per-type virtual sensor metadata map whose key is what used to be the "absolute-orientation" or "relative-orientation" entry in MockSensorType and an appropriate virtual sensor metadata entry.

This is enough to integrate properly with the Generic Sensor spec and allow Orientation virtual sensors to be created and used.

Fixes w3c#77.
  • Loading branch information
JuhaVainio committed Oct 23, 2023
1 parent 5dc2ade commit 14772e6
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ urlPrefix: https://w3c.github.io/sensors/; spec: GENERIC-SENSOR
text: local coordinate system
text: check sensor policy-controlled features; url: check-sensor-policy-controlled-features
text: supported sensor options
text: automation
text: mock sensor type
text: mock sensor reading values
urlPrefix: https://w3c.github.io/accelerometer/; spec: ACCELEROMETER
type: dfn
text: acceleration
Expand Down Expand Up @@ -501,31 +498,18 @@ Abstract Operations {#abstract-operations}

Automation {#automation}
==========
This section extends the [=automation=] section defined in the Generic Sensor API [[GENERIC-SENSOR]]
to provide mocking information about the device's physical orientation in relation to a three
dimensional Cartesian coordinate system for the purposes of testing a user agent's implementation
of {{AbsoluteOrientationSensor}} and {{RelativeOrientationSensor}} APIs.

<h3 id="mock-orientation-sensor-type">Mock Sensor Type</h3>
This section extends [[GENERIC-SENSOR#automation]] by providing [=Orientation Sensor=]-specific virtual sensor metadata.

The {{AbsoluteOrientationSensor}} class has an associated [=mock sensor type=] which is
<a for="MockSensorType" enum-value>"absolute-orientation"</a>, its [=mock sensor reading values=]
dictionary is defined as follows:

<pre class="idl">
dictionary AbsoluteOrientationReadingValues {
required FrozenArray&lt;double>? quaternion;
};
</pre>

The {{RelativeOrientationSensor}} class has an associated [=mock sensor type=] which is
<a for="MockSensorType" enum-value>"relative-orientation"</a>, its [=mock sensor reading values=]
dictionary is defined as follows:
<div algorithm>
The <dfn>orientation reading parsing algorithm</dfn>, given a JSON {{Object}} |parameters|, must return the result of invoking [=parse quaternion reading=] with |parameters|.
</div>

<pre class="idl">
dictionary RelativeOrientationReadingValues : AbsoluteOrientationReadingValues {
};
</pre>
The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]:
: [=map/key=]
:: "`absolute-orientation`" or "`relative-orientation`"
: [=map/value=]
:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Orientation Sensor=] and [=reading parsing algorithm=] is [=orientation reading parsing algorithm=].

Acknowledgements {#acknowledgements}
================
Expand Down

0 comments on commit 14772e6

Please sign in to comment.