2024-07-31 19:04:11 +08:00
|
|
|
import 'dart:math';
|
2024-07-30 18:20:27 +08:00
|
|
|
|
2024-07-31 19:04:11 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:gnss/gnss.dart';
|
2024-07-30 18:20:27 +08:00
|
|
|
|
2024-07-31 19:04:11 +08:00
|
|
|
import 'sky/skyplot.dart';
|
|
|
|
import 'Controller/gnssController.dart'; // Import the correct file location for GnssController
|
2024-07-30 18:20:27 +08:00
|
|
|
|
|
|
|
// void main() {
|
2024-07-31 19:04:11 +08:00
|
|
|
// Get.lazyPut<GnssController>(() => GnssController(), tag: 'gnss');
|
2024-07-30 18:20:27 +08:00
|
|
|
// runApp(MyApp());
|
|
|
|
// }
|
|
|
|
|
2024-07-31 19:04:11 +08:00
|
|
|
// Gnss gnss = Gnss(port: "/dev/ttysWK2", baudrate: 115200);
|
2024-07-30 18:20:27 +08:00
|
|
|
|
2024-07-31 19:04:11 +08:00
|
|
|
// class MyApp extends StatefulWidget {
|
2024-07-30 18:20:27 +08:00
|
|
|
// @override
|
2024-07-31 19:04:11 +08:00
|
|
|
// _MyAppState createState() => _MyAppState();
|
2024-07-30 18:20:27 +08:00
|
|
|
// }
|
|
|
|
|
2024-07-31 19:04:11 +08:00
|
|
|
// class _MyAppState extends State<MyApp> {
|
2024-07-30 18:20:27 +08:00
|
|
|
// @override
|
|
|
|
// void initState() {
|
|
|
|
// super.initState();
|
|
|
|
// // 初始化每个组的颜色
|
2024-07-31 19:04:11 +08:00
|
|
|
// gnss.start();
|
|
|
|
// gnss.locationStream.listen((location) {
|
|
|
|
// log(location.toString() as num);
|
|
|
|
// });
|
|
|
|
// gnss.signalStream.listen((location) {
|
|
|
|
// log(location.toString() as num);
|
2024-07-30 18:20:27 +08:00
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
// return Scaffold(
|
2024-07-31 19:04:11 +08:00
|
|
|
// appBar: AppBar(
|
|
|
|
// title: Text('天空图'),
|
|
|
|
// ),
|
|
|
|
// body: SkyPlotPage(controller: Get.find(tag: 'gnss')));
|
2024-07-30 18:20:27 +08:00
|
|
|
// }
|
|
|
|
// }
|
2024-07-31 19:04:11 +08:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
Get.lazyPut<GnssController>(() => GnssController(), tag: 'gnss');
|
|
|
|
runApp(MyApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Gnss gnss = Gnss(port: "/dev/ttysWK2", baudrate: 115200);
|
|
|
|
|
|
|
|
class MyApp extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
_MyAppState createState() => _MyAppState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
// 初始化每个组的颜色
|
|
|
|
// gnss.start();
|
|
|
|
// gnss.locationStream.listen((location) {
|
|
|
|
// log(location.toString() as num);
|
|
|
|
// });
|
|
|
|
// gnss.signalStream.listen((location) {
|
|
|
|
// log(location.toString() as num);
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final con = Get.find<GnssController>(tag: 'gnss');
|
|
|
|
return MaterialApp(
|
|
|
|
home: Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: Text('天空图'),
|
|
|
|
),
|
|
|
|
body: SkyPlotPage(),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|