添加设备
This commit is contained in:
parent
7eec50c877
commit
8ef7427b0d
@ -1 +1 @@
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"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":[]}],"android":[{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","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":[]}],"macos":[{"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":[]}],"linux":[{"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":[]}],"windows":[{"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":[]}],"web":[]},"dependencyGraph":[{"name":"libserialport","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":[]}],"date_created":"2024-08-26 18:23:25.517122","version":"3.24.0","swift_package_manager_enabled":false}
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"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":[]}],"android":[{"name":"libserialport","path":"C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\\\","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":[]}],"macos":[{"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":[]}],"linux":[{"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":[]}],"windows":[{"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":[]}],"web":[]},"dependencyGraph":[{"name":"libserialport","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":[]}],"date_created":"2024-08-26 18:57:11.469847","version":"3.24.0","swift_package_manager_enabled":false}
|
@ -2,15 +2,16 @@ import 'dart:async';
|
||||
import 'dart:math';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gnss/gnss.dart';
|
||||
import 'package:scence_map/controllers/controller.dart';
|
||||
|
||||
import '../models/pilePoint/coord_trans.dart';
|
||||
|
||||
|
||||
class GnssController extends GetxController {
|
||||
late final Gnss gnss;
|
||||
late ScenceMapController mapController;
|
||||
LocationData? locationData;
|
||||
late Pos3D pilerCenter;
|
||||
|
||||
late DeviceItem device;
|
||||
var locationUpdate = 0.obs;
|
||||
// late final PilerPointCalculate pilerCenterPoint;
|
||||
//三个定义
|
||||
@ -23,7 +24,17 @@ class GnssController extends GetxController {
|
||||
@override
|
||||
void onInit() async {
|
||||
super.onInit();
|
||||
|
||||
mapController = Get.find<ScenceMapController>();
|
||||
device = DeviceItem(
|
||||
name: 'GNSS',
|
||||
TID: 1001,
|
||||
type: 2,
|
||||
height: 3.0,
|
||||
width: 3.0,
|
||||
lat: 4196584.0,
|
||||
lon: 517728,
|
||||
image: ['assets/images/pilerCar.png']);
|
||||
mapController.addDevice(device);
|
||||
// pilerCenterPoint = PilerPointCalculate(
|
||||
// maindrilldistance.value,
|
||||
// auxdrilldistance.value,
|
||||
@ -34,9 +45,10 @@ class GnssController extends GetxController {
|
||||
pilerCenter = Pos3D(4196584.0, 517728, 0.0);
|
||||
// 插入定时器测试代码
|
||||
timer = Timer.periodic(Duration(seconds: 1), (Timer timer) {
|
||||
pilerCenter.X += 0.2;
|
||||
pilerCenter.Y += 0.2;
|
||||
pilerCenter.rotation = pilerCenter.rotation + pi / 180; // 确保旋转角度在0-360度之间
|
||||
device.x += 0.2;
|
||||
device.y += 0.2;
|
||||
device.rotation = device.rotation + pi / 180; // 确保旋转角度在0-360度之间
|
||||
device.update.value++;
|
||||
});
|
||||
|
||||
gnss = Gnss(port: "/dev/ttysWK2", baudrate: 115200);
|
||||
|
@ -1,6 +1,8 @@
|
||||
import 'package:cpnav/controllers/gnss_Controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:scence_map/controllers/controller.dart';
|
||||
import 'package:scence_map/controllers/plumController.dart';
|
||||
import 'appbar.dart';
|
||||
|
||||
@ -11,7 +13,9 @@ import 'pages/pile/rightDra/pileGenerate.dart';
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); //设置全屏
|
||||
Get.put(ScenceMapController());
|
||||
Get.put(PlumDataController());
|
||||
Get.put(GnssController());
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
@ -75,6 +75,7 @@ flutter:
|
||||
assets:
|
||||
- images/navi_pointer.png
|
||||
- images/satellite.png
|
||||
- images/pilerCar.png
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||
|
Loading…
Reference in New Issue
Block a user