cantraceviewer 0.1.0-rc.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/LICENSE.md +19 -0
- package/README.md +131 -0
- package/dist/client.d.ts +21 -0
- package/dist/client.js +37 -0
- package/dist/direct.d.ts +39 -0
- package/dist/direct.js +143 -0
- package/dist/handles.d.ts +24 -0
- package/dist/handles.js +54 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/node-transport.d.ts +12 -0
- package/dist/node-transport.js +38 -0
- package/dist/node-worker.d.ts +1 -0
- package/dist/node-worker.js +27 -0
- package/dist/node.d.ts +12 -0
- package/dist/node.js +25 -0
- package/dist/protocol.d.ts +73 -0
- package/dist/protocol.js +1 -0
- package/dist/rpc-client.d.ts +53 -0
- package/dist/rpc-client.js +177 -0
- package/dist/types.d.ts +99 -0
- package/dist/types.js +1 -0
- package/dist/wasm-bindgen/cantraceviewer.d.ts +95 -0
- package/dist/wasm-bindgen/cantraceviewer.js +588 -0
- package/dist/wasm-bindgen/cantraceviewer_bg.wasm +0 -0
- package/dist/wasm-bindgen/cantraceviewer_bg.wasm.d.ts +25 -0
- package/dist/worker-runtime.d.ts +23 -0
- package/dist/worker-runtime.js +152 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +11 -0
- package/package.json +58 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
/* @ts-self-types="./cantraceviewer.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parsed DBC model owned by WebAssembly.
|
|
5
|
+
*/
|
|
6
|
+
export class Dbc {
|
|
7
|
+
static __wrap(ptr) {
|
|
8
|
+
const obj = Object.create(Dbc.prototype);
|
|
9
|
+
obj.__wbg_ptr = ptr;
|
|
10
|
+
DbcFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
11
|
+
return obj;
|
|
12
|
+
}
|
|
13
|
+
__destroy_into_raw() {
|
|
14
|
+
const ptr = this.__wbg_ptr;
|
|
15
|
+
this.__wbg_ptr = 0;
|
|
16
|
+
DbcFinalization.unregister(this);
|
|
17
|
+
return ptr;
|
|
18
|
+
}
|
|
19
|
+
free() {
|
|
20
|
+
const ptr = this.__destroy_into_raw();
|
|
21
|
+
wasm.__wbg_dbc_free(ptr, 0);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Return the browser catalog projection as JSON.
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
catalogJson() {
|
|
28
|
+
let deferred1_0;
|
|
29
|
+
let deferred1_1;
|
|
30
|
+
try {
|
|
31
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
32
|
+
wasm.wasmdbc_catalogJson(retptr, this.__wbg_ptr);
|
|
33
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
34
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
35
|
+
deferred1_0 = r0;
|
|
36
|
+
deferred1_1 = r1;
|
|
37
|
+
return getStringFromWasm0(r0, r1);
|
|
38
|
+
} finally {
|
|
39
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
40
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Decode one selected signal as packed parallel time/value arrays.
|
|
45
|
+
* @param {Trace} trace
|
|
46
|
+
* @param {number} can_id
|
|
47
|
+
* @param {boolean} is_extended
|
|
48
|
+
* @param {number} size_bytes
|
|
49
|
+
* @param {string} signal_name
|
|
50
|
+
* @returns {Float64Array}
|
|
51
|
+
*/
|
|
52
|
+
decodeSignal(trace, can_id, is_extended, size_bytes, signal_name) {
|
|
53
|
+
try {
|
|
54
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
55
|
+
_assertClass(trace, Trace);
|
|
56
|
+
const ptr0 = passStringToWasm0(signal_name, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
57
|
+
const len0 = WASM_VECTOR_LEN;
|
|
58
|
+
wasm.wasmdbc_decodeSignal(retptr, this.__wbg_ptr, trace.__wbg_ptr, can_id, is_extended, size_bytes, ptr0, len0);
|
|
59
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
60
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
61
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
62
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
63
|
+
if (r3) {
|
|
64
|
+
throw takeObject(r2);
|
|
65
|
+
}
|
|
66
|
+
var v2 = getArrayF64FromWasm0(r0, r1).slice();
|
|
67
|
+
wasm.__wbindgen_export(r0, r1 * 8, 8);
|
|
68
|
+
return v2;
|
|
69
|
+
} finally {
|
|
70
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Parse DBC text and retain the decoded model for subsequent signal work.
|
|
75
|
+
* @param {string} input
|
|
76
|
+
* @returns {Dbc}
|
|
77
|
+
*/
|
|
78
|
+
static parse(input) {
|
|
79
|
+
try {
|
|
80
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
81
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
82
|
+
const len0 = WASM_VECTOR_LEN;
|
|
83
|
+
wasm.wasmdbc_parse(retptr, ptr0, len0);
|
|
84
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
85
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
86
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
87
|
+
if (r2) {
|
|
88
|
+
throw takeObject(r1);
|
|
89
|
+
}
|
|
90
|
+
return Dbc.__wrap(r0);
|
|
91
|
+
} finally {
|
|
92
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (Symbol.dispose) Dbc.prototype[Symbol.dispose] = Dbc.prototype.free;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Parsed trace model owned by WebAssembly.
|
|
100
|
+
*/
|
|
101
|
+
export class Trace {
|
|
102
|
+
static __wrap(ptr) {
|
|
103
|
+
const obj = Object.create(Trace.prototype);
|
|
104
|
+
obj.__wbg_ptr = ptr;
|
|
105
|
+
TraceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
106
|
+
return obj;
|
|
107
|
+
}
|
|
108
|
+
__destroy_into_raw() {
|
|
109
|
+
const ptr = this.__wbg_ptr;
|
|
110
|
+
this.__wbg_ptr = 0;
|
|
111
|
+
TraceFinalization.unregister(this);
|
|
112
|
+
return ptr;
|
|
113
|
+
}
|
|
114
|
+
free() {
|
|
115
|
+
const ptr = this.__destroy_into_raw();
|
|
116
|
+
wasm.__wbg_trace_free(ptr, 0);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @param {number} signal_id
|
|
120
|
+
* @returns {Float64Array}
|
|
121
|
+
*/
|
|
122
|
+
decodeMf4Signal(signal_id) {
|
|
123
|
+
try {
|
|
124
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
125
|
+
wasm.wasmtrace_decodeMf4Signal(retptr, this.__wbg_ptr, signal_id);
|
|
126
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
127
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
128
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
129
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
130
|
+
if (r3) {
|
|
131
|
+
throw takeObject(r2);
|
|
132
|
+
}
|
|
133
|
+
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
134
|
+
wasm.__wbindgen_export(r0, r1 * 8, 8);
|
|
135
|
+
return v1;
|
|
136
|
+
} finally {
|
|
137
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @returns {number | undefined}
|
|
142
|
+
*/
|
|
143
|
+
get durationNs() {
|
|
144
|
+
try {
|
|
145
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
146
|
+
wasm.wasmtrace_durationNs(retptr, this.__wbg_ptr);
|
|
147
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
148
|
+
var r2 = getDataViewMemory0().getFloat64(retptr + 8 * 1, true);
|
|
149
|
+
return r0 === 0 ? undefined : r2;
|
|
150
|
+
} finally {
|
|
151
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @returns {boolean}
|
|
156
|
+
*/
|
|
157
|
+
get hasRawFrames() {
|
|
158
|
+
const ret = wasm.wasmtrace_hasRawFrames(this.__wbg_ptr);
|
|
159
|
+
return ret !== 0;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @returns {number | undefined}
|
|
163
|
+
*/
|
|
164
|
+
get measurementStartMs() {
|
|
165
|
+
try {
|
|
166
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
167
|
+
wasm.wasmtrace_measurementStartMs(retptr, this.__wbg_ptr);
|
|
168
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
169
|
+
var r2 = getDataViewMemory0().getFloat64(retptr + 8 * 1, true);
|
|
170
|
+
return r0 === 0 ? undefined : r2;
|
|
171
|
+
} finally {
|
|
172
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* @returns {string}
|
|
177
|
+
*/
|
|
178
|
+
mf4CatalogJson() {
|
|
179
|
+
let deferred1_0;
|
|
180
|
+
let deferred1_1;
|
|
181
|
+
try {
|
|
182
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
183
|
+
wasm.wasmtrace_mf4CatalogJson(retptr, this.__wbg_ptr);
|
|
184
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
185
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
186
|
+
deferred1_0 = r0;
|
|
187
|
+
deferred1_1 = r1;
|
|
188
|
+
return getStringFromWasm0(r0, r1);
|
|
189
|
+
} finally {
|
|
190
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
191
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* @returns {string}
|
|
196
|
+
*/
|
|
197
|
+
mf4EmbeddedDbcsJson() {
|
|
198
|
+
let deferred1_0;
|
|
199
|
+
let deferred1_1;
|
|
200
|
+
try {
|
|
201
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
202
|
+
wasm.wasmtrace_mf4EmbeddedDbcsJson(retptr, this.__wbg_ptr);
|
|
203
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
204
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
205
|
+
deferred1_0 = r0;
|
|
206
|
+
deferred1_1 = r1;
|
|
207
|
+
return getStringFromWasm0(r0, r1);
|
|
208
|
+
} finally {
|
|
209
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
210
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @returns {string}
|
|
215
|
+
*/
|
|
216
|
+
mf4WarningsJson() {
|
|
217
|
+
let deferred1_0;
|
|
218
|
+
let deferred1_1;
|
|
219
|
+
try {
|
|
220
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
221
|
+
wasm.wasmtrace_mf4WarningsJson(retptr, this.__wbg_ptr);
|
|
222
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
223
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
224
|
+
deferred1_0 = r0;
|
|
225
|
+
deferred1_1 = r1;
|
|
226
|
+
return getStringFromWasm0(r0, r1);
|
|
227
|
+
} finally {
|
|
228
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
229
|
+
wasm.__wbindgen_export(deferred1_0, deferred1_1, 1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* @param {Uint8Array} input
|
|
234
|
+
* @returns {Trace}
|
|
235
|
+
*/
|
|
236
|
+
static parseAsc(input) {
|
|
237
|
+
try {
|
|
238
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
239
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_export2);
|
|
240
|
+
const len0 = WASM_VECTOR_LEN;
|
|
241
|
+
wasm.wasmtrace_parseAsc(retptr, ptr0, len0);
|
|
242
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
243
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
244
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
245
|
+
if (r2) {
|
|
246
|
+
throw takeObject(r1);
|
|
247
|
+
}
|
|
248
|
+
return Trace.__wrap(r0);
|
|
249
|
+
} finally {
|
|
250
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* @param {Uint8Array} input
|
|
255
|
+
* @returns {Trace}
|
|
256
|
+
*/
|
|
257
|
+
static parseBlf(input) {
|
|
258
|
+
try {
|
|
259
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
260
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_export2);
|
|
261
|
+
const len0 = WASM_VECTOR_LEN;
|
|
262
|
+
wasm.wasmtrace_parseBlf(retptr, ptr0, len0);
|
|
263
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
264
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
265
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
266
|
+
if (r2) {
|
|
267
|
+
throw takeObject(r1);
|
|
268
|
+
}
|
|
269
|
+
return Trace.__wrap(r0);
|
|
270
|
+
} finally {
|
|
271
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* @param {Uint8Array} input
|
|
276
|
+
* @returns {Trace}
|
|
277
|
+
*/
|
|
278
|
+
static parseMf4(input) {
|
|
279
|
+
try {
|
|
280
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
281
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_export2);
|
|
282
|
+
const len0 = WASM_VECTOR_LEN;
|
|
283
|
+
wasm.wasmtrace_parseMf4(retptr, ptr0, len0);
|
|
284
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
285
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
286
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
287
|
+
if (r2) {
|
|
288
|
+
throw takeObject(r1);
|
|
289
|
+
}
|
|
290
|
+
return Trace.__wrap(r0);
|
|
291
|
+
} finally {
|
|
292
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* @param {Uint8Array} input
|
|
297
|
+
* @returns {Trace}
|
|
298
|
+
*/
|
|
299
|
+
static parseTrc(input) {
|
|
300
|
+
try {
|
|
301
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
302
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_export2);
|
|
303
|
+
const len0 = WASM_VECTOR_LEN;
|
|
304
|
+
wasm.wasmtrace_parseTrc(retptr, ptr0, len0);
|
|
305
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
306
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
307
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
308
|
+
if (r2) {
|
|
309
|
+
throw takeObject(r1);
|
|
310
|
+
}
|
|
311
|
+
return Trace.__wrap(r0);
|
|
312
|
+
} finally {
|
|
313
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* @returns {number}
|
|
318
|
+
*/
|
|
319
|
+
get skippedLineCount() {
|
|
320
|
+
const ret = wasm.wasmtrace_skippedLineCount(this.__wbg_ptr);
|
|
321
|
+
return ret >>> 0;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* @returns {number}
|
|
325
|
+
*/
|
|
326
|
+
get validMessageCount() {
|
|
327
|
+
const ret = wasm.wasmtrace_validMessageCount(this.__wbg_ptr);
|
|
328
|
+
return ret >>> 0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
if (Symbol.dispose) Trace.prototype[Symbol.dispose] = Trace.prototype.free;
|
|
332
|
+
function __wbg_get_imports() {
|
|
333
|
+
const import0 = {
|
|
334
|
+
__proto__: null,
|
|
335
|
+
__wbg_Error_bce6d499ff0a4aff: function(arg0, arg1) {
|
|
336
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
337
|
+
return addHeapObject(ret);
|
|
338
|
+
},
|
|
339
|
+
__wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
|
|
340
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
return {
|
|
344
|
+
__proto__: null,
|
|
345
|
+
"./cantraceviewer_bg.js": import0,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const DbcFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
350
|
+
? { register: () => {}, unregister: () => {} }
|
|
351
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_dbc_free(ptr, 1));
|
|
352
|
+
const TraceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
353
|
+
? { register: () => {}, unregister: () => {} }
|
|
354
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_trace_free(ptr, 1));
|
|
355
|
+
|
|
356
|
+
function addHeapObject(obj) {
|
|
357
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
358
|
+
const idx = heap_next;
|
|
359
|
+
heap_next = heap[idx];
|
|
360
|
+
|
|
361
|
+
heap[idx] = obj;
|
|
362
|
+
return idx;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function _assertClass(instance, klass) {
|
|
366
|
+
if (!(instance instanceof klass)) {
|
|
367
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function dropObject(idx) {
|
|
372
|
+
if (idx < 1028) return;
|
|
373
|
+
heap[idx] = heap_next;
|
|
374
|
+
heap_next = idx;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function getArrayF64FromWasm0(ptr, len) {
|
|
378
|
+
ptr = ptr >>> 0;
|
|
379
|
+
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
let cachedDataViewMemory0 = null;
|
|
383
|
+
function getDataViewMemory0() {
|
|
384
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
385
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
386
|
+
}
|
|
387
|
+
return cachedDataViewMemory0;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
391
|
+
function getFloat64ArrayMemory0() {
|
|
392
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
393
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
394
|
+
}
|
|
395
|
+
return cachedFloat64ArrayMemory0;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function getStringFromWasm0(ptr, len) {
|
|
399
|
+
return decodeText(ptr >>> 0, len);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
let cachedUint8ArrayMemory0 = null;
|
|
403
|
+
function getUint8ArrayMemory0() {
|
|
404
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
405
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
406
|
+
}
|
|
407
|
+
return cachedUint8ArrayMemory0;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function getObject(idx) { return heap[idx]; }
|
|
411
|
+
|
|
412
|
+
let heap = new Array(1024).fill(undefined);
|
|
413
|
+
heap.push(undefined, null, true, false);
|
|
414
|
+
|
|
415
|
+
let heap_next = heap.length;
|
|
416
|
+
|
|
417
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
418
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
419
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
420
|
+
WASM_VECTOR_LEN = arg.length;
|
|
421
|
+
return ptr;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
425
|
+
if (realloc === undefined) {
|
|
426
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
427
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
428
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
429
|
+
WASM_VECTOR_LEN = buf.length;
|
|
430
|
+
return ptr;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
let len = arg.length;
|
|
434
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
435
|
+
|
|
436
|
+
const mem = getUint8ArrayMemory0();
|
|
437
|
+
|
|
438
|
+
let offset = 0;
|
|
439
|
+
|
|
440
|
+
for (; offset < len; offset++) {
|
|
441
|
+
const code = arg.charCodeAt(offset);
|
|
442
|
+
if (code > 0x7F) break;
|
|
443
|
+
mem[ptr + offset] = code;
|
|
444
|
+
}
|
|
445
|
+
if (offset !== len) {
|
|
446
|
+
if (offset !== 0) {
|
|
447
|
+
arg = arg.slice(offset);
|
|
448
|
+
}
|
|
449
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
450
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
451
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
452
|
+
|
|
453
|
+
offset += ret.written;
|
|
454
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
WASM_VECTOR_LEN = offset;
|
|
458
|
+
return ptr;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function takeObject(idx) {
|
|
462
|
+
const ret = getObject(idx);
|
|
463
|
+
dropObject(idx);
|
|
464
|
+
return ret;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
468
|
+
cachedTextDecoder.decode();
|
|
469
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
470
|
+
let numBytesDecoded = 0;
|
|
471
|
+
function decodeText(ptr, len) {
|
|
472
|
+
numBytesDecoded += len;
|
|
473
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
474
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
475
|
+
cachedTextDecoder.decode();
|
|
476
|
+
numBytesDecoded = len;
|
|
477
|
+
}
|
|
478
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
const cachedTextEncoder = new TextEncoder();
|
|
482
|
+
|
|
483
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
484
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
485
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
486
|
+
view.set(buf);
|
|
487
|
+
return {
|
|
488
|
+
read: arg.length,
|
|
489
|
+
written: buf.length
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
let WASM_VECTOR_LEN = 0;
|
|
495
|
+
|
|
496
|
+
let wasmModule, wasmInstance, wasm;
|
|
497
|
+
function __wbg_finalize_init(instance, module) {
|
|
498
|
+
wasmInstance = instance;
|
|
499
|
+
wasm = instance.exports;
|
|
500
|
+
wasmModule = module;
|
|
501
|
+
cachedDataViewMemory0 = null;
|
|
502
|
+
cachedFloat64ArrayMemory0 = null;
|
|
503
|
+
cachedUint8ArrayMemory0 = null;
|
|
504
|
+
return wasm;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
async function __wbg_load(module, imports) {
|
|
508
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
509
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
510
|
+
try {
|
|
511
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
512
|
+
} catch (e) {
|
|
513
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
514
|
+
|
|
515
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
516
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
517
|
+
|
|
518
|
+
} else { throw e; }
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const bytes = await module.arrayBuffer();
|
|
523
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
524
|
+
} else {
|
|
525
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
526
|
+
|
|
527
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
528
|
+
return { instance, module };
|
|
529
|
+
} else {
|
|
530
|
+
return instance;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function expectedResponseType(type) {
|
|
535
|
+
switch (type) {
|
|
536
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
537
|
+
}
|
|
538
|
+
return false;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function initSync(module) {
|
|
543
|
+
if (wasm !== undefined) return wasm;
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
if (module !== undefined) {
|
|
547
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
548
|
+
({module} = module)
|
|
549
|
+
} else {
|
|
550
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const imports = __wbg_get_imports();
|
|
555
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
556
|
+
module = new WebAssembly.Module(module);
|
|
557
|
+
}
|
|
558
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
559
|
+
return __wbg_finalize_init(instance, module);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
async function __wbg_init(module_or_path) {
|
|
563
|
+
if (wasm !== undefined) return wasm;
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
if (module_or_path !== undefined) {
|
|
567
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
568
|
+
({module_or_path} = module_or_path)
|
|
569
|
+
} else {
|
|
570
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
if (module_or_path === undefined) {
|
|
575
|
+
module_or_path = new URL('cantraceviewer_bg.wasm', import.meta.url);
|
|
576
|
+
}
|
|
577
|
+
const imports = __wbg_get_imports();
|
|
578
|
+
|
|
579
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
580
|
+
module_or_path = fetch(module_or_path);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
584
|
+
|
|
585
|
+
return __wbg_finalize_init(instance, module);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_dbc_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_trace_free: (a: number, b: number) => void;
|
|
6
|
+
export const wasmdbc_catalogJson: (a: number, b: number) => void;
|
|
7
|
+
export const wasmdbc_decodeSignal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
8
|
+
export const wasmdbc_parse: (a: number, b: number, c: number) => void;
|
|
9
|
+
export const wasmtrace_decodeMf4Signal: (a: number, b: number, c: number) => void;
|
|
10
|
+
export const wasmtrace_durationNs: (a: number, b: number) => void;
|
|
11
|
+
export const wasmtrace_hasRawFrames: (a: number) => number;
|
|
12
|
+
export const wasmtrace_measurementStartMs: (a: number, b: number) => void;
|
|
13
|
+
export const wasmtrace_mf4CatalogJson: (a: number, b: number) => void;
|
|
14
|
+
export const wasmtrace_mf4EmbeddedDbcsJson: (a: number, b: number) => void;
|
|
15
|
+
export const wasmtrace_mf4WarningsJson: (a: number, b: number) => void;
|
|
16
|
+
export const wasmtrace_parseAsc: (a: number, b: number, c: number) => void;
|
|
17
|
+
export const wasmtrace_parseBlf: (a: number, b: number, c: number) => void;
|
|
18
|
+
export const wasmtrace_parseMf4: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const wasmtrace_parseTrc: (a: number, b: number, c: number) => void;
|
|
20
|
+
export const wasmtrace_skippedLineCount: (a: number) => number;
|
|
21
|
+
export const wasmtrace_validMessageCount: (a: number) => number;
|
|
22
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
23
|
+
export const __wbindgen_export: (a: number, b: number, c: number) => void;
|
|
24
|
+
export const __wbindgen_export2: (a: number, b: number) => number;
|
|
25
|
+
export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DirectClient } from './direct.js';
|
|
2
|
+
import type { WorkerResponse } from './protocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* Message endpoint a worker host provides: `self` in a browser Worker, the parent port in a Node
|
|
5
|
+
* worker thread. @internal
|
|
6
|
+
*/
|
|
7
|
+
export type WorkerRuntimeEndpoint = {
|
|
8
|
+
postMessage(message: WorkerResponse, transfer?: ArrayBuffer[]): void;
|
|
9
|
+
addEventListener(type: 'message', listener: (event: {
|
|
10
|
+
data: unknown;
|
|
11
|
+
}) => void): void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Drive one synchronous DirectClient behind a message endpoint. Shared by the browser Worker entry
|
|
15
|
+
* and the Node worker-thread entry. @internal
|
|
16
|
+
*
|
|
17
|
+
* The worker owns every direct handle because wasm-bindgen objects carry hidden state that cannot
|
|
18
|
+
* cross threads; only plain data crosses the wire. Each request runs to completion before the next
|
|
19
|
+
* one starts, in post order, so a later close never interrupts an active decode. A per-request
|
|
20
|
+
* error is replied as an error envelope and never poisons the queue. Boot failure is reported once
|
|
21
|
+
* and never retried here; the owning client treats it as fatal and terminates this worker.
|
|
22
|
+
*/
|
|
23
|
+
export declare function startWorkerRuntime(endpoint: WorkerRuntimeEndpoint, loadClient: () => Promise<DirectClient>): void;
|