Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7c83d9ba
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
7c83d9ba
编写于
2月 16, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 16, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7598 【Openharmony4.0.3.2】【release分支】【sensor子系统】【ToC】【RK3568】【必现】修改
Merge pull request !7598 from ldy/OpenHarmony-3.1-Release
上级
8a5de895
ae593c12
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
24 deletion
+26
-24
sensors/sensor_standard/src/main/js/default/test/SensorGeneralalgorithm.test.js
...d/src/main/js/default/test/SensorGeneralalgorithm.test.js
+6
-6
sensors/sensor_standard/src/main/js/default/test/SensorGeomagneticTest.test.js
...rd/src/main/js/default/test/SensorGeomagneticTest.test.js
+20
-18
未找到文件。
sensors/sensor_standard/src/main/js/default/test/SensorGeneralalgorithm.test.js
浏览文件 @
7c83d9ba
...
@@ -991,8 +991,8 @@ describe("SensorJsTest_sensor5", function () {
...
@@ -991,8 +991,8 @@ describe("SensorJsTest_sensor5", function () {
it
(
'
SensorJsTest_107
'
,
0
,
async
function
(
done
)
{
it
(
'
SensorJsTest_107
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------SensorJsTest_107----------------------------------
"
);
console
.
info
(
"
---------------------------SensorJsTest_107----------------------------------
"
);
sensor
.
transformCoordinateSystem
([
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
],
{
sensor
.
transformCoordinateSystem
([
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
],
{
'
axisX
'
:
1
,
'
x
'
:
1
,
'
axisY
'
:
2
'
y
'
:
2
},
(
error
,
data
)
=>
{
},
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_107 failed
'
);
console
.
info
(
'
SensorJsTest_107 failed
'
);
...
@@ -1012,7 +1012,7 @@ describe("SensorJsTest_sensor5", function () {
...
@@ -1012,7 +1012,7 @@ describe("SensorJsTest_sensor5", function () {
it
(
'
SensorJsTest_108
'
,
0
,
async
function
(
done
)
{
it
(
'
SensorJsTest_108
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------SensorJsTest_108----------------------------------
"
);
console
.
info
(
"
---------------------------SensorJsTest_108----------------------------------
"
);
sensor
.
transformCoordinateSystem
([
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
sensor
.
transformCoordinateSystem
([
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
],
{
'
axisX
'
:
1
,
'
axisY
'
:
2
},
(
error
,
data
)
=>
{
3.40282
e
+
38
,
3.40282
e
+
38
,
3.40282
e
+
38
],
{
'
x
'
:
1
,
'
y
'
:
2
},
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
info
(
'
SensorJsTest_108 failed
'
);
console
.
info
(
'
SensorJsTest_108 failed
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -1031,8 +1031,8 @@ describe("SensorJsTest_sensor5", function () {
...
@@ -1031,8 +1031,8 @@ describe("SensorJsTest_sensor5", function () {
it
(
"
SensorJsTest_109
"
,
0
,
async
function
(
done
)
{
it
(
"
SensorJsTest_109
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------SensorJsTest_109----------------------------------
"
);
console
.
info
(
"
---------------------------SensorJsTest_109----------------------------------
"
);
sensor
.
transformCoordinateSystem
([
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
],
{
sensor
.
transformCoordinateSystem
([
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
,
1.5
],
{
'
axisX
'
:
1
,
'
x
'
:
1
,
'
axisY
'
:
2
'
y
'
:
2
}).
then
((
data
)
=>
{
}).
then
((
data
)
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
"
SensorJsTest_109 data[
"
+
i
+
"
] =
"
+
data
[
i
]);
console
.
info
(
"
SensorJsTest_109 data[
"
+
i
+
"
] =
"
+
data
[
i
]);
...
@@ -1053,7 +1053,7 @@ describe("SensorJsTest_sensor5", function () {
...
@@ -1053,7 +1053,7 @@ describe("SensorJsTest_sensor5", function () {
it
(
"
SensorJsTest_110
"
,
0
,
async
function
(
done
)
{
it
(
"
SensorJsTest_110
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------SensorJsTest_110----------------------------------
"
);
console
.
info
(
"
---------------------------SensorJsTest_110----------------------------------
"
);
sensor
.
transformCoordinateSystem
([
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
sensor
.
transformCoordinateSystem
([
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
],
{
'
axisX
'
:
1
,
'
axisY
'
:
3
}).
then
((
data
)
=>
{
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
,
3.40282
e
+
39
],
{
'
x
'
:
1
,
'
y
'
:
3
}).
then
((
data
)
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
"
SensorJsTest_110 data[
"
+
i
+
"
] =
"
+
data
[
i
]);
console
.
info
(
"
SensorJsTest_110 data[
"
+
i
+
"
] =
"
+
data
[
i
]);
expect
(
data
[
i
]).
assertEqual
(
transformCoordinateSystemResult
[
2
][
i
]);
expect
(
data
[
i
]).
assertEqual
(
transformCoordinateSystemResult
[
2
][
i
]);
...
...
sensors/sensor_standard/src/main/js/default/test/SensorGeomagneticTest.test.js
浏览文件 @
7c83d9ba
...
@@ -173,8 +173,9 @@ describe("SensorJsTest_sensor6", function () {
...
@@ -173,8 +173,9 @@ describe("SensorJsTest_sensor6", function () {
*/
*/
it
(
'
SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0030
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0030
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
------------------SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0030-------------------------
"
);
console
.
info
(
"
------------------SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0030-------------------------
"
);
let
geomagneticComponent
=
[
27779.234375
,
-
6214.9794921875
,
-
14924.6611328125
,
-
27.667943954467773
,
let
geomagneticComponent
=
[
-
1417119616
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
-
12.610970497131348
,
28465.9765625
,
32141.2109375
]
93.50342559814453
,
23190329344
,
24058943488
,
27779.234375
,
-
6214.9794921875
,
-
14924.6611328125
,
-
27.667943954467773
,
-
12.610970497131348
,
28465.9765625
,
32141.2109375
]
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
Number
.
MAX_VALUE
,
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
Number
.
MAX_VALUE
,
(
error
,
data
)
=>
{
(
error
,
data
)
=>
{
if
(
error
)
{
if
(
error
)
{
...
@@ -185,13 +186,13 @@ describe("SensorJsTest_sensor6", function () {
...
@@ -185,13 +186,13 @@ describe("SensorJsTest_sensor6", function () {
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
expect
(
data
.
x
).
assertEqual
(
geomagneticComponent
[
0
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
x
)
expect
(
data
.
y
).
assertEqual
(
geomagneticComponent
[
1
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
y
)
expect
(
data
.
z
).
assertEqual
(
geomagneticComponent
[
2
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
z
)
expect
(
data
.
geomagneticDip
).
assertEqual
(
geomagneticComponent
[
3
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
geomagneticDip
)
expect
(
data
.
deflectionAngle
).
assertEqual
(
geomagneticComponent
[
4
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
deflectionAngle
)
expect
(
data
.
levelIntensity
).
assertEqual
(
geomagneticComponent
[
5
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
levelIntensity
)
expect
(
data
.
totalIntensity
).
assertEqual
(
geomagneticComponent
[
6
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
totalIntensity
)
}
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
done
()
done
()
...
@@ -840,21 +841,22 @@ describe("SensorJsTest_sensor6", function () {
...
@@ -840,21 +841,22 @@ describe("SensorJsTest_sensor6", function () {
*/
*/
it
(
"
SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0270
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0270
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
------------------SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0270------------------
'
);
console
.
info
(
'
------------------SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0270------------------
'
);
let
geomagneticComponent
=
[
27779.234375
,
-
6214.9794921875
,
-
14924.6611328125
,
-
27.667943954467773
,
let
geomagneticComponent
=
[
-
1417119616
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
-
12.610970497131348
,
28465.9765625
,
32141.2109375
]
93.50342559814453
,
23190329344
,
24058943488
,
27779.234375
,
-
6214.9794921875
,
-
14924.6611328125
,
-
27.667943954467773
,
-
12.610970497131348
,
28465.9765625
,
32141.2109375
]
await
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
await
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
Number
.
MAX_VALUE
).
then
((
data
)
=>
{
Number
.
MAX_VALUE
).
then
((
data
)
=>
{
console
.
info
(
'
SensorGeomagenticAlgorithmJSTest027 x:
'
+
data
.
x
+
'
,y:
'
+
data
.
y
+
'
,z:
'
+
data
.
z
console
.
info
(
'
SensorGeomagenticAlgorithmJSTest027 x:
'
+
data
.
x
+
'
,y:
'
+
data
.
y
+
'
,z:
'
+
data
.
z
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
expect
(
data
.
x
).
assertEqual
(
geomagneticComponent
[
0
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
x
)
expect
(
data
.
y
).
assertEqual
(
geomagneticComponent
[
1
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
y
)
expect
(
data
.
z
).
assertEqual
(
geomagneticComponent
[
2
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
z
)
expect
(
data
.
geomagneticDip
).
assertEqual
(
geomagneticComponent
[
3
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
geomagneticDip
)
expect
(
data
.
deflectionAngle
).
assertEqual
(
geomagneticComponent
[
4
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
deflectionAngle
)
expect
(
data
.
levelIntensity
).
assertEqual
(
geomagneticComponent
[
5
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
levelIntensity
)
expect
(
data
.
totalIntensity
).
assertEqual
(
geomagneticComponent
[
6
]
)
expect
(
geomagneticComponent
).
assertContain
(
data
.
totalIntensity
)
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
info
(
"
promise::catch
"
,
error
)
console
.
info
(
"
promise::catch
"
,
error
)
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录