import 'package:fis_measure/interfaces/process/items/item.dart'; import 'package:fis_measure/interfaces/process/items/item_metas.dart'; import 'package:fis_measure/process/calcuators/a_b_ratio.dart'; import 'package:fis_measure/process/calcuators/pg.dart'; import 'package:fis_measure/process/calcuators/resistivity_index.dart'; import 'package:fis_measure/process/calcuators/two_location.dart'; import 'package:fis_measure/process/items/top_item_feature.dart'; import 'package:fis_measure/process/primitives/location.dart'; import 'two_length.dart'; class TwoLocation extends TwoLengthAbstract { @override bool get ifAutoFinish => true; @override bool get ifAutoStart => true; late final Location x; late final Location y; TwoLocation(ItemMeta meta) : super(meta) { final metaX = meta.childItems[0]; final metaY = meta.childItems[1]; x = Location.createVelocity(metaX, this); y = Location.createVelocity(metaY, this); childItems.add(x); childItems.add(y); } @override Location get child1 => x; @override Location get child2 => y; @override TwoLocationFeature buildFeature() => TwoLocationFeature(this); @override void onCancelingOnce() {} static TwoLocation createAbRatioTwoVelocity(ItemMeta meta, [IMeasureItem? parent]) { TwoLocation twoLocation = TwoLocation(meta); twoLocation.calculator = ABRatioCal(twoLocation); return twoLocation; } static TwoLocation createResistivityIndexTwoLocationByEd(ItemMeta meta, [IMeasureItem? parent]) { TwoLocation twoLocation = TwoLocation(meta); twoLocation.calculator = ResistivityIndexCal(twoLocation); return twoLocation; } static TwoLocation createMaxPgTwoLocation(ItemMeta meta, [IMeasureItem? parent]) { TwoLocation twoLocation = TwoLocation(meta); twoLocation.calculator = MaxPgCal(twoLocation); return twoLocation; } static TwoLocation createPulsatilityIndex(ItemMeta meta, [IMeasureItem? parent]) { TwoLocation twoLocation = TwoLocation(meta); twoLocation.calculator = PulsatilityIndexCal(twoLocation); return twoLocation; } } class TwoLocationFeature extends TopMeasureItemFeature { TwoLocationFeature( ITopMeasureItem refItem, ) : super(refItem); }