mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
made another correction regarding the MWC sentence when T (theoretical) is provided
Change-Id: I8d4f2eb0176b8f17f18f45f03b04a3be78e81a13
This commit is contained in:
+12
-4
@@ -91,12 +91,20 @@ public class NMEAWindReceiverImpl implements NMEAWindReceiver {
|
||||
if (timePoint != null) {
|
||||
try {
|
||||
final Speed speed = createSpeed(sentence.getSpeedUnit(), sentence.getSpeed());
|
||||
final KnotSpeedWithBearingAndTimepoint fix = new KnotSpeedWithBearingAndTimepoint(timePoint,
|
||||
speed.getKnots(), new DegreeBearingImpl(sentence.getAngle()).reverse());
|
||||
final KnotSpeedWithBearingAndTimepoint fix;
|
||||
if (sentence.isTrue()) {
|
||||
trueWind.add(fix);
|
||||
tryToCreateWindFixFromTrueWind(fix);
|
||||
final Bearing trueHeading = trueHeadings.getInterpolatedValue(getLastTimePoint(), f->new ScalableBearing(f));
|
||||
if (trueHeading != null) {
|
||||
// need to take heading into account as MWV is still relative to bow, even if "true" is provided;
|
||||
// it is what you would see on the wind display when set to "true wind"
|
||||
fix = new KnotSpeedWithBearingAndTimepoint(timePoint,
|
||||
speed.getKnots(), new DegreeBearingImpl(sentence.getAngle()).reverse().add(trueHeading));
|
||||
trueWind.add(fix);
|
||||
tryToCreateWindFixFromTrueWind(fix);
|
||||
}
|
||||
} else {
|
||||
fix = new KnotSpeedWithBearingAndTimepoint(timePoint,
|
||||
speed.getKnots(), new DegreeBearingImpl(sentence.getAngle()).reverse());
|
||||
apparentWind.add(fix);
|
||||
tryToCreateWindFixFromApparentWind(fix);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user