X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Faltosui%2FAltosUI.java;h=ca587b257ee81236fd564fa3c3fd796e0b153582;hp=3aaeb888380c5400caed334476238da980e166a6;hb=8ee3464d8064ebe1694c7b20177878c0d9961451;hpb=4224a7526e51eb8fbf1f0a31bae7ee68c6385095 diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 3aaeb888..ca587b25 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" } };