|
@@ -1,33 +1,24 @@
|
|
|
import 'package:fis_i18n/i18n.dart';
|
|
|
-import 'package:fis_measure/interfaces/enums/annotation.dart';
|
|
|
-import 'package:fis_measure/interfaces/process/player/play_controller.dart';
|
|
|
-import 'package:fis_measure/interfaces/process/workspace/application.dart';
|
|
|
-import 'package:fis_measure/interfaces/process/workspace/exam_info.dart';
|
|
|
-import 'package:fis_measure/process/workspace/measure_controller.dart';
|
|
|
-import 'package:fis_measure/process/workspace/measure_data_controller.dart';
|
|
|
-import 'package:fis_measure/process/workspace/measure_handler.dart';
|
|
|
import 'package:fis_measure/view/measure/measure_config/measure_configuation_page.dart';
|
|
|
import 'package:fis_measure/view/measure/measure_config/widgets/measure_configuration_style.dart';
|
|
|
-import 'package:fis_measure/view/measure/measure_view_controller.dart';
|
|
|
-import 'package:fis_measure/view/player/controller.dart';
|
|
|
+import 'package:fis_measure/view/measure/operate_type_change_button.dart';
|
|
|
import 'package:fis_theme/theme.dart';
|
|
|
import 'package:fis_ui/index.dart';
|
|
|
import 'package:fis_ui/interface/interactive_container.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
-import 'package:vid/us/vid_us_image.dart';
|
|
|
|
|
|
|
|
|
-class MeasureSelectModel {
|
|
|
- MeasureSelectModel({required this.name, required this.code});
|
|
|
- final String name;
|
|
|
- final String code;
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-enum TabEnum {
|
|
|
- tabMeasureTool,
|
|
|
- tabNodesTool,
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
class LeftSiderHold extends StatelessWidget implements FWidget {
|
|
@@ -60,7 +51,8 @@ class LeftSiderHold extends StatelessWidget implements FWidget {
|
|
|
LeftSiderHoldAllStyleConfig(ifHideConfig: ifHideConfig),
|
|
|
],
|
|
|
),
|
|
|
- const _LeftSiderTabBar(),
|
|
|
+ const OperateTypeChangeButton(),
|
|
|
+
|
|
|
|
|
|
|
|
|
],
|
|
@@ -120,125 +112,125 @@ class LeftSiderHoldAllStyleConfig extends StatelessWidget
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-class _LeftSiderTabBar extends StatefulWidget implements FWidget {
|
|
|
- const _LeftSiderTabBar();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- @override
|
|
|
- State<_LeftSiderTabBar> createState() => _LeftSiderTabBarState();
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-class _LeftSiderTabBarState extends State<_LeftSiderTabBar>
|
|
|
- with TickerProviderStateMixin {
|
|
|
- late final measureHandler = Get.find<MeasureHandler>();
|
|
|
- late TabController tabController;
|
|
|
- List<Center> tabs = [];
|
|
|
- late final measureData = Get.find<MeasureDataController>();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- final measureController = Get.find<MeasureController>();
|
|
|
- VidPlayerController playerController =
|
|
|
- Get.find<IPlayerController>() as VidPlayerController;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- @override
|
|
|
- void initState() {
|
|
|
- super.initState();
|
|
|
- measureHandler.annotationsLoaded.addListener(onAnnotationsLoaded);
|
|
|
- measureController.imageLoaded.addListener(_onImageLoaded);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- @override
|
|
|
- void dispose() {
|
|
|
- super.dispose();
|
|
|
- measureHandler.annotationsLoaded.removeListener(onAnnotationsLoaded);
|
|
|
- measureController.imageLoaded.removeListener(_onImageLoaded);
|
|
|
- tabController.dispose();
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- void initTab() {
|
|
|
- final application = Get.find<IApplication>();
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (application.isSingleFrame && application.visuals.length > 1) {
|
|
|
-
|
|
|
- tabs = [i18nBook.measure.annotationTool.t]
|
|
|
- .map((e) => Center(child: Tab(text: e)))
|
|
|
- .toList();
|
|
|
- changeTabTo(TabEnum.tabNodesTool);
|
|
|
- } else {
|
|
|
- tabs = [i18nBook.measure.measureTool.t, i18nBook.measure.annotationTool.t]
|
|
|
- .map((e) => Center(child: Tab(text: e)))
|
|
|
- .toList();
|
|
|
- changeTabTo(TabEnum.tabMeasureTool);
|
|
|
- }
|
|
|
- setState(() {});
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- void changeTabTo(e) {
|
|
|
- measureHandler.changedTab = e;
|
|
|
- if (e == TabEnum.tabMeasureTool) {
|
|
|
- final measureMetaController = Get.find<MeasureMetaController>();
|
|
|
- measureMetaController.setAvailableModes(measureData.currentMode);
|
|
|
- measureMetaController.updateItemList();
|
|
|
- } else {
|
|
|
- final application = Get.find<IApplication>();
|
|
|
- Future.delayed(const Duration(milliseconds: 500), () {
|
|
|
- application.switchAnnotation(AnnotationType.label, "test");
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- void onAnnotationsLoaded(Object sender, _) {
|
|
|
- if (!mounted) return;
|
|
|
- initTab();
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- void _onFrameLoadedAfterFirst(Object sender, VidUsImage? e) {
|
|
|
- if (!mounted) return;
|
|
|
- initTab();
|
|
|
- playerController.firstFrameLoaded.removeListener(_onFrameLoadedAfterFirst);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- void _onImageLoaded(Object sender, ExamImageInfo? e) {
|
|
|
- playerController = Get.find<IPlayerController>() as VidPlayerController;
|
|
|
- playerController.firstFrameLoaded.addListener(_onFrameLoadedAfterFirst);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- @override
|
|
|
- void didUpdateWidget(covariant _LeftSiderTabBar oldWidget) {
|
|
|
- super.didUpdateWidget(oldWidget);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- @override
|
|
|
- FWidget build(BuildContext context) {
|
|
|
- tabController = TabController(
|
|
|
- vsync: this,
|
|
|
- length: tabs.length,
|
|
|
- initialIndex: 0,
|
|
|
- );
|
|
|
- final _colorScheme = FTheme.ins.colorScheme;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- return FTabBar(
|
|
|
- indicatorWeight: 2,
|
|
|
- indicatorColor: _colorScheme.primary,
|
|
|
- labelColor: _colorScheme.primary,
|
|
|
- indicatorSize: TabBarIndicatorSize.label,
|
|
|
- unselectedLabelColor: Colors.white,
|
|
|
- onTap: (int index) {
|
|
|
- try {
|
|
|
- changeTabTo(TabEnum.values[index]);
|
|
|
- } catch (e) {
|
|
|
- debugPrint(e.toString());
|
|
|
- }
|
|
|
- },
|
|
|
- tabs: tabs,
|
|
|
- controller: tabController,
|
|
|
- );
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|