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