修改
This commit is contained in:
parent
22b7993ffc
commit
677705bbbf
File diff suppressed because one or more lines are too long
@ -113,12 +113,21 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
// Navigator.push(context,
|
||||
// MaterialPageRoute(builder: (context) => const ScenceMap())),
|
||||
},
|
||||
child: Row(
|
||||
child: Stack(
|
||||
children: [
|
||||
Text(
|
||||
text,
|
||||
style: const TextStyle(fontSize: 12),
|
||||
const SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Positioned(
|
||||
left: -20,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(text)
|
||||
// Text("${realcontroller.sa.value}"),
|
||||
// const Text("/"),
|
||||
// Text("${realcontroller.sv.value}"),
|
||||
],
|
||||
)),
|
||||
Image(
|
||||
image: const AssetImage('images/satellite.png'),
|
||||
// width: 40,
|
||||
|
@ -1,9 +1,11 @@
|
||||
import 'dart:math';
|
||||
import 'dart:developer' as developer;
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui';
|
||||
import 'package:cpnav/pages/setting/child_pages/XyChange/xy_change.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:scence_map/controllers/controller.dart';
|
||||
import 'package:scence_map/record_entity.dart';
|
||||
// import 'package:flutter_webrtc/flutter_webrtc.dart';
|
||||
|
||||
import '../../models/pilePoint/coord_trans.dart';
|
||||
@ -225,8 +227,34 @@ class RealController extends GetxController {
|
||||
Offset offset = Offset(xyh.X, xyh.Y);
|
||||
if ((mapController.centerXY - offset).distance > 40) {
|
||||
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 =
|
||||
mapController.deviceList[settingController.currentDevice.value?.tid];
|
||||
if (centerDev != null) {
|
||||
@ -234,16 +262,18 @@ class RealController extends GetxController {
|
||||
|
||||
centerDev.update.value++;
|
||||
double pitchRad = pitch * pi / 180;
|
||||
double headingRad = (270 - heading) * pi / 180; //(270-)
|
||||
centerDev.rotation.value = headingRad;
|
||||
double headingRad = (heading) * pi / 180; //(270-)
|
||||
centerDev.rotation.value = (heading + 90) * pi / 180;
|
||||
// 计算水平投影距离
|
||||
double dXY = baseLine * cos(pitchRad);
|
||||
|
||||
// 计算副天线的坐标
|
||||
double carX = xyh.X + dXY * cos(headingRad);
|
||||
double carY = xyh.Y + dXY * sin(headingRad);
|
||||
|
||||
centerDev.x.value = carX;
|
||||
centerDev.y.value = carY;
|
||||
developer.log("carX:$carX,carY:$carY");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import '../bluetooth_page.dart';
|
||||
|
||||
class SocketSetting {
|
||||
int port = 6060;
|
||||
String ip = "192.168.1.206";
|
||||
String ip = "192.168.1.183";
|
||||
bool isConnected = false;
|
||||
int times = 0;
|
||||
Socket? socket;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 2832f031e1f01b2a0b1f285bc44d80121ecbddb6
|
||||
Subproject commit 887a9eeaf57b8c757df93ed09cb2ce65999057ea
|
Loading…
Reference in New Issue
Block a user