|
@@ -1,5 +1,8 @@
|
|
|
import 'package:fis_common/logger/logger.dart';
|
|
|
+import 'package:fis_measure/interfaces/date_types/rect.dart';
|
|
|
import 'package:fis_measure/interfaces/enums/display_mode.dart';
|
|
|
+import 'package:fis_measure/interfaces/enums/visual_area_type.dart';
|
|
|
+import 'package:fis_measure/interfaces/mode_names.dart';
|
|
|
|
|
|
import 'section.dart';
|
|
|
import 'view_port.dart';
|
|
@@ -13,7 +16,7 @@ class LayoutConfiguration {
|
|
|
}
|
|
|
|
|
|
bool _loaded = false;
|
|
|
- List<LayoutSection> _layoutSections = [];
|
|
|
+ final List<LayoutSection> _layoutSections = [];
|
|
|
|
|
|
bool get loaded => _loaded;
|
|
|
|
|
@@ -31,6 +34,47 @@ class LayoutConfiguration {
|
|
|
_loaded = true;
|
|
|
}
|
|
|
|
|
|
+ DRect getRect(
|
|
|
+ String section,
|
|
|
+ VisualAreaTypeEnum areaType,
|
|
|
+ DisplayModeEnum displayFormat,
|
|
|
+ ) {
|
|
|
+ String mode;
|
|
|
+ switch (areaType) {
|
|
|
+ case VisualAreaTypeEnum.tissue:
|
|
|
+ case VisualAreaTypeEnum.flow:
|
|
|
+ mode = ModeNames.B;
|
|
|
+ break;
|
|
|
+ case VisualAreaTypeEnum.timeMotion:
|
|
|
+ case VisualAreaTypeEnum.tissueTimeMotion:
|
|
|
+ mode = ModeNames.TM;
|
|
|
+ break;
|
|
|
+ case VisualAreaTypeEnum.doppler:
|
|
|
+ mode = ModeNames.Doppler;
|
|
|
+ break;
|
|
|
+ case VisualAreaTypeEnum.trace:
|
|
|
+ mode = ModeNames.Trace;
|
|
|
+ break;
|
|
|
+ case VisualAreaTypeEnum.colorbar:
|
|
|
+ mode = ModeNames.P_ColorBar;
|
|
|
+ break;
|
|
|
+ case VisualAreaTypeEnum.tissue3D:
|
|
|
+ mode = ModeNames.FourD;
|
|
|
+ break;
|
|
|
+ case VisualAreaTypeEnum.sweiReliableColorBar:
|
|
|
+ mode = ModeNames.P_SweiReliableColorBar;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ final viewPort = _matchViewPort(section, mode, displayFormat);
|
|
|
+ final rect = DRect(
|
|
|
+ viewPort.left / 100,
|
|
|
+ viewPort.top / 100,
|
|
|
+ (viewPort.right - viewPort.left) / 100,
|
|
|
+ (viewPort.bottom - viewPort.top) / 100);
|
|
|
+ return rect;
|
|
|
+ }
|
|
|
+
|
|
|
LayoutViewPort _matchViewPort(
|
|
|
String name,
|
|
|
String layoutKey,
|
|
@@ -40,7 +84,7 @@ class LayoutConfiguration {
|
|
|
LayoutViewPort viewPort = LayoutViewPort();
|
|
|
List<LayoutSection> sections = [];
|
|
|
|
|
|
- var sectionIdx = _layoutSections.indexWhere((x) => x.key == name);
|
|
|
+ final sectionIdx = _layoutSections.indexWhere((x) => x.key == name);
|
|
|
if (sectionIdx > -1) {
|
|
|
sections.add(_layoutSections[sectionIdx]);
|
|
|
}
|