From 14772e6fe927f744585ce051160fe343e875d6dd Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Mon, 23 Oct 2023 12:22:40 +0300 Subject: [PATCH 1/4] Rewrite Automation section after w3c/sensors#470 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 #77. --- index.bs | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/index.bs b/index.bs index 338e3b2..cfc5c31 100644 --- a/index.bs +++ b/index.bs @@ -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 @@ -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. -

Mock Sensor Type

+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 -"absolute-orientation", its [=mock sensor reading values=] -dictionary is defined as follows: - -
-  dictionary AbsoluteOrientationReadingValues {
-    required FrozenArray<double>? quaternion;
-  };
-
- -The {{RelativeOrientationSensor}} class has an associated [=mock sensor type=] which is -"relative-orientation", its [=mock sensor reading values=] -dictionary is defined as follows: +
+The orientation reading parsing algorithm, given a JSON {{Object}} |parameters|, must return the result of invoking [=parse quaternion reading=] with |parameters|. +
-
-  dictionary RelativeOrientationReadingValues : AbsoluteOrientationReadingValues {
-  };
-
+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} ================ From 688ea27af10ecaa87ec429227feb4fa63756abf9 Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Tue, 24 Oct 2023 10:05:33 +0300 Subject: [PATCH 2/4] Separate absolute and relative orientation sensor to own chapters --- index.bs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/index.bs b/index.bs index cfc5c31..d701d0f 100644 --- a/index.bs +++ b/index.bs @@ -501,15 +501,21 @@ Automation {#automation} This section extends [[GENERIC-SENSOR#automation]] by providing [=Orientation Sensor=]-specific virtual sensor metadata. -
-The orientation reading parsing algorithm, given a JSON {{Object}} |parameters|, must return the result of invoking [=parse quaternion reading=] with |parameters|. -
+

Absolute Orientation Sensor automation

+ +The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]: +: [=map/key=] +:: "`absolute-orientation`" +: [=map/value=] +:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [[#absoluteorientationsensor-model|AbsoluteOrientationSensor]] and [=reading parsing algorithm=] is [=parse quaternion reading=]. + +

Relative Orientation Sensor automation

The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]: : [=map/key=] -:: "`absolute-orientation`" or "`relative-orientation`" +:: "`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=]. +:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [[#relativeorientationsensor-model|RelativeOrientationSensor]] and [=reading parsing algorithm=] is [=parse quaternion reading=]. Acknowledgements {#acknowledgements} ================ From 8408a21c8d9be88c37a55d3bf8c729258e30a094 Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Wed, 25 Oct 2023 08:55:01 +0300 Subject: [PATCH 3/4] Change sensor names to point sensor type --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 2feea58..c317b1d 100644 --- a/index.bs +++ b/index.bs @@ -498,7 +498,7 @@ The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/e : [=map/key=] :: "`absolute-orientation`" : [=map/value=] -:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [[#absoluteorientationsensor-model|AbsoluteOrientationSensor]] and [=reading parsing algorithm=] is [=parse quaternion reading=]. +:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Absolute Orientation Sensor=] and [=reading parsing algorithm=] is [=parse quaternion reading=].

Relative Orientation Sensor automation

@@ -506,7 +506,7 @@ The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/e : [=map/key=] :: "`relative-orientation`" : [=map/value=] -:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [[#relativeorientationsensor-model|RelativeOrientationSensor]] and [=reading parsing algorithm=] is [=parse quaternion reading=]. +:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Relative Orientation Sensor=] and [=reading parsing algorithm=] is [=parse quaternion reading=]. Acknowledgements {#acknowledgements} ================ From f1680ff9971efc4421e86956ae02fb39c84d8715 Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Wed, 25 Oct 2023 11:37:23 +0300 Subject: [PATCH 4/4] Change dnf to id in heading Dnf is used when link to specific heading or text is needed elsewhere in text. In this case there was no need or use for links to these specific headings. --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index c317b1d..1a78057 100644 --- a/index.bs +++ b/index.bs @@ -492,7 +492,7 @@ Automation {#automation} This section extends [[GENERIC-SENSOR#automation]] by providing [=Orientation Sensor=]-specific virtual sensor metadata. -

Absolute Orientation Sensor automation

+

Absolute Orientation Sensor automation

The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]: : [=map/key=] @@ -500,7 +500,7 @@ The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/e : [=map/value=] :: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Absolute Orientation Sensor=] and [=reading parsing algorithm=] is [=parse quaternion reading=]. -

Relative Orientation Sensor automation

+

Relative Orientation Sensor automation

The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]: : [=map/key=]