skyeye-sdk-js 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/RequestFactory.d.ts +1 -1
- package/dist/src/RequestFactory.js +1 -0
- package/dist/src/SkyEyeClient.d.ts +1 -1
- package/dist/src/SkyEyeClient.js +3 -2
- package/dist/test.js +221 -16
- package/package.json +1 -1
- package/src/RequestFactory.ts +3 -3
- package/src/SkyEyeClient.ts +4 -3
- package/test.ts +250 -18
|
@@ -19,7 +19,7 @@ export declare class RequestFactory {
|
|
|
19
19
|
getCurrentSimulationTime(): JSONRequest;
|
|
20
20
|
getCurrentPC(cpuName: string): JSONRequest;
|
|
21
21
|
getCpuMips(cpuName: string): JSONRequest;
|
|
22
|
-
getGlobalVarValue(cpuName: string, varName: string, bytesNum:
|
|
22
|
+
getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): JSONRequest;
|
|
23
23
|
setGlobalVarValue(cpuName: string, varName: string, bytesNum: string, valueType: GlobalVarType, value: string): JSONRequest;
|
|
24
24
|
getDeviceList(): JSONRequest;
|
|
25
25
|
getDeviceTree(): JSONRequest;
|
|
@@ -137,6 +137,7 @@ class RequestFactory {
|
|
|
137
137
|
baseRequest.setArgs(args);
|
|
138
138
|
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
139
139
|
request.setRequest(baseRequest.toJSONString());
|
|
140
|
+
console.log("request:", request);
|
|
140
141
|
return request;
|
|
141
142
|
}
|
|
142
143
|
setGlobalVarValue(cpuName, varName, bytesNum, valueType, value) {
|
|
@@ -40,7 +40,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
|
|
|
40
40
|
getCurrentPC(): Promise<any>;
|
|
41
41
|
getCpuMips(cpuName: string): Promise<any>;
|
|
42
42
|
getCurrentCpuMips(): Promise<any>;
|
|
43
|
-
getGlobalVarValue(cpuName: string, varName: string, bytesNum:
|
|
43
|
+
getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType): Promise<any>;
|
|
44
44
|
getGlobalVarValueDefault(varName: string, valueType: GlobalVarType): Promise<any>;
|
|
45
45
|
setGlobalVarValue(cpuName: string, varName: string, bytesNum: string, valueType: GlobalVarType, value: string): Promise<any>;
|
|
46
46
|
setGlobalVarValueDefault(varName: string, valueType: GlobalVarType, value: string): Promise<any>;
|
package/dist/src/SkyEyeClient.js
CHANGED
|
@@ -147,6 +147,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
147
147
|
return ackObj;
|
|
148
148
|
}
|
|
149
149
|
catch (error) {
|
|
150
|
+
console.error("Error during gRPC request:", JSON.stringify(request));
|
|
150
151
|
console.error("Error during gRPC call:", error);
|
|
151
152
|
throw error;
|
|
152
153
|
}
|
|
@@ -435,7 +436,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
435
436
|
const cpuList = (yield this.getCpuList()).getCpuList();
|
|
436
437
|
if (cpuList != null && cpuList.length > 0) {
|
|
437
438
|
try {
|
|
438
|
-
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName,
|
|
439
|
+
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName, 4, valueType));
|
|
439
440
|
}
|
|
440
441
|
catch (error) {
|
|
441
442
|
console.error("Error during getGlobalVarValueDefault:", error);
|
|
@@ -559,7 +560,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
559
560
|
let result = 0;
|
|
560
561
|
if (!isNaN(numOffset1) && !isNaN(numOffset2)) {
|
|
561
562
|
result = numOffset1 - numOffset2;
|
|
562
|
-
console.log("Result:", result);
|
|
563
|
+
// console.log("Result:", result);
|
|
563
564
|
}
|
|
564
565
|
else {
|
|
565
566
|
console.log("Invalid offset values.");
|
package/dist/test.js
CHANGED
|
@@ -11,9 +11,179 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const { SkyEyeClientFactory } = require('./src/SkyEyeClientFactory');
|
|
13
13
|
const { SkyEyeClient } = require('./src/SkyEyeClient');
|
|
14
|
+
const json = {
|
|
15
|
+
"id": "4a162d75-3a84-5264-992f-287624830ead",
|
|
16
|
+
"name": "鍙戦€佸唴瀛樻秷鎭祴璇?",
|
|
17
|
+
"overview": "",
|
|
18
|
+
"parentId": "8a6d70cd-bd7a-4871-d2f3-2f4fdf7b5a46",
|
|
19
|
+
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
20
|
+
"steps": [
|
|
21
|
+
{
|
|
22
|
+
"id": "35846013-6510-fd0a-a046-a98c2f24157b",
|
|
23
|
+
"sendConditions": {
|
|
24
|
+
"id": "b3c97e92-7367-63ba-6a6b-5f7ca590164c",
|
|
25
|
+
"name": "杩愯0.5s",
|
|
26
|
+
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
27
|
+
"overview": "",
|
|
28
|
+
"relationship": "A",
|
|
29
|
+
"child": [
|
|
30
|
+
{
|
|
31
|
+
"id": "5ba88de6-a224-0e80-6585-d5e417b424ce",
|
|
32
|
+
"tag": "A",
|
|
33
|
+
"condition": {
|
|
34
|
+
"type": 1,
|
|
35
|
+
"time": 0.5
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"expectConditions": {
|
|
41
|
+
"id": "6e265328-255e-d7e3-11fd-0a4211d0d0d6",
|
|
42
|
+
"name": "杩愯0.8s",
|
|
43
|
+
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
44
|
+
"overview": "",
|
|
45
|
+
"relationship": "A",
|
|
46
|
+
"child": [
|
|
47
|
+
{
|
|
48
|
+
"id": "d9e08452-f88b-8de9-bd20-5d5288987fde",
|
|
49
|
+
"tag": "A",
|
|
50
|
+
"condition": {
|
|
51
|
+
"type": 1,
|
|
52
|
+
"time": 0.8
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"sends": {
|
|
58
|
+
"templateId": "",
|
|
59
|
+
"name": "鍐呭瓨0x4鍙戦€?",
|
|
60
|
+
"child": [
|
|
61
|
+
{
|
|
62
|
+
"id": "0cd71a92-4e7a-dcb8-d74b-dc6ea8103d02",
|
|
63
|
+
"templdateId": "",
|
|
64
|
+
"name": "鏂扮殑鍙戦€?",
|
|
65
|
+
"target": {
|
|
66
|
+
"type": 3,
|
|
67
|
+
"globalName": "",
|
|
68
|
+
"varType": "",
|
|
69
|
+
"addr": "0x4",
|
|
70
|
+
"length": 4,
|
|
71
|
+
"name": "",
|
|
72
|
+
"deviceName": "",
|
|
73
|
+
"busType": 0,
|
|
74
|
+
"directions": 1,
|
|
75
|
+
"nodes": [
|
|
76
|
+
{
|
|
77
|
+
"name": "鑺傜偣1",
|
|
78
|
+
"rtAddr": "",
|
|
79
|
+
"subAddr": "",
|
|
80
|
+
"id": "row_253"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "鑺傜偣2",
|
|
84
|
+
"rtAddr": "",
|
|
85
|
+
"subAddr": "",
|
|
86
|
+
"id": "row_254"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"fields": [
|
|
90
|
+
{
|
|
91
|
+
"name": "field1",
|
|
92
|
+
"dataType": 0,
|
|
93
|
+
"defaultValue": 4,
|
|
94
|
+
"dataRange": [],
|
|
95
|
+
"desc": "this is field1",
|
|
96
|
+
"id": "a89ee30f-ea3d-411e-9bf1-543935a003fc"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"dataFormat": 0,
|
|
101
|
+
"value": "4",
|
|
102
|
+
"fields": [
|
|
103
|
+
{
|
|
104
|
+
"name": "field1",
|
|
105
|
+
"dataType": 0,
|
|
106
|
+
"defaultValue": 4,
|
|
107
|
+
"dataRange": [],
|
|
108
|
+
"desc": "this is field1",
|
|
109
|
+
"id": "d4c808d1-47ba-a30e-cfbe-68c0d2772b3d"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"_X_ROW_KEY": "row_251"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"expects": {
|
|
117
|
+
"templateId": "",
|
|
118
|
+
"name": "鍐呭瓨0x14鍙戦€?",
|
|
119
|
+
"child": [
|
|
120
|
+
{
|
|
121
|
+
"id": "85276ca0-0a09-aa87-ebff-1e6dfc4e5f4f",
|
|
122
|
+
"name": "鏂扮殑棰勬湡",
|
|
123
|
+
"templateId": "",
|
|
124
|
+
"target": {
|
|
125
|
+
"type": 3,
|
|
126
|
+
"globalName": "",
|
|
127
|
+
"varType": "",
|
|
128
|
+
"addr": "0x44",
|
|
129
|
+
"length": 4,
|
|
130
|
+
"name": "",
|
|
131
|
+
"deviceName": "",
|
|
132
|
+
"busType": 0,
|
|
133
|
+
"directions": 1,
|
|
134
|
+
"nodes": [
|
|
135
|
+
{
|
|
136
|
+
"name": "鑺傜偣1",
|
|
137
|
+
"rtAddr": "",
|
|
138
|
+
"subAddr": "",
|
|
139
|
+
"id": "row_299"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "鑺傜偣2",
|
|
143
|
+
"rtAddr": "",
|
|
144
|
+
"subAddr": "",
|
|
145
|
+
"id": "row_300"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"fields": [
|
|
149
|
+
{
|
|
150
|
+
"name": "field1",
|
|
151
|
+
"dataType": 0,
|
|
152
|
+
"defaultValue": 4,
|
|
153
|
+
"dataRange": [],
|
|
154
|
+
"desc": "this is field1",
|
|
155
|
+
"id": "ef2b8873-516c-a338-a8d0-5e8eda5fa08b"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"dataFormat": 0,
|
|
160
|
+
"value": "8",
|
|
161
|
+
"fields": [
|
|
162
|
+
{
|
|
163
|
+
"name": "field1",
|
|
164
|
+
"dataType": 0,
|
|
165
|
+
"defaultValue": 4,
|
|
166
|
+
"dataRange": [],
|
|
167
|
+
"desc": "this is field1",
|
|
168
|
+
"id": "379506c9-33d2-167d-6c22-8e0ca8559c0a"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"_X_ROW_KEY": "row_297"
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"select": true
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"settings": {
|
|
179
|
+
"timeout": ""
|
|
180
|
+
},
|
|
181
|
+
"createdAt": "2024-06-05T02:18:27.630Z",
|
|
182
|
+
"updatedAt": "2024-06-11T06:37:05.487Z",
|
|
183
|
+
"results": []
|
|
184
|
+
};
|
|
14
185
|
function test() {
|
|
15
186
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
17
187
|
// console.log("Connected to SkyEye server");
|
|
18
188
|
// await client.getDeviceList();
|
|
19
189
|
// await client.getCurrentCpuMips();
|
|
@@ -26,22 +196,57 @@ function test() {
|
|
|
26
196
|
// const response = await client.getMemoryValueDefault(1, 16);
|
|
27
197
|
// const response = await client.getMemoryValue("c7s",0,16);
|
|
28
198
|
// console.log("结果response:", response)
|
|
29
|
-
const pathSkyEye = "D:/data/case/c6713_demo";
|
|
30
|
-
const fileName = "c6713_demo.skyeye";
|
|
31
|
-
const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe";
|
|
32
|
-
const port = "50051";
|
|
33
199
|
// await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
// const
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// const
|
|
200
|
+
// const pathSkyEye = "D:/data/case/c6713_demo";
|
|
201
|
+
// const fileName = "c6713_demo.skyeye";
|
|
202
|
+
// const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
|
|
203
|
+
// const port = "50051"
|
|
204
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
205
|
+
// await client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir)
|
|
206
|
+
const pathSkyEye = "D:/data/case/workspace_c6713/targets/c6713_fc_1553b";
|
|
207
|
+
const fileName = "c6713_fc_1553b.skyeye";
|
|
208
|
+
const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe";
|
|
209
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
210
|
+
// const response =await client.getCurrentRunningState()
|
|
211
|
+
// const response = await client.getMemoryValueDefault("128","4")
|
|
212
|
+
const response = yield client.getGlobalVarValueDefault("number_b", "int");
|
|
213
|
+
console.log("response:", response);
|
|
214
|
+
//启动多个skyeye
|
|
215
|
+
// const count = 5;
|
|
216
|
+
// const map = new Map<number, any>;
|
|
217
|
+
// for (let i = 1; i < count; i++) {
|
|
218
|
+
// const port = 50050 + i
|
|
219
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port.toString());
|
|
220
|
+
// await client.initSkyEyeAndRun2(pathSkyEye, fileName, port.toString(), skyeyeDir)
|
|
221
|
+
// await client.RunTestcase(json)
|
|
222
|
+
// await client.runCommand()
|
|
223
|
+
// const res = await client.getCurrentRunningState()
|
|
224
|
+
// console.log("state3:", res.state)
|
|
225
|
+
// map.set(port, client);
|
|
226
|
+
// }
|
|
227
|
+
// for (let i = 1; i < count; i++) {
|
|
228
|
+
// setTimeout(async () => {
|
|
229
|
+
// const port = 50050 + i
|
|
230
|
+
// const client = map.get(port)
|
|
231
|
+
// await client.quitCommand()
|
|
232
|
+
// }, i * 5000)
|
|
233
|
+
// }
|
|
234
|
+
// setTimeout(async () => {
|
|
235
|
+
// // await map.get(50051).stopGrpcService("")
|
|
236
|
+
// await map.get(50051).quitCommand()
|
|
237
|
+
// }, 2000)
|
|
238
|
+
// setTimeout(async () => {
|
|
239
|
+
// // await map.get(50052).stopGrpcService("")
|
|
240
|
+
// await map.get(50052).quitCommand()
|
|
241
|
+
// }, 5000)
|
|
242
|
+
// setTimeout(async () => {
|
|
243
|
+
// // await map.get(50053).stopGrpcService("")
|
|
244
|
+
// await map.get(50053).quitCommand()
|
|
245
|
+
// }, 8000)
|
|
246
|
+
// setTimeout(async () => {
|
|
247
|
+
// // await map.get(50054).stopGrpcService("")
|
|
248
|
+
// await map.get(50054).quitCommand()
|
|
249
|
+
// }, 11000)
|
|
45
250
|
});
|
|
46
251
|
}
|
|
47
252
|
test();
|
package/package.json
CHANGED
package/src/RequestFactory.ts
CHANGED
|
@@ -153,10 +153,9 @@ export class RequestFactory {
|
|
|
153
153
|
return request;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
public getGlobalVarValue(cpuName: string, varName: string, bytesNum:
|
|
156
|
+
public getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType) {
|
|
157
157
|
const baseRequest = new BaseRequest("SE_get_global_variable_value");
|
|
158
|
-
const args: { [key: string]:
|
|
159
|
-
|
|
158
|
+
const args: { [key: string]: any } = {};
|
|
160
159
|
args.cpu_name = cpuName;
|
|
161
160
|
args.var_name = varName;
|
|
162
161
|
args.value_bytes_number = bytesNum
|
|
@@ -164,6 +163,7 @@ export class RequestFactory {
|
|
|
164
163
|
baseRequest.setArgs(args)
|
|
165
164
|
const request = new JSONRequest()
|
|
166
165
|
request.setRequest(baseRequest.toJSONString());
|
|
166
|
+
console.log("request:",request)
|
|
167
167
|
return request;
|
|
168
168
|
}
|
|
169
169
|
|
package/src/SkyEyeClient.ts
CHANGED
|
@@ -109,6 +109,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
109
109
|
// this.printResponseLog(ackObj)
|
|
110
110
|
return ackObj;
|
|
111
111
|
} catch (error) {
|
|
112
|
+
console.error("Error during gRPC request:", JSON.stringify(request));
|
|
112
113
|
console.error("Error during gRPC call:", error);
|
|
113
114
|
throw error;
|
|
114
115
|
}
|
|
@@ -370,7 +371,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
370
371
|
}
|
|
371
372
|
|
|
372
373
|
|
|
373
|
-
public async getGlobalVarValue(cpuName: string, varName: string, bytesNum:
|
|
374
|
+
public async getGlobalVarValue(cpuName: string, varName: string, bytesNum: number, valueType: GlobalVarType) {
|
|
374
375
|
try {
|
|
375
376
|
return await this.call(RequestFactory.getInstance().getGlobalVarValue(cpuName, varName, bytesNum, valueType))
|
|
376
377
|
} catch (error) {
|
|
@@ -386,7 +387,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
386
387
|
const cpuList = (await this.getCpuList()).getCpuList();
|
|
387
388
|
if (cpuList != null && cpuList.length > 0) {
|
|
388
389
|
try {
|
|
389
|
-
return await this.call(RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName,
|
|
390
|
+
return await this.call(RequestFactory.getInstance().getGlobalVarValue(cpuList[0].getName(), varName, 4, valueType));
|
|
390
391
|
} catch (error) {
|
|
391
392
|
console.error("Error during getGlobalVarValueDefault:", error);
|
|
392
393
|
throw error;
|
|
@@ -504,7 +505,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
504
505
|
let result: number = 0;
|
|
505
506
|
if (!isNaN(numOffset1) && !isNaN(numOffset2)) {
|
|
506
507
|
result = numOffset1 - numOffset2;
|
|
507
|
-
console.log("Result:", result);
|
|
508
|
+
// console.log("Result:", result);
|
|
508
509
|
} else {
|
|
509
510
|
console.log("Invalid offset values.");
|
|
510
511
|
}
|
package/test.ts
CHANGED
|
@@ -5,8 +5,184 @@ import { ServiceError } from "@grpc/grpc-js";
|
|
|
5
5
|
const { SkyEyeClientFactory } = require('./src/SkyEyeClientFactory')
|
|
6
6
|
const { SkyEyeClient } = require('./src/SkyEyeClient')
|
|
7
7
|
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const json = {
|
|
11
|
+
"id": "4a162d75-3a84-5264-992f-287624830ead",
|
|
12
|
+
"name": "鍙戦€佸唴瀛樻秷鎭祴璇?",
|
|
13
|
+
"overview": "",
|
|
14
|
+
"parentId": "8a6d70cd-bd7a-4871-d2f3-2f4fdf7b5a46",
|
|
15
|
+
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
16
|
+
"steps": [
|
|
17
|
+
{
|
|
18
|
+
"id": "35846013-6510-fd0a-a046-a98c2f24157b",
|
|
19
|
+
"sendConditions": {
|
|
20
|
+
"id": "b3c97e92-7367-63ba-6a6b-5f7ca590164c",
|
|
21
|
+
"name": "杩愯0.5s",
|
|
22
|
+
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
23
|
+
"overview": "",
|
|
24
|
+
"relationship": "A",
|
|
25
|
+
"child": [
|
|
26
|
+
{
|
|
27
|
+
"id": "5ba88de6-a224-0e80-6585-d5e417b424ce",
|
|
28
|
+
"tag": "A",
|
|
29
|
+
"condition": {
|
|
30
|
+
"type": 1,
|
|
31
|
+
"time": 0.5
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"expectConditions": {
|
|
37
|
+
"id": "6e265328-255e-d7e3-11fd-0a4211d0d0d6",
|
|
38
|
+
"name": "杩愯0.8s",
|
|
39
|
+
"projectId": "15ffe24f-8ca6-4fcf-afe5-fe01027e2ffb",
|
|
40
|
+
"overview": "",
|
|
41
|
+
"relationship": "A",
|
|
42
|
+
"child": [
|
|
43
|
+
{
|
|
44
|
+
"id": "d9e08452-f88b-8de9-bd20-5d5288987fde",
|
|
45
|
+
"tag": "A",
|
|
46
|
+
"condition": {
|
|
47
|
+
"type": 1,
|
|
48
|
+
"time": 0.8
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"sends": {
|
|
54
|
+
"templateId": "",
|
|
55
|
+
"name": "鍐呭瓨0x4鍙戦€?",
|
|
56
|
+
"child": [
|
|
57
|
+
{
|
|
58
|
+
"id": "0cd71a92-4e7a-dcb8-d74b-dc6ea8103d02",
|
|
59
|
+
"templdateId": "",
|
|
60
|
+
"name": "鏂扮殑鍙戦€?",
|
|
61
|
+
"target": {
|
|
62
|
+
"type": 3,
|
|
63
|
+
"globalName": "",
|
|
64
|
+
"varType": "",
|
|
65
|
+
"addr": "0x4",
|
|
66
|
+
"length": 4,
|
|
67
|
+
"name": "",
|
|
68
|
+
"deviceName": "",
|
|
69
|
+
"busType": 0,
|
|
70
|
+
"directions": 1,
|
|
71
|
+
"nodes": [
|
|
72
|
+
{
|
|
73
|
+
"name": "鑺傜偣1",
|
|
74
|
+
"rtAddr": "",
|
|
75
|
+
"subAddr": "",
|
|
76
|
+
"id": "row_253"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "鑺傜偣2",
|
|
80
|
+
"rtAddr": "",
|
|
81
|
+
"subAddr": "",
|
|
82
|
+
"id": "row_254"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"fields": [
|
|
86
|
+
{
|
|
87
|
+
"name": "field1",
|
|
88
|
+
"dataType": 0,
|
|
89
|
+
"defaultValue": 4,
|
|
90
|
+
"dataRange": [],
|
|
91
|
+
"desc": "this is field1",
|
|
92
|
+
"id": "a89ee30f-ea3d-411e-9bf1-543935a003fc"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"dataFormat": 0,
|
|
97
|
+
"value": "4",
|
|
98
|
+
"fields": [
|
|
99
|
+
{
|
|
100
|
+
"name": "field1",
|
|
101
|
+
"dataType": 0,
|
|
102
|
+
"defaultValue": 4,
|
|
103
|
+
"dataRange": [],
|
|
104
|
+
"desc": "this is field1",
|
|
105
|
+
"id": "d4c808d1-47ba-a30e-cfbe-68c0d2772b3d"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"_X_ROW_KEY": "row_251"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"expects": {
|
|
113
|
+
"templateId": "",
|
|
114
|
+
"name": "鍐呭瓨0x14鍙戦€?",
|
|
115
|
+
"child": [
|
|
116
|
+
{
|
|
117
|
+
"id": "85276ca0-0a09-aa87-ebff-1e6dfc4e5f4f",
|
|
118
|
+
"name": "鏂扮殑棰勬湡",
|
|
119
|
+
"templateId": "",
|
|
120
|
+
"target": {
|
|
121
|
+
"type": 3,
|
|
122
|
+
"globalName": "",
|
|
123
|
+
"varType": "",
|
|
124
|
+
"addr": "0x44",
|
|
125
|
+
"length": 4,
|
|
126
|
+
"name": "",
|
|
127
|
+
"deviceName": "",
|
|
128
|
+
"busType": 0,
|
|
129
|
+
"directions": 1,
|
|
130
|
+
"nodes": [
|
|
131
|
+
{
|
|
132
|
+
"name": "鑺傜偣1",
|
|
133
|
+
"rtAddr": "",
|
|
134
|
+
"subAddr": "",
|
|
135
|
+
"id": "row_299"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "鑺傜偣2",
|
|
139
|
+
"rtAddr": "",
|
|
140
|
+
"subAddr": "",
|
|
141
|
+
"id": "row_300"
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"fields": [
|
|
145
|
+
{
|
|
146
|
+
"name": "field1",
|
|
147
|
+
"dataType": 0,
|
|
148
|
+
"defaultValue": 4,
|
|
149
|
+
"dataRange": [],
|
|
150
|
+
"desc": "this is field1",
|
|
151
|
+
"id": "ef2b8873-516c-a338-a8d0-5e8eda5fa08b"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"dataFormat": 0,
|
|
156
|
+
"value": "8",
|
|
157
|
+
"fields": [
|
|
158
|
+
{
|
|
159
|
+
"name": "field1",
|
|
160
|
+
"dataType": 0,
|
|
161
|
+
"defaultValue": 4,
|
|
162
|
+
"dataRange": [],
|
|
163
|
+
"desc": "this is field1",
|
|
164
|
+
"id": "379506c9-33d2-167d-6c22-8e0ca8559c0a"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"_X_ROW_KEY": "row_297"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"select": true
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"settings": {
|
|
175
|
+
"timeout": ""
|
|
176
|
+
},
|
|
177
|
+
"createdAt": "2024-06-05T02:18:27.630Z",
|
|
178
|
+
"updatedAt": "2024-06-11T06:37:05.487Z",
|
|
179
|
+
"results": []
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
8
184
|
async function test() {
|
|
9
|
-
|
|
185
|
+
|
|
10
186
|
// console.log("Connected to SkyEye server");
|
|
11
187
|
// await client.getDeviceList();
|
|
12
188
|
// await client.getCurrentCpuMips();
|
|
@@ -24,27 +200,83 @@ async function test() {
|
|
|
24
200
|
// const response = await client.getMemoryValue("c7s",0,16);
|
|
25
201
|
// console.log("结果response:", response)
|
|
26
202
|
|
|
27
|
-
|
|
28
|
-
const fileName = "c6713_demo.skyeye";
|
|
29
|
-
const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
|
|
30
|
-
const port = "50051"
|
|
203
|
+
|
|
31
204
|
// await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
|
|
32
205
|
|
|
33
|
-
await client.initSkyEyeAndRun2(pathSkyEye,fileName,port,skyeyeDir)
|
|
34
|
-
const res = await client.getCurrentRunningState()
|
|
35
|
-
console.log("state:",res.state)
|
|
36
206
|
|
|
37
|
-
|
|
38
|
-
// setTimeout(async ()=>{
|
|
39
|
-
// const quitResponse = await client.quitCommand()
|
|
40
|
-
// console.log("quitResponse",quitResponse)
|
|
41
|
-
// const response = await client.stopGrpcService("")
|
|
42
|
-
// console.log("stopGrpcService",response)
|
|
43
|
-
// },6000)
|
|
44
207
|
|
|
45
|
-
// GrpcUtil.initAndRunExample();
|
|
46
208
|
|
|
47
|
-
// const
|
|
48
|
-
|
|
209
|
+
// const pathSkyEye = "D:/data/case/c6713_demo";
|
|
210
|
+
// const fileName = "c6713_demo.skyeye";
|
|
211
|
+
// const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
// const port = "50051"
|
|
215
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
216
|
+
// await client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir)
|
|
217
|
+
|
|
218
|
+
const pathSkyEye = "D:/data/case/workspace_c6713/targets/c6713_fc_1553b";
|
|
219
|
+
const fileName = "c6713_fc_1553b.skyeye";
|
|
220
|
+
const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
224
|
+
// const response =await client.getCurrentRunningState()
|
|
225
|
+
// const response = await client.getMemoryValueDefault("128","4")
|
|
226
|
+
const response = await client.getGlobalVarValueDefault("number_b","int")
|
|
227
|
+
console.log("response:", response)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
//启动多个skyeye
|
|
231
|
+
// const count = 5;
|
|
232
|
+
// const map = new Map<number, any>;
|
|
233
|
+
// for (let i = 1; i < count; i++) {
|
|
234
|
+
// const port = 50050 + i
|
|
235
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port.toString());
|
|
236
|
+
// await client.initSkyEyeAndRun2(pathSkyEye, fileName, port.toString(), skyeyeDir)
|
|
237
|
+
// await client.RunTestcase(json)
|
|
238
|
+
// await client.runCommand()
|
|
239
|
+
// const res = await client.getCurrentRunningState()
|
|
240
|
+
// console.log("state3:", res.state)
|
|
241
|
+
// map.set(port, client);
|
|
242
|
+
// }
|
|
243
|
+
// for (let i = 1; i < count; i++) {
|
|
244
|
+
// setTimeout(async () => {
|
|
245
|
+
// const port = 50050 + i
|
|
246
|
+
// const client = map.get(port)
|
|
247
|
+
// await client.quitCommand()
|
|
248
|
+
// }, i * 5000)
|
|
249
|
+
// }
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
// setTimeout(async () => {
|
|
257
|
+
// // await map.get(50051).stopGrpcService("")
|
|
258
|
+
// await map.get(50051).quitCommand()
|
|
259
|
+
// }, 2000)
|
|
260
|
+
|
|
261
|
+
// setTimeout(async () => {
|
|
262
|
+
// // await map.get(50052).stopGrpcService("")
|
|
263
|
+
// await map.get(50052).quitCommand()
|
|
264
|
+
// }, 5000)
|
|
265
|
+
|
|
266
|
+
// setTimeout(async () => {
|
|
267
|
+
// // await map.get(50053).stopGrpcService("")
|
|
268
|
+
// await map.get(50053).quitCommand()
|
|
269
|
+
// }, 8000)
|
|
270
|
+
|
|
271
|
+
// setTimeout(async () => {
|
|
272
|
+
// // await map.get(50054).stopGrpcService("")
|
|
273
|
+
// await map.get(50054).quitCommand()
|
|
274
|
+
// }, 11000)
|
|
275
|
+
|
|
276
|
+
|
|
49
277
|
}
|
|
50
278
|
test();
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|