|
@@ -2,12 +2,13 @@ import 'dart:convert';
|
|
|
|
|
|
import 'package:fis_i18n/i18n.dart';
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
-import 'package:fis_measure/interfaces/process/items/item_metas.dart';
|
|
|
+import 'package:fis_measure/interfaces/process/player/play_controller.dart';
|
|
|
import 'package:fis_measure/interfaces/process/workspace/application.dart';
|
|
|
-import 'package:fis_measure/process/items/item_meta_convert.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/widgets/measurement_tool_selection.dart';
|
|
|
+import 'package:fis_measure/view/measure/measure_view_controller.dart';
|
|
|
+import 'package:fis_measure/view/player/controller.dart';
|
|
|
import 'package:fis_theme/theme.dart';
|
|
|
import 'package:fis_ui/index.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
@@ -25,7 +26,7 @@ class ItemMetaGroup {
|
|
|
final String itemMetaGroupTitle;
|
|
|
|
|
|
/// 当前测量组的测量数组
|
|
|
- final List<ItemMeta> itemMeta;
|
|
|
+ final List<ItemMetaDTO> itemMeta;
|
|
|
|
|
|
/// 是否展开
|
|
|
bool? isExpend;
|
|
@@ -64,27 +65,19 @@ class _MeasureConfigurationDialogState
|
|
|
|
|
|
late final application = Get.find<IApplication>();
|
|
|
late final measureHandler = Get.find<MeasureHandler>();
|
|
|
+ final playerController = Get.find<IPlayerController>() as VidPlayerController;
|
|
|
|
|
|
/// 数据
|
|
|
final measureData = Get.find<MeasureDataController>();
|
|
|
|
|
|
+ /// 测量项控制器
|
|
|
+ final measureMetaController = Get.find<MeasureMetaController>();
|
|
|
+
|
|
|
/// 选中的测量项
|
|
|
List<String> chooseMeasureList = [];
|
|
|
List<ItemMetaGroup> itemMetaListGroup = [];
|
|
|
String activeName = '';
|
|
|
|
|
|
- /// 跟超声机端保持一致,配置 项目写死
|
|
|
- List<ItemMetaGroup> getMeasureConfigurationGroupName() {
|
|
|
- return [
|
|
|
- ItemMetaGroup('Common', [], true),
|
|
|
- ItemMetaGroup('ABD', [], true),
|
|
|
- ItemMetaGroup('CARD', [], true),
|
|
|
- ItemMetaGroup('GYN', [], true),
|
|
|
- ItemMetaGroup('OB', [], true),
|
|
|
- ItemMetaGroup('VAS', [], true),
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
/// 打开已选测量工具设置
|
|
|
///
|
|
|
/// [name] 测量的名字 后期改版后应该是一个测量对象
|
|
@@ -95,10 +88,14 @@ class _MeasureConfigurationDialogState
|
|
|
// router.dialog(() => HasSelectedSettingDialog(name: name));
|
|
|
}
|
|
|
Future<void> getName() async {
|
|
|
+ List<String> getModes = [];
|
|
|
+ for (var element in playerController.currentFrame?.visuals[0].modes ?? []) {
|
|
|
+ getModes.add(element.type.toString().split('.')[1]);
|
|
|
+ }
|
|
|
var measureModeSelection = MeasureModeSelection(
|
|
|
application.applicationName,
|
|
|
application.categoryName,
|
|
|
- application.isThirdPart ? ['TPPTissue'] : ['Tissue'],
|
|
|
+ application.isThirdPart ? ['TPPTissue'] : getModes,
|
|
|
);
|
|
|
measureHandler.measureModeChanged = measureModeSelection;
|
|
|
measureData.getMeasureApplicationList = [];
|
|
@@ -108,30 +105,9 @@ class _MeasureConfigurationDialogState
|
|
|
/// 模式版本
|
|
|
measureData.measureApplicationVersion =
|
|
|
measureApplicationDTO.version ?? '';
|
|
|
-
|
|
|
- ///模式列表
|
|
|
- var models = measureApplicationDTO.availableModes;
|
|
|
- if (models != null && models.isNotEmpty) {
|
|
|
- ///群组列表
|
|
|
- var groups = models[0].availableGroups;
|
|
|
- if (groups != null && groups.isNotEmpty) {
|
|
|
- ///项目列表
|
|
|
- var folders = groups[0].availableFolders;
|
|
|
- if (folders != null && folders.isNotEmpty) {
|
|
|
- measureData.getMeasureApplicationList =
|
|
|
- folders[0].workingItemNames ?? [];
|
|
|
- if (folders[0].availableItems != null) {
|
|
|
- measureData.itemMetaList =
|
|
|
- folders[0].availableItems!.map((element) {
|
|
|
- return ItemMetaConverter(element).output();
|
|
|
- }).toList();
|
|
|
- }
|
|
|
- if (measureData.getMeasureApplicationList.isNotEmpty) {
|
|
|
- changeItem(measureData.getMeasureApplicationList[0]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ measureData.availableModes = measureApplicationDTO.availableModes ?? [];
|
|
|
+ measureMetaController.setAvailableModes(measureData.currentMode);
|
|
|
+ activeName = measureData.getItemMetaList[0].name;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -149,7 +125,7 @@ class _MeasureConfigurationDialogState
|
|
|
application.applicationName,
|
|
|
application.categoryName,
|
|
|
UserDefinedMeasureModeDTO(
|
|
|
- modeName: 'Tissue',
|
|
|
+ modeName: measureData.currentMode,
|
|
|
workingGroups: [
|
|
|
UserDefinedMeasureGroupDTO(
|
|
|
name: 'General',
|
|
@@ -164,41 +140,18 @@ class _MeasureConfigurationDialogState
|
|
|
),
|
|
|
);
|
|
|
measureHandler.measureModeSubmitChanged = measureModeSubmitChanged;
|
|
|
- var saveUserDefinedMeasureApplication = await measureData
|
|
|
- .saveUserDefinedMeasureApplicationAsync
|
|
|
+ await measureData.saveUserDefinedMeasureApplicationAsync
|
|
|
.call(measureModeSubmitChanged);
|
|
|
getName();
|
|
|
- setState(() {});
|
|
|
+ measureMetaController.setAvailableModes(measureData.currentMode);
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
|
super.initState();
|
|
|
- List<ItemMetaGroup> _itemMetaConfigurationList = [];
|
|
|
List<String> chooseMeasure = [];
|
|
|
-
|
|
|
- Map<String, List<ItemMeta>> _group = {};
|
|
|
- getMeasureConfigurationGroupName().forEach(
|
|
|
- ((element) {
|
|
|
- List<ItemMeta> itemMetaListGroupItem = [];
|
|
|
- (measureData.itemMetaList).toList().forEach(
|
|
|
- (e) {
|
|
|
- // if (e.categories!.contains(element.itemMetaGroupTitle)) {
|
|
|
- // itemMetaListGroupItem.add(e);
|
|
|
- // }
|
|
|
- _group[element.itemMetaGroupTitle] = itemMetaListGroupItem;
|
|
|
- },
|
|
|
- );
|
|
|
- }),
|
|
|
- );
|
|
|
- _group.forEach(
|
|
|
- (key, value) {
|
|
|
- _itemMetaConfigurationList.add(
|
|
|
- ItemMetaGroup(key, value, true),
|
|
|
- );
|
|
|
- },
|
|
|
- );
|
|
|
- itemMetaListGroup = _itemMetaConfigurationList;
|
|
|
+ measureMetaController.measureConfig();
|
|
|
+ itemMetaListGroup = measureData.itemMetaListGroup;
|
|
|
chooseMeasure = measureData.getMeasureApplicationList;
|
|
|
chooseMeasureList = chooseMeasure.toSet().toList();
|
|
|
}
|
|
@@ -310,9 +263,11 @@ class _MeasureConfigurationDialogState
|
|
|
),
|
|
|
measureToolsTab == 0
|
|
|
? FExpanded(
|
|
|
- child: SelectModulePage(
|
|
|
- itemMetaListGroup: itemMetaListGroup,
|
|
|
- chooseMeasureList: chooseMeasureList,
|
|
|
+ child: FSingleChildScrollView(
|
|
|
+ child: SelectModulePage(
|
|
|
+ itemMetaListGroup: itemMetaListGroup,
|
|
|
+ chooseMeasureList: chooseMeasureList,
|
|
|
+ ),
|
|
|
),
|
|
|
)
|
|
|
: FExpanded(
|