GnssService osztály és refraktorálás a app_drawer miatt, shellview bevezetés.

This commit is contained in:
2026-05-11 13:50:40 +02:00
parent f1a3753f36
commit af5d9d2c0b
18 changed files with 1048 additions and 192 deletions
+21
View File
@@ -6,6 +6,7 @@ import '../../gnss_sentences/gngga.dart';
import 'gnss_connection.dart';
import 'bt_serial_gnss_connection.dart';
import 'ble_gnss_connection.dart';
import 'gnss_device_service.dart';
class GnssService extends GetxService {
static GnssService get to => Get.find();
@@ -101,4 +102,24 @@ class GnssService extends GetxService {
_disconnect();
super.onClose();
}
// ── Eszközváltás — a GnssDevicePickerDialog hívja ───────────────
Future<void> onDeviceChanged(GnssDevice device) async {
switch (device.type) {
case GnssConnectionType.btSerial:
await connectBtSerial(device.address);
case GnssConnectionType.ble:
await connectBle(device.address);
case GnssConnectionType.phoneGps:
// Külső GPS kapcsolat lezárása ha volt
await _disconnect();
connectionState.value = GnssConnectionState.disconnected;
activeConnectionType.value = GnssConnectionType.phoneGps;
// A telefon GPS kezelése a map_controller _startPhoneGps()-ben van
// itt csak jelezzük hogy phone módra váltottunk
}
}
}