drone status pill in footer for fly mode implemented. footer layout and sizes homogenized
This commit is contained in:
@@ -6,10 +6,10 @@ import 'package:dmc_app/transport/msp/msp_telemetry_codec.dart';
|
||||
|
||||
void main() {
|
||||
group('parseMspRawGps', () {
|
||||
test('parst fixType, numSat, lat/lon (1e-7 deg) und Speed (cm/s)', () {
|
||||
test('parst fixType, numSat, lat/lon (1e-7 deg), Speed (cm/s) und HDOP', () {
|
||||
// fixType=2, numSat=9, lat=52.5200000 deg, lon=13.4050000 deg,
|
||||
// alt=100m (ungenutzt), groundSpeed=1234 cm/s, groundCourse=900 (0.1deg,
|
||||
// ungenutzt), hdop=120 (ungenutzt).
|
||||
// ungenutzt), hdop=120 (/100 = 1.2).
|
||||
final data = ByteData(18);
|
||||
data.setUint8(0, 2);
|
||||
data.setUint8(1, 9);
|
||||
@@ -29,6 +29,7 @@ void main() {
|
||||
expect(reading.lon, closeTo(13.405, 1e-9));
|
||||
expect(reading.speedMs, closeTo(12.34, 1e-9));
|
||||
expect(reading.headingDeg, closeTo(90.0, 1e-9));
|
||||
expect(reading.hdop, closeTo(1.2, 1e-9));
|
||||
});
|
||||
|
||||
test('fixType 0 bedeutet kein Fix', () {
|
||||
@@ -142,4 +143,20 @@ void main() {
|
||||
expect(parseMspLinkQuality(payload), 87);
|
||||
});
|
||||
});
|
||||
|
||||
group('parseMspLinkStatsSnr', () {
|
||||
test('liest positives SNR an Offset 2', () {
|
||||
final payload = Uint8List(3);
|
||||
payload[2] = 12;
|
||||
expect(parseMspLinkStatsSnr(payload), 12);
|
||||
});
|
||||
|
||||
test('liest negatives SNR (vorzeichenbehaftetes Byte) an Offset 2', () {
|
||||
// -5 dB als uint8 geschrieben (fc_msp.c: (uint8_t)rxLinkStatistics.
|
||||
// uplinkSNR) entspricht 251 (256-5).
|
||||
final payload = Uint8List(3);
|
||||
payload[2] = 251;
|
||||
expect(parseMspLinkStatsSnr(payload), -5);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user