Prechádzať zdrojové kódy

update(mobile): MeasureHandler 改用 IMeasureHandler

gavin.chen 2 rokov pred
rodič
commit
b93102ff56

+ 1 - 1
lib/process/workspace/application.dart

@@ -203,7 +203,7 @@ class Application implements IApplication {
       _activeAnnotationItem?.featureUpdated
           .removeListener(_onActiveAnnotationItemFeatureUpdated);
       _activeAnnotationItem = value;
-      if (_activeMeasureItem != null) {
+      if (_activeAnnotationItem != null) {
         _annotationItems.add(_activeAnnotationItem!);
         // 添加活动注释项事件监听
         _activeAnnotationItem!.featureUpdated

+ 7 - 12
lib/view/mobile_view/mobile_bottom_menu.dart

@@ -26,7 +26,7 @@ class MobileBottomMenu extends StatefulWidget {
 
 class _MobileBottomMenuState extends State<MobileBottomMenu> {
   final application = Get.find<IApplication>();
-  late final measureHandler = Get.find<MeasureHandler>();
+  late final measureHandler = Get.find<IMeasureHandler>();
   final mobileMeasureStateController =
       Get.find<MobileMeasureViewStateController>();
   late final playerController = Get.find<IPlayerController>();
@@ -126,8 +126,6 @@ class _MobileBottomMenuState extends State<MobileBottomMenu> {
                   ? SingleIconButton(
                       icon: Icons.straighten,
                       onPressed: () {
-                        print("进入测量模式");
-
                         mobileMeasureStateController.currentMode =
                             MobileMeasureMode.measureMode;
                       },
@@ -137,7 +135,6 @@ class _MobileBottomMenuState extends State<MobileBottomMenu> {
                   ? SingleIconButton(
                       icon: Icons.more,
                       onPressed: () {
-                        ///FIXME:[Gavin]直接进入注释模式,绘制事件不响应
                         measureHandler.changedAnnotationType =
                             AnnotationType.label;
                         application.switchAnnotation(AnnotationType.label);
@@ -151,14 +148,12 @@ class _MobileBottomMenuState extends State<MobileBottomMenu> {
         ),
       ),
       ifShowParamsPanel
-          ? Container(
-              child: GestureDetector(
-                onTap: () {
-                  setState(() {
-                    ifShowParamsPanel = false;
-                  });
-                },
-              ),
+          ? GestureDetector(
+              onTap: () {
+                setState(() {
+                  ifShowParamsPanel = false;
+                });
+              },
             )
           : Container(),
       ImageParamsPanel(

+ 1 - 1
lib/view/mobile_view/mobile_measure_main_view.dart

@@ -55,7 +55,7 @@ class _MobileMeasureMainViewState extends State<MobileMeasureMainView> {
   late final application = Get.find<IApplication>();
 
   late final playerController = Get.find<IPlayerController>();
-  late final measureHandler = Get.find<MeasureHandler>();
+  late final measureHandler = Get.find<IMeasureHandler>();
 
   /// 测量数据
   final measureData = Get.find<MeasureDataController>();

+ 1 - 115
lib/view/mobile_view/mobile_measure_view.dart

@@ -1,22 +1,12 @@
 import 'package:fis_i18n/i18n.dart';
 import 'package:fis_jsonrpc/rpc.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/interfaces/process/workspace/measure_3d_view_controller.dart';
 import 'package:fis_measure/process/layout/configuration.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/cursor.dart';
-import 'package:fis_measure/view/gesture/positioned_cursor.dart';
-import 'package:fis_measure/view/measure/measure_left_annotation.dart';
-import 'package:fis_measure/view/measure/measure_tool.dart';
-import 'package:fis_measure/view/measure/carotid_measure_tool.dart';
-import 'package:fis_measure/view/measure/tool_chest_title.dart';
 import 'package:fis_measure/view/mobile_view/mobile_measure_main_view.dart';
-import 'package:fis_measure/view/player/control_board/operate_bar.dart';
 import 'package:fis_ui/index.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
@@ -55,7 +45,7 @@ class _MobileMeasureMainPageState extends State<MobileMeasureMainPage> {
   ///检查图片信息表
   List<ExamImageInfo> examImageInfoList = [];
 
-  late final measureHandler = Get.find<MeasureHandler>();
+  late final measureHandler = Get.find<IMeasureHandler>();
 
   /// 测量控制器
   late MeasureController measureController = Get.put(MeasureController(
@@ -229,35 +219,6 @@ class _MobileMeasureMainPageState extends State<MobileMeasureMainPage> {
     );
   }
 
-  MeasureCursorType _getMeasureSystemSettingCursorType(
-    CursorTypeEnum cursorType,
-  ) {
-    switch (cursorType) {
-      case CursorTypeEnum.CursorType1Icon:
-        return MeasureCursorType.cursor01;
-      case CursorTypeEnum.CursorType2Icon:
-        return MeasureCursorType.cursor02;
-      case CursorTypeEnum.CursorType3Icon:
-        return MeasureCursorType.cursor03;
-      case CursorTypeEnum.CursorType4Icon:
-        return MeasureCursorType.cursor04;
-      case CursorTypeEnum.CursorType5Icon:
-        return MeasureCursorType.cursor05;
-      default:
-        return MeasureCursorType.cursor01;
-    }
-  }
-
-  /// 初始化卡尺样式部分
-  // Future<void> _getMeasureSystemSetting() async {
-  //   final result = await measureData.getMeasureSystemSettingAsync();
-  //   measureData.measureSystemSetting = result as MeasureSystemSettingDTO;
-  //   mouseState.cursorType = _getMeasureSystemSettingCursorType(
-  //       measureData.measureSystemSetting.cursorType);
-  //   mouseState.cursorSize =
-  //       measureData.measureSystemSetting.cursorSize as double;
-  // }
-
   void _initData() async {
     List<RemedicalInfoDTO> remedicals = [];
     loaded = false;
@@ -293,78 +254,3 @@ class _MobileMeasureMainPageState extends State<MobileMeasureMainPage> {
     measureController.imageLoaded.addListener(onImageLoaded);
   }
 }
-
-/// 测量左边操作页面
-class _MeasureLeftBoard extends StatefulWidget implements FWidget {
-  @override
-  State<_MeasureLeftBoard> createState() => _MeasureLeftBoardState();
-}
-
-class _MeasureLeftBoardState extends State<_MeasureLeftBoard> {
-  final measureHandler = Get.find<MeasureHandler>();
-  late final application = Get.find<IApplication>();
-  final playerController = Get.find<IPlayerController>();
-  // final measure3DViewController = Get.find<Measure3DViewController>();
-
-  /// 是否显示颈动脉2D指定的测量项
-  bool showCarotid2DSelectMeasure = false;
-
-  /// 是否显示测量项
-  bool showMeasureItems = true;
-
-  bool get isMeasureTool => measureHandler.changedTab == TagEnum.MeasureTool;
-  bool get isArrowMeasureAnnotationType =>
-      measureHandler.changedAnnotationType == AnnotationType.arrow;
-  void onChangedTab(
-    Object sender,
-    TagEnum? e,
-  ) {
-    setState(() {});
-  }
-
-  @override
-  void initState() {
-    measureHandler.onChangedTab.addListener(onChangedTab);
-    super.initState();
-  }
-
-  @override
-  void dispose() {
-    measureHandler.onChangedTab.removeListener(onChangedTab);
-    super.dispose();
-  }
-
-  @override
-  FWidget build(BuildContext context) {
-    return FColumn(
-      mainAxisSize: MainAxisSize.max,
-      crossAxisAlignment: CrossAxisAlignment.start,
-      children: [
-        const LeftSiderHold(),
-        if (!isMeasureTool) ...[
-          FExpanded(
-            child: FContainer(
-              width: 300,
-              key: UniqueKey(),
-              child: const MeasureLeftAnnotation(),
-            ),
-          ),
-          // _MeasureArrow(),
-        ] else ...[
-          FExpanded(
-            child: showMeasureItems
-                ? FContainer(
-                    width: 300,
-                    key: UniqueKey(),
-                    child: showCarotid2DSelectMeasure
-                        ? const CarotidLeftSiderSelectMeasure()
-                        : const LeftSiderSelectMeasure(),
-                  )
-                : FContainer(),
-          ),
-          const OperateBar(),
-        ]
-      ],
-    );
-  }
-}

+ 1 - 1
lib/view/mobile_view/mobile_right_panel/mobile_annotation_tool.dart

@@ -24,7 +24,7 @@ class _MobileAnnotationSelectorState extends State<MobileAnnotationSelector> {
 
   final scrollController = ScrollController();
   final application = Get.find<IApplication>();
-  late final measureHandler = Get.find<MeasureHandler>();
+  late final measureHandler = Get.find<IMeasureHandler>();
 
   /// 数据
   late final measureData = Get.find<MeasureDataController>();

+ 1 - 1
lib/view/mobile_view/mobile_top_menu.dart

@@ -24,7 +24,7 @@ class MobileTopMenu extends StatefulWidget {
 
 class _MobileTopMenuState extends State<MobileTopMenu> {
   final application = Get.find<IApplication>();
-  final measureHandler = Get.find<MeasureHandler>();
+  final measureHandler = Get.find<IMeasureHandler>();
   final measureData = Get.find<MeasureDataController>();
 
   final mobileMeasureStateController =