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 @@ -73,7 +73,7 @@ protected void doStart() throws SensorHubException

int count = 0;
int retryAttempts = this.config.connection.reconnectAttempts;
// boolean isRetrying = retryAttempts >= 0;

while(true) {
try {
InetAddress addr = InetAddress.getByName(config.remoteHost);
Expand All @@ -82,17 +82,15 @@ protected void doStart() throws SensorHubException
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
socket = factory.createSocket(addr, config.remotePort);
((SSLSocket) socket).startHandshake();
is = socket.getInputStream();
os = socket.getOutputStream();
} else {
SocketAddress endpoint = new InetSocketAddress(addr, config.remotePort);
socket = new Socket();
socket.connect(endpoint, this.config.connection.connectTimeout);
is = socket.getInputStream();
os = socket.getOutputStream();
// isRetrying = false;
break;
}

is = socket.getInputStream();
os = socket.getOutputStream();
break;
} catch (IOException e) {
if(++count >= retryAttempts)
throw new SensorHubException("Cannot connect to remote host "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package org.sensorhub.ui;

import org.sensorhub.ui.api.UIConstants;
import org.vast.data.DataValue;
import org.vast.swe.SWEDataTypeUtils;
import net.opengis.swe.v20.DataArray;
import net.opengis.swe.v20.DataChoice;
Expand Down Expand Up @@ -168,7 +167,11 @@ protected String getCaption(DataComponent dataComponent, boolean showValues)

if (showValues && dataComponent.hasData())
{
var str = sweUtils.getStringValue((DataValue)dataComponent);
// cast to SimpleComponent (not DataValue): range components
// (QuantityRange, etc.) are SimpleComponents but not DataValues.
// getStringValue(SimpleComponent) already renders both scalars
// and ranges, so this is the same call for scalars.
var str = sweUtils.getStringValue((SimpleComponent)dataComponent);
if ("NaN".equals(str) || "null".equals(str))
str = "n/a";

Expand Down
Loading