mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-06 19:12:23 +00:00
implemented TimedPosition and TimedPositionWithSpeed in
TimedPositionWithSpeedSimple; replaced WindFieldCoordinates with TimedPosition in all code dependencies
This commit is contained in:
1 parent
8cacc09bb4
commit
97a5ac9c2a
6 files changed
+42
-43
No files matched your search
+2
-2
@@ -20,7 +20,7 @@ import com.sap.sailing.gwt.ui.shared.WindLatticeDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindLatticeGenParamsDTO;
|
||||
import com.sap.sailing.simulator.WindField;
|
||||
import com.sap.sailing.simulator.impl.RectangularBoundary;
|
||||
import com.sap.sailing.simulator.impl.WindFieldCoordinatesImpl;
|
||||
import com.sap.sailing.simulator.impl.TimedPositionWithSpeedSimple;
|
||||
import com.sap.sailing.simulator.impl.WindFieldImpl;
|
||||
|
||||
public class SimulatorServiceImpl extends RemoteServiceServlet implements SimulatorService {
|
||||
@@ -123,7 +123,7 @@ public class SimulatorServiceImpl extends RemoteServiceServlet implements Simul
|
||||
|
||||
if (lattice != null) {
|
||||
for (Position p : lattice) {
|
||||
Wind localWind = wf.getWind(new WindFieldCoordinatesImpl(p));
|
||||
Wind localWind = wf.getWind(new TimedPositionWithSpeedSimple(p));
|
||||
WindDTO w = new WindDTO();
|
||||
w.position = new PositionDTO(localWind.getPosition().getLatDeg(),localWind.getPosition().getLngDeg());
|
||||
w.trueWindBearingDeg = localWind.getBearing().getDegrees();
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.sap.sailing.simulator;
|
||||
|
||||
import com.sap.sailing.simulator.WindFieldCoordinates;
|
||||
import com.sap.sailing.domain.tracking.Wind;
|
||||
|
||||
public interface WindField {
|
||||
|
||||
Wind getWind(WindFieldCoordinates coordinates);
|
||||
Wind getWind(TimedPosition coordinates);
|
||||
Boundary getBoundaries();
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.sap.sailing.simulator;
|
||||
|
||||
import com.sap.sailing.domain.base.Timed;
|
||||
import com.sap.sailing.domain.tracking.Positioned;
|
||||
|
||||
public interface WindFieldCoordinates extends Positioned, Timed {
|
||||
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.sap.sailing.simulator.impl;
|
||||
|
||||
import com.sap.sailing.domain.base.SpeedWithBearing;
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.Speed;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.simulator.TimedPositionWithSpeed;
|
||||
|
||||
public class TimedPositionWithSpeedSimple implements TimedPositionWithSpeed {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 73150541143821154L;
|
||||
|
||||
Position position;
|
||||
|
||||
public TimedPositionWithSpeedSimple(Position p) {
|
||||
position = p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getTimePoint() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Position getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpeedWithBearing getSpeed() {
|
||||
return (SpeedWithBearing) Speed.NULL;
|
||||
}
|
||||
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package com.sap.sailing.simulator.impl;
|
||||
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.simulator.WindFieldCoordinates;
|
||||
|
||||
public class WindFieldCoordinatesImpl implements WindFieldCoordinates {
|
||||
|
||||
private Position position;
|
||||
|
||||
public WindFieldCoordinatesImpl(Position p) {
|
||||
|
||||
position = p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Position getPosition() {
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getTimePoint() {
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -5,8 +5,8 @@ import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
|
||||
import com.sap.sailing.domain.tracking.Wind;
|
||||
import com.sap.sailing.domain.tracking.impl.WindImpl;
|
||||
import com.sap.sailing.simulator.Boundary;
|
||||
import com.sap.sailing.simulator.TimedPosition;
|
||||
import com.sap.sailing.simulator.WindField;
|
||||
import com.sap.sailing.simulator.WindFieldCoordinates;
|
||||
|
||||
public class WindFieldImpl implements WindField {
|
||||
|
||||
@@ -22,7 +22,7 @@ public class WindFieldImpl implements WindField {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Wind getWind(WindFieldCoordinates coordinates) {
|
||||
public Wind getWind(TimedPosition coordinates) {
|
||||
return new WindImpl(coordinates.getPosition(),coordinates.getTimePoint(),
|
||||
new KilometersPerHourSpeedWithBearingImpl(windSpeed,
|
||||
new DegreeBearingImpl(windBearing)));
|
||||
|
||||
Reference in new issue
Block a user