Compare commits

...

6 Commits
main ... CFG

Author SHA1 Message Date
tanlinxing
8863427829 CFG重新修改 2024-11-21 10:10:51 +08:00
tanlinxing
58ec37a7c5 CFG 2024-11-21 10:01:14 +08:00
tanlinxing
0e3caec53f pile左右栏 2024-11-20 19:42:10 +08:00
ly
677705bbbf 修改 2024-11-20 13:12:51 +08:00
ly
22b7993ffc 车位置 2024-11-18 18:02:15 +08:00
ly
b300935498 液压夯分支 2024-11-18 14:48:54 +08:00
33 changed files with 2103 additions and 1121 deletions

View File

@ -1,17 +1,18 @@
# This is a generated file; do not edit or check into version control.
flutter_webrtc=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\flutter_webrtc-0.9.48+hotfix.1\\
device_info_plus=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\device_info_plus-11.1.1\\
flutter_webrtc=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\flutter_webrtc-0.9.48+hotfix.1\\
libserialport=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\git\\libserialport-d6d27ef7aaf89e4dfa026db0c50dd3053c546710\\
open_settings=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\open_settings-2.0.2\\
path_provider=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider-2.1.5\\
path_provider_android=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_android-2.2.12\\
path_provider_foundation=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_foundation-2.4.0\\
path_provider_linux=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_linux-2.2.1\\
path_provider_windows=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\path_provider_windows-2.3.0\\
permission_handler=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\permission_handler-11.3.1\\
permission_handler_android=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\permission_handler_android-12.0.13\\
permission_handler_apple=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\permission_handler_apple-9.4.5\\
permission_handler_html=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\permission_handler_html-0.1.3+2\\
permission_handler_windows=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\permission_handler_windows-0.2.1\\
quick_blue=D:\\ly\\dart\\A\\new\\pile_nav_new\\plugins\\quick_blue\\
wifi_iot=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\wifi_iot-0.3.19+1\\
wifi_scan=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.flutter-io.cn\\wifi_scan-0.4.1+1\\
open_settings=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\open_settings-2.0.2\\
path_provider=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider-2.1.5\\
path_provider_android=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.12\\
path_provider_foundation=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_foundation-2.4.0\\
path_provider_linux=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_linux-2.2.1\\
path_provider_windows=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_windows-2.3.0\\
permission_handler=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler-11.3.1\\
permission_handler_android=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_android-12.0.13\\
permission_handler_apple=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_apple-9.4.5\\
permission_handler_html=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_html-0.1.3+4\\
permission_handler_windows=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_windows-0.2.1\\
quick_blue=D:\\pile_nav_new\\plugins\\quick_blue\\
wifi_iot=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\wifi_iot-0.3.19+1\\
wifi_scan=C:\\Users\\Administrator\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\wifi_scan-0.4.1+1\\

File diff suppressed because one or more lines are too long

BIN
images/hammer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/hook.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

231
images/index.dart Normal file
View File

@ -0,0 +1,231 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../counter_pointer/sight.dart';
import '../draws/data_type.dart';
import '../draws/scence_map.dart';
import '../getx/polyon.dart';
import 'controller.dart';
import 'direction.dart';
import 'polyon.dart';
import 'real_data.dart';
import 'real_device.dart';
class HomeView extends GetView<PlumDataController> {
const HomeView({super.key});
@override
Widget build(BuildContext context) {
ScenceMapController scenceMapController = Get.find<ScenceMapController>();
PolyonController polyonController = Get.find<PolyonController>();
List<Widget> children = [];
final size = MediaQuery.of(context).size;
return OrientationBuilder(builder: ((context, orientation) {
bool isPortrait = Orientation.portrait == orientation ? true : false;
double topHeight = isPortrait ? size.height / 6 : 0;
if (isPortrait) {
children = [const SightGview()];
} else {
children = [];
}
//
var center = Obx(() {
//
if (controller.isGenerate.value) {
return GestureDetector(
onTapDown: (TapDownDetails details) {
if (controller.checkValue.value == "checkPile") {
controller.centerOffset.value = details.localPosition;
double diagonal = scenceMapController.diagonal;
double mapWidth = scenceMapController.width;
double mapHeight = scenceMapController.height;
Offset offset = Offset(
mapWidth / 2 - diagonal / 2, mapHeight / 2 - diagonal / 2);
Offset sc2xy = scenceMapController
.screen2xy0(details.localPosition - offset);
controller.centerXY.value = sc2xy;
HyRecordItem? checkPoint =
scenceMapController.pointInfo(controller.centerXY.value);
if (checkPoint != null) {
controller.isPileId.value = true;
controller.checkName.value = checkPoint.tpId.toString();
} else {
controller.isPileId.value = false;
controller.checkName.value = "未找到";
}
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return const GenerateDialog();
});
}
},
onScaleStart: (details) {
controller.isUp.value = false;
if (controller.checkValue.value != "checkPile") {
controller.linePoint.value = details.localFocalPoint;
}
controller.shouldPaint.value = true;
},
onScaleUpdate: (details) {
controller.shouldPaint.value = true;
if (controller.checkValue.value != "checkPile") {
if (controller.linePoint.value != details.localFocalPoint) {
controller.updateLinePoint(details.localFocalPoint);
}
}
},
onScaleEnd: (details) {
double deg = (atan2(
controller.linePoint.value.dy -
controller.centerOffset.value.dy,
controller.linePoint.value.dx -
controller.centerOffset.value.dx) *
180 /
pi)
.roundToDouble();
controller.direction.value = deg + 90;
controller.angle.value =
((controller.direction.value * pi / 180) * 100).round() / 100;
controller.isUp.value = true;
controller.shouldPaint.value = false;
},
child: Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
blurRadius: 8,
offset: const Offset(0, 4),
),
],
),
child: Obx(() {
//// --
controller.linePoint.value;
List<Widget> scenceMapViewChildren = [];
if (controller.isGenerate.value) {
scenceMapViewChildren = [];
} else {
scenceMapViewChildren = [const SightGview()];
}
return CustomPaint(
foregroundPainter: DrawDirection(controller),
child: AbsorbPointer(
absorbing: true, //CenterLayout GestureDetector
child: ScenceMapView(scenceMapViewChildren),
));
}),
),
);
//
} else if (polyonController.isRuler.value) {
return const PolyonView( ScenceMapView([]));
} else {
return ScenceMapView(children);
}
});
//
var back = Obx(() => Positioned(
left: controller.isGenerate.value
? controller.centerOffset.value.dx - 25 //
: -50,
top: controller.isGenerate.value
? controller.centerOffset.value.dy + topHeight - 20 // 20
: -50,
width: 50,
height: 40,
child: ClipOval(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
shape: const CircleBorder(),
),
child: const Icon(Icons.keyboard_return),
onPressed: () {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return const GenerateDialog();
});
controller.isDirect.value = false;
},
),
)));
//
var portraitWidget = Column(
children: [
Expanded(flex: 1, child: RealDataVIew()),
Expanded(flex: 5, child: center),
],
);
//
var landscapeWidget = Row(
children: [
Expanded(flex: 2, child: RealDataVIew()),
Expanded(flex: 5, child: center),
const Expanded(flex: 2, child: RealDeviceView()),
],
);
//
var sightWidegt = Positioned(
width: size.width / 9 * 2,
height: size.width / 9 * 2,
bottom: 0,
left: 0,
child: Container(
decoration: const BoxDecoration(color: Colors.transparent),
child: const Card(
elevation: 5.0,
child: SightView(),
)));
return Stack(
children: [
if (isPortrait) portraitWidget else landscapeWidget,
back,
if (!isPortrait) sightWidegt,
],
);
}));
}
}
//
class SightGview extends GetView<SightController> {
const SightGview({super.key});
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Obx(() => Positioned(
left: controller.sightOffset.value.dx,
top: controller.sightOffset.value.dy,
width: size.width / 5 * 2,
height: size.width / 5 * 2,
child: GestureDetector(
onScaleStart: ((details) {
// 17 ?
controller.initSight.value =
Offset(0, size.width / 5 * 2 - 17) + details.localFocalPoint;
controller.sightOffset.value =
details.focalPoint - controller.initSight.value;
}),
onScaleUpdate: (details) {
controller.sightOffset.value =
details.focalPoint - controller.initSight.value;
},
child: Container(
decoration: const BoxDecoration(color: Colors.transparent),
child: const Card(
elevation: 5.0,
child: SightView(),
)),
),
));
}
}

BIN
images/mechinacs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

View File

@ -25,9 +25,9 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
@override
Widget build(BuildContext context) {
const textStyle = TextStyle(fontSize: 16);
const textStyle = TextStyle(fontSize: 20);
return AppBar(
toolbarHeight: 40,
toolbarHeight: 50,
centerTitle: true, //
title: Obx(() {
// pile_cm
@ -83,7 +83,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
},
child: Icon(
appcontroller.isDarkMode.value ? Icons.dark_mode : Icons.sunny,
size: 35,
size: 45,
),
),
),
@ -91,20 +91,53 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
width: 10,
),
Obx(
() => InkWell(
onTap: () {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => const ScenceMap())),
},
child: Image(
image: const AssetImage('images/satellite.png'),
// width: 40,
color: appcontroller.isDarkMode.value
? Colors.white70
: const Color.fromARGB(200, 29, 28, 28),
height: 40,
),
),
() {
Color color = appcontroller.isDarkMode.value
? Colors.white70
: const Color.fromARGB(200, 29, 28, 28);
int status = realcontroller.status.value;
if (status == 4) {
color = Colors.green;
} else if (status == 1) {
color = Colors.red;
} else {
if (status != 0) {
color = Colors.blue;
}
}
String text = "";
text = "${realcontroller.sa.value}/${realcontroller.sv.value}";
return InkWell(
onTap: () {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => const ScenceMap())),
},
child: Stack(
children: [
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,
color: color,
height: 50,
)
],
),
);
},
),
const SizedBox(
width: 10,
@ -124,7 +157,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
},
child: Icon(
Icons.my_location_sharp,
size: 35,
size: 45,
color: aimcontroller.isCardVisible.value
? Colors.blue
// : const Color.fromARGB(200, 29, 28, 28),
@ -145,7 +178,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
},
child: Icon(
Icons.date_range_rounded,
size: 35,
size: 45,
color: isDataVisible.value
? Colors.blue
: (appcontroller.isDarkMode.value

View File

@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:math';
import 'dart:developer' as dev;
import 'package:cpnav/pages/setting/setting_controller.dart';
import 'package:flutter/material.dart';
@ -30,8 +29,8 @@ class GnssController extends GetxController {
var offsetangle = 0.0.obs; //线
late final CoordTrans coordTrans;
RecordEntity? lastPilePoint;
var _dx = 0.0;
var _dy = 0.0;
// var _dx = 0.0;
// var _dy = 0.0;
Timer? timer;
checkDistance() {
if (DateTime.now().millisecondsSinceEpoch -
@ -68,7 +67,7 @@ class GnssController extends GetxController {
@override
void onInit() async {
super.onInit();
mapController = Get.find<ScenceMapController>();
aimcontroller = Get.find<AimPointerController>();
@ -84,10 +83,10 @@ class GnssController extends GetxController {
image: "",
);
}
if (device.x.value == 0 && device.y.value == 0) {
device.x.value = 3790621.123;
device.y.value = 577052.547;
}
// if (device.x.value == 0 && device.y.value == 0) {
// device.x.value = 3790621.123;
// device.y.value = 577052.547;
// }
// device = DeviceItem(
// name: 'GNSS',
// tid: 1001,
@ -108,40 +107,40 @@ class GnssController extends GetxController {
// pilerCenter = Pos3D(4196544.959, 517639.709, 0.0);
//
timer = Timer.periodic(const Duration(seconds: 1), (Timer timer) {
if (lastPilePoint != aimcontroller.selectedPilePoint) {
lastPilePoint = aimcontroller.selectedPilePoint;
if (aimcontroller.selectedPilePoint != null) {
var dx = device.x.value - aimcontroller.selectedPilePoint!.x;
var dy = device.y.value - aimcontroller.selectedPilePoint!.y;
var distance = sqrt(dx * dx + dy * dy);
if (distance > 2) {
dx = (aimcontroller.selectedPilePoint!.x - device.x.value) /
(distance / 2);
dy = (aimcontroller.selectedPilePoint!.y - device.y.value) /
(distance / 2);
device.x.value = aimcontroller.selectedPilePoint!.x + dx;
device.y.value = aimcontroller.selectedPilePoint!.y + dy;
}
_dx = -dx / 10;
_dy = -dy / 10;
}
}
// timer = Timer.periodic(const Duration(seconds: 1), (Timer timer) {
// if (lastPilePoint != aimcontroller.selectedPilePoint) {
// lastPilePoint = aimcontroller.selectedPilePoint;
// if (aimcontroller.selectedPilePoint != null) {
// var dx = device.x.value - aimcontroller.selectedPilePoint!.x;
// var dy = device.y.value - aimcontroller.selectedPilePoint!.y;
// var distance = sqrt(dx * dx + dy * dy);
// if (distance > 2) {
// dx = (aimcontroller.selectedPilePoint!.x - device.x.value) /
// (distance / 2);
// dy = (aimcontroller.selectedPilePoint!.y - device.y.value) /
// (distance / 2);
// device.x.value = aimcontroller.selectedPilePoint!.x + dx;
// device.y.value = aimcontroller.selectedPilePoint!.y + dy;
// }
// _dx = -dx / 10;
// _dy = -dy / 10;
// }
// }
// if ((aimcontroller.selectedPilePoint!.x - device.x).abs() > _dx.abs()) {
device.x.value += _dx;
device.y.value += _dy;
// } else {
// device.x = aimcontroller.selectedPilePoint!.x;
// device.y = aimcontroller.selectedPilePoint!.y;
// }
// // if ((aimcontroller.selectedPilePoint!.x - device.x).abs() > _dx.abs()) {
// device.x.value += _dx;
// device.y.value += _dy;
// // } else {
// // device.x = aimcontroller.selectedPilePoint!.x;
// // device.y = aimcontroller.selectedPilePoint!.y;
// // }
// device.x += 0.05;
// device.y += 0.05;
device.rotation.value += pi / 180; // 0-360
device.update.value++;
checkDistance();
});
// // device.x += 0.05;
// // device.y += 0.05;
// device.rotation.value += pi / 180; // 0-360
// device.update.value++;
// checkDistance();
// });
gnss = Gnss(port: "/dev/ttysWK2", baudrate: 115200);
// gnss = Gnss(port: "COM1", baudrate: 115200);
@ -150,7 +149,7 @@ class GnssController extends GetxController {
} catch (e) {
scaffoldMessengerKey.currentState?.showSnackBar(
SnackBar(
content: Text('发生错误: ${e.toString()}'),
content: Text('发生错误gnss: ${e.toString()}'),
duration: const Duration(seconds: 25),
backgroundColor: Colors.red,
),

View File

@ -13,13 +13,13 @@ import 'pages/history/history_record.dart';
import 'pages/login/login_page.dart';
import 'pages/login/my_routes.dart';
import 'pages/pass_track/view.dart';
import 'pages/real/index.dart';
import 'pages/real/real_controller.dart';
import 'pages/dataAndDevice/controller.dart';
import 'pages/setting/child_pages/antenna/antenna_setting.dart';
import 'pages/setting/child_pages/connect/config/socket_setting.dart';
import 'pages/setting/setting_controller.dart';
import 'pages/setting/setting_page.dart';
import 'pages/setting/child_pages/XyChange/connect.dart';
import 'pages/task/taskcontroller.dart';
import 'service/user/loginprefs.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
@ -31,8 +31,8 @@ import '../../controllers/gnss_controller.dart';
final AppController appcontroller = Get.put(AppController());
final GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey =
GlobalKey<ScaffoldMessengerState>();
Connect connect = Connect();
// Connect connect = Connect();
SocketSetting socket = SocketSetting();
void main() async {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); //
@ -42,11 +42,14 @@ void main() async {
Get.put(PhoneLoginController());
Get.put(ScenceMapController());
Get.put(AimPointerController());
Get.put(RealController());
Get.put(RealDataController());
Get.put(PlumRealDataController());
LoginPrefs loginPrefs = LoginPrefs();
String value =
await loginPrefs.init(); // await await等待异步方法执行完毕
if ('ok' == value) {
// connect.init();
socket.connect();
// loginPrefs.removeToken(); //
runApp(const MyApp());
}
@ -92,7 +95,7 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
late bool isPortrait;
late double appBarHeight = 34.0;
late double appBarHeight = 44.0;
bool isInitialized = false;
@override
void initState() {
@ -100,13 +103,13 @@ class _MyHomePageState extends State<MyHomePage> {
SettingController settingController = Get.put(SettingController());
SchedulerBinding.instance.addPostFrameCallback((_) async {
settingController.getDeviceId(context);
await loadData(settingController);
setState(() {
isInitialized = settingController.isInitialized;
Get.put(PlumDataController());
Get.put(AntennaController());
Get.put(TaskController());
Get.put(RealController());
Get.put(GnssController());
});
});
@ -123,7 +126,7 @@ class _MyHomePageState extends State<MyHomePage> {
}
final List<Widget> pages = [
// const Real(),
PassTrack(),
PassTackAndDevice(),
const TaskManagePage(),
const HistoryRecord(),
const SettingPortrait()
@ -134,16 +137,15 @@ class _MyHomePageState extends State<MyHomePage> {
appBar: PreferredSize(
preferredSize: Size.fromHeight(appBarHeight),
child: CustomAppBar(
appBarHeight: 56,
appBarHeight: 66,
currentIndex: appcontroller.currentIndex,
),
),
body: OrientationBuilder(
builder: (context, orientation) {
// final size = MediaQuery.of(context).size;
appBarHeight = Orientation.portrait == orientation ? 56.0 : 34.0;
appBarHeight = Orientation.portrait == orientation ? 66.0 : 44.0;
isPortrait = Orientation.portrait == orientation ? true : false;
appBarHeight = Orientation.portrait == orientation ? 56.0 : 34.0;
return Obx(() {
appcontroller.currentIndex.value;
if (!isPortrait) {

View File

@ -15,11 +15,10 @@ final GnssController gnsscontroller = Get.find<GnssController>();
// ignore: must_be_immutable
class AimPointer extends GetView<AimPointerController> {
String gradienter = "0";
AimPointer({super.key}); //
final Size size;
AimPointer({super.key, required this.size}); //
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
final mediaQueryData = MediaQueryData.fromView(View.of(context)); //
final orientation = mediaQueryData.orientation; //
bool isPortrait = Orientation.portrait == orientation ? true : false;
@ -27,17 +26,17 @@ class AimPointer extends GetView<AimPointerController> {
final deviceType = getDeviceType(context);
if (orientation == Orientation.landscape) {
rectWidth = size.width / 2 - 60;
if (deviceType == DeviceType.mobile) {
rectWidth = size.height - 130;
}
} else {
rectWidth = size.height / 2;
if (deviceType == DeviceType.mobile) {
rectWidth = size.width - 5;
}
}
// if (orientation == Orientation.landscape) {
// rectWidth = size.width / 2 - 60;
// if (deviceType == DeviceType.mobile) {
// rectWidth = size.height - 60;
// }
// } else {
// rectWidth = size.height / 2;
// if (deviceType == DeviceType.mobile) {
// rectWidth = size.width - 5;
// }
// }
bool isDarkMode = Theme.of(context).brightness == Brightness.dark;
List<Widget> children = [
SizedBox(
@ -50,6 +49,7 @@ class AimPointer extends GetView<AimPointerController> {
borderRadius: BorderRadius.circular(4.0), //
),
child: Container(
width: rectWidth,
height: rectWidth,
@ -85,29 +85,17 @@ class AimPointer extends GetView<AimPointerController> {
},
);
})),
Positioned(
right: 0,
top: 0,
child: IconButton(
icon: const Icon(Icons.close),
onPressed: () {
//
aimcontroller.isCardVisible.value = false;
aimcontroller.lastCloseTapTime =
DateTime.now().millisecondsSinceEpoch;
},
),
),
Positioned(
top: 30,
right: 10,
child: TextButton(
child: Text(
"垂直度:$gradienter°",
style: const TextStyle(fontSize: 20),
),
onPressed: () {},
)),
// Positioned(
// top: 30,
// right: 10,
// child: TextButton(
// child: Text(
// "垂直度:$gradienter°",
// style: const TextStyle(fontSize: 20),
// ),
// onPressed: () {},
// )),
Obx(() {
var pixel2MeterRatio =
aimcontroller.plot.value * 2 / rectWidth;
@ -148,9 +136,10 @@ class AimPointer extends GetView<AimPointerController> {
aimcontroller.x.value / pixel2MeterRatio,
child: Transform(
transform: Matrix4.identity()
..rotateZ(gnsscontroller.device.rotation.value +
pi / 2 +
mapcontroller.rotation.value),
..rotateZ(
gnsscontroller.device.rotation.value +
pi / 2 +
mapcontroller.rotation.value),
alignment: FractionalOffset.center,
child: Stack(
alignment: Alignment.center,
@ -331,11 +320,12 @@ class DrawAxis extends CustomPainter {
//
class SightGview extends StatelessWidget {
const SightGview({super.key});
const SightGview({super.key, required this.size});
final Size size;
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
final mediaQueryData = MediaQueryData.fromView(View.of(context)); //
final orientation = mediaQueryData.orientation; //
double rectWidth = size.width;
@ -354,7 +344,9 @@ class SightGview extends StatelessWidget {
return Obx(() => Visibility(
visible: aimcontroller.isCardVisible.value,
child: Positioned(
child:
Stack(children: [
Positioned(
left: aimcontroller.sightOffset.value.dx,
top: aimcontroller.sightOffset.value.dy,
width: rectWidth + 15,
@ -378,9 +370,24 @@ class SightGview extends StatelessWidget {
Card(
color: Colors.transparent,
elevation: 5.0,
child: AimPointer(),
child: AimPointer(size: Size(rectWidth, rectWidth)),
),
]))
])))));
])),
Positioned(
right: 10,
top: 5,
child: IconButton(
icon: const Icon(Icons.close),
onPressed: () {
//
aimcontroller.isCardVisible.value = false;
aimcontroller.lastCloseTapTime =
DateTime.now().millisecondsSinceEpoch;
},
),
)
]))),])
));
}
}

View File

@ -0,0 +1,150 @@
import 'dart:async';
import 'dart:core';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:roslibdart/roslibdart.dart';
import '../../service/base.dart';
class PlumRealDataController extends GetxController {
var isGenerate = false.obs; //
var angle = 0.0.obs; //
var isDirect = false.obs; //
var checkValue = "".obs; //checkPile -,checkDirection-
var checkName = "".obs;
var centerXY = Offset.zero.obs; //
var space = 5.0.obs; // m
var genLenth = 0.obs; //
var isPileId = false.obs;
var direction = 0.0.obs; //
var centerOffset = Offset.zero.obs;
var linePoint = Offset.zero.obs;
var isUp = false.obs;
var plumList = [].obs;
var shouldPaint = true.obs;
late Service service;
late Ros ros;
@override
void onInit() async {
super.onInit();
ros = BaseService().getRos();
// ros.connect();
// service = Service(
// name: '/smash_point_list_service',
// ros: ros,
// type: "nav2_smash_behavior/srv/SmashPointList");
// var json = {'data': []};
// service.call(json).then((value) {
// print('ros$value');
// });
}
updateLinePoint(Offset offset) {
linePoint.value = offset;
update();
}
// plumList
void listenToPlumList() {
plumList.listen((list) {
var points = [];
for (var i = 0; i < list.length; i++) {
Offset item = list[i];
points.add({"x": item.dx, "y": item.dy, "z": 0});
}
service
.call({"points": points})
.then((value) => {print("----$value")})
.catchError((e) => {print(e)});
}, onError: (err) {
//
});
}
}
class RealDataController extends GetxController {
final time = DateTime.now().obs;
final tid = 100.obs;
final name = '桩点名称'.obs;
final sid = '10.222'.obs;
final times = 10.obs;
final isClicked = false.obs;
late final lineDis = 110.0.obs;
late final distance = 460.0.obs;
var isHooked = false.obs;
late Topic topic;
late Ros ros;
double g = 9.8; //
double t = 0; //
@override
void onInit() async {
super.onInit();
ros = BaseService().getRos();
// ros.connect();
// topic = Topic(
// ros: ros,
// name: '/your_topic',
// type: 'std_msgs/String',
// );
// // ROS
// topic.subscribe((message) async {
// print('Received message: $message');
// });
// ActionClient action = ActionClient(
// ros: ros,
// actionName: '/virtual_odom',
// serverName: 'virtual_odom_publisher_behavior/action/PublishVirtualOdom',
// goalName: "/target_pose",
// goalType: 'geometry_msgs/PoseStamped');
// await action.init();
// action.feedbacker.subscription!.listen((message) {
// String g = message['status']['goal_id']['id'];
// action.goals[g]!.stream.listen((data) {
// // status
// print('Status changed: ${data['status']}');
// });
// });
// Map message = {
// 'target_pose': {
// 'header': {'frame_id': 'map'},
// 'pose': {
// 'position': {'x': 10.0, 'y': 10.0, 'z': 0.0},
// 'orientation': {'x': 0.0, 'y': 0.0, 'z': 0.0, 'w': 1.0}
// }
// }
// };
// action.send(message);
//
Timer.periodic(const Duration(milliseconds: 100), (_) {
time.value = DateTime.now();
if (!isHooked.value && lineDis < 560 && distance >= 460) {
lineDis.value += 10; // 10
} else if (lineDis > 110 && distance <= 460) {
isHooked.value = true;
distance.value -= 10;
lineDis.value -= 10;
} else if (distance.value < 460) {
isHooked.value = false;
t += 1; // 1
distance.value = 0.5 * g * t * t;
if (distance.value >= 460) {
distance.value = 460;
t = 0;
}
lineDis.value = 110;
}
});
}
@override
void dispose() async {
super.dispose();
await ros.close();
}
}

View File

@ -0,0 +1,163 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../../service/pile/device_type.dart';
import '../../service/pile/input.dart';
import '../../service/pile/public_widget.dart';
import '../aim_point/aimpoint_page.dart';
import 'controller.dart';
class RealDataContainer extends StatelessWidget {
final RealDataController controller = Get.find<RealDataController>();
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
double rectWidth = size.width;
return Container(
child: Stack(
children: [
RealDataVIew(),
Positioned(
bottom: 120, //
left: 5, //
child: Container(
decoration: const BoxDecoration(color: Colors.transparent),
child: Stack(children: [
Card(
color: Colors.transparent,
elevation: 0,
child: AimPointer(size: Size(250, 250)),
),
]))),
Positioned(
bottom: 30,
left: 35,
child: Obx(() => ElevatedButton(
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(Size(200, 70)),
backgroundColor: MaterialStateProperty.all(
const Color.fromARGB(255, 226, 220, 220),
),
),
child: Text(
controller.isClicked.value ? ' 暂停 ' : ' 开始 ',
style: TextStyle(
fontSize: 28,
color: controller.isClicked.value
? Colors.red
: Colors.green,
),
),
onPressed: () {
controller.isClicked.value = !controller.isClicked.value;
},
)),
),
],
),
);
}
}
class RealDataVIew extends GetView<RealDataController> {
RealDataVIew({super.key});
final PlumRealDataController plumDataController =
Get.find<PlumRealDataController>();
@override
Widget build(BuildContext context) {
double fontSize = 16;
DeviceType deviceType = getDeviceType(context);
if (deviceType == DeviceType.mobile) {
fontSize = 16;
} else {
fontSize = 20;
}
return Container(
clipBehavior: Clip.hardEdge,
alignment: Alignment.centerLeft,
// height: 130,
padding: const EdgeInsets.symmetric(horizontal: 5),
decoration:
BoxDecoration(border: Border.all(color: Colors.black, width: 1)),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
// Stack(children: [
// Positioned(
// width: 20,
// height: 20,
// child: Card(
// color: Colors.transparent,
// elevation: 5.0,
// child:
// ),
// )
// ]),
const SizedBox(
height: 20,
),
Wrap(
children: [
Obx(() => Text(
DateFormat('yy-MM-dd HH:mm:ss').format(controller.time.value),
style: const TextStyle(fontSize: 20, height: 2),
)),
],
),
SingleChildScrollView(
child: Theme(
data: ThemeData(
textTheme: TextTheme(
titleLarge: TextStyle(
fontSize: fontSize,
fontWeight: FontWeight.normal,
),
)),
child: Obx(() => Wrap(
children: [
// Text(
// '工作区域:$txt ',
// style: textStyle,
// ),
// Text(
// '工作层级:$txt ',
// style: textStyle,
// ),
Text(
'设备编号:${controller.tid.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
Text(
// '桩点名称:${controller.name.value} ',
'桩点名称:${controller.name.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
Text(
// '夯沉量:${controller.sid.value} ',
'桩深:${controller.sid.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
Text(
// '次:${controller.times.value} ',
'垂直度:${controller.times.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
Text(
// '次:${controller.times.value} ',
'电流:${controller.times.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
Text(
// '次:${controller.times.value} ',
'灌注量:${controller.times.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
],
))),
),
]),
);
}
}

View File

@ -0,0 +1,98 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../service/pile/device_type.dart';
import 'controller.dart';
class RealDeviceView extends GetView<RealDataController> {
const RealDeviceView({super.key});
@override
Widget build(BuildContext context) {
DeviceType deviceType = getDeviceType(context);
final size = MediaQuery.of(context).size;
double imageW = size.width / 4 - 20;
double imageH = size.height - 40;
double rad = 0.10625;
// double distance = 0;
double hammerDis = 50; //
double hookDis = 30;
bool isMobile = deviceType != DeviceType.mobile ? false : true;
double lineTop = deviceType != DeviceType.mobile
? (rad * size.height).floorToDouble() - 45
: (rad / 2 * size.height).floorToDouble() - 45;
return Obx(() {
return Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.black, width: 1),
),
child: Stack(
children: [
//
Positioned(
bottom: 45,
left: 0,
width: imageW,
height: imageH,
child: const Image(
image: AssetImage(
'images/mechinacs.png',
),
),
),
// 线
Positioned(
top: lineTop,
left: isMobile ? 35 : 32,
width: 3,
height: controller.lineDis.value,
child: CustomPaint(
painter: LinePainter(),
),
),
//
Positioned(
left: isMobile ? 10 : 8,
top: lineTop + 110 + controller.distance.value,
width: 50,
height: hammerDis,
child: const Image(image: AssetImage('images/hammer.png')),
),
//
Positioned(
top: lineTop + controller.lineDis.value,
left: isMobile ? 20 : 18,
width: 30,
height: hookDis,
child: const Image(
image: AssetImage('images/hook.png'),
fit: BoxFit.contain,
),
),
],
),
);
});
}
}
class LinePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = Colors.black
..strokeWidth = 3;
// 线
canvas.drawLine(Offset(0, 0), Offset(0, size.height), paint);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return false;
}
}

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../real/component/chart.dart';
class MyLineChart extends StatefulWidget {
final int pileId;
@ -32,9 +31,10 @@ class _MyLineChartState extends State<MyLineChart> {
),
body: SizedBox(
height: size.height - 30,
child: ProcessChart(
pileId: widget.pileId,
)),
// child: ProcessChart(
// pileId: widget.pileId,
// )
),
);
}
}

View File

@ -5,7 +5,6 @@ import 'package:intl/intl.dart';
import 'package:scence_map/record_entity.dart';
import '../../service/base.dart';
import '../setting/project/model.dart';
import 'line_chart.dart';
class RecordDataSourceAsync extends AsyncDataTableSource {
bool _empty = false;

View File

@ -20,6 +20,8 @@ class PassTrackController extends GetxController {
var updateCount = 0.obs;
var date = "2023-11-1".obs;
RecordEntity? currentPoint;
var isDeviceShow = false.obs;
PassTrackController();
@override
@ -51,7 +53,7 @@ class PassTrackController extends GetxController {
}
}
loadCoorTrans() async {}
loadSideLine() async {
mapController.sideLinListeMap.clear();
@ -136,14 +138,14 @@ class PassTrackController extends GetxController {
String now = DateFormat('yyyy-MM-dd').format(DateTime.now());
if ((currentPoint == null && date.value == now) ||
(DateFormat('yyyy-MM-dd').format(currentPoint!.startTime) == now)) {
log("${currentPoint?.startTime},now:$now");
scaffoldMessengerKey.currentState?.showSnackBar(
SnackBar(
content: Text('提示: ${date.value}暂无施工数据'),
duration: const Duration(seconds: 5),
backgroundColor: const Color.fromARGB(255, 230, 162, 60),
),
);
// scaffoldMessengerKey.currentState?.showSnackBar(
// SnackBar(
// content: Text('提示: ${date.value}暂无施工数据'),
// duration: const Duration(seconds: 5),
// backgroundColor: const Color.fromARGB(255, 230, 162, 60),
// ),
// );
}
}
mapController.updateCount++;

View File

@ -10,21 +10,50 @@ import 'package:intl/intl.dart';
import 'package:scence_map/controllers/controller.dart';
import 'package:scence_map/record_entity.dart';
import 'package:scence_map/scence_map.dart';
import '../../service/pile/device_type.dart';
import '../aim_point/aimpoint_controller.dart';
import '../dataAndDevice/real_data.dart';
import '../dataAndDevice/real_device.dart';
import '../real/real_data_card.dart';
import "controller.dart";
ScenceMapController mapcontroller = Get.put(ScenceMapController());
// class PassTrack extends StatefulWidget {
// final String date;
// final controller;
class PassTackAndDevice extends StatelessWidget {
final RecordEntity? currentPoint;
PassTackAndDevice({this.currentPoint});
final controller = Get.put(PassTrackController());
// const PassTrack({super.key, required this.date, this.controller});
// @override
// State<PassTrack> createState() => _PasstrackState();
// }
@override
Widget build(BuildContext context) {
if (controller.isDeviceShow.value) {
return Row(
children: [
Expanded(
flex: 2,
child: RealDeviceView(),
),
Expanded(
flex: 5,
child: PassTrack(currentPoint: currentPoint),
),
Expanded(flex: 2, child: RealDataContainer()),
],
);
} else {
return Row(
children: [
Expanded(
flex: 7,
child: PassTrack(currentPoint: currentPoint),
),
Expanded(flex: 2, child: RealDataContainer()),
],
);
}
}
}
// ignore: must_be_immutable
class PassTrack extends GetView<PassTrackController> {
@ -33,7 +62,7 @@ class PassTrack extends GetView<PassTrackController> {
RecordEntity? currentPoint;
@override
final controller = Get.put(PassTrackController());
final aimcontroller = Get.find<AimPointerController>();
// String str = "播放";
// int sWidth = 0;
// int bits = -1;
@ -62,7 +91,10 @@ class PassTrack extends GetView<PassTrackController> {
controller,
)
: null;
return OrientationBuilder(builder: (context, orientation) {
final size = MediaQuery.of(context).size;
return Stack(
children: [
ScenceMapView(
@ -79,7 +111,7 @@ class PassTrack extends GetView<PassTrackController> {
},
children: const [],
),
const SightGview(),
SightGview(size: size),
const RealDataShow(),
],
);

View File

@ -1,368 +1,368 @@
import 'dart:math';
import 'dart:developer' as dev;
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:intl/intl.dart';
import '../../../service/base.dart';
import '../../setting/project/model.dart';
import '../process.dart';
// import 'dart:math';
// import 'dart:developer' as dev;
// import 'package:flutter/material.dart';
// import 'package:flutter/scheduler.dart';
// import 'package:flutter/services.dart';
// import 'package:fl_chart/fl_chart.dart';
// import 'package:intl/intl.dart';
// import '../../../service/base.dart';
// import '../../setting/project/model.dart';
// import '../process.dart';
class ProcessChart extends StatefulWidget {
final int pileId;
const ProcessChart({super.key, required this.pileId});
// class ProcessChart extends StatefulWidget {
// final int pileId;
// const ProcessChart({super.key, required this.pileId});
@override
State<ProcessChart> createState() => _ProcessChartState();
}
// @override
// State<ProcessChart> createState() => _ProcessChartState();
// }
class _ProcessChartState extends State<ProcessChart> {
List<ProcessEntity> processList = [];
List<Widget> chartTitleWidget = [];
// class _ProcessChartState extends State<ProcessChart> {
// List<ProcessEntity> processList = [];
// List<Widget> chartTitleWidget = [];
@override
void initState() {
super.initState();
fetchData();
}
// @override
// void initState() {
// super.initState();
// fetchData();
// }
int maxX = 5;
int maxYL = 14; //
int maxYR = 0; //10cm
ChartData chartData = ChartData([]);
void fetchData() async {
try {
SchedulerBinding.instance.addPostFrameCallback((_) async {
ProjectModel project = settingController.currentProject.value!;
String projType = settingController.projType;
//
List detailCdate = await services.getProcessData(
widget.pileId,
project.projCode,
projType,
);
// int maxX = 5;
// int maxYL = 14; //
// int maxYR = 0; //10cm
// ChartData chartData = ChartData([]);
// void fetchData() async {
// try {
// SchedulerBinding.instance.addPostFrameCallback((_) async {
// ProjectModel project = settingController.currentProject.value!;
// String projType = settingController.projType;
// //
// List detailCdate = await services.getProcessData(
// widget.pileId,
// project.projCode,
// projType,
// );
setState(() {
double ten1Max = 0;
double ten2Max = 0;
for (var i = 0; i < detailCdate.length; i++) {
ProcessEntity process = ProcessEntity.fromJson(detailCdate[i]);
processList.add(process);
// ()(10cm流量)
maxYL = max(maxYL, process.depth.ceil());
ten1Max = max(ten1Max, process.subtotalFlow1);
ten2Max = max(ten2Max, process.subtotalFlow2);
maxYR = max(ten2Max.ceil(), ten1Max.ceil());
}
int radtio = (maxYR / maxYL).ceil();
chartData = ChartData(processList, maxX, maxYL, maxYR, radtio);
chartTitleWidget = chartData.chartTitleWeidget();
});
});
} catch (e) {
dev.log("错误");
setState(() {
processList = [];
});
}
}
// setState(() {
// double ten1Max = 0;
// double ten2Max = 0;
// for (var i = 0; i < detailCdate.length; i++) {
// ProcessEntity process = ProcessEntity.fromJson(detailCdate[i]);
// processList.add(process);
// // ()(10cm流量)
// maxYL = max(maxYL, process.depth.ceil());
// ten1Max = max(ten1Max, process.subtotalFlow1);
// ten2Max = max(ten2Max, process.subtotalFlow2);
// maxYR = max(ten2Max.ceil(), ten1Max.ceil());
// }
// int radtio = (maxYR / maxYL).ceil();
// chartData = ChartData(processList, maxX, maxYL, maxYR, radtio);
// chartTitleWidget = chartData.chartTitleWeidget();
// });
// });
// } catch (e) {
// dev.log("错误");
// setState(() {
// processList = [];
// });
// }
// }
@override
void dispose() {
super.dispose();
SystemChrome.setPreferredOrientations([]);
}
// @override
// void dispose() {
// super.dispose();
// SystemChrome.setPreferredOrientations([]);
// }
@override
Widget build(BuildContext context) {
return Stack(
children: [
Positioned(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: chartTitleWidget)),
LineChart(chartData.lineChart)
],
);
}
}
// @override
// Widget build(BuildContext context) {
// return Stack(
// children: [
// Positioned(
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: chartTitleWidget)),
// LineChart(chartData.lineChart)
// ],
// );
// }
// }
class ChartTileModel {
String title;
Color colors;
ChartTileModel(
this.title,
this.colors,
);
}
// class ChartTileModel {
// String title;
// Color colors;
// ChartTileModel(
// this.title,
// this.colors,
// );
// }
class ChartData {
List<ProcessEntity> processList;
int maxX;
// 3
int maxYL;
int maxYR;
int radtio;
List<ChartTileModel> chartTitle = [
ChartTileModel("深度:", Colors.green),
ChartTileModel("10cm流量1", Colors.pink),
ChartTileModel("10cm流量2", Colors.cyan),
];
ChartData(this.processList,
[this.maxX = 5, this.maxYL = 14, this.maxYR = 100, this.radtio = 8]);
// class ChartData {
// List<ProcessEntity> processList;
// int maxX;
// // 3
// int maxYL;
// int maxYR;
// int radtio;
// List<ChartTileModel> chartTitle = [
// ChartTileModel("深度:", Colors.green),
// ChartTileModel("10cm流量1", Colors.pink),
// ChartTileModel("10cm流量2", Colors.cyan),
// ];
// ChartData(this.processList,
// [this.maxX = 5, this.maxYL = 14, this.maxYR = 100, this.radtio = 8]);
List<Widget> chartTitleWeidget() {
List<Widget> chartTitleWidget = [];
for (var i = 0; i < chartTitle.length; i++) {
ChartTileModel tileModel = chartTitle[i];
List<Widget> item = [
Text(tileModel.title),
Container(
width: 13,
height: 8,
margin: const EdgeInsets.only(right: 5),
decoration: BoxDecoration(color: tileModel.colors),
),
const SizedBox(
width: 10,
height: 10,
),
];
chartTitleWidget.addAll(item);
}
return chartTitleWidget;
}
// List<Widget> chartTitleWeidget() {
// List<Widget> chartTitleWidget = [];
// for (var i = 0; i < chartTitle.length; i++) {
// ChartTileModel tileModel = chartTitle[i];
// List<Widget> item = [
// Text(tileModel.title),
// Container(
// width: 13,
// height: 8,
// margin: const EdgeInsets.only(right: 5),
// decoration: BoxDecoration(color: tileModel.colors),
// ),
// const SizedBox(
// width: 10,
// height: 10,
// ),
// ];
// chartTitleWidget.addAll(item);
// }
// return chartTitleWidget;
// }
LineChartData get lineChart => LineChartData(
lineTouchData: lineTouchData,
gridData: gridData,
titlesData: titlesData,
borderData: borderData,
lineBarsData: lineBarsData,
minX: 0,
maxX: maxX.toDouble(),
maxY: maxYR.toDouble(),
minY: 0,
);
// LineChartData get lineChart => LineChartData(
// lineTouchData: lineTouchData,
// gridData: gridData,
// titlesData: titlesData,
// borderData: borderData,
// lineBarsData: lineBarsData,
// minX: 0,
// maxX: maxX.toDouble(),
// maxY: maxYR.toDouble(),
// minY: 0,
// );
LineTouchData get lineTouchData => LineTouchData(
handleBuiltInTouches: true,
touchTooltipData: LineTouchTooltipData(
fitInsideHorizontally: true,
fitInsideVertically: true,
// tooltipBgColor: Colors.black38.withOpacity(0.8),
getTooltipItems: (List<LineBarSpot> touchedSpots) {
//
return touchedSpots.map((LineBarSpot touchedSpot) {
//
final x = touchedSpot.x;
int index = (x / maxX * processList.length).round();
ProcessEntity process = processList[index];
String lineToolValue = "";
TextStyle lineToolStyle = const TextStyle(
color: Colors.green,
);
// LineTouchData get lineTouchData => LineTouchData(
// handleBuiltInTouches: true,
// touchTooltipData: LineTouchTooltipData(
// fitInsideHorizontally: true,
// fitInsideVertically: true,
// // tooltipBgColor: Colors.black38.withOpacity(0.8),
// getTooltipItems: (List<LineBarSpot> touchedSpots) {
// //
// return touchedSpots.map((LineBarSpot touchedSpot) {
// //
// final x = touchedSpot.x;
// int index = (x / maxX * processList.length).round();
// ProcessEntity process = processList[index];
// String lineToolValue = "";
// TextStyle lineToolStyle = const TextStyle(
// color: Colors.green,
// );
if (touchedSpot.barIndex == 0) {
lineToolValue =
"时间:${DateFormat('HH:mm:ss').format(DateTime.parse(process.recvTime)).toString()}\n深度:${process.depth}\n累计流量:${process.toatalFlow1}";
lineToolStyle = const TextStyle(color: Colors.green);
} else if (touchedSpot.barIndex == 1) {
lineToolValue = "10cm流量1:${process.subtotalFlow1}";
lineToolStyle = const TextStyle(color: Colors.pink);
} else if (touchedSpot.barIndex == 2) {
lineToolValue = "10cm流量2:${process.subtotalFlow2}";
lineToolStyle = const TextStyle(color: Colors.cyan);
}
// if (touchedSpot.barIndex == 0) {
// lineToolValue =
// "时间:${DateFormat('HH:mm:ss').format(DateTime.parse(process.recvTime)).toString()}\n深度:${process.depth}\n累计流量:${process.toatalFlow1}";
// lineToolStyle = const TextStyle(color: Colors.green);
// } else if (touchedSpot.barIndex == 1) {
// lineToolValue = "10cm流量1:${process.subtotalFlow1}";
// lineToolStyle = const TextStyle(color: Colors.pink);
// } else if (touchedSpot.barIndex == 2) {
// lineToolValue = "10cm流量2:${process.subtotalFlow2}";
// lineToolStyle = const TextStyle(color: Colors.cyan);
// }
return LineTooltipItem(lineToolValue, lineToolStyle,
textAlign: TextAlign.left);
}).toList();
},
),
);
// FlGridData get gridData => const FlGridData(show: false);
//
FlGridData get gridData => const FlGridData(drawHorizontalLine: true);
//
FlTitlesData get titlesData => FlTitlesData(
bottomTitles: AxisTitles(
sideTitles: bottomTitles,
),
rightTitles: AxisTitles(
sideTitles: rightTitles(),
),
topTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
leftTitles: AxisTitles(
sideTitles: leftTitles(),
),
);
// return LineTooltipItem(lineToolValue, lineToolStyle,
// textAlign: TextAlign.left);
// }).toList();
// },
// ),
// );
// // FlGridData get gridData => const FlGridData(show: false);
// //
// FlGridData get gridData => const FlGridData(drawHorizontalLine: true);
// //
// FlTitlesData get titlesData => FlTitlesData(
// bottomTitles: AxisTitles(
// sideTitles: bottomTitles,
// ),
// rightTitles: AxisTitles(
// sideTitles: rightTitles(),
// ),
// topTitles: const AxisTitles(
// sideTitles: SideTitles(showTitles: false),
// ),
// leftTitles: AxisTitles(
// sideTitles: leftTitles(),
// ),
// );
SideTitles get bottomTitles => SideTitles(
showTitles: true,
reservedSize: 32,
interval: 1,
getTitlesWidget: bottomTitleWidgets,
);
SideTitles leftTitles() => SideTitles(
getTitlesWidget: leftTitleWidgets,
showTitles: true,
interval: 1,
reservedSize: 40,
);
SideTitles rightTitles() => SideTitles(
getTitlesWidget: rightTitleWidgets,
showTitles: true,
interval: 1,
reservedSize: 40,
);
// SideTitles get bottomTitles => SideTitles(
// showTitles: true,
// reservedSize: 32,
// interval: 1,
// getTitlesWidget: bottomTitleWidgets,
// );
// SideTitles leftTitles() => SideTitles(
// getTitlesWidget: leftTitleWidgets,
// showTitles: true,
// interval: 1,
// reservedSize: 40,
// );
// SideTitles rightTitles() => SideTitles(
// getTitlesWidget: rightTitleWidgets,
// showTitles: true,
// interval: 1,
// reservedSize: 40,
// );
//x轴
Widget bottomTitleWidgets(double value, TitleMeta meta) {
const style = TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
);
// //x轴
// Widget bottomTitleWidgets(double value, TitleMeta meta) {
// const style = TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 14,
// );
String getTimeFromIndex(int index) {
if (processList.isEmpty || index < 0 || index >= processList.length) {
return '';
}
return processList[index].recvTime.toString().split(" ")[1];
}
// String getTimeFromIndex(int index) {
// if (processList.isEmpty || index < 0 || index >= processList.length) {
// return '';
// }
// return processList[index].recvTime.toString().split(" ")[1];
// }
int index;
// int index;
switch (value.toInt()) {
case 0:
index = 0;
break;
case 1:
index = (processList.length / 5).round();
break;
case 2:
index = (processList.length * 2 / 5).round();
break;
case 3:
index = (processList.length * 3 / 5).round();
break;
case 4:
index = (processList.length * 4 / 5).round();
break;
case 5:
index = processList.length - 1;
break;
default:
return SideTitleWidget(
axisSide: meta.axisSide,
space: 10,
child: const Text(''),
);
}
// switch (value.toInt()) {
// case 0:
// index = 0;
// break;
// case 1:
// index = (processList.length / 5).round();
// break;
// case 2:
// index = (processList.length * 2 / 5).round();
// break;
// case 3:
// index = (processList.length * 3 / 5).round();
// break;
// case 4:
// index = (processList.length * 4 / 5).round();
// break;
// case 5:
// index = processList.length - 1;
// break;
// default:
// return SideTitleWidget(
// axisSide: meta.axisSide,
// space: 10,
// child: const Text(''),
// );
// }
return SideTitleWidget(
axisSide: meta.axisSide,
space: 10,
child: Text(
getTimeFromIndex(index),
style: style,
),
);
}
// return SideTitleWidget(
// axisSide: meta.axisSide,
// space: 10,
// child: Text(
// getTimeFromIndex(index),
// style: style,
// ),
// );
// }
final style = const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
);
//y轴
Widget leftTitleWidgets(double value, TitleMeta meta) {
String text;
int intValue = (value).ceil();
if (intValue % (2 * radtio) == 0 && intValue <= maxYR) {
text = (intValue / radtio).floor().toString();
if (maxYR - intValue < 2 * radtio) {
text = "深度(m)";
}
} else {
return const Text("");
}
// final style = const TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 14,
// );
// //y轴
// Widget leftTitleWidgets(double value, TitleMeta meta) {
// String text;
// int intValue = (value).ceil();
// if (intValue % (2 * radtio) == 0 && intValue <= maxYR) {
// text = (intValue / radtio).floor().toString();
// if (maxYR - intValue < 2 * radtio) {
// text = "深度(m)";
// }
// } else {
// return const Text("");
// }
return Text(text, style: style, textAlign: TextAlign.center);
}
// return Text(text, style: style, textAlign: TextAlign.center);
// }
//y轴
Widget rightTitleWidgets(double value, TitleMeta meta) {
String text;
int intValue = value.toInt();
// //y轴
// Widget rightTitleWidgets(double value, TitleMeta meta) {
// String text;
// int intValue = value.toInt();
if (intValue >= 0 && intValue % (2 * radtio) == 0 && intValue <= maxYR) {
text = (intValue.ceil()).toString();
if (maxYR - intValue < 2 * radtio) {
text = "流量(L)";
}
} else {
return Container();
}
// if (intValue >= 0 && intValue % (2 * radtio) == 0 && intValue <= maxYR) {
// text = (intValue.ceil()).toString();
// if (maxYR - intValue < 2 * radtio) {
// text = "流量(L)";
// }
// } else {
// return Container();
// }
return Text(text, style: style, textAlign: TextAlign.center);
}
// return Text(text, style: style, textAlign: TextAlign.center);
// }
//
FlBorderData get borderData => FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(color: Colors.grey, width: 4),
left: BorderSide(color: Colors.transparent),
right: BorderSide(color: Colors.transparent),
top: BorderSide(color: Colors.transparent),
),
);
//
List<LineChartBarData> get lineBarsData => [
lineChartBarDataTen1,
lineChartBarDataTen2,
lineChartBarDataDepth,
];
LineChartBarData get lineChartBarDataDepth => LineChartBarData(
isCurved: false,
color: Colors.green,
barWidth: 3,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(show: false),
spots: processList.map((item) {
int index = processList.indexOf(item);
return FlSpot(
(maxX / processList.length) * index, (item.depth * radtio));
}).toList());
// //
// FlBorderData get borderData => FlBorderData(
// show: true,
// border: const Border(
// bottom: BorderSide(color: Colors.grey, width: 4),
// left: BorderSide(color: Colors.transparent),
// right: BorderSide(color: Colors.transparent),
// top: BorderSide(color: Colors.transparent),
// ),
// );
// //
// List<LineChartBarData> get lineBarsData => [
// lineChartBarDataTen1,
// lineChartBarDataTen2,
// lineChartBarDataDepth,
// ];
// LineChartBarData get lineChartBarDataDepth => LineChartBarData(
// isCurved: false,
// color: Colors.green,
// barWidth: 3,
// isStrokeCapRound: true,
// dotData: const FlDotData(show: false),
// belowBarData: BarAreaData(show: false),
// spots: processList.map((item) {
// int index = processList.indexOf(item);
// return FlSpot(
// (maxX / processList.length) * index, (item.depth * radtio));
// }).toList());
LineChartBarData get lineChartBarDataTen1 => LineChartBarData(
isCurved: false,
color: Colors.pink,
barWidth: 3,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(
show: false,
color: Colors.pink,
),
spots: processList.map((item) {
int index = processList.indexOf(item);
return FlSpot((maxX / processList.length) * index, item.subtotalFlow1);
}).toList());
// LineChartBarData get lineChartBarDataTen1 => LineChartBarData(
// isCurved: false,
// color: Colors.pink,
// barWidth: 3,
// isStrokeCapRound: true,
// dotData: const FlDotData(show: false),
// belowBarData: BarAreaData(
// show: false,
// color: Colors.pink,
// ),
// spots: processList.map((item) {
// int index = processList.indexOf(item);
// return FlSpot((maxX / processList.length) * index, item.subtotalFlow1);
// }).toList());
LineChartBarData get lineChartBarDataTen2 => LineChartBarData(
isCurved: false,
color: Colors.cyan,
barWidth: 3,
isStrokeCapRound: true,
dotData: const FlDotData(show: false),
belowBarData: BarAreaData(show: false),
spots: processList.map((item) {
int index = processList.indexOf(item);
return FlSpot((maxX / processList.length) * index, item.subtotalFlow2);
}).toList());
}
// LineChartBarData get lineChartBarDataTen2 => LineChartBarData(
// isCurved: false,
// color: Colors.cyan,
// barWidth: 3,
// isStrokeCapRound: true,
// dotData: const FlDotData(show: false),
// belowBarData: BarAreaData(show: false),
// spots: processList.map((item) {
// int index = processList.indexOf(item);
// return FlSpot((maxX / processList.length) * index, item.subtotalFlow2);
// }).toList());
// }

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'line_chart.dart';
import 'real_controller.dart';
import 'real_data.dart';
@ -30,21 +29,21 @@ class Real extends StatelessWidget {
),
space,
// lineChart
Expanded(
flex: 1,
child: Column(
children: [
Expanded(child: RealChart()),
Obx(() => Slider(
value: realController.startIndex.toDouble(),
onChanged: (newvalue) =>
realController.updateSlider(newvalue),
min: 0,
max: realController.processList.length.toDouble(),
)),
],
),
)
// Expanded(
// flex: 1,
// child: Column(
// children: [
// Expanded(child: RealChart()),
// Obx(() => Slider(
// value: realController.startIndex.toDouble(),
// onChanged: (newvalue) =>
// realController.updateSlider(newvalue),
// min: 0,
// max: realController.processList.length.toDouble(),
// )),
// ],
// ),
// )
];
if (isPortrait) {
return Container(

View File

@ -1,113 +1,113 @@
// ignore_for_file: must_be_immutable
// // ignore_for_file: must_be_immutable
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
// import 'package:fl_chart/fl_chart.dart';
// import 'package:flutter/material.dart';
// import 'package:get/get.dart';
// import 'package:intl/intl.dart';
import 'component/chart.dart';
import 'process.dart';
import 'real_controller.dart';
// import 'component/chart.dart';
// import 'process.dart';
// import 'real_controller.dart';
//
class RealChart extends StatelessWidget {
RealChart({super.key});
ChartData chartData = ChartData(
[],
);
final RealController realController = Get.put(RealController());
List<ProcessEntity> processList = [];
format(double value, [int fix = 2]) {
return double.parse(value.toStringAsFixed(fix));
}
// //
// class RealChart extends StatelessWidget {
// RealChart({super.key});
// ChartData chartData = ChartData(
// [],
// );
// final RealController realController = Get.put(RealController());
// List<ProcessEntity> processList = [];
// format(double value, [int fix = 2]) {
// return double.parse(value.toStringAsFixed(fix));
// }
List<ProcessEntity> cache = [];
@override
Widget build(BuildContext context) {
//
int showlength = 30;
ever(realController.depth, (newValue) {
ProcessEntity process = ProcessEntity(
recvTime: DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
pileId: realController.pileId.value,
utc: 0,
tid: 100,
toatalFlow1: format(realController.totalFlow1.value),
toatalFlow2: format(realController.totalFlow2.value),
subtotalFlow1: format(realController.subtotalFlow1.value),
subtotalFlow2: format(realController.subtotalFlow2.value),
depth: format(realController.depth.value),
);
// List<ProcessEntity> cache = [];
// @override
// Widget build(BuildContext context) {
// //
// int showlength = 30;
// ever(realController.depth, (newValue) {
// ProcessEntity process = ProcessEntity(
// recvTime: DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
// pileId: realController.pileId.value,
// utc: 0,
// tid: 100,
// toatalFlow1: format(realController.totalFlow1.value),
// toatalFlow2: format(realController.totalFlow2.value),
// subtotalFlow1: format(realController.subtotalFlow1.value),
// subtotalFlow2: format(realController.subtotalFlow2.value),
// depth: format(realController.depth.value),
// );
processList.add(process);
// processList.add(process);
if (realController.sliderTime != null) {
if (DateTime.now().difference(realController.sliderTime!).inSeconds >
10) {
realController.updateProcessList(processList);
realController.updateSlider(processList.length.toDouble(), false);
} else {
return;
}
} else {
realController.updateProcessList(processList);
if (realController.startIndex.value != processList.length) {
realController.updateSlider(processList.length.toDouble(), false);
}
}
});
ever(realController.pileId, (newValue) {
ProcessEntity process = ProcessEntity(
recvTime: DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
pileId: realController.pileId.value,
utc: 0,
tid: 100,
toatalFlow1: format(realController.totalFlow1.value),
toatalFlow2: format(realController.totalFlow2.value),
subtotalFlow1: format(realController.subtotalFlow1.value),
subtotalFlow2: format(realController.subtotalFlow2.value),
depth: format(realController.depth.value),
);
processList.length = 0;
processList.add(process);
realController.updateProcessList(processList.toList());
realController.startIndex.value = 0;
});
// if (realController.sliderTime != null) {
// if (DateTime.now().difference(realController.sliderTime!).inSeconds >
// 10) {
// realController.updateProcessList(processList);
// realController.updateSlider(processList.length.toDouble(), false);
// } else {
// return;
// }
// } else {
// realController.updateProcessList(processList);
// if (realController.startIndex.value != processList.length) {
// realController.updateSlider(processList.length.toDouble(), false);
// }
// }
// });
// ever(realController.pileId, (newValue) {
// ProcessEntity process = ProcessEntity(
// recvTime: DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
// pileId: realController.pileId.value,
// utc: 0,
// tid: 100,
// toatalFlow1: format(realController.totalFlow1.value),
// toatalFlow2: format(realController.totalFlow2.value),
// subtotalFlow1: format(realController.subtotalFlow1.value),
// subtotalFlow2: format(realController.subtotalFlow2.value),
// depth: format(realController.depth.value),
// );
// processList.length = 0;
// processList.add(process);
// realController.updateProcessList(processList.toList());
// realController.startIndex.value = 0;
// });
List<Widget> chartTitleWidget = chartData.chartTitleWeidget();
Widget chartWidget(List<ProcessEntity> processList) {
int startIndex = 0;
// List<Widget> chartTitleWidget = chartData.chartTitleWeidget();
// Widget chartWidget(List<ProcessEntity> processList) {
// int startIndex = 0;
if ((realController.startIndex.value + showlength) < processList.length &&
realController.startIndex.value != 0) {
startIndex = realController.startIndex.value;
} else {
startIndex = ((processList.length - showlength < 0)
? 0
: (processList.length - showlength));
}
int endIndex = startIndex + showlength > processList.length
? processList.length
: startIndex + showlength;
ChartData chartData = ChartData(
processList.sublist(startIndex, endIndex),
);
return LineChart(chartData.lineChart);
}
// if ((realController.startIndex.value + showlength) < processList.length &&
// realController.startIndex.value != 0) {
// startIndex = realController.startIndex.value;
// } else {
// startIndex = ((processList.length - showlength < 0)
// ? 0
// : (processList.length - showlength));
// }
// int endIndex = startIndex + showlength > processList.length
// ? processList.length
// : startIndex + showlength;
// ChartData chartData = ChartData(
// processList.sublist(startIndex, endIndex),
// );
// return LineChart(chartData.lineChart);
// }
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: chartTitleWidget,
),
Expanded(
flex: 1,
child: Obx(
() => SizedBox(child: chartWidget(realController.processList))))
],
);
}
}
// return Column(
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: chartTitleWidget,
// ),
// Expanded(
// flex: 1,
// child: Obx(
// () => SizedBox(child: chartWidget(realController.processList))))
// ],
// );
// }
// }

View File

@ -1,107 +1,134 @@
import 'dart:core';
class ProcessEntity {
double speed;
double depth;
double tiltX;
double tiltY;
double current1;
double current2;
double toatalFlow2;
double toatalFlow1;
double subtotalFlow2;
double subtotalFlow1;
String recvTime;
// double? azimuth;
double alt = 0;
double lng = 0;
double lat = 0;
String pileId;
int utc;
int tid;
int? id;
ProcessEntity(
{this.speed = 0,
this.depth = 0,
this.tiltX = 0,
this.tiltY = 0,
this.current1 = 0,
this.current2 = 0,
this.toatalFlow2 = 0,
this.toatalFlow1 = 0,
this.subtotalFlow2 = 0,
this.subtotalFlow1 = 0,
required this.recvTime,
// this.azimuth,
this.alt = 0,
this.lng = 0,
this.lat = 0,
required this.pileId,
required this.utc,
required this.tid,
this.id});
factory ProcessEntity.fromJson(Map<String, dynamic> json) {
return ProcessEntity(
speed: (json["speed"] ?? "0").toDouble(),
depth: (json["depth"] ?? "0").toDouble(),
tiltX: (json["tilt_x"] ?? "0").toDouble(),
tiltY: (json["tilt_y"] ?? "0").toDouble(),
current1: (json["current1"] ?? "0").toDouble(),
current2: (json["current2"] ?? "0").toDouble(),
toatalFlow2: (json["toatal_flow2"] ?? "0").toDouble(),
toatalFlow1: (json["toatal_flow1"] ?? "0").toDouble(),
subtotalFlow2: (json["subtotal_flow2"] ?? "0").toDouble(),
subtotalFlow1: (json["subtotal_flow1"] ?? "0").toDouble(),
recvTime: json["recv_time"] ?? DateTime.now(),
// azimuth: (json["azimuth"] ?? "0").toDouble(),
alt: (json["ALT"] ?? "0").toDouble(),
lng: (json["LNG"] ?? "0").toDouble(),
lat: (json["LAT"] ?? "0").toDouble(),
pileId: json["pile_id"].toString(),
utc: json["UTC"],
tid: json['tid'],
id: json["id"],
);
}
}
// class ProcessEntity {
// // String recvTime;
// double? azimuth;
// double speed;
// double depth;
// double tiltX;
// double tiltY;
// double current1;
// double current2;
// double toatalFlow2;
// double toatalFlow1;
// double subtotalFlow2;
// double subtotalFlow1;
// String recvTime;
// // double? azimuth;
// double alt = 0;
// double lng = 0;
// double lat = 0;
// int tp_id;
// String pileId;
// int utc;
// int tid;
// int? id;
// int times;
// // impact_force
// // distance;
// // pith
// ProcessEntity(
// {this.times = 0,
// // required this.recvTime,
// this.azimuth,
// {this.speed = 0,
// this.depth = 0,
// this.tiltX = 0,
// this.tiltY = 0,
// this.current1 = 0,
// this.current2 = 0,
// this.toatalFlow2 = 0,
// this.toatalFlow1 = 0,
// this.subtotalFlow2 = 0,
// this.subtotalFlow1 = 0,
// required this.recvTime,
// // this.azimuth,
// this.alt = 0,
// this.lng = 0,
// this.lat = 0,
// required this.tp_id,
// required this.pileId,
// required this.utc,
// required this.tid,
// this.id});
// factory ProcessEntity.fromJson(Map<String, dynamic> json) {
// return ProcessEntity(
// // recvTime: json["recv_time"] ?? DateTime.now(),
// speed: (json["speed"] ?? "0").toDouble(),
// depth: (json["depth"] ?? "0").toDouble(),
// tiltX: (json["tilt_x"] ?? "0").toDouble(),
// tiltY: (json["tilt_y"] ?? "0").toDouble(),
// current1: (json["current1"] ?? "0").toDouble(),
// current2: (json["current2"] ?? "0").toDouble(),
// toatalFlow2: (json["toatal_flow2"] ?? "0").toDouble(),
// toatalFlow1: (json["toatal_flow1"] ?? "0").toDouble(),
// subtotalFlow2: (json["subtotal_flow2"] ?? "0").toDouble(),
// subtotalFlow1: (json["subtotal_flow1"] ?? "0").toDouble(),
// recvTime: json["recv_time"] ?? DateTime.now(),
// // azimuth: (json["azimuth"] ?? "0").toDouble(),
// alt: (json["ALT"] ?? "0").toDouble(),
// lng: (json["LNG"] ?? "0").toDouble(),
// lat: (json["LAT"] ?? "0").toDouble(),
// tp_id: json["tp_id"],
// pileId: json["pile_id"].toString(),
// utc: json["UTC"],
// tid: json['tid'],
// id: json["id"],
// );
// }
// }
class ProcessEntity {
// String recvTime;
double? azimuth;
double alt = 0;
double lng = 0;
double lat = 0;
int tp_id;
int utc;
int tid;
int? id;
int times;
double height;
double speed;
// double impact_force;
List<double> impact_force;
// distance;
// pith
ProcessEntity(
{this.times = 0,
// required this.recvTime,
this.azimuth,
this.alt = 0,
this.lng = 0,
this.lat = 0,
this.height = 0,
this.speed = 0,
required this.impact_force,
required this.tp_id,
required this.utc,
required this.tid,
this.id});
factory ProcessEntity.fromJson(Map<String, dynamic> json) {
return ProcessEntity(
// recvTime: json["recv_time"] ?? DateTime.now(),
// azimuth: (json["azimuth"] ?? "0").toDouble(),
alt: (json["ALT"] ?? "0").toDouble(),
lng: (json["LNG"] ?? "0").toDouble(),
lat: (json["LAT"] ?? "0").toDouble(),
tp_id: json["tp_id"],
utc: json["UTC"],
tid: json['tid'],
id: json["id"],
times: json["times"],
impact_force: json["impact_force"].cast<double>(),
);
}
factory ProcessEntity.fromList(List<String> list) {
return ProcessEntity(
utc:int.parse( list[2]),
lat: double.parse(list[3]),
lng: double.parse(list[4]),
height: double.parse(list[5]),
speed: double.parse(list[6]),
tp_id: 0, tid: 0,
impact_force: []
// impact_force: double.parse(list[7]),
// recvTime: json["recv_time"] ?? DateTime.now(),
// tp_id: ,
);
}
}

View File

@ -1,15 +1,189 @@
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';
import '../setting/child_pages/XyChange/coor_trans.dart';
import '../setting/setting_controller.dart';
import 'process.dart';
// pile_cm
// class RealController extends GetxController {
// var sightOffset1 = const Offset(3, 3).obs;
// var sightOffsetInit1 = const Offset(0, 0).obs;
// var sightInit1 = const Offset(0, 0).obs;
// var initDx = 0.0.obs;
// reset() {
// sightOffset1.value = const Offset(3, 3);
// sightOffsetInit1.value = const Offset(0, 0);
// sightInit1.value = const Offset(0, 0);
// initDx.value = 0.0;
// update();
// }
// // RTCPeerConnection? peerConnection;
// // RTCDataChannel? dataChannel;
// final speed = 0.0.obs;
// final depth = 0.0.obs;
// final tiltX = 0.0.obs;
// final tiltY = 0.0.obs;
// final centerX = 0.0.obs;
// final centerY = 0.0.obs;
// final current1 = 0.0.obs;
// final current2 = 0.0.obs;
// final totalFlow2 = 0.0.obs;
// final totalFlow1 = 0.0.obs;
// final flow10cm1 = 0.0.obs;
// final flow10cm2 = 0.0.obs;
// final subtotalFlow2 = 0.0.obs;
// final subtotalFlow1 = 0.0.obs;
// final recvTime = ''.obs;
// final alt = 0.0.obs;
// final lng = 0.0.obs;
// final lat = 0.0.obs;
// final pileId = ''.obs;
// final time = "0".obs;
// final startIndex = 0.obs;
// // 线
// final processList = <ProcessEntity>[].obs;
// var isDataVisible = false.obs;
// void updateProcessList(List<ProcessEntity> newList) {
// processList.assignAll(newList); // 使 assignAll RxList
// }
// DateTime? sliderTime;
// updateSlider(double newValue, [isHand = true]) {
// if (isHand) {
// sliderTime = DateTime.now();
// }
// startIndex.value = newValue.toInt();
// update();
// }
// @override
// void onInit() {
// super.onInit();
// //
// // Timer.periodic(const Duration(milliseconds: 1000), (_) {
// // time.value = DateTime.now();
// // });
// initializePeerConnection();
// }
// void initializePeerConnection() async {
// // final configuration = <String, dynamic>{
// // 'iceServers': [
// // {'url': 'stun:stun.l.google.com:19302'},
// // ],
// // };
// // peerConnection = await createPeerConnection(configuration);
// // initializeDataChannel();
// }
// // void initializeDataChannel() async {
// // //
// // dataChannel = await peerConnection!
// // .createDataChannel('dataChannel', RTCDataChannelInit()..id = 1);
// // //
// // dataChannel!.onMessage = (RTCDataChannelMessage message) {
// // //
// // if (message.isBinary) {
// // onBleData(message.binary);
// // }
// // };
// // }
// onBleData(Uint8List data) {
// ByteData byteData = data.buffer.asByteData();
// int tag = byteData.getUint8(0);
// // int length = byteData.getUint8(1);
// if (tag == 161) {
// speed.value = byteData.getInt16(2, Endian.little) * 0.1;
// int timeInt = byteData.getUint16(4, Endian.little);
// // log(timeInt);
// time.value = convertSecondsToMinSec(timeInt);
// depth.value = byteData.getInt16(6, Endian.little) * 0.001;
// pileId.value = byteData.getUint16(8, Endian.little).toString();
// subtotalFlow1.value = byteData.getInt16(10, Endian.little) * 0.01;
// flow10cm1.value = byteData.getUint16(12, Endian.little) * 0.01;
// totalFlow1.value = byteData.getInt32(14, Endian.little) * 0.01;
// subtotalFlow2.value = byteData.getInt16(18, Endian.little) * 0.01;
// flow10cm2.value = byteData.getUint16(20, Endian.little) * 0.01;
// totalFlow2.value = byteData.getInt32(22, Endian.little) * 0.01;
// current1.value = byteData.getUint16(26, Endian.little) * 0.01;
// current2.value = byteData.getUint16(28, Endian.little) * 0.01;
// // current3.value = byteData.getUint16(30, Endian.little) * 0.01;
// int tag1 = byteData.getUint8(34);
// // int length = byteData.getUint8(35);
// if (tag1 == 162) {
// // var gpsStatus = byteData.getUint8(36);
// // var gpsView = byteData.getUint8(37);
// // var gpsUse = byteData.getUint8(38);
// // var reg = byteData.getUint8(39);
// // var utc = byteData.getUint32(40, Endian.little);
// //
// centerX.value = byteData.getFloat64(44, Endian.little);
// centerY.value = byteData.getFloat64(52, Endian.little);
// // log("中心---$centerX,$centerY");
// // tiltX.value = byteData.getFloat64(44, Endian.little);
// // tiltY.value = byteData.getFloat64(52, Endian.little);
// // var direction = byteData.getFloat64(60, Endian.little);
// // var pitch = byteData.getFloat64(68, Endian.little);
// // log("$gpsUse,$gpsView,$utc,$direction,$pitch");
// }
// }
// }
// String convertSecondsToMinSec(int totalSeconds) {
// int minutes = totalSeconds ~/ 60;
// int seconds = totalSeconds % 60;
// String formattedTime = '$minutes:${seconds.toString().padLeft(2, '0')}';
// return formattedTime;
// }
// @override
// void dispose() {
// // dataChannel?.close(); //
// // peerConnection?.close(); //
// super.dispose();
// }
// }
final ScenceMapController mapController = Get.find<ScenceMapController>();
SettingController settingController = Get.find<SettingController>();
XYChangeController xyChangeController = Get.put(XYChangeController());
class RealController extends GetxController {
var sightOffset1 = const Offset(3, 3).obs;
var sightOffsetInit1 = const Offset(0, 0).obs;
var sightInit1 = const Offset(0, 0).obs;
var initDx = 0.0.obs;
var processdata = ProcessEntity(
tid: 0,
speed: 0,
alt: 0,
lng: 0,
lat: 0,
tp_id: 0,
utc: DateTime.now().millisecond,
impact_force: []).obs;
var dataCount = 0.obs;
CoordTrans? coordTrans;
var status = 0.obs;
var sa = 0.obs;
var sv = 0.obs;
reset() {
sightOffset1.value = const Offset(3, 3);
sightOffsetInit1.value = const Offset(0, 0);
@ -19,136 +193,87 @@ class RealController extends GetxController {
update();
}
// RTCPeerConnection? peerConnection;
// RTCDataChannel? dataChannel;
final speed = 0.0.obs;
final depth = 0.0.obs;
final tiltX = 0.0.obs;
final tiltY = 0.0.obs;
final centerX = 0.0.obs;
final centerY = 0.0.obs;
final current1 = 0.0.obs;
final current2 = 0.0.obs;
final totalFlow2 = 0.0.obs;
final totalFlow1 = 0.0.obs;
final flow10cm1 = 0.0.obs;
final flow10cm2 = 0.0.obs;
final subtotalFlow2 = 0.0.obs;
final subtotalFlow1 = 0.0.obs;
final recvTime = ''.obs;
final alt = 0.0.obs;
final lng = 0.0.obs;
final lat = 0.0.obs;
final pileId = ''.obs;
final time = "0".obs;
final startIndex = 0.obs;
// 线
final processList = <ProcessEntity>[].obs;
var isDataVisible = false.obs;
void updateProcessList(List<ProcessEntity> newList) {
processList.assignAll(newList); // 使 assignAll RxList
}
DateTime? sliderTime;
updateSlider(double newValue, [isHand = true]) {
if (isHand) {
sliderTime = DateTime.now();
}
startIndex.value = newValue.toInt();
update();
}
@override
void onInit() {
super.onInit();
//
// Timer.periodic(const Duration(milliseconds: 1000), (_) {
// time.value = DateTime.now();
// });
initializePeerConnection();
}
void initializePeerConnection() async {
// final configuration = <String, dynamic>{
// 'iceServers': [
// {'url': 'stun:stun.l.google.com:19302'},
// ],
// };
// peerConnection = await createPeerConnection(configuration);
// initializeDataChannel();
}
// void initializeDataChannel() async {
// //
// dataChannel = await peerConnection!
// .createDataChannel('dataChannel', RTCDataChannelInit()..id = 1);
// //
// dataChannel!.onMessage = (RTCDataChannelMessage message) {
// //
// if (message.isBinary) {
// onBleData(message.binary);
// }
// };
// }
onBleData(Uint8List data) {
ByteData byteData = data.buffer.asByteData();
int tag = byteData.getUint8(0);
// int length = byteData.getUint8(1);
if (tag == 161) {
speed.value = byteData.getInt16(2, Endian.little) * 0.1;
int timeInt = byteData.getUint16(4, Endian.little);
// log(timeInt);
time.value = convertSecondsToMinSec(timeInt);
depth.value = byteData.getInt16(6, Endian.little) * 0.001;
pileId.value = byteData.getUint16(8, Endian.little).toString();
subtotalFlow1.value = byteData.getInt16(10, Endian.little) * 0.01;
flow10cm1.value = byteData.getUint16(12, Endian.little) * 0.01;
totalFlow1.value = byteData.getInt32(14, Endian.little) * 0.01;
subtotalFlow2.value = byteData.getInt16(18, Endian.little) * 0.01;
flow10cm2.value = byteData.getUint16(20, Endian.little) * 0.01;
totalFlow2.value = byteData.getInt32(22, Endian.little) * 0.01;
current1.value = byteData.getUint16(26, Endian.little) * 0.01;
current2.value = byteData.getUint16(28, Endian.little) * 0.01;
// current3.value = byteData.getUint16(30, Endian.little) * 0.01;
int tag1 = byteData.getUint8(34);
// int length = byteData.getUint8(35);
if (tag1 == 162) {
// var gpsStatus = byteData.getUint8(36);
// var gpsView = byteData.getUint8(37);
// var gpsUse = byteData.getUint8(38);
// var reg = byteData.getUint8(39);
// var utc = byteData.getUint32(40, Endian.little);
//
centerX.value = byteData.getFloat64(44, Endian.little);
centerY.value = byteData.getFloat64(52, Endian.little);
// log("中心---$centerX,$centerY");
// tiltX.value = byteData.getFloat64(44, Endian.little);
// tiltY.value = byteData.getFloat64(52, Endian.little);
// var direction = byteData.getFloat64(60, Endian.little);
// var pitch = byteData.getFloat64(68, Endian.little);
// log("$gpsUse,$gpsView,$utc,$direction,$pitch");
String str = String.fromCharCodes(data);
String first = str.split("#POSA")[1];
List<String> list = first.split(",");
double baseLine = double.parse(list[7]);
double heading = double.parse(list[8]);
double pitch = double.parse(list[9]);
status.value = int.parse(list[1]);
sa.value = int.parse(list[10]);
List<String> svStr = list[11].trim().split(" ");
sv.value = int.parse(svStr[0]);
ProcessEntity process = ProcessEntity.fromList(list);
processdata.update((value) {
// value.speed = process.speed;
value?.lat = process.lat;
value?.lng = process.lng;
value?.alt = process.height;
value?.utc = process.utc;
});
dataCount.value++;
CoorTransModel trans = xyChangeController.coorTrans.value;
coordTrans ??= CoordTrans(TransOptions(
L0: trans.L0,
// dstEllipsoid: trans.dstEllipsoid,
// srcEllipsoid: trans.srcEllipsoid,
dx: trans.dx,
dy: trans.dy,
type: trans.type));
var xyh = coordTrans!
.d2p(CoordBLH(B: process.lat, L: process.lng, H: process.alt));
Offset offset = Offset(xyh.X, xyh.Y);
if ((mapController.centerXY - offset).distance > 40) {
mapController.centerXY = offset;
}
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;
}
}
}
String convertSecondsToMinSec(int totalSeconds) {
int minutes = totalSeconds ~/ 60;
int seconds = totalSeconds % 60;
mapController.updateCount++;
var centerDev =
mapController.deviceList[settingController.currentDevice.value?.tid];
if (centerDev != null) {
// log("center${xyh.X},${xyh.Y}");
String formattedTime = '$minutes:${seconds.toString().padLeft(2, '0')}';
centerDev.update.value++;
double pitchRad = pitch * pi / 180;
double headingRad = (heading) * pi / 180; //(270-)
centerDev.rotation.value = (heading + 90) * pi / 180;
//
double dXY = baseLine * cos(pitchRad);
return formattedTime;
}
// 线
double carX = xyh.X + dXY * cos(headingRad);
double carY = xyh.Y + dXY * sin(headingRad);
@override
void dispose() {
// dataChannel?.close(); //
// peerConnection?.close(); //
super.dispose();
centerDev.x.value = carX;
centerDev.y.value = carY;
developer.log("carX:$carX,carY:$carY");
}
}
}

View File

@ -22,97 +22,98 @@ class RealData extends StatelessWidget {
@override
Widget build(BuildContext context) {
//
late TextStyle titleFontstyle;
late TextStyle valueFontstyle;
final deviceType = getDeviceType(context);
if (deviceType == DeviceType.mobile) {
titleFontstyle = const TextStyle(fontSize: 15);
valueFontstyle = const TextStyle(fontSize: 36);
} else {
titleFontstyle = const TextStyle(fontSize: 22);
valueFontstyle = const TextStyle(fontSize: 45);
}
Widget space = const SizedBox(
height: 5,
width: 5,
);
return Expanded(
// late TextStyle titleFontstyle;
// late TextStyle valueFontstyle;
// final deviceType = getDeviceType(context);
// if (deviceType == DeviceType.mobile) {
// titleFontstyle = const TextStyle(fontSize: 15);
// valueFontstyle = const TextStyle(fontSize: 36);
// } else {
// titleFontstyle = const TextStyle(fontSize: 22);
// valueFontstyle = const TextStyle(fontSize: 45);
// }
// Widget space = const SizedBox(
// height: 5,
// width: 5,
// );
return const Expanded(
flex: 1,
child: Column(
children: [
RealItem(children: [
RealItemChild(
// flex: 2,
title: "速度(m/min)",
titleFontstyle: titleFontstyle,
child: Obx(() {
return Text(
realController.speed.abs() >= 100
? realController.speed.toStringAsFixed(1)
: realController.speed.toStringAsFixed(2),
style: valueFontstyle,
);
}),
),
space,
RealItemChild(
// flex: 3,
title: "时间(min:s)",
titleFontstyle: titleFontstyle,
child: Obx(() => Text(
realController.time.value,
style: valueFontstyle,
))),
space,
RealItemChild(
// flex: 2,
title: "深度(m)",
titleFontstyle: titleFontstyle,
child: Obx(() => Text(
realController.depth.toStringAsFixed(2),
style: valueFontstyle,
))),
]),
space,
RealItem(children: [
RealItemChild(
// flex: 1,
title: "1#瞬时流量(L/min)",
titleFontstyle: titleFontstyle,
child: Obx(() => Text(
realController.subtotalFlow1.toStringAsFixed(2),
style: valueFontstyle,
))),
space,
RealItemChild(
// flex: 1,
title: "2#瞬时流量(L/min)",
titleFontstyle: titleFontstyle,
child: Obx(() => Text(
realController.subtotalFlow2.toStringAsFixed(2),
style: valueFontstyle,
))),
]),
space,
RealItem(children: [
RealItemChild(
// flex: 1,
title: "1#累计流量(L)",
titleFontstyle: titleFontstyle,
child: Obx(() => Text(
realController.totalFlow1.toStringAsFixed(2),
style: valueFontstyle,
))),
space,
RealItemChild(
// flex: 1,
title: "2#累计流量(L)",
titleFontstyle: titleFontstyle,
child: Obx(() => Text(
realController.totalFlow2.toStringAsFixed(2),
style: valueFontstyle,
))),
])
// RealItem(children: [
// RealItemChild(
// // flex: 2,
// title: "速度(m/min)",
// titleFontstyle: titleFontstyle,
// child: Obx(() {
// return Text(
// realController.speed.abs() >= 100
// ? realController.speed.toStringAsFixed(1)
// : realController.speed.toStringAsFixed(2),
// style: valueFontstyle,
// );
// }),
// ),
// space,
// RealItemChild(
// // flex: 3,
// title: "时间(min:s)",
// titleFontstyle: titleFontstyle,
// child: Obx(() => Text(
// realController.time.value,
// style: valueFontstyle,
// ))),
// space,
// RealItemChild(
// // flex: 2,
// title: "深度(m)",
// titleFontstyle: titleFontstyle,
// child: Obx(() => Text(
// realController.depth.toStringAsFixed(2),
// style: valueFontstyle,
// ))),
// ]),
// space,
// RealItem(children: [
// RealItemChild(
// // flex: 1,
// title: "1#瞬时流量(L/min)",
// titleFontstyle: titleFontstyle,
// child: Obx(() => Text(
// realController.subtotalFlow1.toStringAsFixed(2),
// style: valueFontstyle,
// ))),
// space,
// RealItemChild(
// // flex: 1,
// title: "2#瞬时流量(L/min)",
// titleFontstyle: titleFontstyle,
// child: Obx(() => Text(
// realController.subtotalFlow2.toStringAsFixed(2),
// style: valueFontstyle,
// ))),
// ]),
// space,
// RealItem(children: [
// RealItemChild(
// // flex: 1,
// title: "1#累计流量(L)",
// titleFontstyle: titleFontstyle,
// child: Obx(() => Text(
// realController.totalFlow1.toStringAsFixed(2),
// style: valueFontstyle,
// ))),
// space,
// RealItemChild(
// // flex: 1,
// title: "2#累计流量(L)",
// titleFontstyle: titleFontstyle,
// child: Obx(() => Text(
// realController.totalFlow2.toStringAsFixed(2),
// style: valueFontstyle,
// ))),
// ])
],
));
}

View File

@ -1,6 +1,7 @@
//
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'real_controller.dart';
@ -74,7 +75,12 @@ class RealDataShow extends StatelessWidget {
),
],
),
..._buildRealTimeDataList(context),
Obx(() {
controller1.dataCount;
return Column(children: [
..._buildRealTimeDataList(context, controller1)
]);
})
],
),
),
@ -114,9 +120,8 @@ class RealDataShow extends StatelessWidget {
// );
// }
List<Widget> _buildRealTimeDataList(BuildContext context) {
//
final RealController realController = Get.find();
List<Widget> _buildRealTimeDataList(
BuildContext context, RealController controller) {
bool isDarkMode = Theme.of(context).brightness == Brightness.dark;
// final orientation = MediaQuery.of(context).orientation;
@ -142,7 +147,11 @@ class RealDataShow extends StatelessWidget {
// ];
// hydraulic_tamping
List<DataItem> dataItems = [
DataItem("时间(min:s)", () => realController.time.value),
DataItem(
"时间(min:s)",
() => DateFormat('HH:mm:ss').format(
DateTime.fromMillisecondsSinceEpoch(
controller.processdata.value.utc * 1000))),
// DataItem("夯击次数:", () => realController.times.value)
];
//
@ -157,11 +166,11 @@ class RealDataShow extends StatelessWidget {
fontSize: 13,
color: isDarkMode ? Colors.white : Colors.black,
)),
Obx(() => Text(item.value(),
Text(item.value(),
style: TextStyle(
fontSize: 18,
color: isDarkMode ? Colors.white : Colors.black,
))),
)),
],
),
);

View File

@ -511,8 +511,8 @@ class XYChangeController extends GetxController {
project.projCode,
);
if (coordTransmap.isNotEmpty) {
var mianBelt =
coordTransmap.firstWhere((element) => element['belt'] == 'main');
var mianBelt = coordTransmap.firstWhere(
(element) => element['belt'] == 'main' || element["name"] == "主带");
coorTrans.value = CoorTransModel.fromJson(mianBelt);
} else {
log("当前项目没有设置中央子午线");

View File

@ -1,3 +1,5 @@
import 'dart:async';
import 'dart:developer';
import 'dart:io';
import 'dart:typed_data';
@ -5,74 +7,83 @@ import '../../../../real/index.dart';
import '../bluetooth_page.dart';
class SocketSetting {
int port = 6000;
String ip = "192.168.4.1";
int port = 6060;
String ip = "192.168.1.183";
bool isConnected = false;
int times = 0;
RawDatagramSocket? socket;
Socket? socket;
int reconnectCount = 0;
Duration _reconnectDelay = const Duration(seconds: 5);
connect() async {
// tcp连接
// try {
// socket = await Socket.connect(ip, port);
// //
// socket!.add([0xf2]);
try {
socket = await Socket.connect(ip, port);
//
// socket!.add([0xf2]);
// //
// socket!.listen(
// (Uint8List data) {
// realController.onBleData(data);
// // log('收到服务器回复:$data');
// },
// onError: (error) async {
// disConnect();
//
socket!.listen(
(Uint8List data) {
realController.onBleData(data);
if (isConnected == false) {
isConnected = true;
reconnectCount = 0;
_reconnectDelay = const Duration(seconds: 5);
}
// log('收到服务器回复:$data');
},
onError: (error) async {
disConnect();
reconnect();
log('与服务器的连接发生错误:$error');
socket = await Socket.connect(ip, port);
return;
},
);
// log('与服务器的连接发生错误:$error');
// socket = await Socket.connect(ip, port);
// return;
// },
// );
//
socket!.done.then((_) {
log('与服务器的连接已断开');
// //
// socket!.done.then((_) {
// log('与服务器的连接已断开');
// disConnect();
// });
// } catch (e) {
// log("----------$e");
// disConnect();
// }
disConnect();
reconnect();
});
} catch (e) {
log("----------$e");
disConnect();
reconnect();
}
// udp连接
socket = await RawDatagramSocket.bind(
InternetAddress.anyIPv4, 6000); //InternetAddress(ip)
// socket = await RawDatagramSocket.bind(
// InternetAddress.anyIPv4, 6000); //InternetAddress(ip)
// //
socket!.send([0xf2], InternetAddress(ip), 6000);
// socket!.send([0xf2], InternetAddress(ip), 6000);
socket!.listen((RawSocketEvent e) {
times++;
if (times == 20) {
times = 0;
socket!.send([0xf2], InternetAddress(ip), 6000);
}
Datagram? dg = socket!.receive();
if (dg != null) {
realController.onBleData(dg.data);
// log('${dg.address.address}:${dg.port} 接收:');
//
// socket.send("已收到".codeUnits, dg.address, dg.port);
}
});
// socket!.listen((RawSocketEvent e) {
// times++;
// if (times == 20) {
// times = 0;
// socket!.send([0xf2], InternetAddress(ip), 6000);
// }
// Datagram? dg = socket!.receive();
// if (dg != null) {
// realController.onBleData(dg.data);
// // log('${dg.address.address}:${dg.port} 接收:');
// //
// // socket.send("已收到".codeUnits, dg.address, dg.port);
// }
// });
}
write(Uint8List data) async {
try {
// socket ??= await Socket.connect(ip, port);
Datagram? dg = socket!.receive();
socket!.send(data, dg!.address, dg.port);
// socket!.add(data);
// Datagram? dg = socket!.receive();
// socket!.send(data, dg!.address, dg.port);
socket!.add(data);
// ignore: empty_catches
} catch (e) {}
}
@ -86,4 +97,21 @@ class SocketSetting {
//
}
}
void reconnect() {
if (socket != null) {
socket!.close();
socket = null;
}
log('Reconnecting in ${_reconnectDelay.inSeconds} seconds...');
Timer(_reconnectDelay, () {
reconnectCount++;
if (reconnectCount > 20) {
_reconnectDelay = const Duration(seconds: 60);
}
isConnected = false;
connect();
});
}
}

View File

@ -1,9 +1,10 @@
import 'package:cpnav/pages/pass_track/controller.dart';
import 'package:cpnav/pages/setting/project/model.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:scence_map/controllers/controller.dart';
import 'package:device_info_plus/device_info_plus.dart';
import '../../models/user.dart';
import '../../service/base.dart';
import '../../service/user/loginprefs.dart';
@ -26,9 +27,28 @@ class SettingController extends GetxController {
// @override
// void onInit() async {
// super.onInit();
// }
Future<void> getDeviceId(context) async {
final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
String id;
//
if (Theme.of(context).platform == TargetPlatform.android) {
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
id = androidInfo.brand; //
}
// else if (Theme.of(context).platform == TargetPlatform.iOS) {
// IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
// // id = iosInfo.identifierForVendor; // iOS设备编号
// }
else {
id = 'Unknown platform';
}
}
init() async {
isInitialized = false;
UserModel? getUser = UserController().getUser();
@ -55,9 +75,8 @@ class SettingController extends GetxController {
currentProject.value = projectList[0];
setProject(currentProject.value!.toJson());
// services.projCode = currentProject.value!.projCode;
await getBindService(services);
}
await getBindService(services);
isInitialized = true;
}

View File

@ -197,6 +197,9 @@ class DrawDirection extends CustomPainter {
}
getRect(List<Offset> list) {
if (list.isEmpty) {
return [Offset.zero, Offset.zero, Offset.zero, Offset.zero];
}
List<Offset> rect = [];
double minx = double.infinity;
double maxx = double.negativeInfinity;

View File

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
@ -6,6 +7,7 @@ import 'package:cpnav/pages/setting/setting_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
import 'package:roslibdart/roslibdart.dart';
import '../main.dart';
import 'user/loginprefs.dart';
@ -41,12 +43,11 @@ class BaseService {
loginPrefs.clearLogin();
return;
}
if (res['code'] == 1000) {
return res;
} else {
log(res);
int code = res['code'];
if (code != 1000) {
// log(res);
String msg = res['message'].toString();
if (res['code'] == 404) {
if (code == 404) {
msg = "当前接口不存在:$msg";
}
scaffoldMessengerKey.currentState?.showSnackBar(
@ -56,9 +57,14 @@ class BaseService {
backgroundColor: Colors.red,
),
);
return res;
}
return res;
} catch (e) {
log(" catch error: ${e.toString()}");
if (e is TimeoutException) {
return {};
}
} catch (e) {
scaffoldMessengerKey.currentState?.showSnackBar(
SnackBar(
content: Text('发生错误: ${e.toString()}'),
@ -66,7 +72,7 @@ class BaseService {
backgroundColor: Colors.red,
),
);
log(e.toString());
return {};
}
}
@ -102,9 +108,9 @@ class BaseService {
checkExpire() {
int old = loginPrefs.getRefreshExpire();
int now = DateTime.now().millisecond;
int now = DateTime.now().millisecondsSinceEpoch;
if (now - old <= 2000) {
if (old - now <= 2000) {
//2s
refreshToken();
}
@ -117,22 +123,26 @@ class BaseService {
return;
}
try {
Uri fullUrl = Uri.parse(
"$baseUrl/admin/base/open/refreshToken?refreshToken=$refreshToken");
http.Response response = await _client.get(fullUrl).timeout(timeout);
var res = json.decode(response.body);
Uri fullUrl = Uri.parse(
"$baseUrl/admin/base/open/refreshToken?refreshToken=$refreshToken");
http.Response response = await _client.get(fullUrl).timeout(timeout);
var res = json.decode(response.body);
if (res['code'] == 1000 && res["data"] != null) {
token = res["data"]["token"];
loginPrefs.saveExpire(res["data"]["expire"]);
loginPrefs.saveToken(token);
loginPrefs.saveRefreshToken(res["data"]["refreshToken"]);
loginPrefs.saveRefreshExpire(res["data"]["refreshExpire"]);
}
if (res['code'] == 1000 && res["data"] != null) {
token = res["data"]["token"];
loginPrefs.saveExpire(res["data"]["expire"]);
loginPrefs.saveToken(token);
loginPrefs.saveRefreshToken(res["data"]["refreshToken"]);
loginPrefs.saveRefreshExpire(res["data"]["refreshExpire"]);
}
} catch (e) {
log("refreshToken error: $e");
}
}
String rosUrl ="ws://192.168.1.90:9090";
getRos(){
Ros ros = Ros(url: rosUrl);
return ros;
}
}
@ -314,7 +324,7 @@ class GetServices {
dateEnd ??= date;
Map? res = await service.getClient(
"/api/$projType/record/list?org_code=$org_code&proj_code=$projCode&date=$date&dateEnd=$dateEnd"); //&tid=1000
if (res != null && res['data'] != null) {
if (res != null && res.isNotEmpty && res['data'] != null) {
return res['data'];
}

View File

@ -6,7 +6,7 @@ packages:
description:
name: args
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.6.0"
async:
@ -14,7 +14,7 @@ packages:
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
bluez:
@ -22,7 +22,7 @@ packages:
description:
name: bluez
sha256: "203a1924e818a9dd74af2b2c7a8f375ab8e5edf0e486bba8f90a0d8a17ed9fce"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.8.2"
boolean_selector:
@ -30,7 +30,7 @@ packages:
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
characters:
@ -38,7 +38,7 @@ packages:
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
clock:
@ -46,7 +46,7 @@ packages:
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
@ -54,7 +54,7 @@ packages:
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.18.0"
convert:
@ -62,7 +62,7 @@ packages:
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
cupertino_icons:
@ -70,7 +70,7 @@ packages:
description:
name: cupertino_icons
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.8"
dbus:
@ -78,7 +78,7 @@ packages:
description:
name: dbus
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
fake_async:
@ -86,7 +86,7 @@ packages:
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
@ -94,7 +94,7 @@ packages:
description:
name: ffi
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
flutter:
@ -107,7 +107,7 @@ packages:
description:
name: flutter_lints
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.0.3"
flutter_test:
@ -120,7 +120,7 @@ packages:
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
leak_tracker_flutter_testing:
@ -128,7 +128,7 @@ packages:
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
leak_tracker_testing:
@ -136,7 +136,7 @@ packages:
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints:
@ -144,7 +144,7 @@ packages:
description:
name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
logging:
@ -152,7 +152,7 @@ packages:
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
matcher:
@ -160,7 +160,7 @@ packages:
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
material_color_utilities:
@ -168,7 +168,7 @@ packages:
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
meta:
@ -176,7 +176,7 @@ packages:
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
path:
@ -184,7 +184,7 @@ packages:
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
petitparser:
@ -192,7 +192,7 @@ packages:
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.0.2"
plugin_platform_interface:
@ -200,7 +200,7 @@ packages:
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
quick_blue:
@ -220,7 +220,7 @@ packages:
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
stack_trace:
@ -228,7 +228,7 @@ packages:
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
stream_channel:
@ -236,7 +236,7 @@ packages:
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
string_scanner:
@ -244,7 +244,7 @@ packages:
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
term_glyph:
@ -252,7 +252,7 @@ packages:
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
test_api:
@ -260,7 +260,7 @@ packages:
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
typed_data:
@ -268,7 +268,7 @@ packages:
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
vector_math:
@ -276,23 +276,23 @@ packages:
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.flutter-io.cn"
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.2.4"
xml:
dependency: transitive
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.5.0"
sdks:

@ -1 +1 @@
Subproject commit cc9ee2fe1abf30613fe191794e841cf0399f8d58
Subproject commit 9b1ec3ea2d0ee1e10f6ad2ee32482092972f5cfd

View File

@ -6,7 +6,7 @@ packages:
description:
name: args
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.6.0"
async:
@ -14,7 +14,7 @@ packages:
description:
name: async
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.11.0"
bluez:
@ -22,7 +22,7 @@ packages:
description:
name: bluez
sha256: "203a1924e818a9dd74af2b2c7a8f375ab8e5edf0e486bba8f90a0d8a17ed9fce"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.8.2"
boolean_selector:
@ -30,23 +30,23 @@ packages:
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
bottom_picker:
dependency: "direct main"
description:
name: bottom_picker
sha256: "7c690407c6c489bc7c556858c3f1b804aac73c3a128559f328cc829ba12983ad"
url: "https://pub.flutter-io.cn"
sha256: "5d52cf94cfe41e3cc448101552f9b2e9faa810e3609e18432280431fb7dd676a"
url: "https://pub.dev"
source: hosted
version: "2.8.0"
version: "2.9.0"
calendar_date_picker2:
dependency: "direct main"
description:
name: calendar_date_picker2
sha256: "986955aea43081c8cf70fe01735ccdfe9a7041218b2be53ed92d5d4e639e8a1a"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.7"
characters:
@ -54,7 +54,7 @@ packages:
description:
name: characters
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
clock:
@ -62,7 +62,7 @@ packages:
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
@ -70,7 +70,7 @@ packages:
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.18.0"
convert:
@ -78,7 +78,7 @@ packages:
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
crypto:
@ -86,7 +86,7 @@ packages:
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
cupertino_icons:
@ -94,7 +94,7 @@ packages:
description:
name: cupertino_icons
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.8"
dart_webrtc:
@ -102,7 +102,7 @@ packages:
description:
name: dart_webrtc
sha256: c664ad88d5646735753add421ee2118486c100febef5e92b7f59cdbabf6a51f6
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.4.9"
data_table_2:
@ -110,7 +110,7 @@ packages:
description:
name: data_table_2
sha256: f02ec9b24f44420816a87370ff4f4e533e15b274f6267e4c9a88a585ad1a0473
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.5.15"
dbus:
@ -118,15 +118,31 @@ packages:
description:
name: dbus
sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.7.10"
device_info_plus:
dependency: "direct main"
description:
name: device_info_plus
sha256: f545ffbadee826f26f2e1a0f0cbd667ae9a6011cc0f77c0f8f00a969655e6e95
url: "https://pub.dev"
source: hosted
version: "11.1.1"
device_info_plus_platform_interface:
dependency: transitive
description:
name: device_info_plus_platform_interface
sha256: "282d3cf731045a2feb66abfe61bbc40870ae50a3ed10a4d3d217556c35c8c2ba"
url: "https://pub.dev"
source: hosted
version: "7.0.1"
dylib:
dependency: transitive
description:
name: dylib
sha256: bf609b3eb6492a3309b3d1dbe8f83a4031de5535dd7686be33487051cc760bb0
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.3.3"
equatable:
@ -134,7 +150,7 @@ packages:
description:
name: equatable
sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.0.5"
fake_async:
@ -142,7 +158,7 @@ packages:
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
@ -150,15 +166,23 @@ packages:
description:
name: ffi
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
file:
dependency: transitive
description:
name: file
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
url: "https://pub.dev"
source: hosted
version: "7.0.1"
fl_chart:
dependency: "direct main"
description:
name: fl_chart
sha256: "94307bef3a324a0d329d3ab77b2f0c6e5ed739185ffc029ed28c0f9b019ea7ef"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.69.0"
flutter:
@ -171,7 +195,7 @@ packages:
description:
name: flutter_lints
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
flutter_localizations:
@ -183,10 +207,10 @@ packages:
dependency: "direct main"
description:
name: flutter_svg
sha256: de82e6bf958cec7190fbc1c5298282c851228e35ae2b14e2b103e7f777818c64
url: "https://pub.flutter-io.cn"
sha256: "578bd8c508144fdaffd4f77b8ef2d8c523602275cd697cc3db284dbd762ef4ce"
url: "https://pub.dev"
source: hosted
version: "2.0.13"
version: "2.0.14"
flutter_test:
dependency: "direct dev"
description: flutter
@ -202,7 +226,7 @@ packages:
description:
name: flutter_webrtc
sha256: "2f17fb96e0c9c6ff75f6b1c36d94755461fc7f36a5c28386f5ee5a18b98688c8"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.9.48+hotfix.1"
get:
@ -210,7 +234,7 @@ packages:
description:
name: get
sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "4.6.6"
get_storage:
@ -218,7 +242,7 @@ packages:
description:
name: get_storage
sha256: "39db1fffe779d0c22b3a744376e86febe4ade43bf65e06eab5af707dc84185a2"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
gnss:
@ -235,7 +259,7 @@ packages:
description:
name: google_fonts
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.2.1"
http:
@ -243,7 +267,7 @@ packages:
description:
name: http
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
http_parser:
@ -251,7 +275,7 @@ packages:
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
intl:
@ -259,7 +283,7 @@ packages:
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.19.0"
js:
@ -267,7 +291,7 @@ packages:
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.7.1"
leak_tracker:
@ -275,7 +299,7 @@ packages:
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
leak_tracker_flutter_testing:
@ -283,7 +307,7 @@ packages:
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
leak_tracker_testing:
@ -291,7 +315,7 @@ packages:
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
libserialport:
@ -308,7 +332,7 @@ packages:
description:
name: lints
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
logging:
@ -316,7 +340,7 @@ packages:
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
matcher:
@ -324,7 +348,7 @@ packages:
description:
name: matcher
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.12.16+1"
material_color_utilities:
@ -332,7 +356,7 @@ packages:
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
meta:
@ -340,7 +364,7 @@ packages:
description:
name: meta
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
open_settings:
@ -348,7 +372,7 @@ packages:
description:
name: open_settings
sha256: ceb716dc476352aecb939805b6fa6a593168a5ed1abfe3caa022b6b1715e94ae
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
path:
@ -356,7 +380,7 @@ packages:
description:
name: path
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.9.0"
path_parsing:
@ -364,7 +388,7 @@ packages:
description:
name: path_parsing
sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
path_provider:
@ -372,7 +396,7 @@ packages:
description:
name: path_provider
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
path_provider_android:
@ -380,7 +404,7 @@ packages:
description:
name: path_provider_android
sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.2.12"
path_provider_foundation:
@ -388,7 +412,7 @@ packages:
description:
name: path_provider_foundation
sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
path_provider_linux:
@ -396,7 +420,7 @@ packages:
description:
name: path_provider_linux
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
path_provider_platform_interface:
@ -404,7 +428,7 @@ packages:
description:
name: path_provider_platform_interface
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
path_provider_windows:
@ -412,7 +436,7 @@ packages:
description:
name: path_provider_windows
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.3.0"
permission_handler:
@ -420,7 +444,7 @@ packages:
description:
name: permission_handler
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "11.3.1"
permission_handler_android:
@ -428,7 +452,7 @@ packages:
description:
name: permission_handler_android
sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "12.0.13"
permission_handler_apple:
@ -436,23 +460,23 @@ packages:
description:
name: permission_handler_apple
sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "9.4.5"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851
url: "https://pub.flutter-io.cn"
sha256: "6b9cb54b7135073841a35513fba39e598b421702d5f4d92319992fd6eb5532a9"
url: "https://pub.dev"
source: hosted
version: "0.1.3+2"
version: "0.1.3+4"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "4.2.3"
permission_handler_windows:
@ -460,7 +484,7 @@ packages:
description:
name: permission_handler_windows
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.2.1"
petitparser:
@ -468,7 +492,7 @@ packages:
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.0.2"
platform:
@ -476,7 +500,7 @@ packages:
description:
name: platform
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.1.6"
platform_detect:
@ -484,7 +508,7 @@ packages:
description:
name: platform_detect
sha256: a62f99417fc4fa2d099ce0ccdbb1bd3977920f2a64292c326271f049d4bc3a4f
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
plugin_platform_interface:
@ -492,7 +516,7 @@ packages:
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
pub_semver:
@ -500,7 +524,7 @@ packages:
description:
name: pub_semver
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
quick_blue:
@ -515,7 +539,7 @@ packages:
description:
name: roslibdart
sha256: "7473a39947f3f5ee32b032f8bab5285a465449e5cd234ae486e5ea11bd6c9e3b"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.0.1-dev+4"
scence_map:
@ -529,10 +553,10 @@ packages:
dependency: "direct main"
description:
name: searchfield
sha256: "837721576ca1de1ce40c9841760e40cd7452d3068ea2a22a7b25d06133a7d989"
url: "https://pub.flutter-io.cn"
sha256: "6b657ee0cf943fc53bdf3cc68459231bdaba9b25ebac52a335f35079a68f2a7c"
url: "https://pub.dev"
source: hosted
version: "1.1.7"
version: "1.1.8"
sky_engine:
dependency: transitive
description: flutter
@ -543,7 +567,7 @@ packages:
description:
name: source_span
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
stack_trace:
@ -551,7 +575,7 @@ packages:
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
stream_channel:
@ -559,7 +583,7 @@ packages:
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
string_scanner:
@ -567,7 +591,7 @@ packages:
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
syncfusion_flutter_core:
@ -575,7 +599,7 @@ packages:
description:
name: syncfusion_flutter_core
sha256: "6e67726b85812afc7105725a23620b876ab7f6b04b8410e211330ffb8c2cdbe8"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "26.2.14"
syncfusion_flutter_sliders:
@ -583,7 +607,7 @@ packages:
description:
name: syncfusion_flutter_sliders
sha256: dca62b54b6b4f99efa1c34abfc54ce83854d7628e78118a1941a2f30d33ea4d5
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "26.2.14"
synchronized:
@ -591,7 +615,7 @@ packages:
description:
name: synchronized
sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.3.0+3"
term_glyph:
@ -599,7 +623,7 @@ packages:
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
test_api:
@ -607,7 +631,7 @@ packages:
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
typed_data:
@ -615,7 +639,7 @@ packages:
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
vector_graphics:
@ -623,7 +647,7 @@ packages:
description:
name: vector_graphics
sha256: "773c9522d66d523e1c7b25dfb95cc91c26a1e17b107039cfe147285e92de7878"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.14"
vector_graphics_codec:
@ -631,39 +655,39 @@ packages:
description:
name: vector_graphics_codec
sha256: "2430b973a4ca3c4dbc9999b62b8c719a160100dcbae5c819bae0cacce32c9cdb"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.12"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: "26d520739b7c6b5d2a2b3274427874a8390831fd4cd5bb8cfbd7d913477d3a2e"
url: "https://pub.flutter-io.cn"
sha256: ab9ff38fc771e9ee1139320adbe3d18a60327370c218c60752068ebee4b49ab1
url: "https://pub.dev"
source: hosted
version: "1.1.14"
version: "1.1.15"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.flutter-io.cn"
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.2.4"
web:
dependency: transitive
description:
name: web
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web_socket_channel:
@ -671,7 +695,7 @@ packages:
description:
name: web_socket_channel
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
webrtc_interface:
@ -679,7 +703,7 @@ packages:
description:
name: webrtc_interface
sha256: abec3ab7956bd5ac539cf34a42fa0c82ea26675847c0966bb85160400eea9388
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
wifi_iot:
@ -687,7 +711,7 @@ packages:
description:
name: wifi_iot
sha256: "4a3301f71663a908bb50ffe6d9dc9e8b8383fab48368accf978409bde96e9aca"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.3.19+1"
wifi_scan:
@ -695,15 +719,31 @@ packages:
description:
name: wifi_scan
sha256: "9a9df688d3e71c39edcd861e6d50beb63815d5505d3884867d75f93e49d66363"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.4.1+1"
win32:
dependency: transitive
description:
name: win32
sha256: "84ba388638ed7a8cb3445a320c8273136ab2631cd5f2c57888335504ddab1bc2"
url: "https://pub.dev"
source: hosted
version: "5.8.0"
win32_registry:
dependency: transitive
description:
name: win32_registry
sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852"
url: "https://pub.dev"
source: hosted
version: "1.1.5"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
xml:
@ -711,7 +751,7 @@ packages:
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.5.0"
sdks:

View File

@ -63,6 +63,7 @@ dependencies:
flutter_localizations:
sdk: flutter
searchfield: ^1.1.7
device_info_plus: ^11.1.1
dev_dependencies:
@ -93,6 +94,9 @@ flutter:
- images/navi_pointer.png
- images/satellite.png
- images/pilerCar.png
- images/hammer.png
- images/hook.png
- images/mechinacs.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware