Skip markers for now in MSL

This commit is contained in:
Piotr Rogowski 2023-09-10 21:50:02 +02:00
parent 608f20008e
commit eafd652b83
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
3 changed files with 16 additions and 4 deletions

View File

@ -168,6 +168,7 @@ const LogCanvas = ({
selectedFields2.length,
plotSync.key,
);
options2 = result2.options;
plotData2 = [result2.xData, ...result2.yData];
}

View File

@ -1,7 +1,9 @@
import { Result } from 'mlg-converter/dist/types';
import { Record, Result, BlockType } from 'mlg-converter/dist/types';
import { ParserInterface } from '../ParserInterface';
class MslLogParser implements ParserInterface {
private markerPrefix = 'MARK';
private raw = '';
private result: Result = {
@ -32,6 +34,7 @@ class MslLogParser implements ParserInterface {
continue;
}
// header line eg. Time SD: Present SD: Logging triggerScopeReady...
if (line.startsWith('Time') || line.startsWith('RPM')) {
unitsIndex = lineIndex + 1;
const fields = line.split('\t');
@ -50,15 +53,22 @@ class MslLogParser implements ParserInterface {
continue;
}
// markers: eg. MARK 000
if (line.startsWith(this.markerPrefix)) {
// TODO: parse markers
continue;
}
if (lineIndex > unitsIndex) {
// data line eg. 215.389 0 0 0 0 0 1 0 1...
const fields = line.split('\t');
const record = {
type: 'field' as const,
const record: Record = {
type: 'field' as BlockType, // TODO: use enum
timestamp: 0,
};
fields.forEach((value, fieldIndex) => {
(record as any)[this.result.fields[fieldIndex].name] = parseFloat(value);
record[this.result.fields[fieldIndex].name] = parseFloat(value);
});
this.result.records.push(record);

View File

@ -58,6 +58,7 @@ ctx.addEventListener('message', ({ data }: { data: ArrayBuffer }) => {
if (logParser.isMSL()) {
const mslResult = parseMsl(raw, t0);
ctx.postMessage({
type: 'metrics',
elapsed: elapsed(t0),