X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosUI.java;h=edee146da748a7b7dbd3f9c64a60e52c483d9700;hb=48f57997452e17564e28fe3e37403f6f63d32dea;hp=3aaeb888380c5400caed334476238da980e166a6;hpb=9941b05a1d03dafd6cd899b5fe999ed769efb1d6;p=fw%2Faltos diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 3aaeb888..edee146d 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -70,8 +70,22 @@ public class AltosUI extends JFrame { public AltosVoice voice = new AltosVoice(); + public static boolean load_library(Frame frame) { + if (!AltosDevice.load_library()) { + JOptionPane.showMessageDialog(frame, + String.format("No AltOS library in \"%s\"", + System.getProperty("java.library.path","")), + "Cannot load device access library", + JOptionPane.ERROR_MESSAGE); + return false; + } + return true; + } + public AltosUI() { + load_library(null); + String[] statusNames = { "Height (m)", "State", "RSSI (dBm)", "Speed (m/s)" }; Object[][] statusData = { { "0", "pad", "-50", "0" } }; @@ -509,7 +523,8 @@ public class AltosUI extends JFrame { } private void ConnectToDevice() { - AltosDevice device = AltosDeviceDialog.show(AltosUI.this, AltosDevice.BaseStation); + AltosDevice device = AltosDeviceDialog.show(AltosUI.this, + AltosDevice.product_basestation); if (device != null) { try {