Warning thresholds added in drone profile. traffic light indication in drone satus menue added. layout and content optimized
This commit is contained in:
@@ -65,6 +65,52 @@ class _DroneProfileEditorState extends ConsumerState<DroneProfileEditor> {
|
||||
(key: 'maxAltitudeM', label: 'Ceiling', min: 50.0, max: 10000.0, stepBig: 100.0, stepSmall: 10.0, decimals: 0, unit: 'm'),
|
||||
],
|
||||
),
|
||||
// Ampel-Schwellwerte fuer die farbcodierten Telemetriefelder im
|
||||
// Drohnen-Status-Menue (Doku: "Schwellwerte fuer die Ampel-Kodierung im
|
||||
// Drohnenprofil anlegen", siehe domain/telemetry/telemetry_field_status.dart) -
|
||||
// je Feld Gruen-/Rot-Schwelle als eigene Gruppe, analog Climb/Descent oben.
|
||||
(
|
||||
title: 'GPS satellites alarm',
|
||||
fields: [
|
||||
(key: 'gpsSatGreenMin', label: 'Green from', min: 0.0, max: 20.0, stepBig: 2.0, stepSmall: 1.0, decimals: 0, unit: 'sat'),
|
||||
(key: 'gpsSatRedMin', label: 'Red below', min: 0.0, max: 20.0, stepBig: 2.0, stepSmall: 1.0, decimals: 0, unit: 'sat'),
|
||||
],
|
||||
),
|
||||
(
|
||||
title: 'GPS precision (HDOP) alarm',
|
||||
fields: [
|
||||
(key: 'hdopGreenMax', label: 'Green up to', min: 0.5, max: 10.0, stepBig: 1.0, stepSmall: 0.1, decimals: 1, unit: ''),
|
||||
(key: 'hdopRedMax', label: 'Red above', min: 0.5, max: 20.0, stepBig: 1.0, stepSmall: 0.1, decimals: 1, unit: ''),
|
||||
],
|
||||
),
|
||||
(
|
||||
title: 'Current draw alarm (A)',
|
||||
fields: [
|
||||
(key: 'currentGreenMaxA', label: 'Green up to', min: 1.0, max: 200.0, stepBig: 10.0, stepSmall: 1.0, decimals: 0, unit: 'A'),
|
||||
(key: 'currentRedMaxA', label: 'Red above', min: 1.0, max: 300.0, stepBig: 10.0, stepSmall: 1.0, decimals: 0, unit: 'A'),
|
||||
],
|
||||
),
|
||||
(
|
||||
title: 'Battery voltage alarm (V)',
|
||||
fields: [
|
||||
(key: 'batteryVoltageGreenMinV', label: 'Green from', min: 5.0, max: 60.0, stepBig: 1.0, stepSmall: 0.1, decimals: 1, unit: 'V'),
|
||||
(key: 'batteryVoltageRedMinV', label: 'Red below', min: 5.0, max: 60.0, stepBig: 1.0, stepSmall: 0.1, decimals: 1, unit: 'V'),
|
||||
],
|
||||
),
|
||||
(
|
||||
title: 'RX link quality alarm (%)',
|
||||
fields: [
|
||||
(key: 'rxQualityGreenMin', label: 'Green from', min: 0.0, max: 100.0, stepBig: 10.0, stepSmall: 1.0, decimals: 0, unit: '%'),
|
||||
(key: 'rxQualityRedMin', label: 'Red below', min: 0.0, max: 100.0, stepBig: 10.0, stepSmall: 1.0, decimals: 0, unit: '%'),
|
||||
],
|
||||
),
|
||||
(
|
||||
title: 'RX SNR alarm (dB)',
|
||||
fields: [
|
||||
(key: 'rxSnrGreenMinDb', label: 'Green from', min: -30.0, max: 30.0, stepBig: 5.0, stepSmall: 1.0, decimals: 0, unit: 'dB'),
|
||||
(key: 'rxSnrRedMinDb', label: 'Red below', min: -30.0, max: 30.0, stepBig: 5.0, stepSmall: 1.0, decimals: 0, unit: 'dB'),
|
||||
],
|
||||
),
|
||||
];
|
||||
|
||||
double _fieldValue(DroneProfile p, String key) => switch (key) {
|
||||
@@ -79,6 +125,18 @@ class _DroneProfileEditorState extends ConsumerState<DroneProfileEditor> {
|
||||
'maxRangeM' => p.maxRangeM,
|
||||
'maxEnduranceMin' => p.maxEnduranceMin,
|
||||
'maxAltitudeM' => p.maxAltitudeM,
|
||||
'gpsSatGreenMin' => p.gpsSatGreenMin,
|
||||
'gpsSatRedMin' => p.gpsSatRedMin,
|
||||
'hdopGreenMax' => p.hdopGreenMax,
|
||||
'hdopRedMax' => p.hdopRedMax,
|
||||
'currentGreenMaxA' => p.currentGreenMaxA,
|
||||
'currentRedMaxA' => p.currentRedMaxA,
|
||||
'batteryVoltageGreenMinV' => p.batteryVoltageGreenMinV,
|
||||
'batteryVoltageRedMinV' => p.batteryVoltageRedMinV,
|
||||
'rxQualityGreenMin' => p.rxQualityGreenMin,
|
||||
'rxQualityRedMin' => p.rxQualityRedMin,
|
||||
'rxSnrGreenMinDb' => p.rxSnrGreenMinDb,
|
||||
'rxSnrRedMinDb' => p.rxSnrRedMinDb,
|
||||
_ => throw ArgumentError(key),
|
||||
};
|
||||
|
||||
@@ -120,6 +178,18 @@ class _DroneProfileEditorState extends ConsumerState<DroneProfileEditor> {
|
||||
maxRangeM: v('maxRangeM'),
|
||||
maxEnduranceMin: v('maxEnduranceMin'),
|
||||
maxAltitudeM: v('maxAltitudeM'),
|
||||
gpsSatGreenMin: v('gpsSatGreenMin'),
|
||||
gpsSatRedMin: v('gpsSatRedMin'),
|
||||
hdopGreenMax: v('hdopGreenMax'),
|
||||
hdopRedMax: v('hdopRedMax'),
|
||||
currentGreenMaxA: v('currentGreenMaxA'),
|
||||
currentRedMaxA: v('currentRedMaxA'),
|
||||
batteryVoltageGreenMinV: v('batteryVoltageGreenMinV'),
|
||||
batteryVoltageRedMinV: v('batteryVoltageRedMinV'),
|
||||
rxQualityGreenMin: v('rxQualityGreenMin'),
|
||||
rxQualityRedMin: v('rxQualityRedMin'),
|
||||
rxSnrGreenMinDb: v('rxSnrGreenMinDb'),
|
||||
rxSnrRedMinDb: v('rxSnrRedMinDb'),
|
||||
);
|
||||
|
||||
final repo = ref.read(droneProfileRepositoryProvider);
|
||||
|
||||
Reference in New Issue
Block a user