39 lines
1.1 KiB
Dart
39 lines
1.1 KiB
Dart
// ignore_for_file: constant_identifier_names
|
|
|
|
import 'parser.dart';
|
|
import 'sentence.dart';
|
|
|
|
import 'types.dart';
|
|
|
|
const TypeDBK = "DBK";
|
|
|
|
class DBK {
|
|
double depthFeet; // Depth, feet
|
|
String depthFeetUnit; // f = feet
|
|
double depthMeters; // Depth, meters
|
|
String depthMetersUnit; // M = meters
|
|
double depthFathoms; // Depth, Fathoms
|
|
String depthFathomsUnit; // F = Fathoms
|
|
DBK({
|
|
required this.depthFeet,
|
|
required this.depthFeetUnit,
|
|
required this.depthMeters,
|
|
required this.depthMetersUnit,
|
|
required this.depthFathoms,
|
|
required this.depthFathomsUnit,
|
|
});
|
|
static DBK newDBK(BaseSentence s) {
|
|
var p = Parser(s);
|
|
return DBK(
|
|
depthFeet: p.float64(0, "depth feet"),
|
|
depthFeetUnit: p.enumString(1, "depth feet unit", [DistanceUnitFeet]),
|
|
depthMeters: p.float64(2, "depth meters"),
|
|
depthMetersUnit:
|
|
p.enumString(3, "depth meters unit", [DistanceUnitMetre]),
|
|
depthFathoms: p.float64(4, "depth fathom"),
|
|
depthFathomsUnit:
|
|
p.enumString(5, "depth fathom unit", [DistanceUnitFathom]),
|
|
);
|
|
}
|
|
}
|