|
@@ -1,4 +1,5 @@
|
|
|
import 'package:fis_measure/interfaces/enums/annotation.dart';
|
|
|
+import 'package:fis_measure/interfaces/process/items/item.dart';
|
|
|
import 'package:fis_measure/interfaces/process/workspace/application.dart';
|
|
|
import 'package:fis_measure/interfaces/process/workspace/recorder.dart';
|
|
|
|
|
@@ -78,19 +79,21 @@ class MeasureRecorder implements IMeasureRecorder {
|
|
|
final matchs =
|
|
|
_application.measureItems.where((e) => e.meta.name == record.name);
|
|
|
if (matchs.isEmpty) return false;
|
|
|
- final count = matchs.length;
|
|
|
- for (var i = count - 1; i >= 0; i--) {
|
|
|
- final item = matchs.elementAt(i);
|
|
|
+
|
|
|
+ final item = matchs.last;
|
|
|
+ if (item is ITopMeasureItem) {
|
|
|
+ _application.measureItems.remove(item);
|
|
|
+ } else {
|
|
|
if (item.feature != null) {
|
|
|
item.cancelOnce();
|
|
|
} else if (item.measuredFeatures.isNotEmpty) {
|
|
|
item.measuredFeatures.removeLast();
|
|
|
- // item.calculator?.outputs.removeLast();
|
|
|
}
|
|
|
- return true;
|
|
|
+ if (item.measuredFeatures.isEmpty) {
|
|
|
+ _application.measureItems.remove(item);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- return false;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
bool _undoOnceAnnotation(_AnnotationModel record) {
|