Also parse the extras from the comment field
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IPosition, ISymbol } from "./frame.types";
|
||||
import { IDirectionFinding, IPosition, IPowerHeightGain, ISymbol } from "./frame.types";
|
||||
|
||||
export class Symbol implements ISymbol {
|
||||
table: string; // Symbol table identifier
|
||||
@@ -10,9 +10,7 @@ export class Symbol implements ISymbol {
|
||||
this.code = table[1];
|
||||
this.table = table[0];
|
||||
} else {
|
||||
throw new Error(
|
||||
`Invalid symbol format: '${table}' (expected 2 characters if code is not provided)`,
|
||||
);
|
||||
throw new Error(`Invalid symbol format: '${table}' (expected 2 characters if code is not provided)`);
|
||||
}
|
||||
} else {
|
||||
this.table = table;
|
||||
@@ -34,6 +32,9 @@ export class Position implements IPosition {
|
||||
course?: number; // Course in degrees
|
||||
symbol?: Symbol;
|
||||
comment?: string;
|
||||
range?: number;
|
||||
phg?: IPowerHeightGain;
|
||||
dfs?: IDirectionFinding;
|
||||
|
||||
constructor(data: Partial<IPosition>) {
|
||||
this.latitude = data.latitude ?? 0;
|
||||
@@ -48,6 +49,9 @@ export class Position implements IPosition {
|
||||
this.symbol = new Symbol(data.symbol.table, data.symbol.code);
|
||||
}
|
||||
this.comment = data.comment;
|
||||
this.range = data.range;
|
||||
this.phg = data.phg;
|
||||
this.dfs = data.dfs;
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
|
||||
Reference in New Issue
Block a user