System messages fuer GPS-Fix und Drone connected/disconnected, Batterie-Schwellwerte auf Pro-Zelle umgestellt
- detectSystemMessages() erkennt jetzt auch den Uebergang zu einem GPS-Fix (flankengetriggert wie Battery/Failsafe), Meldung "GPS fix acquired (N satellites)". - Die automatisch erkannten Verbindungsmeldungen heissen jetzt "Drone connected"/"Drone disconnected" statt "Connected"/"Connection lost" - praeziser an die tatsaechliche Bedeutung angelehnt (Eintreffen/Ausbleiben echter Telemetrie-Frames, nicht nur des rohen Socket-Zustands). - DroneProfile: feste Pack-Alarmspannung (batteryVoltageGreenMinV/RedMinV) ersetzt durch batteryCellCount + Pro-Zelle-Schwellwerte (batteryVoltageGreenMinPerCellV/RedMinPerCellV, LiPo-Standardwerte 3.4/3.2 V als Default). Die alten Feldnamen bleiben als berechnete Getter (Zellenzahl * Pro-Zelle-Wert) erhalten, damit telemetry_field_status.dart unveraendert bleibt. T1-Ranger-Standardprofil auf 4S gesetzt. - DB-Schema v8 -> v9 (additiv, alte Pack-Spannungs-Spalten bleiben als tote Spalten stehen), Repository und Share-Codec-Im-/Export entsprechend angepasst; alte Exportdateien ohne die neuen Felder fallen auf die DroneProfile-Defaults zurueck statt eine unbekannte Zellenzahl zu raten. - DroneProfileEditor: "Battery voltage alarm"-Gruppe um ein Zellenzahl-Feld erweitert und auf V/Zelle umbenannt. - Tests ergaenzt/angepasst: GPS-Fix-Erkennung (Unit + Provider-Integration), neuer v8->v9-Migrationstest analog zum bestehenden v7->v8-Test, Connected/Disconnected-Umbenennung in Provider- und Widget-Tests, Cell-Count-Roundtrip in Repository- und Share-Codec-Tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b68c16d8e6
commit
e902197462
@@ -16,9 +16,41 @@ void main() {
|
||||
expect(parsed.profile.minSpeed, profile.minSpeed);
|
||||
expect(parsed.profile.maxSpeed, profile.maxSpeed);
|
||||
expect(parsed.profile.maxAltitudeM, profile.maxAltitudeM);
|
||||
expect(parsed.profile.batteryCellCount, profile.batteryCellCount);
|
||||
expect(
|
||||
parsed.profile.batteryVoltageGreenMinPerCellV,
|
||||
profile.batteryVoltageGreenMinPerCellV,
|
||||
);
|
||||
expect(
|
||||
parsed.profile.batteryVoltageRedMinPerCellV,
|
||||
profile.batteryVoltageRedMinPerCellV,
|
||||
);
|
||||
expect(parsed.versionMismatch, isNull);
|
||||
});
|
||||
|
||||
test('alte Exportdatei ohne batteryCellCount faellt auf die neuen '
|
||||
'Defaults zurueck, statt die alte Pack-Spannung zu uebernehmen', () {
|
||||
final json = buildDroneExportJson(profile).replaceFirst(
|
||||
RegExp(
|
||||
r',\s*"batteryCellCount": [\d.]+,\s*'
|
||||
r'"batteryVoltageGreenMinPerCellV": [\d.]+,\s*'
|
||||
r'"batteryVoltageRedMinPerCellV": [\d.]+',
|
||||
),
|
||||
'',
|
||||
);
|
||||
final parsed = parseDroneImportJson(json);
|
||||
|
||||
expect(parsed.profile.batteryCellCount, DroneProfile.defaultBatteryCellCount);
|
||||
expect(
|
||||
parsed.profile.batteryVoltageGreenMinPerCellV,
|
||||
DroneProfile.defaultBatteryVoltageGreenMinPerCellV,
|
||||
);
|
||||
expect(
|
||||
parsed.profile.batteryVoltageRedMinPerCellV,
|
||||
DroneProfile.defaultBatteryVoltageRedMinPerCellV,
|
||||
);
|
||||
});
|
||||
|
||||
test('erkennt eine abweichende Hauptversion als Mismatch', () {
|
||||
final json = buildDroneExportJson(profile).replaceFirst('"1.0.0"', '"2.0.0"');
|
||||
final parsed = parseDroneImportJson(json);
|
||||
|
||||
Reference in New Issue
Block a user