mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 19:20:04 +00:00
using Track.getInterpolatedValue in IgtimiWindReceiver; breaks a few tests that may point at issues in the implementation
Change-Id: I26a7c1dfd22d288817fd60aee30fe29d7717a12c
This commit is contained in:
1 parent
82da2ccb51
commit
3a1cf15ba4
2 files changed
+21
-190
No files matched your search
+12
-12
@@ -275,24 +275,24 @@ public class TrackImpl<FixType extends Timed> implements Track<FixType> {
|
||||
|
||||
@Override
|
||||
public <InternalType, ValueType> ValueType getInterpolatedValue(TimePoint timePoint, Function<FixType, ScalableValue<InternalType, ValueType>> converter) {
|
||||
final ValueType aws;
|
||||
Pair<FixType, FixType> awsPair = getSurroundingFixes(timePoint);
|
||||
if (awsPair.getA() == null) {
|
||||
if (awsPair.getB() == null) {
|
||||
aws = null;
|
||||
final ValueType result;
|
||||
Pair<FixType, FixType> fixPair = getSurroundingFixes(timePoint);
|
||||
if (fixPair.getA() == null) {
|
||||
if (fixPair.getB() == null) {
|
||||
result = null;
|
||||
} else {
|
||||
aws = converter.get(awsPair.getB()).divide(1);
|
||||
result = converter.get(fixPair.getB()).divide(1);
|
||||
}
|
||||
} else {
|
||||
if (awsPair.getB() == null) {
|
||||
aws = converter.get(awsPair.getA()).divide(1);
|
||||
if (fixPair.getB() == null || fixPair.getA() == fixPair.getB()) {
|
||||
result = converter.get(fixPair.getA()).divide(1);
|
||||
} else {
|
||||
aws = timeBasedAverage(timePoint,
|
||||
converter.get(awsPair.getA()), awsPair.getA().getTimePoint(),
|
||||
converter.get(awsPair.getB()), awsPair.getB().getTimePoint());
|
||||
result = timeBasedAverage(timePoint,
|
||||
converter.get(fixPair.getA()), fixPair.getA().getTimePoint(),
|
||||
converter.get(fixPair.getB()), fixPair.getB().getTimePoint());
|
||||
}
|
||||
}
|
||||
return aws;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user