skyeye-sdk-js 1.3.7 → 1.4.0
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 +2 -0
- package/dist/src/RequestFactory.js +19 -0
- package/dist/src/SkyEyeClient.d.ts +2 -0
- package/dist/src/SkyEyeClient.js +24 -2
- package/dist/src/response/RunToTimeResponse.d.ts +4 -0
- package/dist/src/response/RunToTimeResponse.js +10 -0
- package/dist/test.js +23 -380
- package/dist/test_backup1.d.ts +1 -0
- package/dist/test_backup1.js +303 -0
- package/package.json +1 -1
- package/skyeye-sdk-js-1.3.9.tgz +0 -0
- package/src/RequestFactory.ts +22 -0
- package/src/SkyEyeClient.ts +24 -4
- package/src/response/RunToTimeResponse.ts +9 -0
- package/test.ts +30 -448
- package/test_backup1.ts +365 -0
- package/skyeye-sdk-js-1.3.6.tgz +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const { SkyEyeClientFactory } = require('./src/SkyEyeClientFactory');
|
|
13
|
+
const { SkyEyeClient } = require('./src/SkyEyeClient');
|
|
14
|
+
const { Cpu } = require('./src/models/Cpu');
|
|
15
|
+
class RegisterItem {
|
|
16
|
+
}
|
|
17
|
+
var RegisterType;
|
|
18
|
+
(function (RegisterType) {
|
|
19
|
+
RegisterType[RegisterType["CPU"] = 0] = "CPU";
|
|
20
|
+
RegisterType[RegisterType["Device"] = 1] = "Device";
|
|
21
|
+
})(RegisterType || (RegisterType = {}));
|
|
22
|
+
function getAllRegisterList() {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const allRegister = [];
|
|
25
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
26
|
+
//通过 getDeviceTree 获取板卡、设备、寄存器层级, 列出所有寄存器列表选择
|
|
27
|
+
const resultTree = yield client.getDeviceTree();
|
|
28
|
+
console.log("结果 resultTree:", JSON.stringify(resultTree));
|
|
29
|
+
console.log("结果 keys:", resultTree.boardMap.keys());
|
|
30
|
+
for (const key of resultTree.boardMap.keys()) {
|
|
31
|
+
const device = resultTree.boardMap.get(key);
|
|
32
|
+
// 在这里对获取到的键值对进行处理
|
|
33
|
+
console.log(`板卡: ${key},设备: ${device.deviceMap}`);
|
|
34
|
+
if (!device.deviceMap || device.deviceMap.keys().length == 0) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
for (const k of device.deviceMap.keys()) {
|
|
38
|
+
const register = device.deviceMap.get(k);
|
|
39
|
+
console.log(`设备: ${k}, 寄存器: ${register}`);
|
|
40
|
+
console.log("寄存器下的寄存器: ", register.registerMap);
|
|
41
|
+
if (!register.registerMap || register.registerMap.keys().length == 0) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
getRegisterMap(register, allRegister);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
console.log("allRegister2:", allRegister.length);
|
|
48
|
+
return allRegister;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// getAllRegisterList()
|
|
52
|
+
function getRegisterMap(bean, allRegister) {
|
|
53
|
+
if (!bean.registerMap || bean.registerMap.keys().length == 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
for (const r of bean.registerMap.keys()) {
|
|
57
|
+
const result = bean.registerMap.get(r);
|
|
58
|
+
console.log(`设备: ${r}, 寄存器: ${result}`);
|
|
59
|
+
const item = new RegisterItem();
|
|
60
|
+
item.name = r.name;
|
|
61
|
+
if (bean instanceof Cpu) {
|
|
62
|
+
console.log(`寄存器类型: ${bean.className}`);
|
|
63
|
+
item.type = RegisterType.CPU;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
item.type = RegisterType.Device;
|
|
67
|
+
}
|
|
68
|
+
allRegister.push(item);
|
|
69
|
+
getRegisterMap(result, allRegister);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function setRegister() {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
75
|
+
const r2 = yield client.setDeviceRegisterValue('c6713_0', 'c67x_core_0', 'A7', '34');
|
|
76
|
+
console.log("setRegister:", r2);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function getRegister() {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
82
|
+
const result = yield client.getCpuRegisters("");
|
|
83
|
+
console.log("setRegister:", result);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function getState() {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
89
|
+
const result = yield client.getCurrentRunningState();
|
|
90
|
+
console.log("getState:", result);
|
|
91
|
+
client.getCurrentCpuMips();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
// getState()
|
|
95
|
+
function getCurrentSimulationTime() {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
98
|
+
const result = yield client.getCurrentSimulationTime();
|
|
99
|
+
console.log("getCurrentCpuMips:", result);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// getCurrentSimulationTime()
|
|
103
|
+
function run() {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
const client = SkyEyeClientFactory.instance.createClient('192.168.0.187', '52589');
|
|
106
|
+
const result = yield client.runCommand();
|
|
107
|
+
console.log("run:", result);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// run()
|
|
111
|
+
function setMemoryValue() {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
114
|
+
const result = yield client.setMemoryValue('c67x_core_0', '10000', '15', 2);
|
|
115
|
+
console.log("setMemoryValue:", result);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// setMemoryValue()
|
|
119
|
+
function getMemoryValue() {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
122
|
+
const result = yield client.getMemoryValue('c67x_core_0', "10000", 2);
|
|
123
|
+
console.log("setMemoryValue:", result);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// getMemoryValue()
|
|
127
|
+
function testSocket() {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
const json = {
|
|
130
|
+
"msgId": "0",
|
|
131
|
+
"msgTime": "2023-12-5 12:00:00",
|
|
132
|
+
"msgType": "2",
|
|
133
|
+
"msgData": {
|
|
134
|
+
"version": "10001",
|
|
135
|
+
"protocol": "0",
|
|
136
|
+
"direction": "0",
|
|
137
|
+
"bigEndian": "0",
|
|
138
|
+
"length": "0",
|
|
139
|
+
"data": "0"
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const net = require('net');
|
|
143
|
+
const client = new net.Socket();
|
|
144
|
+
const host = '127.0.0.1';
|
|
145
|
+
const port = 8099;
|
|
146
|
+
client.connect(port, host, () => {
|
|
147
|
+
console.log('Connected');
|
|
148
|
+
// const str = JSON.stringify(json)
|
|
149
|
+
// // const str = "hhh"
|
|
150
|
+
// const strBuffer = Buffer.from(str, 'utf8'); // 将字符串转换为 Buffer
|
|
151
|
+
// const strLength = strBuffer.length; // 获取 JSON 数据的长度
|
|
152
|
+
// // 创建一个新的 Buffer 用于存储长度信息和数据
|
|
153
|
+
// const totalLength = 4 + strLength; // 4 字节长度 + 数据长度
|
|
154
|
+
// const buffer = Buffer.alloc(totalLength);
|
|
155
|
+
// // 写入前 4 个字节的长度信息
|
|
156
|
+
// buffer.writeUInt32LE(strLength, 0); // 以小端序方式写入 JSON 数据的长度
|
|
157
|
+
// // 将 JSON 数据复制到 Buffer 中
|
|
158
|
+
// strBuffer.copy(buffer, 4); // 从第 5 个字节开始复制 JSON 数据
|
|
159
|
+
// console.log("Buffer sent:", buffer);
|
|
160
|
+
// console.log("String Length:", strLength); // 打印实际的字符串长度
|
|
161
|
+
// console.log("Hex Length:", strLength.toString(16)); // 打印十六进制表示
|
|
162
|
+
// client.write(buffer); // 发送拼接后的 Buffer
|
|
163
|
+
// 发送数据
|
|
164
|
+
//第一阶段0827测试
|
|
165
|
+
// const hexString = "B90000007B0A09226D73674964223A2230222C0A09226D736754696D65223A22323032332D31322D352031323A30303A3030222C0A09226D736754797065223A2232222C0A09226D736744617461223A7B0A09092276657273696F6E223A2231222C0A09092270726F746F636F6C223A2230222C0A090922646972656374696F6E223A2230222C0A090922626967456E6469616E223A2230222C0A0909226C656E677468223A2230222C0A09092264617461223A2230220A097D0A7D0A";
|
|
166
|
+
const s1 = "12 01 AA 11 BB 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 33 33 00 00 00 00 00 00 00 00 44 44 00 00 00 00 00 00 88 88 66 44 00 00 00 00 00 00 00 00 00 00 65 76";
|
|
167
|
+
const s1_1 = s1.replace(/\s+/g, '');
|
|
168
|
+
const hexString = "B90000007B0D0A09226D73674964223A2230222C0D0A09226D736754797065223A2232222C0D0A09226D736754696D65223A22323032332D31322D352031323A30303A3030222C0D0A09226D736744617461223A207B0D0A09092276657273696F6E223A223130303031222C0D0A09092270726F746F636F6C223A2230222C0D0A090922646972656374696F6E223A2230222C0D0A090922626967456E6469616E223A2230222C0D0A0909226C656E677468223A36340D0A097D0D0A7D" + s1_1;
|
|
169
|
+
//74
|
|
170
|
+
// const hexString = "B90000007B0D0A09226D73674964223A2230222C0D0A09226D736754797065223A2232222C0D0A09226D736754696D65223A22323032332D31322D352031323A30303A3030222C0D0A09226D736744617461223A207B0D0A09092276657273696F6E223A223130303031222C0D0A09092270726F746F636F6C223A2230222C0D0A090922646972656374696F6E223A2230222C0D0A090922626967456E6469616E223A2230222C0D0A0909226C656E677468223A37340D0A097D0D0A7D1201AA11BB220000000000000000000000000000FFFF000000003333000000000000000044440000000000008888664400000000000000000000006576";
|
|
171
|
+
console.log("hexString:", hexString);
|
|
172
|
+
console.log("hexString:", hexString.length);
|
|
173
|
+
const buffer2 = Buffer.from(hexString, 'hex');
|
|
174
|
+
console.log("buffer2:", buffer2.length);
|
|
175
|
+
client.write(buffer2);
|
|
176
|
+
});
|
|
177
|
+
client.on('data', (data) => {
|
|
178
|
+
console.log('Received: ' + data);
|
|
179
|
+
client.destroy();
|
|
180
|
+
});
|
|
181
|
+
client.on('close', () => {
|
|
182
|
+
console.log('Connection closed');
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
// testSocket()
|
|
187
|
+
function testgetGlobalVarValue() {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50052');
|
|
190
|
+
const response = yield client.getGlobalVarValue("cx53123", "a", 16, "double");
|
|
191
|
+
console.log("testgetGlobalVarValue response:", response);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
// testgetGlobalVarValue()
|
|
195
|
+
function testsetGlobalVarValue() {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
198
|
+
const response = yield client.setGlobalVarValueDefault("int_test_var_0", "int", 16);
|
|
199
|
+
console.log("testgetGlobalVarValue response:", response);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
// testsetGlobalVarValue()
|
|
203
|
+
function getDeviceList() {
|
|
204
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
206
|
+
const response = yield client.getDeviceList();
|
|
207
|
+
// console.log("getDeviceList response:", response)
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
// getDeviceList()
|
|
211
|
+
function getDeviceTree() {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
214
|
+
const client = SkyEyeClientFactory.instance.createClient('192.168.0.187', '53774');
|
|
215
|
+
const response = yield client.getDeviceTree();
|
|
216
|
+
console.log("getDeviceList response:", response);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
// getDeviceTree()
|
|
220
|
+
function test() {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
// console.log("Connected to SkyEye server");
|
|
223
|
+
// await client.getDeviceList();
|
|
224
|
+
// await client.getCurrentCpuMips();
|
|
225
|
+
// await client.runCommand();
|
|
226
|
+
// const response = await client.getCurrentRunningState();
|
|
227
|
+
// const response = await client.getGlobalVarValueDefault("a",GlobalVarType.DOUBLE);
|
|
228
|
+
// const response = await client.getGlobalVarValue("cx53123","a",16,GlobalVarType.DOUBLE);
|
|
229
|
+
// const response = await client.getCpuRegistersDefault();
|
|
230
|
+
// const response = await client.getCpuRegisters("c7xx");
|
|
231
|
+
// const response = await client.getMemoryValueDefault(1, 16);
|
|
232
|
+
// const response = await client.getMemoryValue("c7s",0,16);
|
|
233
|
+
// console.log("结果response:", response)
|
|
234
|
+
// const pathSkyEye = "D:/data/case/workspace_c6713/targets/c6713_fc_1553b";
|
|
235
|
+
// const fileName = "c6713_fc_1553b.skyeye";
|
|
236
|
+
// const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe"
|
|
237
|
+
// const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
238
|
+
// const response =await client.getCurrentRunningState()
|
|
239
|
+
// const response = await client.getMemoryValueDefault("128","4")
|
|
240
|
+
// const response = await client.getGlobalVarValueDefault("number_a","int")
|
|
241
|
+
// const response = await client.setGlobalVarValueDefault("number_a", "int", "12")
|
|
242
|
+
// const response = await client.getDeviceTree()
|
|
243
|
+
// const response = await client.getMemoryValueDefault("10001", "1")
|
|
244
|
+
// console.log("response:", response)
|
|
245
|
+
// console.log("response:", response.boardMap)
|
|
246
|
+
// console.log("response:", response.boardMap.keys[0])
|
|
247
|
+
// await client.initSkyEyeAndRun(pathSkyEye,fileName,port,skyeyeDir);
|
|
248
|
+
const pathSkyEye = "D:/data/case/FMQL45T900_SylixOS";
|
|
249
|
+
const fileName = "FMQL45T900_SylixOS.skyeye";
|
|
250
|
+
const skyeyeDir = "D:/install/SkyEye/opt/skyeye/bin/skyeye.exe";
|
|
251
|
+
const port = "50066";
|
|
252
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port);
|
|
253
|
+
const t = yield client.initSkyEyeAndRun2(pathSkyEye, fileName, port, skyeyeDir);
|
|
254
|
+
client.runCommand();
|
|
255
|
+
console.log("t:", t);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
test();
|
|
259
|
+
function testMutil() {
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
const pathSkyEye = "D:/data/case/workspace_c6713/targets/c6713_fc_1553b";
|
|
262
|
+
const fileName = "c6713_fc_1553b.skyeye";
|
|
263
|
+
const skyeyeDir = "D:/install/skyeye/opt/skyeye/bin/skyeye.exe";
|
|
264
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', '50051');
|
|
265
|
+
//启动多个skyeye
|
|
266
|
+
const count = 5;
|
|
267
|
+
const map = new Map;
|
|
268
|
+
for (let i = 1; i < count; i++) {
|
|
269
|
+
const port = 50050 + i;
|
|
270
|
+
const client = SkyEyeClientFactory.instance.createClient('127.0.0.1', port.toString());
|
|
271
|
+
yield client.initSkyEyeAndRun2(pathSkyEye, fileName, port.toString(), skyeyeDir);
|
|
272
|
+
// await client.RunTestcase(json)
|
|
273
|
+
yield client.runCommand();
|
|
274
|
+
const res = yield client.getCurrentRunningState();
|
|
275
|
+
console.log("state3:", res.state);
|
|
276
|
+
map.set(port, client);
|
|
277
|
+
}
|
|
278
|
+
for (let i = 1; i < count; i++) {
|
|
279
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
280
|
+
const port = 50050 + i;
|
|
281
|
+
const client = map.get(port);
|
|
282
|
+
yield client.quitCommand();
|
|
283
|
+
}), i * 5000);
|
|
284
|
+
}
|
|
285
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
// await map.get(50051).stopGrpcService("")
|
|
287
|
+
yield map.get(50051).quitCommand();
|
|
288
|
+
}), 2000);
|
|
289
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
290
|
+
// await map.get(50052).stopGrpcService("")
|
|
291
|
+
yield map.get(50052).quitCommand();
|
|
292
|
+
}), 5000);
|
|
293
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
294
|
+
// await map.get(50053).stopGrpcService("")
|
|
295
|
+
yield map.get(50053).quitCommand();
|
|
296
|
+
}), 8000);
|
|
297
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
298
|
+
// await map.get(50054).stopGrpcService("")
|
|
299
|
+
yield map.get(50054).quitCommand();
|
|
300
|
+
}), 11000);
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
// testMutil()
|
package/package.json
CHANGED
|
Binary file
|
package/src/RequestFactory.ts
CHANGED
|
@@ -145,6 +145,28 @@ export class RequestFactory {
|
|
|
145
145
|
return request;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
public getCpuFreq(cpuName: string) {
|
|
149
|
+
const baseRequest = new BaseRequest("SE_get_cpu_freq_hz");
|
|
150
|
+
const args: { [key: string]: string } = {};
|
|
151
|
+
args.cpuname = cpuName;
|
|
152
|
+
baseRequest.setArgs(args)
|
|
153
|
+
const request = new JSONRequest()
|
|
154
|
+
request.setRequest(baseRequest.toJSONString());
|
|
155
|
+
return request;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public runToTimeRequest(cpuName: string,time:string) {
|
|
159
|
+
const baseRequest = new BaseRequest("SE_run_to_time");
|
|
160
|
+
const args: { [key: string]: string } = {};
|
|
161
|
+
args.cpu_name = cpuName;
|
|
162
|
+
args.time_s = time;
|
|
163
|
+
baseRequest.setArgs(args)
|
|
164
|
+
const request = new JSONRequest()
|
|
165
|
+
request.setRequest(baseRequest.toJSONString());
|
|
166
|
+
return request;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
148
170
|
|
|
149
171
|
public getCurrentPC(cpuName: string) {
|
|
150
172
|
const baseRequest = new BaseRequest("SE_get_current_pc");
|
package/src/SkyEyeClient.ts
CHANGED
|
@@ -64,6 +64,7 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
|
|
67
68
|
public async RunTestcase(json: string) {
|
|
68
69
|
try {
|
|
69
70
|
const request = new JSONRequest();
|
|
@@ -110,8 +111,8 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
110
111
|
// this.printResponseLog(ackObj)
|
|
111
112
|
return ackObj;
|
|
112
113
|
} catch (error) {
|
|
113
|
-
console.error("Error during gRPC request:", JSON.stringify(request));
|
|
114
|
-
console.error("Error during gRPC call:", error);
|
|
114
|
+
// console.error("Error during gRPC request:", JSON.stringify(request));
|
|
115
|
+
// console.error("Error during gRPC call:", error);
|
|
115
116
|
throw error;
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -272,6 +273,8 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
|
|
276
|
+
|
|
277
|
+
|
|
275
278
|
public async getDeviceList() {
|
|
276
279
|
const response = new GetDeviceListResponse();
|
|
277
280
|
try {
|
|
@@ -313,6 +316,25 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
313
316
|
}
|
|
314
317
|
|
|
315
318
|
|
|
319
|
+
public async runToTime(cpuName:string,time:string) {
|
|
320
|
+
try {
|
|
321
|
+
return await this.call(RequestFactory.getInstance().runToTimeRequest(cpuName,time));
|
|
322
|
+
} catch (error) {
|
|
323
|
+
console.error("Error during runToTime:", error);
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
public async getCpuFreq(cpuName:string){
|
|
330
|
+
try {
|
|
331
|
+
return await this.call(RequestFactory.getInstance().getCpuFreq(cpuName));
|
|
332
|
+
} catch (error) {
|
|
333
|
+
console.error("Error during getCpuFreq:", error);
|
|
334
|
+
throw error;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
316
338
|
public async getPC(cpuName: string) {
|
|
317
339
|
try {
|
|
318
340
|
return await this.call(RequestFactory.getInstance().getCurrentPC(cpuName));
|
|
@@ -905,10 +927,8 @@ export class SkyEyeClient extends JSONTransmissionClient {
|
|
|
905
927
|
}, 2000);
|
|
906
928
|
}
|
|
907
929
|
|
|
908
|
-
|
|
909
930
|
private childProcess: cp.ChildProcess | null = null;
|
|
910
931
|
|
|
911
|
-
|
|
912
932
|
public async initSkyEyeAndRun2(pathSkyEye: string, fileName: string, port: string, skyeyeDir: string) {
|
|
913
933
|
try {
|
|
914
934
|
console.log('runExample');
|