gnss-js 1.35.0 → 1.37.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/binex.js +2 -2
- package/dist/{chunk-AFEDNWXI.js → chunk-24TKGUTY.js} +310 -111
- package/dist/{chunk-BLGBMRX7.js → chunk-3FG4XVCB.js} +136 -1
- package/dist/{chunk-F4CM6Q4F.js → chunk-5X4AG4MK.js} +2 -2
- package/dist/{chunk-5RNDQQ6J.js → chunk-6SWJTN6H.js} +2 -2
- package/dist/{chunk-OK4GGNOO.js → chunk-D25WNE43.js} +1 -1
- package/dist/{chunk-5AUK42AL.js → chunk-FA2UTLEQ.js} +2 -2
- package/dist/{chunk-IQ5OIMQD.js → chunk-V2D5KUKH.js} +33 -0
- package/dist/{chunk-726LQBGM.js → chunk-YUW33VXK.js} +1 -1
- package/dist/{chunk-FEOMYZEU.js → chunk-ZQDLYLQA.js} +9 -28
- package/dist/index.cjs +480 -132
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -9
- package/dist/novatel.js +3 -3
- package/dist/positioning.cjs +137 -1
- package/dist/positioning.d.cts +62 -1
- package/dist/positioning.d.ts +62 -1
- package/dist/positioning.js +3 -1
- package/dist/rinex.js +3 -3
- package/dist/sbf.cjs +462 -107
- package/dist/sbf.d.cts +103 -14
- package/dist/sbf.d.ts +103 -14
- package/dist/sbf.js +8 -4
- package/dist/ubx.cjs +37 -24
- package/dist/ubx.js +4 -4
- package/package.json +1 -1
|
@@ -25,6 +25,38 @@ function setBitU(buff, pos, len, data) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
var GpsLnavAssembler = class _GpsLnavAssembler {
|
|
29
|
+
buffers = /* @__PURE__ */ new Map();
|
|
30
|
+
last = /* @__PURE__ */ new Map();
|
|
31
|
+
/** Subframe ID (1–5) from the HOW word of a parity-stripped subframe. */
|
|
32
|
+
static subframeId(subframe) {
|
|
33
|
+
return getBitU(subframe, 43, 3);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Push one parity-stripped 30-byte LNAV subframe for `prn`, resolving
|
|
37
|
+
* the 10-bit week against `refWeek`. See {@link LnavPush} for outcomes.
|
|
38
|
+
*/
|
|
39
|
+
push(prn, subframe, refWeek) {
|
|
40
|
+
const id = _GpsLnavAssembler.subframeId(subframe);
|
|
41
|
+
if (id < 1 || id > 3) return { kind: "skipped" };
|
|
42
|
+
let sf = this.buffers.get(prn);
|
|
43
|
+
if (!sf) {
|
|
44
|
+
sf = { buf: new Uint8Array(90), have: 0 };
|
|
45
|
+
this.buffers.set(prn, sf);
|
|
46
|
+
}
|
|
47
|
+
sf.buf.set(subframe, (id - 1) * 30);
|
|
48
|
+
sf.have |= 1 << id - 1;
|
|
49
|
+
if (id !== 3 || sf.have !== 7) return { kind: "incomplete" };
|
|
50
|
+
const eph = decodeGpsLnavFrame(sf.buf, { prn, refWeek });
|
|
51
|
+
if (!eph) return { kind: "decodeFailed" };
|
|
52
|
+
const prev = this.last.get(prn);
|
|
53
|
+
if (prev && prev.iode === eph.iode && prev.tocDate.getTime() === eph.tocDate.getTime()) {
|
|
54
|
+
return { kind: "duplicate" };
|
|
55
|
+
}
|
|
56
|
+
this.last.set(prn, eph);
|
|
57
|
+
return { kind: "eph", eph };
|
|
58
|
+
}
|
|
59
|
+
};
|
|
28
60
|
function decodeGpsLnavFrame(subframes, opts = {}) {
|
|
29
61
|
if (subframes.length < 90) return null;
|
|
30
62
|
const b = subframes;
|
|
@@ -144,5 +176,6 @@ export {
|
|
|
144
176
|
getBitU,
|
|
145
177
|
getBitS,
|
|
146
178
|
setBitU,
|
|
179
|
+
GpsLnavAssembler,
|
|
147
180
|
decodeGpsLnavFrame
|
|
148
181
|
};
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
bdsSubframeParityOk,
|
|
6
6
|
galInavPageCrcOk,
|
|
7
7
|
testGloString
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FA2UTLEQ.js";
|
|
9
9
|
import {
|
|
10
10
|
CnavAssembler,
|
|
11
11
|
cnavCrcOk
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YUW33VXK.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
GpsLnavAssembler,
|
|
15
15
|
getBitS,
|
|
16
16
|
getBitU,
|
|
17
17
|
setBitU
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-V2D5KUKH.js";
|
|
19
19
|
|
|
20
20
|
// src/ubx/frame.ts
|
|
21
21
|
function* ubxFrames(data, stats = { badChecksums: 0 }) {
|
|
@@ -92,38 +92,19 @@ function parseUbxNav(data, opts = {}) {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
if (refWeek === void 0) return { ephemerides, badParity };
|
|
95
|
-
const
|
|
96
|
-
const last = /* @__PURE__ */ new Map();
|
|
95
|
+
const assembler = new GpsLnavAssembler();
|
|
97
96
|
for (const f of ubxFrames(data)) {
|
|
98
97
|
if (f.msgClass !== 2 || f.msgId !== 19) continue;
|
|
99
98
|
const lnav = readLnavSubframe(view, f);
|
|
100
99
|
if (!lnav) continue;
|
|
101
|
-
const { prn,
|
|
100
|
+
const { prn, buff, id } = lnav;
|
|
102
101
|
if (id < 1 || id > 5) {
|
|
103
102
|
badParity++;
|
|
104
103
|
continue;
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (!sf) {
|
|
110
|
-
sf = { buf: new Uint8Array(90), have: 0 };
|
|
111
|
-
subframes.set(key, sf);
|
|
112
|
-
}
|
|
113
|
-
sf.buf.set(buff, (id - 1) * 30);
|
|
114
|
-
sf.have |= 1 << id - 1;
|
|
115
|
-
if (id !== 3 || sf.have !== 7) continue;
|
|
116
|
-
const eph = decodeGpsLnavFrame(sf.buf, { prn, refWeek });
|
|
117
|
-
if (!eph) {
|
|
118
|
-
badParity++;
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
const prev = last.get(prn);
|
|
122
|
-
if (prev && prev.iode === eph.iode && prev.tocDate.getTime() === eph.tocDate.getTime()) {
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
last.set(prn, eph);
|
|
126
|
-
ephemerides.push(eph);
|
|
105
|
+
const r = assembler.push(prn, buff, refWeek);
|
|
106
|
+
if (r.kind === "eph") ephemerides.push(r.eph);
|
|
107
|
+
else if (r.kind === "decodeFailed") badParity++;
|
|
127
108
|
}
|
|
128
109
|
return { ephemerides, badParity };
|
|
129
110
|
}
|