skyeye-sdk-js 1.4.13 → 1.4.15
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/.vscode/launch.json +22 -0
- package/dist/src/RequestFactory.d.ts +3 -3
- package/dist/src/RequestFactory.js +12 -3
- package/dist/src/SkyEyeClient.d.ts +4 -4
- package/dist/src/SkyEyeClient.js +15 -9
- package/dist/src/proto/line_chart.proto +25 -0
- package/dist/src/proto/line_chart_grpc_pb.js +1 -0
- package/dist/src/proto/line_chart_pb.js +681 -0
- package/dist/src/proto/protoc.bat +1 -1
- package/dist/test.dat +0 -0
- package/dist/test.js +395 -34
- package/package.json +5 -3
- package/src/RequestFactory.ts +12 -3
- package/src/SkyEyeClient.ts +16 -9
- package/src/proto/line_chart.proto +25 -0
- package/src/proto/line_chart_grpc_pb.js +1 -0
- package/src/proto/line_chart_pb.js +681 -0
- package/src/proto/protoc.bat +1 -1
- package/src/proto/skyeye_rpc_grpc_pb.js +1 -1
- package/test.dat +0 -0
- package/test.ts +472 -39
- package/test_111.dat +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
|
|
8
|
+
{
|
|
9
|
+
"type": "node",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"name": "Launch Program",
|
|
12
|
+
"skipFiles": [
|
|
13
|
+
"<node_internals>/**"
|
|
14
|
+
],
|
|
15
|
+
"program": "${workspaceFolder}\\dist\\test.js",
|
|
16
|
+
"preLaunchTask": "tsc: build - tsconfig.json",
|
|
17
|
+
"outFiles": [
|
|
18
|
+
"${workspaceFolder}/dist/**/*.js"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -41,8 +41,8 @@ export declare class RequestFactory {
|
|
|
41
41
|
step(cpuName: string, stepNum: number): JSONRequest;
|
|
42
42
|
singleStep(cpuName: string): JSONRequest;
|
|
43
43
|
getcpuRegisterInfo(cpuName: string): JSONRequest;
|
|
44
|
-
startTimeMonitor(): JSONRequest;
|
|
45
|
-
stopTimeMonitor(): JSONRequest;
|
|
44
|
+
startTimeMonitor(id?: string): JSONRequest;
|
|
45
|
+
stopTimeMonitor(id?: string): JSONRequest;
|
|
46
46
|
registerTimeMonitor(config: object): JSONRequest;
|
|
47
|
-
getTimeMonitorConfig(): JSONRequest;
|
|
47
|
+
getTimeMonitorConfig(id?: string): JSONRequest;
|
|
48
48
|
}
|
|
@@ -348,14 +348,20 @@ class RequestFactory {
|
|
|
348
348
|
request.setRequest(baseRequest.toJSONString());
|
|
349
349
|
return request;
|
|
350
350
|
}
|
|
351
|
-
startTimeMonitor() {
|
|
351
|
+
startTimeMonitor(id) {
|
|
352
352
|
const baseRequest = new BaseRequest_1.BaseRequest("SE_start_time_monitor");
|
|
353
|
+
const args = {};
|
|
354
|
+
args.id = id;
|
|
355
|
+
baseRequest.setArgs(args);
|
|
353
356
|
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
354
357
|
request.setRequest(baseRequest.toJSONString());
|
|
355
358
|
return request;
|
|
356
359
|
}
|
|
357
|
-
stopTimeMonitor() {
|
|
360
|
+
stopTimeMonitor(id) {
|
|
358
361
|
const baseRequest = new BaseRequest_1.BaseRequest("SE_stop_time_monitor");
|
|
362
|
+
const args = {};
|
|
363
|
+
args.id = id;
|
|
364
|
+
baseRequest.setArgs(args);
|
|
359
365
|
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
360
366
|
request.setRequest(baseRequest.toJSONString());
|
|
361
367
|
return request;
|
|
@@ -369,8 +375,11 @@ class RequestFactory {
|
|
|
369
375
|
request.setRequest(baseRequest.toJSONString());
|
|
370
376
|
return request;
|
|
371
377
|
}
|
|
372
|
-
getTimeMonitorConfig() {
|
|
378
|
+
getTimeMonitorConfig(id) {
|
|
373
379
|
const baseRequest = new BaseRequest_1.BaseRequest("SE_get_time_monitor_config");
|
|
380
|
+
const args = {};
|
|
381
|
+
args.id = id;
|
|
382
|
+
baseRequest.setArgs(args);
|
|
374
383
|
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
375
384
|
request.setRequest(baseRequest.toJSONString());
|
|
376
385
|
return request;
|
|
@@ -25,7 +25,7 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
|
|
|
25
25
|
stopGrpcService(json: string): Promise<any>;
|
|
26
26
|
RunTestcase(json: string): Promise<any>;
|
|
27
27
|
Monitor(json: string): Promise<any>;
|
|
28
|
-
timeDataReceive(
|
|
28
|
+
timeDataReceive(id: string): any;
|
|
29
29
|
call(request: JSONRequest): Promise<any>;
|
|
30
30
|
callTimeout(request: JSONRequest, timeout: number): Promise<any>;
|
|
31
31
|
private printRequestLog;
|
|
@@ -97,8 +97,8 @@ export declare class SkyEyeClient extends JSONTransmissionClient {
|
|
|
97
97
|
private startSkyEye;
|
|
98
98
|
private setWorkingDirectory;
|
|
99
99
|
private runScript;
|
|
100
|
-
startTimeMonitor(): Promise<any>;
|
|
101
|
-
stopTimeMonitor(): Promise<any>;
|
|
100
|
+
startTimeMonitor(id?: string): Promise<any>;
|
|
101
|
+
stopTimeMonitor(id?: string): Promise<any>;
|
|
102
102
|
registerTimeMonitor(config: object): Promise<any>;
|
|
103
|
-
getTimeMonitorConfig(): Promise<any>;
|
|
103
|
+
getTimeMonitorConfig(id?: string): Promise<any>;
|
|
104
104
|
}
|
package/dist/src/SkyEyeClient.js
CHANGED
|
@@ -59,6 +59,12 @@ const cp = __importStar(require("child_process"));
|
|
|
59
59
|
const BaseResponse_1 = require("./response/BaseResponse");
|
|
60
60
|
const GetAddressWidthResponse_1 = require("./response/GetAddressWidthResponse");
|
|
61
61
|
const GetFaultInjectListResponse2_1 = require("./response/GetFaultInjectListResponse2");
|
|
62
|
+
const JSONbig = require('json-bigint')({
|
|
63
|
+
// 建议配置此项,将大数字存储为字符串,避免后续操作中的潜在问题
|
|
64
|
+
storeAsString: true
|
|
65
|
+
// 或者使用 'strict' 模式将其解析为 BigInt 类型 (ES2020)
|
|
66
|
+
// useNativeBigInt: true
|
|
67
|
+
});
|
|
62
68
|
let client = null;
|
|
63
69
|
// ----------------------------当前运行程序的设备树----------------------------------------//
|
|
64
70
|
const boardMap = new Map();
|
|
@@ -127,10 +133,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
127
133
|
}
|
|
128
134
|
});
|
|
129
135
|
}
|
|
130
|
-
timeDataReceive(
|
|
136
|
+
timeDataReceive(id) {
|
|
131
137
|
try {
|
|
132
138
|
const request = new skyeye_rpc_pb_1.JSONRequest();
|
|
133
|
-
request.setRequest(
|
|
139
|
+
request.setRequest(JSON.stringify({ id: id }));
|
|
134
140
|
const stream = super.timeDataReceive(request);
|
|
135
141
|
return stream;
|
|
136
142
|
}
|
|
@@ -158,7 +164,7 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
158
164
|
});
|
|
159
165
|
// const res = JSON.parse(response.toString());
|
|
160
166
|
// console.log("res:",res)
|
|
161
|
-
const ackObj =
|
|
167
|
+
const ackObj = JSONbig.parse(response.toString()).ack;
|
|
162
168
|
// this.printResponseLog(ackObj)
|
|
163
169
|
if (ackObj.result === 'false')
|
|
164
170
|
ackObj.result = false;
|
|
@@ -1318,10 +1324,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
1318
1324
|
});
|
|
1319
1325
|
});
|
|
1320
1326
|
}
|
|
1321
|
-
startTimeMonitor() {
|
|
1327
|
+
startTimeMonitor(id) {
|
|
1322
1328
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1323
1329
|
try {
|
|
1324
|
-
return yield this.call(RequestFactory_1.RequestFactory.getInstance().startTimeMonitor());
|
|
1330
|
+
return yield this.call(RequestFactory_1.RequestFactory.getInstance().startTimeMonitor(id));
|
|
1325
1331
|
}
|
|
1326
1332
|
catch (error) {
|
|
1327
1333
|
console.error("Error during stopCommand:", error);
|
|
@@ -1329,10 +1335,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
1329
1335
|
}
|
|
1330
1336
|
});
|
|
1331
1337
|
}
|
|
1332
|
-
stopTimeMonitor() {
|
|
1338
|
+
stopTimeMonitor(id) {
|
|
1333
1339
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1334
1340
|
try {
|
|
1335
|
-
return yield this.call(RequestFactory_1.RequestFactory.getInstance().stopTimeMonitor());
|
|
1341
|
+
return yield this.call(RequestFactory_1.RequestFactory.getInstance().stopTimeMonitor(id));
|
|
1336
1342
|
}
|
|
1337
1343
|
catch (error) {
|
|
1338
1344
|
console.error("Error during stopCommand:", error);
|
|
@@ -1351,10 +1357,10 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
1351
1357
|
}
|
|
1352
1358
|
});
|
|
1353
1359
|
}
|
|
1354
|
-
getTimeMonitorConfig() {
|
|
1360
|
+
getTimeMonitorConfig(id) {
|
|
1355
1361
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1356
1362
|
try {
|
|
1357
|
-
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getTimeMonitorConfig());
|
|
1363
|
+
return yield this.call(RequestFactory_1.RequestFactory.getInstance().getTimeMonitorConfig(id));
|
|
1358
1364
|
}
|
|
1359
1365
|
catch (error) {
|
|
1360
1366
|
console.error("Error during stopCommand:", error);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
message Value {
|
|
4
|
+
string type = 1;
|
|
5
|
+
double doubleValue = 2;
|
|
6
|
+
int64 intValue = 3;
|
|
7
|
+
string stringValue = 4;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message TimeData {
|
|
11
|
+
Value realTime = 1;
|
|
12
|
+
Value simulationTime = 2;
|
|
13
|
+
Value customTime = 3;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message SeriesData {
|
|
17
|
+
string id = 1;
|
|
18
|
+
string name = 2;
|
|
19
|
+
repeated Value value = 3;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message Series {
|
|
23
|
+
repeated SeriesData series = 1;
|
|
24
|
+
repeated TimeData time = 2;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// GENERATED CODE -- NO SERVICES IN PROTO
|