Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,13 @@ public void handle(PropertiesChanged event)
callback.onConnected(this, IGattClient.GATT_FAILURE);
}
}



// TODO placeholder, need to properly implement
@Override
public boolean requestMtu(int mtu) {
return false;
}

@Override
public void disconnect()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.time.Instant;
import org.sensorhub.impl.sensor.AbstractSensorDriver;
import org.vast.ogc.gml.IFeature;
import org.vast.ogc.om.SamplingSphere;
import org.vast.sensorML.sampling.SamplingSphere;
import org.vast.sensorML.SMLHelper;
import org.vast.swe.SWEConstants;
import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -108,7 +108,8 @@ protected ISASensor setSoftwareVersion(String version)

protected ISASensor setFixedLocation(Instant time, double lat, double lon, double alt)
{
setSamplingPointFoi(lat, lon, alt);
clearFois();
addSamplingPointFoi(lat, lon, alt);
addLocationOutput(Double.NaN);
return this;
}
Expand Down Expand Up @@ -136,7 +137,8 @@ protected void setSamplingSphereFoi(double lat, double lon, double alt, double r
point.setPos(new double[] {lat, lon, alt});
sf.setShape(point);
sf.setRadius(radius);
foiMap = ImmutableMap.of(sf.getUniqueIdentifier(), sf);
clearFois();
addFoi(sf);
}


Expand Down Expand Up @@ -166,15 +168,15 @@ protected ISASensor addStatusOutputs(StatusType... statusTypes)

public IFeature getFeatureOfInterest()
{
return !foiMap.isEmpty() ? foiMap.values().iterator().next() : null;
return !getCurrentFeaturesOfInterest().isEmpty() ? getCurrentFeaturesOfInterest().values().iterator().next() : null;
}


public void sendLocation(long time)
{
if (!foiMap.isEmpty())
if (!getCurrentFeaturesOfInterest().isEmpty())
{
var foi = foiMap.values().iterator().next();
var foi = getCurrentFeaturesOfInterest().values().iterator().next();
var point = ((Point)foi.getGeometry()).getPos();
locationOutput.updateLocation(time/1000., point[1], point[0], point[2], false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.sensorhub.impl.sensor.isa;

import org.sensorhub.api.data.DataEvent;
import org.vast.ogc.om.SamplingSphere;
import org.vast.sensorML.sampling.SamplingSphere;
import org.vast.swe.SWEConstants;
import org.locationtech.jts.geom.Point;
import net.opengis.swe.v20.DataType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected ResourceBinding<BigId, IObsData> getBinding(RequestContext ctx, boolea
@Override
protected BigId getKey(RequestContext ctx, String id) throws InvalidRequestException
{
return decodeID(ctx, id);
return decodeID(id);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected ResourceBinding<BigId, IObsData> getBinding(RequestContext ctx, boolea
@Override
protected BigId getKey(RequestContext ctx, String id) throws InvalidRequestException
{
return decodeID(ctx, id);
return decodeID(id);
}


Expand Down