38 lines
1.2 KiB
Dart
38 lines
1.2 KiB
Dart
// ignore_for_file: constant_identifier_names
|
|
|
|
import 'parser.dart';
|
|
import 'sentence.dart';
|
|
|
|
import 'types.dart';
|
|
|
|
const TypeBWW = "BWW";
|
|
|
|
class BWW {
|
|
double bearingTrue; // true bearing in degrees
|
|
String bearingTrueType; // is type of true bearing
|
|
double bearingMagnetic; // magnetic bearing in degrees
|
|
String bearingMagneticType; // is type of magnetic bearing
|
|
String destinationWaypointID; // destination waypoint ID
|
|
String originWaypointID; // origin waypoint ID
|
|
BWW({
|
|
required this.bearingTrue,
|
|
required this.bearingTrueType,
|
|
required this.bearingMagnetic,
|
|
required this.bearingMagneticType,
|
|
required this.destinationWaypointID,
|
|
required this.originWaypointID,
|
|
});
|
|
static BWW newBWW(BaseSentence s) {
|
|
var p = Parser(s);
|
|
return BWW(
|
|
bearingTrue: p.float64(0, "true bearing"),
|
|
bearingTrueType: p.enumString(1, "true bearing type", [BearingTrue]),
|
|
bearingMagnetic: p.float64(2, "magnetic bearing"),
|
|
bearingMagneticType:
|
|
p.enumString(3, "magnetic bearing type", [BearingMagnetic]),
|
|
destinationWaypointID: p.string(4, "destination waypoint ID"),
|
|
originWaypointID: p.string(5, "origin waypoint ID"),
|
|
);
|
|
}
|
|
}
|