提交 2a2c6553 编写于 作者: C cff-gite

修改sensor资料

Signed-off-by: Ncff-gite <chenfeifei8@huawei.com>
上级 a20fb64f
...@@ -2021,7 +2021,7 @@ getDeviceAltitude(seaPressure: number, currentPressure: number, callback: AsyncC ...@@ -2021,7 +2021,7 @@ getDeviceAltitude(seaPressure: number, currentPressure: number, callback: AsyncC
```js ```js
try { try {
sensor.getDeviceAltitude(0, 200, function(data) { sensor.getDeviceAltitude(0, 200, function(data) {
console.info("Successed to get getDeviceAltitude interface get data: " + data); console.info('Successed to get getDeviceAltitude interface get data: ' + data);
}); });
} catch (err) { } catch (err) {
console.error('getDeviceAltitude failed. Error code: ' + err.code + '; message: ' + err.message); console.error('getDeviceAltitude failed. Error code: ' + err.code + '; message: ' + err.message);
...@@ -2084,7 +2084,7 @@ getInclination(inclinationMatrix: Array&lt;number&gt;, callback: AsyncCallback&l ...@@ -2084,7 +2084,7 @@ getInclination(inclinationMatrix: Array&lt;number&gt;, callback: AsyncCallback&l
```js ```js
try { try {
sensor.getInclination ([1, 0, 0, 0, 1, 0, 0, 0, 1], function(data) { sensor.getInclination ([1, 0, 0, 0, 1, 0, 0, 0, 1], function(data) {
console.info("Successed to get getInclination interface get data: " + data); console.info('Successed to get getInclination interface get data: ' + data);
}) })
} catch (err) { } catch (err) {
console.error('getInclination failed. Error code: ' + err.code + '; message: ' + err.message); console.error('getInclination failed. Error code: ' + err.code + '; message: ' + err.message);
...@@ -2185,10 +2185,10 @@ try { ...@@ -2185,10 +2185,10 @@ try {
const promise = sensor.getAngleVariation([1,0,0,0,1,0,0,0,1], [1,0,0,0,0.87,-0.50,0,0.50,0.87]); const promise = sensor.getAngleVariation([1,0,0,0,1,0,0,0,1], [1,0,0,0,0.87,-0.50,0,0.50,0.87]);
promise.then((data) => { promise.then((data) => {
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info('data[' + i + ']: ' + data[i]);
} }
}).catch((reason) => { }).catch((reason) => {
console.info("promise::catch", reason); console.info('promise::catch ', reason);
}) })
} catch (err) { } catch (err) {
console.error('getAngleVariation failed. Error code: ' + err.code + '; message: ' + err.message); console.error('getAngleVariation failed. Error code: ' + err.code + '; message: ' + err.message);
...@@ -2216,7 +2216,7 @@ getRotationMatrix(rotationVector: Array&lt;number&gt;, callback: AsyncCallback<A ...@@ -2216,7 +2216,7 @@ getRotationMatrix(rotationVector: Array&lt;number&gt;, callback: AsyncCallback<A
try { try {
sensor.getRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877], function(data) { sensor.getRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877], function(data) {
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info('data[' + i + ']: ' + data[i]);
} }
}) })
} catch (err) { } catch (err) {
...@@ -2251,10 +2251,10 @@ try { ...@@ -2251,10 +2251,10 @@ try {
const promise = sensor.getRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877]); const promise = sensor.getRotationMatrix([0.20046076, 0.21907, 0.73978853, 0.60376877]);
promise.then((data) => { promise.then((data) => {
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info('data[' + i + ']: ' + data[i]);
} }
}).catch((reason) => { }).catch((reason) => {
console.info("promise::catch", reason); console.info('promise::catch ', reason);
}) })
} catch (err) { } catch (err) {
console.error('getRotationMatrix failed. Error code: ' + err.code + '; message: ' + err.message); console.error('getRotationMatrix failed. Error code: ' + err.code + '; message: ' + err.message);
...@@ -2284,7 +2284,7 @@ transformRotationMatrix(inRotationVector: Array&lt;number&gt;, coordinates: Coor ...@@ -2284,7 +2284,7 @@ transformRotationMatrix(inRotationVector: Array&lt;number&gt;, coordinates: Coor
try { try {
sensor.transformRotationMatrix([1, 0, 0, 0, 1, 0, 0, 0, 1], {x:2, y:3}, function(data) { sensor.transformRotationMatrix([1, 0, 0, 0, 1, 0, 0, 0, 1], {x:2, y:3}, function(data) {
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("transformRotationMatrix data[ " + i + "] = " + data[i]); console.info('transformRotationMatrix data[' + i + '] = ' + data[i]);
} }
}) })
} catch (err) { } catch (err) {
...@@ -2320,7 +2320,7 @@ try { ...@@ -2320,7 +2320,7 @@ try {
const promise = sensor.transformRotationMatrix([1, 0, 0, 0, 1, 0, 0, 0, 1], {x:2, y:3}); const promise = sensor.transformRotationMatrix([1, 0, 0, 0, 1, 0, 0, 0, 1], {x:2, y:3});
promise.then((data) => { promise.then((data) => {
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("transformRotationMatrix data[ " + i + "] = " + data[i]); console.info('transformRotationMatrix data[' + i + '] = ' + data[i]);
} }
}).catch((err) => { }).catch((err) => {
console.info("Operation failed"); console.info("Operation failed");
...@@ -2351,7 +2351,7 @@ getQuaternion(rotationVector: Array&lt;number&gt;, callback: AsyncCallback<Array ...@@ -2351,7 +2351,7 @@ getQuaternion(rotationVector: Array&lt;number&gt;, callback: AsyncCallback<Array
try { try {
sensor.getQuaternion ([0.20046076, 0.21907, 0.73978853, 0.60376877], function(data) { sensor.getQuaternion ([0.20046076, 0.21907, 0.73978853, 0.60376877], function(data) {
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info('data[' + i + ']: ' + data[i]);
} }
}) })
} catch (err) { } catch (err) {
...@@ -2387,7 +2387,7 @@ try { ...@@ -2387,7 +2387,7 @@ try {
promise.then((data) => { promise.then((data) => {
console.info('getQuaternionn_promise successed'); console.info('getQuaternionn_promise successed');
for (var i=0; i < data.length; i++) { for (var i=0; i < data.length; i++) {
console.info("data[" + i + "]: " + data[i]); console.info('data[' + i + ']: ' + data[i]);
} }
}).catch((err) => { }).catch((err) => {
console.info('promise failed'); console.info('promise failed');
...@@ -2419,7 +2419,7 @@ try { ...@@ -2419,7 +2419,7 @@ try {
sensor.getOrientation([1, 0, 0, 0, 1, 0, 0, 0, 1], function(data) { sensor.getOrientation([1, 0, 0, 0, 1, 0, 0, 0, 1], function(data) {
console.info("SensorJsAPI--->Successed to get getOrientation interface get data: " + data); console.info("SensorJsAPI--->Successed to get getOrientation interface get data: " + data);
for (var i = 1; i < data.length; i++) { for (var i = 1; i < data.length; i++) {
console.info("sensor_getOrientation_callback" + data[i]); console.info('sensor_getOrientation_callback ' + data[i]);
} }
}) })
} catch (err) { } catch (err) {
...@@ -2455,7 +2455,7 @@ try { ...@@ -2455,7 +2455,7 @@ try {
promise.then((data) => { promise.then((data) => {
console.info('sensor_getOrientation_Promise success', data); console.info('sensor_getOrientation_Promise success', data);
for (var i = 1; i < data.length; i++) { for (var i = 1; i < data.length; i++) {
console.info("sensor_getOrientation_promise" + data[i]); console.info('sensor_getOrientation_promise ' + data[i]);
} }
}).catch((err) => { }).catch((err) => {
console.info('promise failed'); console.info('promise failed');
...@@ -2486,7 +2486,7 @@ getRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number&gt; ...@@ -2486,7 +2486,7 @@ getRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number&gt;
```js ```js
try { try {
sensor.getRotationMatrix ([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444], function(data) { sensor.getRotationMatrix ([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444], function(data) {
console.info("sensor_getRotationMatrix_callback" + JSON.stringify(data)); console.info('sensor_getRotationMatrix_callback ' + JSON.stringify(data));
}) })
} catch (err) { } catch (err) {
console.error('getRotationMatrix failed. Error code: ' + err.code + '; message: ' + err.message); console.error('getRotationMatrix failed. Error code: ' + err.code + '; message: ' + err.message);
...@@ -2520,7 +2520,7 @@ getRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number&gt; ...@@ -2520,7 +2520,7 @@ getRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number&gt;
try { try {
const promise = sensor.getRotationMatrix ([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444]); const promise = sensor.getRotationMatrix ([-0.27775216, 0.5351276, 9.788099], [210.87253, -78.6096, -111.44444]);
promise.then((data) => { promise.then((data) => {
console.info("sensor_getRotationMatrix_callback" + JSON.stringify(data)); console.info('sensor_getRotationMatrix_callback ' + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.info('promise failed'); console.info('promise failed');
}) })
...@@ -2548,7 +2548,7 @@ try { ...@@ -2548,7 +2548,7 @@ try {
```js ```js
try { try {
sensor.getSensorList((data) => { sensor.getSensorList((data) => {
console.info("getSensorList callback in" + data.length); console.info('getSensorList callback in ' + data.length);
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
console.info("getSensorList " + JSON.stringify(data[i])); console.info("getSensorList " + JSON.stringify(data[i]));
} }
...@@ -2577,7 +2577,7 @@ try { ...@@ -2577,7 +2577,7 @@ try {
```js ```js
try { try {
sensor.getSensorList().then((data) => { sensor.getSensorList().then((data) => {
console.info("getSensorList promise in" + data.length); console.info('getSensorList promise in ' + data.length);
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
console.info("getSensorList " + JSON.stringify(data[i])); console.info("getSensorList " + JSON.stringify(data[i]));
} }
...@@ -2609,7 +2609,7 @@ getSingleSensor(type: SensorId, callback: AsyncCallback&lt;Sensor&gt;): void ...@@ -2609,7 +2609,7 @@ getSingleSensor(type: SensorId, callback: AsyncCallback&lt;Sensor&gt;): void
```js ```js
try { try {
sensor.getSingleSensor(sensor.SensorId.SENSOR_TYPE_ID_ACCELEROMETER, (error, data) => { sensor.getSingleSensor(sensor.SensorId.SENSOR_TYPE_ID_ACCELEROMETER, (error, data) => {
console.info("getSingleSensor " + JSON.stringify(data)); console.info('getSingleSensor ' + JSON.stringify(data));
}); });
} catch (err) { } catch (err) {
console.error('getSingleSensor failed. Error code: ' + err.code + '; message: ' + err.message); console.error('getSingleSensor failed. Error code: ' + err.code + '; message: ' + err.message);
...@@ -2641,7 +2641,7 @@ try { ...@@ -2641,7 +2641,7 @@ try {
```js ```js
try { try {
sensor.getSingleSensor(sensor.SensorId.SENSOR_TYPE_ID_ACCELEROMETER).then((data) => { sensor.getSingleSensor(sensor.SensorId.SENSOR_TYPE_ID_ACCELEROMETER).then((data) => {
console.info("getSingleSensor " + JSON.stringify(data)); console.info('getSingleSensor '+ JSON.stringify(data));
}, (error)=>{ }, (error)=>{
console.error('getSingleSensor failed'); console.error('getSingleSensor failed');
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册