This commit is contained in:
2025-02-21 08:20:41 +01:00
parent 1be6b0681f
commit ff9636b75b
330 changed files with 0 additions and 36926 deletions
-35
View File
@@ -1,35 +0,0 @@
import 'package:nmea/nmea.dart';
class Gngga extends TalkerSentence {
static const String id = "GNGGA";
Gngga({required super.raw});
@override
bool get valid => super.valid && fields.length == 15;
String get utcOfPositionFix => fields[1];
int get gpsQualityIndicator => int.parse(fields[6]);
double get latitude => _getCoordinateFromGpsLatitude(fields[2]);
String get latitudeDirection => fields[3];
double get longitude => _getCoordinateFromGpsLongitude(fields[4]);
String get longitudeDirection => fields[5];
int get numberOfSvsInUse => int.parse(fields[7]);
double get hdop => double.parse(fields[8]);
double get altitudeAboveMeanSeaLevel => double.parse(fields[9]);
double get geoidSeparation => double.parse(fields[11]);
double _getCoordinateFromGpsLongitude(String coordinate) {
double result =
double.parse("${coordinate[0]}${coordinate[1]}${coordinate[2]}") +
double.parse(coordinate.substring(3)) / 60;
return result;
}
double _getCoordinateFromGpsLatitude(String coordinate) {
double result = double.parse("${coordinate[0]}${coordinate[1]}") +
double.parse(coordinate.substring(2)) / 60;
return result;
}
}