refactor: route all decoders through plugin runtime
This commit is contained in:
@@ -29,10 +29,12 @@ test("FT2 entry normalizes audio offsets and registers typed callbacks", async (
|
||||
Array,
|
||||
console,
|
||||
});
|
||||
const runtime = await readFile(new URL("../../assets/web/generated/plugin-runtime.js", import.meta.url), "utf8");
|
||||
const source = await readFile(new URL("../../assets/web/generated/ft2.js", import.meta.url), "utf8");
|
||||
new vm.Script(runtime).runInContext(context);
|
||||
new vm.Script(source).runInContext(context);
|
||||
|
||||
window.onServerFt2({ message: "CQ SP0ABC JO91", freq_hz: 1_250, ts_ms: Date.now(), snr_db: -8 });
|
||||
window.trxPluginRuntime.dispatch("ft2", { message: "CQ SP0ABC JO91", freq_hz: 1_250, ts_ms: Date.now(), snr_db: -8 });
|
||||
assert.equal(mapMessages.length, 1);
|
||||
assert.equal(mapMessages[0][4].freq_hz, 14_075_250);
|
||||
const bar = barRenderer();
|
||||
@@ -59,12 +61,14 @@ test("FT8 entry installs shared parsing without relying on script globals", asyn
|
||||
Set,
|
||||
console,
|
||||
});
|
||||
const runtime = await readFile(new URL("../../assets/web/generated/plugin-runtime.js", import.meta.url), "utf8");
|
||||
const source = await readFile(new URL("../../assets/web/generated/ft8.js", import.meta.url), "utf8");
|
||||
new vm.Script(runtime).runInContext(context);
|
||||
new vm.Script(source).runInContext(context);
|
||||
|
||||
const details = window.ft8ExtractLocatorDetails("K1ABC SP0ABC JO91");
|
||||
assert.equal(details[0].source, "SP0ABC");
|
||||
assert.equal(details[0].target, "K1ABC");
|
||||
window.onServerFt8({ message: "K1ABC SP0ABC JO91", freq_hz: 500, ts_ms: Date.now() });
|
||||
window.trxPluginRuntime.dispatch("ft8", { message: "K1ABC SP0ABC JO91", freq_hz: 500, ts_ms: Date.now() });
|
||||
assert.equal(forwarded[0][4].freq_hz, 7_074_500);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user