Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/iridium ripples gateway #102

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
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
3 changes: 2 additions & 1 deletion plugins-dev/cloud/pt/lsts/ripples/RipplesPositions.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import pt.lsts.neptus.types.coord.LocationType;
import pt.lsts.neptus.util.DateTimeUtil;
import pt.lsts.neptus.util.ImageUtils;
import pt.lsts.neptus.util.conf.GeneralPreferences;

/**
* @author zp
Expand All @@ -74,7 +75,7 @@
public class RipplesPositions extends ConsoleLayer {

@NeptusProperty
String positionsApiUrl = "http://ripples.lsts.pt/positions";
String positionsApiUrl = GeneralPreferences.ripplesUrl + "/positions";

ColorMap cmap = ColorMapFactory.createRedYellowGreenColorMap();

Expand Down
2 changes: 1 addition & 1 deletion plugins-dev/cloud/pt/lsts/ripples/RipplesUpload.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class RipplesUpload extends ConsolePanel implements ConfigurationListener
private static final long serialVersionUID = -8036937519999303108L;

private final String firebasePath = "https://neptus.firebaseio.com/";
private final String ripplesActiveSysUrl = "http://ripples.lsts.pt/api/v1/systems/active";
private final String ripplesActiveSysUrl = GeneralPreferences.ripplesUrl + "/api/v1/systems/active";

private JCheckBoxMenuItem menuItem;
private ImageIcon onIcon, offIcon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import pt.lsts.neptus.comm.manager.imc.ImcSystemsHolder;
import pt.lsts.neptus.console.notifications.Notification;
import pt.lsts.neptus.i18n.I18n;
import pt.lsts.neptus.util.conf.GeneralPreferences;

/**
* @author zp
Expand All @@ -66,8 +67,8 @@
public class HistoricWebAdapter {

private ExecutorService executor = Executors.newSingleThreadExecutor();
private String getURL = "http://ripples.lsts.pt/datastore/lsf";
private String postURL = "http://ripples.lsts.pt/datastore";
private String getURL = GeneralPreferences.ripplesUrl + "/datastore/lsf";
private String postURL = GeneralPreferences.ripplesUrl + "/datastore";
private HttpClient client = new HttpClient();
private long lastPoll = System.currentTimeMillis() - 1200 * 1000;
private HistoricDataInteraction interaction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@
import com.eclipsesource.json.Json;
import com.eclipsesource.json.JsonObject;

import pt.lsts.neptus.util.conf.GeneralPreferences;

public class EnduranceWebApi {

private static final String SOI_URL_DEFAULT = "http://ripples.lsts.pt/soi";
private static final String SOI_URL_DEFAULT = GeneralPreferences.ripplesUrl + "/soi";

private static String soiUrl = SOI_URL_DEFAULT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import pt.lsts.neptus.comm.iridium.HubIridiumMessenger.HubSystemMsg;
import pt.lsts.neptus.console.notifications.Notification;
import pt.lsts.neptus.plugins.update.Periodic;
import pt.lsts.neptus.util.conf.GeneralPreferences;


/**
Expand All @@ -56,7 +57,7 @@
public class HubLocationProvider implements ILocationProvider {

SituationAwareness parent;
private String systemsUrl = "http://ripples.lsts.pt/api/v1/systems/active";
private String systemsUrl = GeneralPreferences.ripplesUrl + "/api/v1/systems/active";
@Override
public void onInit(SituationAwareness instance) {
this.parent = instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@
import org.apache.commons.io.FileUtils;

import pt.lsts.neptus.NeptusLog;
import pt.lsts.neptus.util.conf.GeneralPreferences;

/**
* @author zp
*
*/
public class PositionHistory {

private static final String positions_url = "http://ripples.lsts.pt/api/v1/csvTag/";
private static final String positions_url = GeneralPreferences.ripplesUrl + "/api/v1/csvTag/";
private static DateFormat fmt2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

public static void downloadCsv(String day, boolean force) throws Exception {
Expand Down
3 changes: 2 additions & 1 deletion src/pt/lsts/neptus/comm/iridium/HubIridiumMessenger.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import pt.lsts.neptus.NeptusLog;
import pt.lsts.neptus.comm.iridium.Position.PosType;
import pt.lsts.neptus.util.ByteUtil;
import pt.lsts.neptus.util.conf.GeneralPreferences;

/**
* @author zp
Expand All @@ -66,7 +67,7 @@
public class HubIridiumMessenger implements IridiumMessenger {

protected boolean available = true;
protected String serverUrl = "http://ripples.lsts.pt/api/v1/";
protected String serverUrl = GeneralPreferences.ripplesUrl + "/api/v1/";
// protected String serverUrl = "http://lsts-hub/api/v1/";
protected String systemsUrl = serverUrl+"systems";
protected String activeSystemsUrl = systemsUrl+"/active";
Expand Down
4 changes: 2 additions & 2 deletions src/pt/lsts/neptus/comm/iridium/IridiumManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public enum IridiumMessengerEnum {
RockBlockIridiumMessenger,
HubIridiumMessenger,
SimulatedMessenger,
HerokuMessenger
RipplesMessenger
}

private IridiumManager() {
Expand All @@ -100,7 +100,7 @@ public IridiumMessenger getCurrentMessenger() {
return hubMessenger;
case RockBlockIridiumMessenger:
return rockBlockMessenger;
case HerokuMessenger:
case RipplesMessenger:
return ripplesMessenger;
default:
return simMessenger;
Expand Down
4 changes: 2 additions & 2 deletions src/pt/lsts/neptus/comm/iridium/RipplesIridiumMessenger.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
* @author zp
*
*/
@IridiumProvider(id="heroku", name="Heroku Messenger", description="Sends Iridium messages directly via heroku ripples app.")
@IridiumProvider(id="ripples", name="Ripples Messenger", description="Sends Iridium messages directly to ripples app.")
public class RipplesIridiumMessenger extends HubIridiumMessenger {

public RipplesIridiumMessenger() {
serverUrl = "http://ripples-spring.herokuapp.com/api/v1/";
serverUrl = "http://falkor.lsts.pt:9090/api/v1/";
}

}
3 changes: 2 additions & 1 deletion src/pt/lsts/neptus/comm/iridium/SimulatedMessenger.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import pt.lsts.imc.IridiumMsgTx;
import pt.lsts.neptus.NeptusLog;
import pt.lsts.neptus.comm.manager.imc.ImcMsgManager;
import pt.lsts.neptus.util.conf.GeneralPreferences;

/**
* @author zp
Expand All @@ -63,7 +64,7 @@ public class SimulatedMessenger implements IridiumMessenger {

protected HashSet<IridiumMessageListener> listeners = new HashSet<>();

protected String serverUrl = "http://ripples.lsts.pt/api/v1/";
protected String serverUrl = GeneralPreferences.ripplesUrl + "/api/v1/";
protected String messagesUrl = serverUrl+"irsim";
protected int timeoutMillis = 10000;

Expand Down
7 changes: 7 additions & 0 deletions src/pt/lsts/neptus/util/conf/GeneralPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ public class GeneralPreferences implements PropertiesProvider {
description = "Select this if you want also to show local time on console status bar.")
public static boolean localTimeOnConsoleOn = false;

// -------------------------------------------------------------------------

@NeptusProperty(name = "Ripples URL", category="Iridium Communications", userLevel = LEVEL.REGULAR,
description = "URL of the ripples web server")
public static String ripplesUrl = "http://ripples.lsts.pt";


// -------------------------------------------------------------------------
// Constructor and initialize

Expand Down