diff --git a/lib/www/server/lib/binary/bundle.js b/lib/www/server/lib/binary/bundle.js index 3ba8f2c..1f161b6 100644 --- a/lib/www/server/lib/binary/bundle.js +++ b/lib/www/server/lib/binary/bundle.js @@ -38,7 +38,7 @@ function bundle (json, opts = {}) { return encode.sequential(json, el => el.sailline, el => el.point, deltas, values, type) - } if (type == 1) { + } else if (type == 1) { /* Preplot information – source line points * * elem 0: Float32Array Longitude @@ -273,6 +273,88 @@ function bundle (json, opts = {}) { }); return encode.sequential(json, el => el.sequence, el => el.point, deltas, values, type) + } else if (type == 0xa) { + /* 4D comparison data: + * + * elem0: i differences + * elem1: j differences + * + * Note that line/point may not be unique. + * + */ + + /* + deltas.push({ + key: el => el.baseTStamp, + baseType: BigUint64Array, + incrType: Int32Array + }); + + deltas.push({ + key: el => el.monTStamp, + baseType: BigUint64Array, + incrType: Int32Array + }) + */ + + values.push({ + key: el => el[2], + type: Float32Array + }); + + values.push({ + key: el => el[3], + type: Float32Array + }); + + /* + values.push({ + key: el => el.baseSeq, + type: Uint16Array + }); + + values.push({ + key: el => el.monSeq, + type: Uint16Array + }); + */ + + return encode.sequential(json, el => el[0], el => el[1], deltas, values, type) + } else if (type == 0xc) { + /* 4D comparison data (reduced sample) + * + * Input is comparison records, i.e.: + * [ [ line, point, δi, δj ], … ] + * + * elem0: line + * elem1: point + * elem2: δi + * elem3: δj + * + * Note that the chunk's `i` and `j` values are not used + */ + + values.push({ + key: el => el[0], + type: Uint16Array + }); + + values.push({ + key: el => el[1], + type: Uint16Array + }); + + values.push({ + key: el => el[2], + type: Float32Array + }); + + values.push({ + key: el => el[3], + type: Float32Array + }); + + return encode.sequential(json, el => 0, el => 0, deltas, values, type) } }