skyeye-sdk-js 1.4.20 → 1.4.21
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/SkyEyeClient.js +6 -2
- package/dist/test.js +128 -95
- package/package.json +1 -1
- package/src/SkyEyeClient.ts +6 -2
- package/test.ts +130 -91
package/dist/src/SkyEyeClient.js
CHANGED
|
@@ -59,6 +59,7 @@ 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 child_process_1 = require("child_process");
|
|
62
63
|
const JSONbig = require('json-bigint')({
|
|
63
64
|
// 建议配置此项,将大数字存储为字符串,避免后续操作中的潜在问题
|
|
64
65
|
storeAsString: true
|
|
@@ -1196,9 +1197,12 @@ class SkyEyeClient extends skyeye_rpc_grpc_pb_1.JSONTransmissionClient {
|
|
|
1196
1197
|
}
|
|
1197
1198
|
catch (error) {
|
|
1198
1199
|
console.error("initSkyEyeAndRun error:", error);
|
|
1199
|
-
if (this.childProcess) {
|
|
1200
|
+
if (this.childProcess && this.childProcess.exitCode == null) {
|
|
1200
1201
|
console.log('Terminating SkyEye child process...');
|
|
1201
|
-
this.childProcess.
|
|
1202
|
+
// const res = this.childProcess.exitCode
|
|
1203
|
+
// this.childProcess.kill();
|
|
1204
|
+
(0, child_process_1.execSync)(`chcp 65001 && taskkill /F /T /PID ${this.childProcess.pid}`);
|
|
1205
|
+
console.log(`Terminating SkyEye child process ${this.childProcess.pid}, result: ${true}`);
|
|
1202
1206
|
}
|
|
1203
1207
|
throw error;
|
|
1204
1208
|
}
|
package/dist/test.js
CHANGED
|
@@ -51,13 +51,20 @@ function test() {
|
|
|
51
51
|
// const fileName = "FMQL45T900_SylixOS.skyeye";
|
|
52
52
|
// const skyeyeDir = "D:/install/SkyEye/opt/skyeye/bin/skyeye.exe"
|
|
53
53
|
// const port = "50066"
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
// C:/Users/SkyEye/Desktop/skytest-project/SkyTest_Double
|
|
55
|
+
// C:/Users/SkyEye/Desktop/zzkk演示/hx1_ws/targets/hx1
|
|
56
|
+
const pathSkyEye = "C:/Users/SkyEye/Desktop/zzkk演示/hx1_ws/targets/hx1";
|
|
57
|
+
const fileName = "hx1.skyeye";
|
|
56
58
|
const skyeyeDir = "C:/SkyEye/opt/skyeye/bin/skyeye.exe";
|
|
57
59
|
const port = '50019';
|
|
58
60
|
const client = SkyEyeClientFactory_1.SkyEyeClientFactory.instance.createClient('127.0.0.1', port);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
try {
|
|
62
|
+
const t = yield client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.log('start error, do exit.');
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
61
68
|
let count = 1;
|
|
62
69
|
while (count === 1) {
|
|
63
70
|
const res = (yield client.getCurrentRunningState()).getState();
|
|
@@ -76,106 +83,132 @@ function test() {
|
|
|
76
83
|
client.getSimulationTime("c67x_core_0").then(res => {
|
|
77
84
|
console.log(res);
|
|
78
85
|
});
|
|
79
|
-
yield
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
yield new Promise(resolve => setTimeout(resolve, 1000));
|
|
87
|
+
while (true) {
|
|
88
|
+
yield client.registerTimeMonitor({
|
|
89
|
+
id: "a1",
|
|
90
|
+
time: 10,
|
|
91
|
+
cpu_name: "c67x_core_0",
|
|
92
|
+
items: [],
|
|
93
|
+
direction: 'send',
|
|
94
|
+
cycle: 2
|
|
95
|
+
});
|
|
96
|
+
yield client.startTimeMonitor("a1");
|
|
97
|
+
let dataStream = client.timeDataReceive("a1");
|
|
98
|
+
dataStream.on('data', (data) => {
|
|
99
|
+
try {
|
|
100
|
+
console.log('1');
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
console.log('stream parse error:' + e);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
dataStream.on('error', (err) => {
|
|
107
|
+
console.log('stream error:' + err);
|
|
108
|
+
});
|
|
109
|
+
yield new Promise(resolve => setTimeout(resolve, 1000));
|
|
110
|
+
dataStream.cancel();
|
|
111
|
+
yield new Promise(resolve => setTimeout(resolve, 1000));
|
|
112
|
+
yield client.stopTimeMonitor("a1");
|
|
113
|
+
yield new Promise(resolve => setTimeout(resolve, 1000));
|
|
114
|
+
}
|
|
98
115
|
// await client.stopTimeMonitor("1")
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
// await client.registerTimeMonitor({
|
|
117
|
+
// id: "a1",
|
|
118
|
+
// time: 1,
|
|
119
|
+
// cpu_name: "c67x_core_0",
|
|
120
|
+
// items: [],
|
|
121
|
+
// direction: 'send',
|
|
122
|
+
// cycle: 2
|
|
123
|
+
// })
|
|
124
|
+
// await client.startTimeMonitor("a1")
|
|
125
|
+
// dataStream = client.timeDataReceive("a1")
|
|
126
|
+
// dataStream.on('data', (data: any) => {
|
|
127
|
+
// try {
|
|
128
|
+
// console.log('1')
|
|
129
|
+
// } catch (e) {
|
|
130
|
+
// console.log('stream parse error:' + e)
|
|
131
|
+
// }
|
|
132
|
+
// })
|
|
133
|
+
// dataStream.on('error', (err: any) => {
|
|
134
|
+
// console.log('stream error:' + err)
|
|
135
|
+
// })
|
|
136
|
+
// await client.registerTimeMonitor({
|
|
137
|
+
// id: "2",
|
|
138
|
+
// time: 1,
|
|
139
|
+
// cpu_name: "c67x_core_0",
|
|
140
|
+
// items: [],
|
|
141
|
+
// direction: 'send',
|
|
142
|
+
// cycle: 2
|
|
143
|
+
// })
|
|
144
|
+
// await client.startTimeMonitor("2")
|
|
145
|
+
// const dataStream2 = client.timeDataReceive("2")
|
|
146
|
+
// dataStream2.on('data', (data: any) => {
|
|
147
|
+
// try {
|
|
148
|
+
// console.log('2')
|
|
149
|
+
// } catch (e) {
|
|
150
|
+
// console.log('stream parse error:' + e)
|
|
151
|
+
// }
|
|
152
|
+
// })
|
|
117
153
|
// await new Promise(resolve => setTimeout(resolve, 100))
|
|
118
154
|
// await client.stopTimeMonitor("1")
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
const dataStream3 = client.timeDataReceive("3")
|
|
129
|
-
dataStream3.on('data', (data) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
155
|
+
// await client.registerTimeMonitor({
|
|
156
|
+
// id: "3",
|
|
157
|
+
// time: 300,
|
|
158
|
+
// cpu_name: "c67x_core_0",
|
|
159
|
+
// items: [],
|
|
160
|
+
// direction: 'send',
|
|
161
|
+
// cycle: 5
|
|
162
|
+
// })
|
|
163
|
+
// await client.startTimeMonitor("3")
|
|
164
|
+
// const dataStream3 = client.timeDataReceive("3")
|
|
165
|
+
// dataStream3.on('data', (data: any) => {
|
|
166
|
+
// try {
|
|
167
|
+
// console.log('3')
|
|
168
|
+
// } catch (e) {
|
|
169
|
+
// console.log('stream parse error:' + e)
|
|
170
|
+
// }
|
|
171
|
+
// })
|
|
137
172
|
// await new Promise(resolve => setTimeout(resolve, 1000))
|
|
138
173
|
// const rr = await client.getSimulationTime("c67x_core_0")
|
|
139
174
|
// console.log(rr)
|
|
140
175
|
// await client.stopTimeMonitor("1")
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
const dataStream4 = client.timeDataReceive("4")
|
|
151
|
-
dataStream4.on('data', (data) => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
});
|
|
176
|
+
// await client.registerTimeMonitor({
|
|
177
|
+
// id: "4",
|
|
178
|
+
// time: 200,
|
|
179
|
+
// cpu_name: "c67x_core_0",
|
|
180
|
+
// items: [],
|
|
181
|
+
// direction: 'send',
|
|
182
|
+
// cycle: 5
|
|
183
|
+
// })
|
|
184
|
+
// await client.startTimeMonitor("4")
|
|
185
|
+
// const dataStream4 = client.timeDataReceive("4")
|
|
186
|
+
// dataStream4.on('data', (data: any) => {
|
|
187
|
+
// try {
|
|
188
|
+
// console.log('4')
|
|
189
|
+
// } catch (e) {
|
|
190
|
+
// console.log('stream parse error:' + e)
|
|
191
|
+
// }
|
|
192
|
+
// })
|
|
159
193
|
// await new Promise(resolve => setTimeout(resolve, 100))
|
|
160
194
|
// await client.stopTimeMonitor("1")
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
const dataStream5 = client.timeDataReceive("5")
|
|
171
|
-
dataStream5.on('data', (data) => {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
});
|
|
195
|
+
// await client.registerTimeMonitor({
|
|
196
|
+
// id: "5",
|
|
197
|
+
// time: 100,
|
|
198
|
+
// cpu_name: "c67x_core_0",
|
|
199
|
+
// items: [],
|
|
200
|
+
// direction: 'send',
|
|
201
|
+
// cycle: 5
|
|
202
|
+
// })
|
|
203
|
+
// await client.startTimeMonitor("5")
|
|
204
|
+
// const dataStream5 = client.timeDataReceive("5")
|
|
205
|
+
// dataStream5.on('data', (data: any) => {
|
|
206
|
+
// try {
|
|
207
|
+
// console.log('5')
|
|
208
|
+
// } catch (e) {
|
|
209
|
+
// console.log('stream parse error:' + e)
|
|
210
|
+
// }
|
|
211
|
+
// })
|
|
179
212
|
yield new Promise(resolve => setTimeout(resolve, 300000));
|
|
180
213
|
// await client.stopTimeMonitor("1")
|
|
181
214
|
console.log("response:", 123);
|
package/package.json
CHANGED
package/src/SkyEyeClient.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { Board } from './models/Board';
|
|
|
28
28
|
import { BaseResponse } from './response/BaseResponse';
|
|
29
29
|
import { GetAddressWidthResponse } from './response/GetAddressWidthResponse';
|
|
30
30
|
import { GetFaultInjectListResponse2 } from './response/GetFaultInjectListResponse2';
|
|
31
|
+
import { execSync } from 'child_process';
|
|
31
32
|
const JSONbig = require('json-bigint')({
|
|
32
33
|
// 建议配置此项,将大数字存储为字符串,避免后续操作中的潜在问题
|
|
33
34
|
storeAsString: true
|
|
@@ -1104,9 +1105,12 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
1104
1105
|
return true;
|
|
1105
1106
|
} catch (error) {
|
|
1106
1107
|
console.error("initSkyEyeAndRun error:", error);
|
|
1107
|
-
if (this.childProcess) {
|
|
1108
|
+
if (this.childProcess && this.childProcess.exitCode == null) {
|
|
1108
1109
|
console.log('Terminating SkyEye child process...');
|
|
1109
|
-
this.childProcess.
|
|
1110
|
+
// const res = this.childProcess.exitCode
|
|
1111
|
+
// this.childProcess.kill();
|
|
1112
|
+
execSync(`chcp 65001 && taskkill /F /T /PID ${this.childProcess.pid}`)
|
|
1113
|
+
console.log(`Terminating SkyEye child process ${this.childProcess.pid}, result: ${true}`);
|
|
1110
1114
|
}
|
|
1111
1115
|
throw error;
|
|
1112
1116
|
}
|
package/test.ts
CHANGED
|
@@ -57,13 +57,22 @@ async function test() {
|
|
|
57
57
|
// const skyeyeDir = "D:/install/SkyEye/opt/skyeye/bin/skyeye.exe"
|
|
58
58
|
// const port = "50066"
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
// C:/Users/SkyEye/Desktop/skytest-project/SkyTest_Double
|
|
61
|
+
|
|
62
|
+
// C:/Users/SkyEye/Desktop/zzkk演示/hx1_ws/targets/hx1
|
|
63
|
+
|
|
64
|
+
const pathSkyEye = "C:/Users/SkyEye/Desktop/zzkk演示/hx1_ws/targets/hx1"
|
|
65
|
+
const fileName = "hx1.skyeye";
|
|
62
66
|
const skyeyeDir = "C:/SkyEye/opt/skyeye/bin/skyeye.exe"
|
|
63
67
|
const port = '50019'
|
|
64
68
|
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port);
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
try {
|
|
70
|
+
const t = await client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir)
|
|
71
|
+
} catch (e) {
|
|
72
|
+
console.log('start error, do exit.')
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
|
|
67
76
|
let count = 1
|
|
68
77
|
while (count === 1) {
|
|
69
78
|
const res = (await client.getCurrentRunningState()).getState()
|
|
@@ -82,108 +91,138 @@ async function test() {
|
|
|
82
91
|
client.getSimulationTime("c67x_core_0").then(res => {
|
|
83
92
|
console.log(res)
|
|
84
93
|
})
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
|
95
|
+
while (true) {
|
|
96
|
+
await client.registerTimeMonitor({
|
|
97
|
+
id: "a1",
|
|
98
|
+
time: 10,
|
|
99
|
+
cpu_name: "c67x_core_0",
|
|
100
|
+
items: [],
|
|
101
|
+
direction: 'send',
|
|
102
|
+
cycle: 2
|
|
103
|
+
})
|
|
104
|
+
await client.startTimeMonitor("a1")
|
|
105
|
+
let dataStream = client.timeDataReceive("a1")
|
|
106
|
+
dataStream.on('data', (data: any) => {
|
|
107
|
+
try {
|
|
108
|
+
console.log('1')
|
|
109
|
+
} catch (e) {
|
|
110
|
+
console.log('stream parse error:' + e)
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
dataStream.on('error', (err: any) => {
|
|
114
|
+
console.log('stream error:' + err)
|
|
115
|
+
})
|
|
116
|
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
|
117
|
+
dataStream.cancel()
|
|
118
|
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
|
119
|
+
await client.stopTimeMonitor("a1")
|
|
120
|
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
|
121
|
+
}
|
|
104
122
|
// await client.stopTimeMonitor("1")
|
|
105
123
|
|
|
106
|
-
await client.registerTimeMonitor({
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
})
|
|
114
|
-
await client.startTimeMonitor("
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
})
|
|
124
|
+
// await client.registerTimeMonitor({
|
|
125
|
+
// id: "a1",
|
|
126
|
+
// time: 1,
|
|
127
|
+
// cpu_name: "c67x_core_0",
|
|
128
|
+
// items: [],
|
|
129
|
+
// direction: 'send',
|
|
130
|
+
// cycle: 2
|
|
131
|
+
// })
|
|
132
|
+
// await client.startTimeMonitor("a1")
|
|
133
|
+
// dataStream = client.timeDataReceive("a1")
|
|
134
|
+
// dataStream.on('data', (data: any) => {
|
|
135
|
+
// try {
|
|
136
|
+
// console.log('1')
|
|
137
|
+
// } catch (e) {
|
|
138
|
+
// console.log('stream parse error:' + e)
|
|
139
|
+
// }
|
|
140
|
+
// })
|
|
141
|
+
// dataStream.on('error', (err: any) => {
|
|
142
|
+
// console.log('stream error:' + err)
|
|
143
|
+
// })
|
|
144
|
+
|
|
145
|
+
// await client.registerTimeMonitor({
|
|
146
|
+
// id: "2",
|
|
147
|
+
// time: 1,
|
|
148
|
+
// cpu_name: "c67x_core_0",
|
|
149
|
+
// items: [],
|
|
150
|
+
// direction: 'send',
|
|
151
|
+
// cycle: 2
|
|
152
|
+
// })
|
|
153
|
+
// await client.startTimeMonitor("2")
|
|
154
|
+
// const dataStream2 = client.timeDataReceive("2")
|
|
155
|
+
// dataStream2.on('data', (data: any) => {
|
|
156
|
+
// try {
|
|
157
|
+
// console.log('2')
|
|
158
|
+
// } catch (e) {
|
|
159
|
+
// console.log('stream parse error:' + e)
|
|
160
|
+
// }
|
|
161
|
+
// })
|
|
123
162
|
// await new Promise(resolve => setTimeout(resolve, 100))
|
|
124
163
|
// await client.stopTimeMonitor("1")
|
|
125
164
|
|
|
126
165
|
|
|
127
|
-
await client.registerTimeMonitor({
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
})
|
|
135
|
-
await client.startTimeMonitor("3")
|
|
136
|
-
const dataStream3 = client.timeDataReceive("3")
|
|
137
|
-
dataStream3.on('data', (data: any) => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
})
|
|
166
|
+
// await client.registerTimeMonitor({
|
|
167
|
+
// id: "3",
|
|
168
|
+
// time: 300,
|
|
169
|
+
// cpu_name: "c67x_core_0",
|
|
170
|
+
// items: [],
|
|
171
|
+
// direction: 'send',
|
|
172
|
+
// cycle: 5
|
|
173
|
+
// })
|
|
174
|
+
// await client.startTimeMonitor("3")
|
|
175
|
+
// const dataStream3 = client.timeDataReceive("3")
|
|
176
|
+
// dataStream3.on('data', (data: any) => {
|
|
177
|
+
// try {
|
|
178
|
+
// console.log('3')
|
|
179
|
+
// } catch (e) {
|
|
180
|
+
// console.log('stream parse error:' + e)
|
|
181
|
+
// }
|
|
182
|
+
// })
|
|
144
183
|
// await new Promise(resolve => setTimeout(resolve, 1000))
|
|
145
184
|
// const rr = await client.getSimulationTime("c67x_core_0")
|
|
146
185
|
// console.log(rr)
|
|
147
186
|
// await client.stopTimeMonitor("1")
|
|
148
187
|
|
|
149
|
-
await client.registerTimeMonitor({
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
})
|
|
157
|
-
await client.startTimeMonitor("4")
|
|
158
|
-
const dataStream4 = client.timeDataReceive("4")
|
|
159
|
-
dataStream4.on('data', (data: any) => {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
})
|
|
188
|
+
// await client.registerTimeMonitor({
|
|
189
|
+
// id: "4",
|
|
190
|
+
// time: 200,
|
|
191
|
+
// cpu_name: "c67x_core_0",
|
|
192
|
+
// items: [],
|
|
193
|
+
// direction: 'send',
|
|
194
|
+
// cycle: 5
|
|
195
|
+
// })
|
|
196
|
+
// await client.startTimeMonitor("4")
|
|
197
|
+
// const dataStream4 = client.timeDataReceive("4")
|
|
198
|
+
// dataStream4.on('data', (data: any) => {
|
|
199
|
+
// try {
|
|
200
|
+
// console.log('4')
|
|
201
|
+
// } catch (e) {
|
|
202
|
+
// console.log('stream parse error:' + e)
|
|
203
|
+
// }
|
|
204
|
+
// })
|
|
166
205
|
// await new Promise(resolve => setTimeout(resolve, 100))
|
|
167
206
|
// await client.stopTimeMonitor("1")
|
|
168
207
|
|
|
169
208
|
|
|
170
|
-
await client.registerTimeMonitor({
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
})
|
|
178
|
-
await client.startTimeMonitor("5")
|
|
179
|
-
const dataStream5 = client.timeDataReceive("5")
|
|
180
|
-
dataStream5.on('data', (data: any) => {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
})
|
|
209
|
+
// await client.registerTimeMonitor({
|
|
210
|
+
// id: "5",
|
|
211
|
+
// time: 100,
|
|
212
|
+
// cpu_name: "c67x_core_0",
|
|
213
|
+
// items: [],
|
|
214
|
+
// direction: 'send',
|
|
215
|
+
// cycle: 5
|
|
216
|
+
// })
|
|
217
|
+
// await client.startTimeMonitor("5")
|
|
218
|
+
// const dataStream5 = client.timeDataReceive("5")
|
|
219
|
+
// dataStream5.on('data', (data: any) => {
|
|
220
|
+
// try {
|
|
221
|
+
// console.log('5')
|
|
222
|
+
// } catch (e) {
|
|
223
|
+
// console.log('stream parse error:' + e)
|
|
224
|
+
// }
|
|
225
|
+
// })
|
|
187
226
|
await new Promise(resolve => setTimeout(resolve, 300000))
|
|
188
227
|
// await client.stopTimeMonitor("1")
|
|
189
228
|
|