This commit is contained in:
tanlinxing 2024-11-21 10:01:14 +08:00
parent 0e3caec53f
commit 58ec37a7c5
6 changed files with 90 additions and 63 deletions

File diff suppressed because one or more lines are too long

View File

@ -325,7 +325,7 @@ class SightGview extends StatelessWidget {
final Size size; final Size size;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// final Size size = MediaQuery.of(context).size;
final mediaQueryData = MediaQueryData.fromView(View.of(context)); // final mediaQueryData = MediaQueryData.fromView(View.of(context)); //
final orientation = mediaQueryData.orientation; // final orientation = mediaQueryData.orientation; //
double rectWidth = size.width; double rectWidth = size.width;
@ -370,7 +370,7 @@ class SightGview extends StatelessWidget {
Card( Card(
color: Colors.transparent, color: Colors.transparent,
elevation: 5.0, elevation: 5.0,
child: AimPointer(size: Size(580, 580)), child: AimPointer(size: Size(rectWidth, rectWidth)),
), ),
])), ])),

View File

@ -11,15 +11,18 @@ import 'controller.dart';
class RealDataContainer extends StatelessWidget { class RealDataContainer extends StatelessWidget {
final PlumRealDataController controller = Get.put(PlumRealDataController()); final PlumRealDataController controller = Get.put(PlumRealDataController());
final RealDataController realdatacontroller = Get.put(RealDataController());
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// final size = MediaQuery.of(context).size; final size = MediaQuery.of(context).size;
double rectWidth = size.width;
return Container( return Container(
child: Stack( child: Stack(
children: [ children: [
RealDataVIew(), RealDataVIew(),
Positioned( Positioned(
bottom: 60, // bottom: 120, //
left: 5, // left: 5, //
child: Container( child: Container(
decoration: const BoxDecoration(color: Colors.transparent), decoration: const BoxDecoration(color: Colors.transparent),
@ -27,9 +30,31 @@ class RealDataContainer extends StatelessWidget {
Card( Card(
color: Colors.transparent, color: Colors.transparent,
elevation: 0, elevation: 0,
child: AimPointer(size: Size(250,250)), child: AimPointer(size: Size(250, 250)),
), ),
]))), ]))),
Positioned(
bottom: 30,
left: 35,
child: ElevatedButton(
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(Size(200, 70)),
backgroundColor: MaterialStateProperty.all(
const Color.fromARGB(255, 226, 220, 220))),
child: Text(
realdatacontroller.isClick.value ? ' 暂停 ' : ' 开始 ',
style: TextStyle(
fontSize: 28,
color: realdatacontroller.isClick.value
? Colors.red
: Colors.green),
),
onPressed: () => {
realdatacontroller.isClick.value =
!realdatacontroller.isClick.value,
},
),
)
], ],
), ),
); );
@ -104,15 +129,28 @@ class RealDataVIew extends GetView<RealDataController> {
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,
), ),
Text( Text(
// '桩点名称:${controller.name.value} ',
'桩点名称:${controller.name.value} ', '桩点名称:${controller.name.value} ',
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,
), ),
Text( Text(
'夯沉量:${controller.sid.value} ', // '夯沉量:${controller.sid.value} ',
'桩深:${controller.sid.value} ',
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,
), ),
Text( Text(
'次:${controller.times.value} ', // '次:${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, style: Theme.of(context).textTheme.titleLarge,
), ),
], ],

View File

@ -72,35 +72,7 @@ class RealDeviceView extends GetView<RealDataController> {
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
Positioned(
bottom: 20,
left: 35,
child: ElevatedButton(
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(Size(200, 70)),
backgroundColor: MaterialStateProperty.all( const Color.fromARGB(255, 226, 220, 220))),
child: Text(
controller.isClick.value ? ' 暂停 ' : ' 开始 ',
style: TextStyle(fontSize: 28,
color:
controller.isClick.value ? Colors.red : Colors.green),
),
onPressed: () => {
controller.isClick.value = !controller.isClick.value,
},
),
)
// Positioned(
// bottom: 40,
// right: 30,
// child: ElevatedButton(
// child:
// const Text(" 暂停 ", style: TextStyle(color: Colors.red)),
// onPressed: () => null,
// ),
// )
], ],
), ),
); );

View File

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

View File

@ -10,6 +10,7 @@ import 'package:intl/intl.dart';
import 'package:scence_map/controllers/controller.dart'; import 'package:scence_map/controllers/controller.dart';
import 'package:scence_map/record_entity.dart'; import 'package:scence_map/record_entity.dart';
import 'package:scence_map/scence_map.dart'; import 'package:scence_map/scence_map.dart';
import '../../service/pile/device_type.dart';
import '../aim_point/aimpoint_controller.dart'; import '../aim_point/aimpoint_controller.dart';
import '../dataAndDevice/real_data.dart'; import '../dataAndDevice/real_data.dart';
import '../dataAndDevice/real_device.dart'; import '../dataAndDevice/real_device.dart';
@ -22,21 +23,35 @@ ScenceMapController mapcontroller = Get.put(ScenceMapController());
class PassTackAndDevice extends StatelessWidget { class PassTackAndDevice extends StatelessWidget {
final RecordEntity? currentPoint; final RecordEntity? currentPoint;
PassTackAndDevice({this.currentPoint}); PassTackAndDevice({this.currentPoint});
final controller = Get.put(PassTrackController());
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( if (controller.isDeviceShow.value) {
children: [ return Row(
Expanded(flex: 2, child: RealDataContainer()), children: [
Expanded( Expanded(
flex: 5, flex: 2,
child: PassTrack(currentPoint: currentPoint), child: RealDeviceView(),
), ),
Expanded( Expanded(
flex: 2, flex: 5,
child: RealDeviceView(), 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()),
],
);
}
} }
} }
@ -47,7 +62,7 @@ class PassTrack extends GetView<PassTrackController> {
RecordEntity? currentPoint; RecordEntity? currentPoint;
@override @override
final controller = Get.put(PassTrackController()); final controller = Get.put(PassTrackController());
final aimcontroller = Get.find<AimPointerController>();
// String str = "播放"; // String str = "播放";
// int sWidth = 0; // int sWidth = 0;
// int bits = -1; // int bits = -1;
@ -78,7 +93,8 @@ class PassTrack extends GetView<PassTrackController> {
: null; : null;
return OrientationBuilder(builder: (context, orientation) { return OrientationBuilder(builder: (context, orientation) {
final size = MediaQuery.of(context).size; final size = MediaQuery.of(context).size;
return Stack( return Stack(
children: [ children: [
ScenceMapView( ScenceMapView(
@ -95,9 +111,8 @@ class PassTrack extends GetView<PassTrackController> {
}, },
children: const [], children: const [],
), ),
SightGview(size:size), SightGview(size: size),
const RealDataShow(), const RealDataShow(),
], ],
); );
}); });