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;
@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;
@ -370,7 +370,7 @@ class SightGview extends StatelessWidget {
Card(
color: Colors.transparent,
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 {
final PlumRealDataController controller = Get.put(PlumRealDataController());
final RealDataController realdatacontroller = Get.put(RealDataController());
@override
Widget build(BuildContext context) {
// final size = MediaQuery.of(context).size;
final size = MediaQuery.of(context).size;
double rectWidth = size.width;
return Container(
child: Stack(
children: [
RealDataVIew(),
Positioned(
bottom: 60, //
bottom: 120, //
left: 5, //
child: Container(
decoration: const BoxDecoration(color: Colors.transparent),
@ -27,9 +30,31 @@ class RealDataContainer extends StatelessWidget {
Card(
color: Colors.transparent,
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,
),
Text(
// '桩点名称:${controller.name.value} ',
'桩点名称:${controller.name.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
Text(
'夯沉量:${controller.sid.value} ',
// '夯沉量:${controller.sid.value} ',
'桩深:${controller.sid.value} ',
style: Theme.of(context).textTheme.titleLarge,
),
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,
),
],

View File

@ -72,35 +72,7 @@ class RealDeviceView extends GetView<RealDataController> {
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 date = "2023-11-1".obs;
RecordEntity? currentPoint;
var isDeviceShow = false.obs;
PassTrackController();
@override
@ -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,6 +10,7 @@ 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';
@ -22,21 +23,35 @@ ScenceMapController mapcontroller = Get.put(ScenceMapController());
class PassTackAndDevice extends StatelessWidget {
final RecordEntity? currentPoint;
PassTackAndDevice({this.currentPoint});
final controller = Get.put(PassTrackController());
@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(flex: 2, child: RealDataContainer()),
Expanded(
flex: 5,
child: PassTrack(currentPoint: currentPoint),
),
Expanded(
flex: 2,
child: RealDeviceView(),
),
],
);
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()),
],
);
}
}
}
@ -47,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;
@ -78,7 +93,8 @@ class PassTrack extends GetView<PassTrackController> {
: null;
return OrientationBuilder(builder: (context, orientation) {
final size = MediaQuery.of(context).size;
final size = MediaQuery.of(context).size;
return Stack(
children: [
ScenceMapView(
@ -95,9 +111,8 @@ class PassTrack extends GetView<PassTrackController> {
},
children: const [],
),
SightGview(size:size),
SightGview(size: size),
const RealDataShow(),
],
);
});