Quellcode durchsuchen

改用与PC一致的测量项过滤方式

gavin.chen vor 2 Jahren
Ursprung
Commit
4f776fa46e
1 geänderte Dateien mit 8 neuen und 62 gelöschten Zeilen
  1. 8 62
      lib/view/mobile_view/mobile_right_panel/mobile_measure_tool.dart

+ 8 - 62
lib/view/mobile_view/mobile_right_panel/mobile_measure_tool.dart

@@ -581,38 +581,8 @@ class _MobileMeasureSelector extends FState<MobileMeasureSelector> {
 
   /// 过滤出当前支持的所有测量项
   List<ItemMetaDTO> _currSupportedItemFilter(MeasureModeDTO mode) {
-    final supportedMeasureTypeName = [
-      'TimeSpan', // StraightLine
-      'Distance', // StraightLine
-      "VerticalDistance", // StraightLine
-      'AreaPerimeterTrace', // Trace
-      "Depth", // Location
-      "Velocity", // Location
-      "MDepth", // Location
-      "HipOneRay", // TwoRay
-      "HipTwoRay", // ThreeRay
-      "DepthToBaseLine", // DepthToBaseLine
-      "AbRatioTwoVelocity", // TwoLocation
-      "ResistivityIndexTwoLocationByEd", // TwoLocation
-      "MaxPgTwoLocation", // TwoLocation
-      "VolumeThreeDistance", // LWHStraightLine
-      "ThreeDistanceMean", // LWHStraightLine
-      "ThreeDistanceMax", // LWHStraightLine
-      "AbRatioTwoArea", // TwoArea
-      "StenosisTwoArea", // TwoArea
-      "AreaStraightLine", // AreaStraightLine
-      "AreaPerimeterSpline", // Spline
-      "CurveLengthSpline", // Spline
-      "AreaPerimeterPolyline", // Polyline
-      "CurveLengthPolyline", // Polyline
-      "PolyLineAngle", // PolyLineAngle
-      "CardiacAxis", // TwolineAngle
-      "Afi", // Afi
-      "VolumeEllipse", // Ellipse
-      "AreaPerimeterEllipse", // Ellipse
-      "DopplerTrace", // MultiTrace
-    ];
     List<ItemMetaDTO> _supportedItems = [];
+    List<ItemMetaDTO> _unSupportedItems = [];
     if (mode.availableGroups == null || mode.availableGroups!.isEmpty) {
       return _supportedItems;
     }
@@ -626,46 +596,22 @@ class _MobileMeasureSelector extends FState<MobileMeasureSelector> {
         }
         for (ItemMetaDTO items in folder.availableItems!) {
           bool isSupported = false;
-          if (supportedMeasureTypeName.contains(items.measureTypeName)) {
-            _supportedItems.add(items);
+          if (!MeasureUnsupportedTerms.items.contains(items.name)) {
             isSupported = true;
-          }
-          if (items.multiMethodItems != null &&
-              items.multiMethodItems!.isNotEmpty) {
-            for (var item in items.multiMethodItems!) {
-              if (supportedMeasureTypeName.contains(item.measureTypeName)) {
-                if (item.isWorking) {
-                  _supportedItems.add(items);
-                  isSupported = true;
-                }
-              }
-            }
-          }
-
-          /// 筛选支持的组合测量项
-          if (items.methodChildItems != null &&
-              items.methodChildItems!.isNotEmpty) {
-            bool isAdd = true;
-            for (var item in items.methodChildItems!) {
-              if (!supportedMeasureTypeName.contains(item.measureTypeName)) {
-                isAdd = false;
-              }
-            }
-            if (isAdd) {
-              _supportedItems.add(items);
-              isSupported = true;
-            }
+            _supportedItems.add(items);
           }
 
           if (isSupported) {
-            print("✅ 支持的测量项:${items.name} | ${items.measureTypeName}}");
+            // print("✅ 支持的测量项:${items.name} | ${items.measureTypeName}}");
           } else {
-            print("❌ 不支持的测量项:${items.name} | ${items.measureTypeName}}");
+            // print("❌ 暂不支持的测量项:${items.name} | ${items.measureTypeName}}");
+            _unSupportedItems.add(items);
           }
         }
       }
     }
-    print("${mode.modeName} 模式下过滤出 ${_supportedItems.length} 项");
+    // print("${mode.modeName} 模式下过滤出支持的 ${_supportedItems.length} 项");
+    // print("${mode.modeName} 模式下过滤出不支持的 ${_unSupportedItems.length} 项");
     return _supportedItems;
   }
 }