This commit is contained in:
刘媛 2024-11-20 13:12:51 +08:00
parent 22b7993ffc
commit 677705bbbf
5 changed files with 49 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -113,12 +113,21 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
// Navigator.push(context, // Navigator.push(context,
// MaterialPageRoute(builder: (context) => const ScenceMap())), // MaterialPageRoute(builder: (context) => const ScenceMap())),
}, },
child: Row( child: Stack(
children: [ children: [
Text( const SizedBox(
text, width: 20,
style: const TextStyle(fontSize: 12),
), ),
Positioned(
left: -20,
child: Column(
children: [
Text(text)
// Text("${realcontroller.sa.value}"),
// const Text("/"),
// Text("${realcontroller.sv.value}"),
],
)),
Image( Image(
image: const AssetImage('images/satellite.png'), image: const AssetImage('images/satellite.png'),
// width: 40, // width: 40,

View File

@ -1,9 +1,11 @@
import 'dart:math'; import 'dart:math';
import 'dart:developer' as developer;
import 'dart:typed_data'; import 'dart:typed_data';
import 'dart:ui'; import 'dart:ui';
import 'package:cpnav/pages/setting/child_pages/XyChange/xy_change.dart'; import 'package:cpnav/pages/setting/child_pages/XyChange/xy_change.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:scence_map/controllers/controller.dart'; import 'package:scence_map/controllers/controller.dart';
import 'package:scence_map/record_entity.dart';
// import 'package:flutter_webrtc/flutter_webrtc.dart'; // import 'package:flutter_webrtc/flutter_webrtc.dart';
import '../../models/pilePoint/coord_trans.dart'; import '../../models/pilePoint/coord_trans.dart';
@ -225,8 +227,34 @@ class RealController extends GetxController {
Offset offset = Offset(xyh.X, xyh.Y); Offset offset = Offset(xyh.X, xyh.Y);
if ((mapController.centerXY - offset).distance > 40) { if ((mapController.centerXY - offset).distance > 40) {
mapController.centerXY = offset; mapController.centerXY = offset;
mapController.updateCount++;
} }
RecordEntity record = RecordEntity(
tid: 0,
tpId: -1,
id: 0,
startTime: DateTime.now(),
endTime: DateTime.now(),
lat: process.lat,
lng: process.lng,
name: "实时",
times: 1,
x: xyh.X,
y: xyh.Y,
strongDrop: 0,
);
if (mapController.recordList.isEmpty) {
mapController.recordList.add(record);
} else {
int index = mapController.recordList
.lastIndexWhere((element) => element.tpId == -1);
if (index == -1) {
mapController.recordList.add(record);
} else {
mapController.recordList[index] = record;
}
}
mapController.updateCount++;
var centerDev = var centerDev =
mapController.deviceList[settingController.currentDevice.value?.tid]; mapController.deviceList[settingController.currentDevice.value?.tid];
if (centerDev != null) { if (centerDev != null) {
@ -234,16 +262,18 @@ class RealController extends GetxController {
centerDev.update.value++; centerDev.update.value++;
double pitchRad = pitch * pi / 180; double pitchRad = pitch * pi / 180;
double headingRad = (270 - heading) * pi / 180; //(270-) double headingRad = (heading) * pi / 180; //(270-)
centerDev.rotation.value = headingRad; centerDev.rotation.value = (heading + 90) * pi / 180;
// //
double dXY = baseLine * cos(pitchRad); double dXY = baseLine * cos(pitchRad);
// 线 // 线
double carX = xyh.X + dXY * cos(headingRad); double carX = xyh.X + dXY * cos(headingRad);
double carY = xyh.Y + dXY * sin(headingRad); double carY = xyh.Y + dXY * sin(headingRad);
centerDev.x.value = carX; centerDev.x.value = carX;
centerDev.y.value = carY; centerDev.y.value = carY;
developer.log("carX:$carX,carY:$carY");
} }
} }
} }

View File

@ -8,7 +8,7 @@ import '../bluetooth_page.dart';
class SocketSetting { class SocketSetting {
int port = 6060; int port = 6060;
String ip = "192.168.1.206"; String ip = "192.168.1.183";
bool isConnected = false; bool isConnected = false;
int times = 0; int times = 0;
Socket? socket; Socket? socket;

@ -1 +1 @@
Subproject commit 2832f031e1f01b2a0b1f285bc44d80121ecbddb6 Subproject commit 887a9eeaf57b8c757df93ed09cb2ce65999057ea