mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
added a first simple test for Phoenix sensor / GPS data being received from a UDP stream
Change-Id: I619cef8ececa0a392c4e237ba134bbef57ded833
This commit is contained in:
-13
@@ -177,19 +177,6 @@ public interface ExpeditionMessage extends UDPMessage {
|
||||
*/
|
||||
final int ID_TARG_BSP_P = 238;
|
||||
|
||||
/**
|
||||
* Heel (inclination along the axis parallel to the boat's keel) in decimal degrees; negative values indicate heel
|
||||
* to port, positive values to starboard
|
||||
*/
|
||||
final int ID_HEEL = 000; // TODO find out the ID of the HEEL value in the Expedition UDP stream
|
||||
|
||||
/**
|
||||
* Trim (also called "pitch" or "nick"; the boat's inclination along the axis parallel to the water surface and
|
||||
* perpendicular to the keel direction in which the boat is generally moving) in decimal degrees; negative values
|
||||
* indicate that the bow is lower than the stern;
|
||||
*/
|
||||
final int ID_TRIM = 000; // TODO find out the ID of the TRIM value in the Expedition UDP stream
|
||||
|
||||
/**
|
||||
* A message's checksum determines whether the package is to be considered valid.
|
||||
*/
|
||||
|
||||
+5
-4
@@ -100,13 +100,14 @@ public class UDPExpeditionReceiver extends UDPReceiver<ExpeditionMessage, Expedi
|
||||
* store in the {@link DeviceRegistry#getSensorFixStore() sensor fix store}.
|
||||
*/
|
||||
private void tryToProduceAndStoreSensorFix(ExpeditionMessage msg, ExpeditionSensorDeviceIdentifier sensorDeviceIdentifier) {
|
||||
final Double heelInDegrees = msg.hasValue(ExpeditionMessage.ID_HEEL) ? msg.getValue(ExpeditionMessage.ID_HEEL) : null;
|
||||
final Double trimInDegrees = msg.hasValue(ExpeditionMessage.ID_TRIM) ? msg.getValue(ExpeditionMessage.ID_TRIM) : null;
|
||||
final Double[] vector = new Double[Math.max(ExpeditionExtendedSensorDataMetadata.HEEL.getColumnIndex(), ExpeditionExtendedSensorDataMetadata.TRIM.getColumnIndex())-1];
|
||||
final Double heelInDegrees = msg.hasValue(ExpeditionMessage.ID_ROLL) ? msg.getValue(ExpeditionMessage.ID_ROLL) : null;
|
||||
final Double trimInDegrees = msg.hasValue(ExpeditionMessage.ID_PITCH) ? msg.getValue(ExpeditionMessage.ID_PITCH) : null;
|
||||
final Double[] vector = new Double[Math.max(ExpeditionExtendedSensorDataMetadata.HEEL.getColumnIndex(),
|
||||
ExpeditionExtendedSensorDataMetadata.TRIM.getColumnIndex())+1];
|
||||
vector[ExpeditionExtendedSensorDataMetadata.HEEL.getColumnIndex()] = heelInDegrees;
|
||||
vector[ExpeditionExtendedSensorDataMetadata.TRIM.getColumnIndex()] = trimInDegrees;
|
||||
final DoubleVectorFix fix = new DoubleVectorFixImpl(msg.getTimePoint(), vector);
|
||||
if (fix != null) {
|
||||
if (fix != null && fix.hasValidData()) {
|
||||
deviceRegistry.getSensorFixStore().storeFix(sensorDeviceIdentifier, fix);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user