GNSS minőség adatok kijelzése (pod-ok)
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -65,10 +66,16 @@ class MapSurveyController extends GetxController {
|
||||
Rx<DateTime> get gpsDateTime => _gnss.gpsDateTime;
|
||||
bool get gpsIsConnected =>
|
||||
_gnss.connectionState.value == GnssConnectionState.connected;
|
||||
double? get horizontalAccuracy => _gnss.horizontalAccuracy;
|
||||
|
||||
RxDouble get pdop => _gnss.pdop;
|
||||
RxDouble get hdop => _gnss.hdop;
|
||||
RxDouble get vdop => _gnss.vdop;
|
||||
|
||||
final wgs84CoordinateFormat = Wgs84CoordinateFormat.decimalDegrees.obs;
|
||||
final showWgs84Card = true.obs;
|
||||
final showEovCard = true.obs;
|
||||
final showGnssQualityCard = true.obs;
|
||||
|
||||
// NTRIP állapot
|
||||
RxBool get ntripIsConnected => _ntrip.isConnected;
|
||||
@@ -799,6 +806,10 @@ class MapSurveyController extends GetxController {
|
||||
showEovCard.value = !showEovCard.value;
|
||||
}
|
||||
|
||||
void toggleShowGnssQualityCard() {
|
||||
showGnssQualityCard.value = !showGnssQualityCard.value;
|
||||
}
|
||||
|
||||
String get latitudeText {
|
||||
return Wgs84CoordinateFormatter.formatLatitude(
|
||||
gpsLatitude.value, wgs84CoordinateFormat.value);
|
||||
@@ -808,4 +819,28 @@ class MapSurveyController extends GetxController {
|
||||
return Wgs84CoordinateFormatter.formatLongitude(
|
||||
gpsLongitude.value, wgs84CoordinateFormat.value);
|
||||
}
|
||||
|
||||
String formatDop(double? value) {
|
||||
if (value == null || value.isNaN || value.isInfinite) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return value.toStringAsFixed(2);
|
||||
}
|
||||
|
||||
String formatMeterCompact(double? value) {
|
||||
if (value == null || value.isNaN || value.isInfinite) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
if (value < 1.0) {
|
||||
return '${value.toStringAsFixed(3)}m';
|
||||
}
|
||||
|
||||
if (value < 10.0) {
|
||||
return '${value.toStringAsFixed(2)}m';
|
||||
}
|
||||
|
||||
return '${value.toStringAsFixed(1)}m';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user