summaryrefslogtreecommitdiff
path: root/ao-tools
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2010-11-21 11:15:02 +1000
committerAnthony Towns <aj@erisian.com.au>2010-11-21 11:15:02 +1000
commit835b903727a2eabda8d9659cc46e53301f92897c (patch)
tree7853fb259f03477068f183e07772aa05cd855bb4 /ao-tools
parent440a0f3f5130eb0c8e614691892be8c94e7fd3c3 (diff)
parent878913551a1e4e3c8f2b39fa4aeb234880735a1c (diff)
Merge branch 'sitemap' into buttonbox
Conflicts: ao-tools/altosui/AltosSiteMap.java
Diffstat (limited to 'ao-tools')
-rw-r--r--ao-tools/altosui/AltosFlightUI.java12
-rw-r--r--ao-tools/altosui/AltosSiteMap.java14
2 files changed, 15 insertions, 11 deletions
diff --git a/ao-tools/altosui/AltosFlightUI.java b/ao-tools/altosui/AltosFlightUI.java
index a3a28782..732f7395 100644
--- a/ao-tools/altosui/AltosFlightUI.java
+++ b/ao-tools/altosui/AltosFlightUI.java
@@ -145,12 +145,12 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
// Channel menu
channels = new AltosChannelMenu(AltosPreferences.channel(serial));
channels.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- int channel = channels.getSelectedIndex();
- reader.set_channel(channel);
- AltosPreferences.set_channel(serial, channel);
- }
- });
+ public void actionPerformed(ActionEvent e) {
+ int channel = channels.getSelectedIndex();
+ reader.set_channel(channel);
+ AltosPreferences.set_channel(serial, channel);
+ }
+ });
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.WEST;
diff --git a/ao-tools/altosui/AltosSiteMap.java b/ao-tools/altosui/AltosSiteMap.java
index 50177d4e..2c542061 100644
--- a/ao-tools/altosui/AltosSiteMap.java
+++ b/ao-tools/altosui/AltosSiteMap.java
@@ -33,8 +33,10 @@ import java.awt.geom.Point2D;
import java.awt.geom.Line2D;
public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay {
- // max vertical step in a tile in naut. miles
- static final double tile_size_nmi = 1.0;
+ // preferred vertical step in a tile in naut. miles
+ // will actually choose a step size between x and 2x, where this
+ // is 1.5x
+ static final double tile_size_nmi = 1.5;
static final int px_size = 512;
@@ -117,7 +119,7 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay {
scale_x = 256/360.0 * Math.pow(2, zoom);
scale_y = 256/(2.0*Math.PI) * Math.pow(2, zoom);
locn = pt(lat, lng);
- north_step = pt(lat+tile_size_nmi/60.0, lng);
+ north_step = pt(lat+tile_size_nmi*4/3/60.0, lng);
if (locn.y - north_step.y > px_size)
break;
} while (zoom < 22);
@@ -211,10 +213,12 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay {
boolean initialised = false;
public void show(AltosState state, int crc_errors) {
// if insufficient gps data, nothing to update
- if (state.gps == null || !state.gps.locked) {
+ if (state.gps == null)
+ return;
+ if (!state.gps.locked) {
if (state.pad_lat == 0 && state.pad_lon == 0)
return;
- if (state.ngps < 3)
+ if (state.gps.nsat < 4)
return;
}