mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:07:08 +00:00
Add type 3 binary bundle.
Consisting of final positions + errors.
This commit is contained in:
@@ -78,7 +78,7 @@ function bundle (json, opts = {}) {
|
||||
return encode.sequential(json, el => el.line, el => el.point, deltas, values, type)
|
||||
|
||||
} else if (type == 2) {
|
||||
/* Gun information:
|
||||
/* Raw positions and gun information:
|
||||
*
|
||||
* - Δelem 0: BigUint64Array + Int16Array – timestamps
|
||||
* - elem 0‒1: Float32Array, Float32Array – Raw positions (x, y)
|
||||
@@ -225,6 +225,59 @@ function bundle (json, opts = {}) {
|
||||
console.log("DELTAS", deltas);
|
||||
console.log("VALUES", values);
|
||||
|
||||
return encode.sequential(json, el => el.sequence, el => el.point, deltas, values, type)
|
||||
} else if (type == 3) {
|
||||
/* Final positions and raw vs final errors:
|
||||
*
|
||||
* - Δelem 0: BigUint64Array + Int16Array – timestamps
|
||||
* - elem 0‒1: Float32Array, Float32Array – Final positions (x, y)
|
||||
* - elem 2‒3: Int16Array, Int16Array – (×10) Final - raw position errors (i, j)
|
||||
*/
|
||||
|
||||
// Add timestamps
|
||||
deltas.push({
|
||||
// Timestamp
|
||||
key: el => el.tstamp.valueOf(),
|
||||
baseType: BigUint64Array,
|
||||
incrType: Int16Array
|
||||
});
|
||||
|
||||
// Add raw positions
|
||||
values.push({
|
||||
// longitude
|
||||
key: el => el.geometryfinal?.coordinates?.[0],
|
||||
type: Float32Array
|
||||
});
|
||||
values.push({
|
||||
// latitude
|
||||
key: el => el.geometryfinal?.coordinates?.[1],
|
||||
type: Float32Array
|
||||
});
|
||||
|
||||
// Add raw inline, crossline errors relative to preplot
|
||||
values.push({
|
||||
// Crossline
|
||||
key: el => el.errorfinal?.coordinates?.[0] * 10,
|
||||
type: Int16Array
|
||||
});
|
||||
values.push({
|
||||
// Inline
|
||||
key: el => el.errorfinal?.coordinates?.[1] * 10,
|
||||
type: Int16Array
|
||||
});
|
||||
|
||||
// Add raw inline, crossline errors relative to raw
|
||||
values.push({
|
||||
// Crossline
|
||||
key: el => (el.errorfinal?.coordinates?.[0] - el.errorraw?.coordinates?.[0]) * 10,
|
||||
type: Int16Array
|
||||
});
|
||||
values.push({
|
||||
// Inline
|
||||
key: el => (el.errorfinal?.coordinates?.[1] - el.errorraw?.coordinates?.[1]) * 10,
|
||||
type: Int16Array
|
||||
});
|
||||
|
||||
return encode.sequential(json, el => el.sequence, el => el.point, deltas, values, type)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user