diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 54bc871..00ce447 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"open_settings","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\open_settings-2.0.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_apple-9.4.5\\\\","native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]},{"name":"wifi_iot","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_iot-0.3.19+1\\\\","native_build":true,"dependencies":[]},{"name":"wifi_scan","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_scan-0.4.1+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","native_build":true,"dependencies":[]},{"name":"open_settings","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\open_settings-2.0.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.10\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_android-12.0.12\\\\","native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]},{"name":"wifi_iot","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_iot-0.3.19+1\\\\","native_build":true,"dependencies":[]},{"name":"wifi_scan","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_scan-0.4.1+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_windows-0.2.1\\\\","native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"permission_handler_html","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_html-0.1.3+2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_webrtc","dependencies":["path_provider"]},{"name":"libserialport","dependencies":[]},{"name":"open_settings","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"quick_blue","dependencies":[]},{"name":"wifi_iot","dependencies":[]},{"name":"wifi_scan","dependencies":[]}],"date_created":"2024-08-30 17:03:17.654195","version":"3.24.0","swift_package_manager_enabled":false} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"open_settings","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\open_settings-2.0.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_apple-9.4.5\\\\","native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]},{"name":"wifi_iot","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_iot-0.3.19+1\\\\","native_build":true,"dependencies":[]},{"name":"wifi_scan","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_scan-0.4.1+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","native_build":true,"dependencies":[]},{"name":"open_settings","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\open_settings-2.0.2\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.10\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_android-12.0.12\\\\","native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]},{"name":"wifi_iot","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_iot-0.3.19+1\\\\","native_build":true,"dependencies":[]},{"name":"wifi_scan","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\wifi_scan-0.4.1+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.4.0\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"flutter_webrtc","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_webrtc-0.9.48+hotfix.1\\\\","native_build":true,"dependencies":[]},{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_windows-0.2.1\\\\","native_build":true,"dependencies":[]},{"name":"quick_blue","path":"D:\\\\workspace\\\\pile_NAV_new\\\\plugins\\\\quick_blue\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"permission_handler_html","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_html-0.1.3+2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_webrtc","dependencies":["path_provider"]},{"name":"libserialport","dependencies":[]},{"name":"open_settings","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"quick_blue","dependencies":[]},{"name":"wifi_iot","dependencies":[]},{"name":"wifi_scan","dependencies":[]}],"date_created":"2024-08-31 17:22:57.541154","version":"3.24.0","swift_package_manager_enabled":false} \ No newline at end of file diff --git a/lib/appbar.dart b/lib/appbar.dart index 1483f39..a491089 100644 --- a/lib/appbar.dart +++ b/lib/appbar.dart @@ -1,14 +1,11 @@ -import 'dart:async'; - +import 'package:cpnav/pages/aim_point/aimpoint_page.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:scence_map/controllers/controller.dart'; - import 'main.dart'; -import 'pages/aim_point/aimPointer.dart'; +import 'pages/aim_point/aimpointController.dart'; import 'pages/real/realController.dart'; -final SightController sightcontroller = Get.find(); +final AimPointerController aimcontroller = Get.find(); final RealController realcontroller = Get.find(); class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { @@ -96,17 +93,16 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { () => InkWell( onTap: () { // 点击图标时显示对点卡片 - sightcontroller.isCardVisible.value = - !sightcontroller.isCardVisible.value; // 确保控制器已定义 - - sightcontroller.lastManualTapTime = - DateTime.now().millisecondsSinceEpoch; + aimcontroller.isCardVisible.value = + !aimcontroller.isCardVisible.value; // 确保控制器已定义 + aimcontroller.lastManualTapTime = + DateTime.now().millisecondsSinceEpoch; }, child: Icon( Icons.my_location_sharp, size: 35, - color: sightcontroller.isCardVisible.value + color: aimcontroller.isCardVisible.value ? Colors.blue // : const Color.fromARGB(200, 29, 28, 28), : (appcontroller.isDarkMode.value diff --git a/lib/controllers/gnss_Controller.dart b/lib/controllers/gnss_Controller.dart index abe181f..0f2d21d 100644 --- a/lib/controllers/gnss_Controller.dart +++ b/lib/controllers/gnss_Controller.dart @@ -1,19 +1,19 @@ import 'dart:async'; import 'dart:math'; import 'dart:ui'; -import 'package:cpnav/pages/pass_track/controller.dart'; +import 'package:cpnav/pages/aim_point/aimpoint_page.dart'; import 'package:get/get.dart'; import 'package:gnss/gnss.dart'; import 'package:scence_map/controllers/controller.dart'; import 'package:scence_map/record_entity.dart'; import '../models/pilePoint/coord_trans.dart'; -import '../pages/aim_point/aimPointer.dart'; +import '../pages/aim_point/aimpointController.dart'; class GnssController extends GetxController { late final Gnss gnss; late ScenceMapController mapController; - late SightController sight; + late AimPointerController aimcontroller; LocationData? locationData; late Pos3D pilerCenter; @@ -30,31 +30,31 @@ class GnssController extends GetxController { var _dy = 0.0; Timer? timer; checkDistance() { - if (DateTime.now().millisecondsSinceEpoch - sight.lastManualTapTime < - 10000 || - DateTime.now().millisecondsSinceEpoch - sight.lastCloseTapTime < - 10000) { + if (DateTime.now().millisecondsSinceEpoch - aimcontroller.lastManualTapTime < + 30000 || + DateTime.now().millisecondsSinceEpoch - aimcontroller.lastCloseTapTime < + 30000) { return; } Offset pilerCenterPoint = Offset(device.x, device.y); - if (sight.selectedPilePoint == null) { + if (aimcontroller.selectedPilePoint == null) { return; } - var offset = Offset(sight.selectedPilePoint!.x, sight.selectedPilePoint!.y); - if (mapController.calculateDistance(pilerCenterPoint, offset) < 0.9) { - if (!sight.isCardVisible.value) { + var offset = Offset(aimcontroller.selectedPilePoint!.x, aimcontroller.selectedPilePoint!.y); + if (mapController.calculateDistance(pilerCenterPoint, offset) < 1.9) { + if (!aimcontroller.isCardVisible.value) { print("距离小于1m"); - sight.isCardVisible.value = true; + aimcontroller.isCardVisible.value = true; } else { return null; } } else { - if (!sight.isCardVisible.value) { + if (!aimcontroller.isCardVisible.value) { print("距离大于1m"); return null; } else { - sight.isCardVisible.value = false; + aimcontroller.isCardVisible.value = false; } } } @@ -64,15 +64,15 @@ class GnssController extends GetxController { super.onInit(); mapController = Get.find(); - sight = Get.find(); + aimcontroller = Get.find(); device = DeviceItem( name: 'GNSS', TID: 1001, type: 2, height: 3.0, width: 3.0, - lat: 3790616.710, - lon: 577046.048, + lat: 3790621.123, + lon: 577052.547, image: ['assets/images/pilerCar.png']); mapController.addDevice(device); // pilerCenterPoint = PilerPointCalculate( @@ -86,26 +86,26 @@ class GnssController extends GetxController { // 插入定时器测试代码 timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { - // if (lastPilePoint != sight.selectedPilePoint) { - // lastPilePoint = sight.selectedPilePoint; - // if (sight.selectedPilePoint != null) { - // var dx = device.x - sight.selectedPilePoint!.x; - // var dy = device.y - sight.selectedPilePoint!.y; - // var distance = sqrt(dx * dx + dy * dy); - // if (distance > 20) { - // dx = (sight.selectedPilePoint!.x - device.x) / (distance / 20); - // dy = (sight.selectedPilePoint!.y - device.y) / (distance / 20); - // device.x = sight.selectedPilePoint!.x + dx; - // device.y = sight.selectedPilePoint!.y + dy; - // } - // _dx = -dx / 50; - // _dy = -dy / 50; - // } - // } - // device.x += _dx; - // device.y += _dy; - device.x += 0.2; - device.y += 0.2; + if (lastPilePoint != aimcontroller.selectedPilePoint) { + lastPilePoint = aimcontroller.selectedPilePoint; + if (aimcontroller.selectedPilePoint != null) { + var dx = device.x - aimcontroller.selectedPilePoint!.x; + var dy = device.y - aimcontroller.selectedPilePoint!.y; + var distance = sqrt(dx * dx + dy * dy); + if (distance > 20) { + dx = (aimcontroller.selectedPilePoint!.x - device.x) / (distance / 20); + dy = (aimcontroller.selectedPilePoint!.y - device.y) / (distance / 20); + device.x = aimcontroller.selectedPilePoint!.x + dx; + device.y = aimcontroller.selectedPilePoint!.y + dy; + } + _dx = -dx / 50; + _dy = -dy / 50; + } + } + device.x += _dx; + device.y += _dy; + // device.x += 0.05; + // device.y += 0.05; device.rotation = device.rotation + pi / 180; // 确保旋转角度在0-360度之间 device.update.value++; checkDistance(); diff --git a/lib/main.dart b/lib/main.dart index 5365c76..0b25ec7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,9 +7,8 @@ import 'package:get/get.dart'; import 'package:scence_map/controllers/controller.dart'; import 'package:scence_map/controllers/plumController.dart'; import 'appbar.dart'; -import 'pages/aim_point/aimPointer.dart'; +import 'pages/aim_point/aimpointController.dart'; import 'pages/history/history_record.dart'; -import 'pages/pass_track/view.dart'; import 'pages/pile/pileNav/view.dart'; import 'pages/pile/rightDra/pileGenerate.dart'; import 'pages/real/index.dart'; @@ -24,7 +23,7 @@ void main() async { SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); //设置全屏 Get.put(ScenceMapController()); Get.put(PlumDataController()); - Get.put(SightController()); + Get.put(AimPointerController()); Get.put(GnssController()); Get.put(AntennaController()); LoginPrefs loginPrefs = LoginPrefs(); diff --git a/lib/pages/aim_point/aimPointer.dart b/lib/pages/aim_point/aimPointer.dart deleted file mode 100644 index c1f16c9..0000000 --- a/lib/pages/aim_point/aimPointer.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:scence_map/controllers/controller.dart'; -import 'package:scence_map/record_entity.dart'; - -import '../../service/pile/device_type.dart'; - -final ScenceMapController mapcontroller = Get.put(ScenceMapController()); - -// 对点 瞄准器 -class SightController extends GetxController { - var isNomal = true.obs; - //左下圆 - var sightOffset = const Offset(3, 3).obs; - var sightOffsetInit = const Offset(0, 0).obs; - var sightInit = const Offset(0, 0).obs; - // var lastSightOffset = const Offset(0, 0).obs; // 新增变量,用于存储上一次手指离开时的位置 - var isCardVisible = false.obs; // 控制卡片是否可见 - RecordEntity? selectedPilePoint; - - var initDx = 0.0.obs; - var isFirst = true.obs; - var visualList = [].obs; - var plot = 2.0.obs; - var scale = 0.75.obs; - int lastManualTapTime = 0; - int lastCloseTapTime = 0; - reset() { - sightOffset.value = const Offset(3, 3); - sightOffsetInit.value = const Offset(0, 0); - sightInit.value = const Offset(0, 0); - - initDx.value = 0.0; - update(); - } -} - -class SightView extends GetView { - const SightView({super.key}); - - @override - Widget build(BuildContext context) { - final size = MediaQuery.of(context).size; - MediaQueryData mediaQueryData = - MediaQueryData.fromView(WidgetsBinding.instance.window); //获取当前屏幕信息 - final orientation = mediaQueryData.orientation; //获得设备方向 - final deviceType = getDeviceType(context); - double rectWidth = size.height / 2; - if (!controller.isNomal.value) { - rectWidth = size.width; - } else { - if (orientation == Orientation.landscape) { - rectWidth = size.width / 2; - if (deviceType == DeviceType.mobile) { - rectWidth = size.height - 5; - } - } else { - rectWidth = size.height / 2; - if (deviceType == DeviceType.mobile) { - rectWidth = size.width - 5; - } - } - } - - bool isDarkMode = Theme.of(context).brightness == Brightness.dark; - - return Stack( - children: [ - CustomPaint( - //绘制瞄准器 - size: Size(rectWidth, rectWidth), - painter: DrawCicle(controller, 0, 0, isDarkMode), - ) - ], - ); - } -} - -class DrawCicle extends CustomPainter { - final SightController sight; - final double tiltX; - final double tiltY; - final bool isDarkMode; - - DrawCicle(this.sight, this.tiltX, this.tiltY, this.isDarkMode); - final _paint = Paint(); //创建一个画笔并配置其属性 - Path path = Path(); - - List icons = [ - Icons.arrow_drop_up, - Icons.arrow_drop_down, - Icons.arrow_left, - Icons.arrow_right - ]; - List iconOffset = []; - - List text = ["", "", "", ""]; //['前移', '后移', '左移', '右移']; - @override - void paint(Canvas canvas, size) { - _paint - ..strokeWidth = 2 - ..style = PaintingStyle.stroke - ..color = const Color.fromARGB(255, 183, 183, 162); - - double rectWidth = (size.height / 2 - 5).roundToDouble(); - if (!sight.isNomal.value) { - } else {} - - path.moveTo(0, rectWidth + 5); - path.lineTo(size.height, rectWidth + 5); - path.moveTo(rectWidth + 5, 0); - path.lineTo(rectWidth + 5, size.height); - canvas.drawPath(path, _paint); - // 总长 2m - double step = (rectWidth / sight.plot.value / 10).roundToDouble(); - canvas.translate(rectWidth + 5, rectWidth + 5); - for (var i = 0; i < 21; i++) { - if (i % 10 == 0) { - double line = 7; - canvas.drawLine(Offset(0, i * step), Offset(line, i * step), _paint); - canvas.drawLine(Offset(i * step, 0), Offset(i * step, line), _paint); - canvas.drawLine(Offset(0, -i * step), Offset(line, -i * step), _paint); - canvas.drawLine(Offset(-i * step, 0), Offset(-i * step, line), _paint); - drawText(canvas, Offset(line, i * step), i ~/ 10); - drawText(canvas, Offset(line, -i * step), (-i ~/ 10)); - if (i ~/ 10 != 0) { - drawText(canvas, Offset(i * step, line), i ~/ 10); - drawText(canvas, Offset(-i * step, line), (-i ~/ 10)); - } - } else if (i % 5 == 0) { - double line = 5; - canvas.drawLine(Offset(0, i * step), Offset(line, i * step), _paint); - canvas.drawLine(Offset(i * step, 0), Offset(i * step, line), _paint); - canvas.drawLine(Offset(0, -i * step), Offset(line, -i * step), _paint); - canvas.drawLine(Offset(-i * step, 0), Offset(-i * step, line), _paint); - } else { - double line = 3; - canvas.drawLine(Offset(0, i * step), Offset(line, i * step), _paint); - canvas.drawLine(Offset(i * step, 0), Offset(i * step, line), _paint); - canvas.drawLine(Offset(0, -i * step), Offset(line, -i * step), _paint); - canvas.drawLine(Offset(-i * step, 0), Offset(-i * step, line), _paint); - } - } - canvas.translate(-(rectWidth + 5), -(rectWidth + 5)); - - canvas.translate(rectWidth + 5, rectWidth + 5); - if (sight.selectedPilePoint != null) { - drawPoint(canvas); - } - - // // 绘制水平仪 - // double x = real.tiltX.value; // - // double y = real.tiltY.value; // - // print("----${real.centerX.value},${real.centerY.value}"); - // if (real.tiltX.value == 0 || real.tiltY.value == 0) { - // x = 0; - // y = 0; - // } - // _paint.color = Colors.red; - // canvas.drawCircle(Offset(x * step * 10, y * step * 10), 10, _paint); - // canvas.translate(-(rectWidth + 5), -(rectWidth + 5)); - } - - drawText(Canvas canvas, Offset offset, int i, [bool isShow = true]) { - TextPainter textPainter = TextPainter( - text: TextSpan( - text: isShow ? "$i m" : "$i", - style: TextStyle( - fontSize: 12, color: isDarkMode ? Colors.white : Colors.black)), - textDirection: TextDirection.ltr, - textAlign: TextAlign.left); - textPainter.layout(); - - textPainter.paint(canvas, offset); - } - - drawPoint(Canvas canvas) { - canvas.drawCircle(Offset.zero, 20, - Paint()..color = const Color.fromARGB(255, 139, 33, 33)); - // drawText(canvas, pos - const Offset(20, 10), i, false); - } - - // drawRect(Canvas canvas, double rectWidth) { - // double x = item.dx - real.centerX.value; - // double y = item.dy - real.centerY.value; - // Offset center = Offset(x, y); - // canvas.drawRect( - // Rect.fromCenter(center: center, width: rectWidth, height: rectWidth), - // _paint); - // } - - @override - bool shouldRepaint(covariant CustomPainter oldDelegate) => true; -} - -class DevicePointer extends StatelessWidget { - // final DeviceItemController item; - // DevicePointer(this.item); - DevicePointer(); - - @override - Widget build(BuildContext context) { - // double carWidth = item.width / controller.pixel2MeterRatio; - // double carHeight = item.height / controller.pixel2MeterRatio; - - return Stack( - alignment: Alignment.center, - children: [ - SizedBox( - width: 60.0, // 设置图像的宽度 - height: 60.0, // 设置图像的高度 - child: Image.asset( - "images/navi_pointer.png", - errorBuilder: (context, error, stackTrace) { - return Text('无法加载图片'); - }, - ), - ), - - // Obx(() { - // Offset offset = controller.xy2Screen( - // gnsscontroller.pilerCenter.X, gnsscontroller.pilerCenter.Y); - - // return Positioned( - // left: offset.dx, - // top: offset.dy, - // child: Transform( - // transform: Matrix4.identity() - // ..rotateZ(-controller.rotation.value), - // child: Column( - // children: [Text("设备:${item.name}")], - // ), - // ), - // ); - // }), - ], - ); - } -} diff --git a/lib/pages/aim_point/aimpointController.dart b/lib/pages/aim_point/aimpointController.dart new file mode 100644 index 0000000..d5953d4 --- /dev/null +++ b/lib/pages/aim_point/aimpointController.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:scence_map/record_entity.dart'; + +class AimPointerController extends GetxController { + var isNomal = true.obs; + //左下圆 + var sightOffset = const Offset(3, 3).obs; + var sightOffsetInit = const Offset(0, 0).obs; + var sightInit = const Offset(0, 0).obs; + // var lastSightOffset = const Offset(0, 0).obs; // 新增变量,用于存储上一次手指离开时的位置 + var isCardVisible = false.obs; // 控制卡片是否可见 + RecordEntity? selectedPilePoint; + + var initDx = 0.0.obs; + var isFirst = true.obs; + var visualList = [].obs; + var plot = 2.0.obs; + var scale = 0.75.obs; + var cardWidth = 0.0.obs; + var left = 0.0.obs; + var top = 0.0.obs; + var positionUpdate = 0.obs; + + int lastManualTapTime = 0; + int lastCloseTapTime = 0; + reset() { + sightOffset.value = const Offset(3, 3); + sightOffsetInit.value = const Offset(0, 0); + sightInit.value = const Offset(0, 0); + + initDx.value = 0.0; + update(); + } +} diff --git a/lib/pages/aim_point/aimpoint_page.dart b/lib/pages/aim_point/aimpoint_page.dart index 0161420..1cc9793 100644 --- a/lib/pages/aim_point/aimpoint_page.dart +++ b/lib/pages/aim_point/aimpoint_page.dart @@ -2,40 +2,18 @@ import 'dart:async'; import 'dart:math'; import 'dart:ui' as ui; import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; import 'package:get/get.dart'; import 'package:scence_map/controllers/controller.dart'; import '../../controllers/gnss_Controller.dart'; import '../../service/pile/device_type.dart'; -import 'aimPointer.dart'; +import 'aimpointController.dart'; -final SightController sight = Get.put(SightController()); +final AimPointerController aimcontroller = Get.put(AimPointerController()); final ScenceMapController mapcontroller = Get.put(ScenceMapController()); final GnssController gnsscontroller = Get.put(GnssController()); -class AimPointer extends StatefulWidget { - const AimPointer({super.key}); - - @override - State createState() => _AimPointerState(); -} -//CounterPointer 是一个自定义的 StatefulWidget 类。 -//它通过重写 createState 方法来创建一个与之关联的 State 对象。 -//createState 方法返回 _CounterPointerState(),这是一个 _CounterPointerState -//类的实例,用于管理 CounterPointer 的状态和生命周期。 - -class _AimPointerState extends State { - // late final DeviceItemController item; - // late final double maprotation; - // late final Offset targetPoint; - - @override - void initState() { - super.initState(); - - // map.disableMove.value = true; - // map.update(); - } - +class AimPointer extends GetView { String gradienter = "0"; //水平仪 @override Widget build(BuildContext context) { @@ -45,17 +23,9 @@ class _AimPointerState extends State { final orientation = mediaQueryData.orientation; //获得设备方向 bool isPortrait = Orientation.portrait == orientation ? true : false; double rectWidth = size.width; + final deviceType = getDeviceType(context); - double left = 0.0; - double top = 0.0; - if (sight.selectedPilePoint != null) { - var dx = gnsscontroller.device.x - sight.selectedPilePoint!.x; - var dy = gnsscontroller.device.y - sight.selectedPilePoint!.y; - left = dx * cos(mapcontroller.rotation.value) + - dy * sin(mapcontroller.rotation.value); - top = -dx * sin(mapcontroller.rotation.value) + - dy * cos(mapcontroller.rotation.value); - } + if (orientation == Orientation.landscape) { rectWidth = size.width / 2 - 60; if (deviceType == DeviceType.mobile) { @@ -73,8 +43,10 @@ class _AimPointerState extends State { width: rectWidth, height: rectWidth, child: Card( + clipBehavior: Clip.antiAlias, shape: RoundedRectangleBorder( side: BorderSide(color: Colors.transparent, width: 0), + borderRadius: BorderRadius.circular(4.0), // 可以根据需要调整圆角半径 ), child: Stack( @@ -82,78 +54,141 @@ class _AimPointerState extends State { Container( width: rectWidth, height: rectWidth, - clipBehavior: Clip.hardEdge, //圆形剪裁 decoration: BoxDecoration( border: Border.all( color: isDarkMode ? Colors.white : Colors.black), borderRadius: BorderRadius.all(Radius.circular(rectWidth / 2)), ), - child: Obx(() { - return Transform( - transform: Matrix4.identity() - ..rotateZ(mapcontroller.rotation.value), - alignment: FractionalOffset.center, - child: const SightView(), - ); - })), - Positioned( - top: 0, - left: 10, - child: Obx(() { - return TextButton( - child: Text( - "${sight.plot.value}m", - style: const TextStyle(fontSize: 20), - ), - onPressed: () { - if (sight.plot.value == 1) { - sight.plot.value = 2; - } else { - sight.plot.value = 1; - } - sight.update(); - }, - ); - })), - Positioned( - top: 25, - right: 10, - child: TextButton( - child: Text( - "垂直度:$gradienter°", - style: const TextStyle(fontSize: 20), - ), - onPressed: () {}, - )), - Positioned( - right: 0, - top: 0, - child: IconButton( - icon: const Icon(Icons.close), - onPressed: () { - // 关闭按钮的回调函数 - sight.isCardVisible.value = false; - sight.lastCloseTapTime = - DateTime.now().millisecondsSinceEpoch; - }, - ), - ), - if (sight.selectedPilePoint != null) - Positioned( - left: rectWidth / 2 + left / mapcontroller.pixel2MeterRatio, - top: rectWidth / 2 - top / mapcontroller.pixel2MeterRatio, - // left: 70, - // top: 70, - child: Transform( - transform: Matrix4.identity() - ..rotateZ(gnsscontroller.device.rotation + pi / 2), - alignment: FractionalOffset.center, - child: DevicePointer(), - ) + child: Stack( + children: [ + CustomPaint( + //绘制瞄准器 + size: Size(rectWidth, rectWidth), + painter: DrawAxis(aimcontroller, 0, 0, isDarkMode), + child: Stack( + children: [ + Positioned( + top: 20, + left: 20, + child: Obx(() { + return TextButton( + child: Text( + "${aimcontroller.plot.value}m", + style: const TextStyle(fontSize: 20), + ), + onPressed: () { + if (aimcontroller.plot.value == 1) { + aimcontroller.plot.value = 2; + } else { + aimcontroller.plot.value = 1; + } + aimcontroller.update(); + }, + ); + })), + Positioned( + top: 25, + right: 10, + child: TextButton( + child: Text( + "垂直度:$gradienter°", + style: const TextStyle(fontSize: 20), + ), + onPressed: () {}, + )), + Positioned( + right: 0, + top: 0, + child: IconButton( + icon: const Icon(Icons.close), + onPressed: () { + // 关闭按钮的回调函数 + aimcontroller.isCardVisible.value = false; + aimcontroller.lastCloseTapTime = + DateTime.now().millisecondsSinceEpoch; + }, + ), + ), + Obx(() { + var pixel2MeterRatio = + aimcontroller.plot.value * 2 / rectWidth; + if (aimcontroller.selectedPilePoint != null) + gnsscontroller.device.update.value; + if (aimcontroller.selectedPilePoint != null) { + var dx = (gnsscontroller.device.x - + aimcontroller.selectedPilePoint!.x); + var dy = (gnsscontroller.device.y - + aimcontroller.selectedPilePoint!.y); - // child: DevicePointer(), - ) + aimcontroller.top.value = dx * + cos(mapcontroller.rotation.value) + + dy * sin(mapcontroller.rotation.value); + aimcontroller.left.value = -dx * + sin(mapcontroller.rotation.value) + + dy * cos(mapcontroller.rotation.value); + // aimcontroller.positionUpdate.value++; + print("dx:$dx,dy:$dy"); + print( + "left:${aimcontroller.left.value},top:${aimcontroller.top.value}"); + } + + return Positioned( + left: rectWidth / 2 - + 30 + + aimcontroller.left.value / + pixel2MeterRatio, + top: rectWidth / 2 - + 30 - + aimcontroller.top.value / + pixel2MeterRatio, + // left: 70, + // top: 70, + child: Transform( + transform: Matrix4.identity() + ..rotateZ( + gnsscontroller.device.rotation + + pi / 2 + + mapcontroller.rotation.value), + alignment: FractionalOffset.center, + child: Stack( + alignment: Alignment.center, + children: [ + SizedBox( + width: 60.0, // 设置图像的宽度 + height: 60.0, // 设置图像的高度 + child: Image.asset( + "images/navi_pointer.png", + errorBuilder: (context, error, + stackTrace) { + return Text('无法加载图片'); + }, + ), + ), + + // Obx(() { + // Offset offset = controller.xy2Screen( + // gnsscontroller.pilerCenter.X, gnsscontroller.pilerCenter.Y); + + // return Positioned( + // left: offset.dx, + // top: offset.dy, + // child: Transform( + // transform: Matrix4.identity() + // ..rotateZ(-controller.rotation.value), + // child: Column( + // children: [Text("设备:${item.name}")], + // ), + // ), + // ); + // }), + ], + ))); + }) + ], + )) + ], + )), ], ), ), @@ -178,6 +213,124 @@ class _AimPointerState extends State { } } +class DrawAxis extends CustomPainter { + final AimPointerController aimcontroller; + final double tiltX; + final double tiltY; + final bool isDarkMode; + + DrawAxis(this.aimcontroller, this.tiltX, this.tiltY, this.isDarkMode); + final _paint = Paint(); //创建一个画笔并配置其属性 + Path path = Path(); + + List icons = [ + Icons.arrow_drop_up, + Icons.arrow_drop_down, + Icons.arrow_left, + Icons.arrow_right + ]; + List iconOffset = []; + + List text = ["", "", "", ""]; //['前移', '后移', '左移', '右移']; + @override + void paint(Canvas canvas, size) { + _paint + ..strokeWidth = 2 + ..style = PaintingStyle.stroke + ..color = const Color.fromARGB(255, 183, 183, 162); + + double rectWidth = (size.height / 2 - 5).roundToDouble(); + aimcontroller.cardWidth.value = rectWidth; + if (!aimcontroller.isNomal.value) { + } else {} + + path.moveTo(0, rectWidth + 5); + path.lineTo(size.height, rectWidth + 5); + path.moveTo(rectWidth + 5, 0); + path.lineTo(rectWidth + 5, size.height); + canvas.drawPath(path, _paint); + // 总长 2m + double step = (rectWidth / aimcontroller.plot.value / 10).roundToDouble(); + canvas.translate(rectWidth + 5, rectWidth + 5); + for (var i = 0; i < 21; i++) { + if (i % 10 == 0) { + double line = 7; + canvas.drawLine(Offset(0, i * step), Offset(line, i * step), _paint); + canvas.drawLine(Offset(i * step, 0), Offset(i * step, line), _paint); + canvas.drawLine(Offset(0, -i * step), Offset(line, -i * step), _paint); + canvas.drawLine(Offset(-i * step, 0), Offset(-i * step, line), _paint); + drawText(canvas, Offset(line, i * step), -i ~/ 10); + drawText(canvas, Offset(line, -i * step), (i ~/ 10)); + if (i ~/ 10 != 0) { + drawText(canvas, Offset(i * step, line), i ~/ 10); + drawText(canvas, Offset(-i * step, line), (-i ~/ 10)); + } + } else if (i % 5 == 0) { + double line = 5; + canvas.drawLine(Offset(0, i * step), Offset(line, i * step), _paint); + canvas.drawLine(Offset(i * step, 0), Offset(i * step, line), _paint); + canvas.drawLine(Offset(0, -i * step), Offset(line, -i * step), _paint); + canvas.drawLine(Offset(-i * step, 0), Offset(-i * step, line), _paint); + } else { + double line = 3; + canvas.drawLine(Offset(0, i * step), Offset(line, i * step), _paint); + canvas.drawLine(Offset(i * step, 0), Offset(i * step, line), _paint); + canvas.drawLine(Offset(0, -i * step), Offset(line, -i * step), _paint); + canvas.drawLine(Offset(-i * step, 0), Offset(-i * step, line), _paint); + } + } + canvas.translate(-(rectWidth + 5), -(rectWidth + 5)); + + canvas.translate(rectWidth + 5, rectWidth + 5); + if (aimcontroller.selectedPilePoint != null) { + drawPoint(canvas); + } + + // // 绘制水平仪 + // double x = real.tiltX.value; // + // double y = real.tiltY.value; // + // print("----${real.centerX.value},${real.centerY.value}"); + // if (real.tiltX.value == 0 || real.tiltY.value == 0) { + // x = 0; + // y = 0; + // } + // _paint.color = Colors.red; + // canvas.drawCircle(Offset(x * step * 10, y * step * 10), 10, _paint); + // canvas.translate(-(rectWidth + 5), -(rectWidth + 5)); + } + + drawText(Canvas canvas, Offset offset, int i, [bool isShow = true]) { + TextPainter textPainter = TextPainter( + text: TextSpan( + text: isShow ? "$i m" : "$i", + style: TextStyle( + fontSize: 12, color: isDarkMode ? Colors.white : Colors.black)), + textDirection: TextDirection.ltr, + textAlign: TextAlign.left); + textPainter.layout(); + + textPainter.paint(canvas, offset); + } + + drawPoint(Canvas canvas) { + canvas.drawCircle(Offset.zero, 20, + Paint()..color = const Color.fromARGB(255, 139, 33, 33)); + // drawText(canvas, pos - const Offset(20, 10), i, false); + } + + // drawRect(Canvas canvas, double rectWidth) { + // double x = item.dx - real.centerX.value; + // double y = item.dy - real.centerY.value; + // Offset center = Offset(x, y); + // canvas.drawRect( + // Rect.fromCenter(center: center, width: rectWidth, height: rectWidth), + // _paint); + // } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => true; +} + // 瞄准器卡片 class SightGview extends StatelessWidget { const SightGview(); @@ -203,30 +356,31 @@ class SightGview extends StatelessWidget { } return Obx(() => Visibility( - visible: sight.isCardVisible.value, + visible: aimcontroller.isCardVisible.value, child: Positioned( - left: sight.sightOffset.value.dx, - top: sight.sightOffset.value.dy, + left: aimcontroller.sightOffset.value.dx, + top: aimcontroller.sightOffset.value.dy, width: rectWidth + 15, height: rectWidth + 15, child: GestureDetector( onScaleStart: (details) { // 正确计算初始偏移量:当前手指位置与卡片当前位置之间的差值 - sight.sightInit.value = - details.localFocalPoint - sight.sightOffset.value; + aimcontroller.sightInit.value = + details.localFocalPoint - aimcontroller.sightOffset.value; // // // - print('sight.isCardVisible: ${sight.isCardVisible.value}'); + print( + 'aimcontroller.isCardVisible: ${aimcontroller.isCardVisible.value}'); }, onScaleUpdate: (details) { // 使用初始偏移量来更新卡片的位置 - sight.sightOffset.value = - details.localFocalPoint - sight.sightInit.value; + aimcontroller.sightOffset.value = + details.localFocalPoint - aimcontroller.sightInit.value; }, child: Container( decoration: const BoxDecoration(color: Colors.transparent), - child: const Stack(children: [ + child: Stack(children: [ Card( color: Colors.transparent, elevation: 5.0, diff --git a/lib/pages/pass_track/view.dart b/lib/pages/pass_track/view.dart index 2c62b04..085299e 100644 --- a/lib/pages/pass_track/view.dart +++ b/lib/pages/pass_track/view.dart @@ -1,7 +1,6 @@ //字体 import 'package:bottom_picker/resources/arrays.dart'; import 'package:cpnav/controllers/gnss_Controller.dart'; -import 'package:cpnav/pages/aim_point/aimPointer.dart'; import 'package:cpnav/pages/aim_point/aimpoint_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -13,6 +12,7 @@ import 'package:scence_map/record_entity.dart'; import 'package:scence_map/scence_map.dart'; import 'package:syncfusion_flutter_sliders/sliders.dart'; +import '../aim_point/aimpointController.dart'; import '../real/realDataCard.dart'; import 'iconContainer.dart'; import "controller.dart"; @@ -42,7 +42,7 @@ class _PasstrackState extends State { final GlobalKey> _popupMenuKey = GlobalKey>(); final controller = Get.put(PassTrackController("TEST", "pile_cm")); - final sightcontroller = Get.find(); + final aimcontroller = Get.find(); String str = "播放"; int sWidth = 0; int bits = -1; @@ -122,7 +122,7 @@ class _PasstrackState extends State { print( "selectedPilePoint:$selectedPilePoint scale:$scale rotation:$rotation"); controller.selectedPilePoint = selectedPilePoint; - sightcontroller.selectedPilePoint = selectedPilePoint; + aimcontroller.selectedPilePoint = selectedPilePoint; }, ), Positioned( @@ -280,7 +280,6 @@ class _PasstrackState extends State { class BorderPainter extends CustomPainter { final PassTrackController controller; final GnssController gnsscontroller; - // final SightController sight; BorderPainter(this.controller) : gnsscontroller = Get.find(), super(repaint: controller);