|
@@ -41,59 +41,34 @@ class LayoutConfiguration {
|
|
VisualAreaTypeEnum areaType,
|
|
VisualAreaTypeEnum areaType,
|
|
DisplayModeEnum displayFormat,
|
|
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 mode = _findVisualAreaMode(areaType);
|
|
final viewPort = _matchViewPort(section, mode, displayFormat);
|
|
final viewPort = _matchViewPort(section, mode, displayFormat);
|
|
final rect = DRect(
|
|
final rect = DRect(
|
|
- viewPort.left / 100,
|
|
|
|
- viewPort.top / 100,
|
|
|
|
- (viewPort.right - viewPort.left) / 100,
|
|
|
|
- (viewPort.bottom - viewPort.top) / 100);
|
|
|
|
|
|
+ viewPort.left / 100,
|
|
|
|
+ viewPort.top / 100,
|
|
|
|
+ (viewPort.right - viewPort.left) / 100,
|
|
|
|
+ (viewPort.bottom - viewPort.top) / 100,
|
|
|
|
+ );
|
|
return rect;
|
|
return rect;
|
|
}
|
|
}
|
|
|
|
|
|
LayoutViewPort _matchViewPort(
|
|
LayoutViewPort _matchViewPort(
|
|
- String name,
|
|
|
|
- String layoutKey,
|
|
|
|
|
|
+ String section,
|
|
|
|
+ String mode,
|
|
DisplayModeEnum displayFormat,
|
|
DisplayModeEnum displayFormat,
|
|
) {
|
|
) {
|
|
bool found = false;
|
|
bool found = false;
|
|
LayoutViewPort viewPort = LayoutViewPort();
|
|
LayoutViewPort viewPort = LayoutViewPort();
|
|
List<LayoutSection> sections = [];
|
|
List<LayoutSection> sections = [];
|
|
|
|
|
|
- final sectionIdx = _layoutSections.indexWhere((x) => x.key == name);
|
|
|
|
|
|
+ final sectionIdx = _layoutSections.indexWhere((x) => x.name == section);
|
|
if (sectionIdx > -1) {
|
|
if (sectionIdx > -1) {
|
|
sections.add(_layoutSections[sectionIdx]);
|
|
sections.add(_layoutSections[sectionIdx]);
|
|
}
|
|
}
|
|
sections.add(_layoutSections[0]);
|
|
sections.add(_layoutSections[0]);
|
|
|
|
|
|
for (final candidate in sections) {
|
|
for (final candidate in sections) {
|
|
- final layoutIdx = candidate.layouts.indexWhere((x) => x.key == layoutKey);
|
|
|
|
|
|
+ final layoutIdx = candidate.layouts.indexWhere((x) => x.mode == mode);
|
|
if (layoutIdx > -1) {
|
|
if (layoutIdx > -1) {
|
|
final layout = candidate.layouts[layoutIdx];
|
|
final layout = candidate.layouts[layoutIdx];
|
|
int i = -1;
|
|
int i = -1;
|
|
@@ -114,9 +89,30 @@ class LayoutConfiguration {
|
|
|
|
|
|
if (!found) {
|
|
if (!found) {
|
|
logger.w(
|
|
logger.w(
|
|
- "MatchViewPort failed, ViewPort:$viewPort is used. layout section:$name, layout key:$layoutKey, display format:${displayFormat.name}.");
|
|
|
|
|
|
+ "MatchViewPort failed, ViewPort:$viewPort is used. layout section:$section, mode:$mode, display format:${displayFormat.name}.");
|
|
}
|
|
}
|
|
|
|
|
|
return viewPort;
|
|
return viewPort;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ String _findVisualAreaMode(VisualAreaTypeEnum areaType) {
|
|
|
|
+ switch (areaType) {
|
|
|
|
+ case VisualAreaTypeEnum.tissue:
|
|
|
|
+ case VisualAreaTypeEnum.flow:
|
|
|
|
+ return ModeNames.B;
|
|
|
|
+ case VisualAreaTypeEnum.timeMotion:
|
|
|
|
+ case VisualAreaTypeEnum.tissueTimeMotion:
|
|
|
|
+ return ModeNames.TM;
|
|
|
|
+ case VisualAreaTypeEnum.doppler:
|
|
|
|
+ return ModeNames.Doppler;
|
|
|
|
+ case VisualAreaTypeEnum.trace:
|
|
|
|
+ return ModeNames.Trace;
|
|
|
|
+ case VisualAreaTypeEnum.colorbar:
|
|
|
|
+ return ModeNames.P_ColorBar;
|
|
|
|
+ case VisualAreaTypeEnum.tissue3D:
|
|
|
|
+ return ModeNames.FourD;
|
|
|
|
+ case VisualAreaTypeEnum.sweiReliableColorBar:
|
|
|
|
+ return ModeNames.P_SweiReliableColorBar;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|